To set up and run LArSoft

Background:

  1. Note: LArSoft is designed to be run by experiments, so it is not possible to set up LArSoft without setting up LArSoft for a specific experiment. You do this via the setup guide for your experiment. 
  2. The core LArSoft code lives in a set of git repositories maintained by the LArSoft core team. Can view the code organization at http://larsoft.org/larsoft-code-organization/
  3. If you do not have code changes to LArSoft code itself, you may just set up the appropriate products and a Fermilab Hierarchical Configuration Language (FHiCL) file, ends in .fcl

To set up and run LArSoft, the user:

  1. Runs a setup script
    1. Source <experiment specific script>
    2. This tells UPS where to find the programs needed like UPS itself, git, MRB, ROOT, and LArSoft. A UPS product is a software package set up and distributed via UPS, Unix Product Support. Each UPS product is entirely self-contained, aside from dependencies.
    3. Specific example for SBND:
      1. using CVMFS: source /cvmfs/sbnd.opensciencegrid.org/products/sbnd/setup_sbnd.sh
      2. using a local UPS database /path/to/products filled with pullProducts:
        1. source /path/to/products/setup
          export MRB_PROJECT=larsoft
          setup mrb
    4. Specific example for DUNE:
      1. source /grid/fermiapp/products/dune/setup_dune.sh
    5. Can find links to all LArSoft Collaboration experiments at: https://larsoft.github.io/LArSoftWiki/Quick_Links
  2. Create a new development area. This creates a number of subdirectories.
    1. mkdir <working_dir> #Do not use your home directory, as the libraries you build can get large.
    2. cd <working_dir>
    3. mrb newDev or mrb n
    4. # May need to specific the version and qualified unless larsoft product is set up.
    5. mrb newDev -v <version> -q <qualifiers>
    6. # Can find out the larsoft releases
    7. ups list -aK+ larsoft
    8. # May want to just make the products area (checks that src, build are already there)
    9. mrb newDev -p
    10. Can see mrb newDev options at: https://cdcvs.fnal.gov/redmine/projects/mrb/wiki/MrbRefereceGuide#newDev-n
  3. Set up a LArSoft release – Can be Integration or Production.
    1. setup larsoft vXXX -q e15:<prof|debug>
    2. Set up local products
      1. source localProducts_larsoft_vxx_xx_xx_ex_prof/setup
    3. Check out code from repository
      1. cd $MRB_SOURCE
      2. mrb gitCheckout <code>
        1. This will get the code from current development head. If you want code with a different version of LArSoft, use -t with mrb g
        2. mrb g -t LARSOFT_SUITE_vxx_xx_xx <code>
        3. mrb g larsoft_suite
        4. mrb g larsoftAlg_suite
  4. Build and test the code, all commands must be run in the same shell.
    1. cd $MRB_BUILDDIR
    2. mrbsetenv  #set up development environment
    3. mrb b (build) -jN #N is number of parallel build streams
      1. mrb z (zapBuild) #to get rid of what you just built
      2. mrbsetenv
    4. mrb t (test) [jN]  #run buildtool with test, all commands must be run in the same shell
    5. May need to fix code, rebuild, retest.
  5. Once the code works as expected, publish it to a feature branch.

A simple view

  1. mkdir my_larsoft
  2. source <experiment_setup_script>
  3. cd my_larsoft/
  4. mrb newDev -vvxx_xx_xx -q <e15:debug>
  5. source localProducts_larsoft_vxx_xx_xx_ex_prof/setup
  6. cd $MRB_SOURCE
  7. mrb g larsoft_suite
  8. mrb g larsoftAlg_suite
  9. cd $MRB_BUILDDIR
  10. mrbsetenv
  11. mrb b -jN
  12. mrb t -jN