Original Author: P G Jones, p.g.jones@qmul.ac.uk

Updated March 26, 2020 - Jamie Rajewski, jrajewsk@ualberta.ca

Method 1 (Easiest) - RAT Container

The easiest way to both build and run RAT locally is now through the docker container. Full documentation, instructions, and explanation of what a container is are available at the Github repository. From the repo:

Singularity and Docker recipes to build a SNO+ environment for RAT.
For regular usage, simply download the pre-built container with the following instructions for your container platform of choice.

FEATURES


Method 2 (Advanced) - Manual Installation of Dependencies

The traditional way to install RAT is to build the dependenices and RAT individually.

  1. FFTW
  2. GSL
  3. ROOT
    1. Get the ROOT source tarball: https://root.cern.ch/download/root_v5.34.38.source.tar.gz
    2. Untar somewhere, rename the directory if you like, then build it (adding extra library location options if FFTW and GSL are not installed to default locations):
          $ tar zxvf root_v5.34.38.source.tar.gz
          $ cd root
          $ ./configure --enable-minuit2 --enable-python --enable-mathmore
          $ make # Use -jN for N parallel job
              
    3. Source the ROOT environment: source /PATH/TO/ROOT/bin/thisroot.sh
  4. GEANT4
    1. Get the source: http://geant4.cern.ch/support/source/geant4.10.00.p02.tar.gz
    2. Untar, create a CMake build directory, and build:
          $ tar zxvf geant4.10.00.p02.tar.gz
          $ mkdir geant4.10.00.p02-build
          $ cd geant4.10.00.p02-build
          $ cmake -DGEANT4_INSTALL_DATA=ON -DCMAKE_INSTALL_PREFIX=/PATH/TO/geant4.10.00.p02 /PATH/TO/geant4.10.00.p02
          $ make
          $ make install
              
    3. Source the environment: $ source /PATH/TO/geant4.10.00.p02/bin/geant4.sh
    4. Source the development script: $source /PATH/TO/geant4.10.00.p02/share/Geant4-10.0.2/geant4make/geant4make.sh
  5. cURL
  6. bzip2
  7. scons
    1. Download scons from https://sourceforge.net/projects/scons/files/scons/3.1.2/scons-3.1.2.tar.gz
    2. Extract scons and set the RAT_SCONS environment by:
          $ tar zxvf scons-3.1.2.tar.gz
          $ export RAT_SCONS = PATH/TO/scons-3.1.2
              
  8. RAT
    1. Clone the repository and configure:
          $ git clone git@github.com:snoplus/rat
          $ cd rat
          $ ./configure
          $ source env.sh
              
    2. Build: scons

Along the way we set a lot of environment variables, which must always be set to run RAT. To make this easier, create a script to do it:

      # rat_env.sh

      source /PATH/TO/root/bin/thisroot.sh
      source /PATH/TO/geant4.10.00.p02/bin/geant4.sh
      source /PATH/TO/RAT/env.sh
      

Then, you can just `source rat_env.sh` and RAT is ready to go.

Manual updating

Rat is git managed code; therefore, you must fetch and merge the code to update it manually before doing scons, i.e.

      $ git fetch
      $ git merge
      $ scons
    

Scons build options

There a few options that can be passed to scons to disable or enable dependencies which are

Installation against ROOT6 (Advanced Installation)

It is possible to install RAT against ROOT6, although the default for SNO+ software remains ROOT 5.34.38.

The installation follows closely the Manual Installation above except that both ROOT6 and GEANT must be installed against GCC 4.8.5 for RAT 6.18.1 or older. Newer versions of GCC are not compatible with the construction of RAT ROOT. For versions of RAT greater than or equal to 6.18.2, this restriction on the compiler version no longer applies.

  1. ROOT
  2. GEANT
  3. All other dependencies and RAT:

Method 3 (No longer supported but may still work for some) - Snoing

The SNO+ RAT code, tools and documentation can all be installed via the snoing tool. This tool aims to make the installation as simple and painless as possible. To start, however, you need a github account, as this is where all the snoplus code lives. To do so go to github to apply for an account, then ask for access to the snoplus organisation as explained in SNO+-doc-1462.

An ssh key for github is required to download all the snoing -dev packages. Follow the instructions at Github: Generating SSH Keys.

Once you have access to github you can download snoing via this command (make sure you have git installed):

      git clone git@github.com:snoplus/snoing.git
    

Now you can run snoing to install the snoplus code. To do so, navigate to the snoing directory and type:

      $ source env.sh
    

and then

      $ ./snoing.py rat-dev
    

If you are missing any libraries on your system, then snoing will tell you. You will have to install these manually. If snoing completes without errors, then you are done. To run rat simply type

      $ source install/env_rat-dev.sh
      $ rat
    

Updating the software

Snoing takes care of software updating via the '-p' command e.g.

      $ ./snoing.py -p rat-dev
    

updates rat-dev.

Troubleshooting

If snoing fails, then it will output "Snoing has failed, please consult the above error messages or the snoing.log file.". Above this line, snoing should output text explaining why it failed and will often give advice on how to solve the error. If this information is not sufficient to solve the problem, then email the snoing.log file to the MC group leader.

Known problems

Snoing options

Snoing has the following options:

  Usage: snoing.py [options] [package]

  Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -c CACHE_PATH         Cache path.
  -i INSTALL_PATH       Install path.
  -v                    Verbose Install?
  -l, --list            List packages, without installing anything.
  -a                    All packages?
  -k, --clean           Clean temporary files.

  Optional Install modes:
    -g, --graphical     Graphical install?
    -x                  Grid install (NO X11)?

  Optional Actions:
    Default snoing action is to install the specified package, which
    defaults to rat-dev.

    -q                  Query Package Status?
    -r                  Remove the package?
    -d                  Install dependencies only?
    -p                  Progress/update the package?

  Github authentication Options:
    Supply a username or a github token, not both.

    -u USERNAME         Github username
    -t TOKEN            Github token
    

Home