Author: P G Jones, p.g.jones@qmul.ac.uk
Snoing (Simple Installation)
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
- On Ubuntu 12 geant4 will not be able to locate the openGL library when installing in graphical mode, you must do so for it. When you have found the location re-run snoing with the verbose -v option and enter the location when prompted.
- Root versions < 5.34 will not install on Mac OS 10.8.
- XQuartz must be installed on Mac OS 10.8+.
- Root versions > 5.32 requires XCode 4.3+ and the command line tools on Mac OS 10.7. If you have XCode 4.1/4.2 you will need to get a fresh install from the App Store, the command line tools can then be installed from the XCode→Preferences→Downloads menu.
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
Manual (Advanced Installation)
The traditional way to install RAT is to build the dependenices and RAT individually.
-
FFTW
- If you have admin access, install the packages (Debian/Ubuntu: fftw3, libfftw3-dev; RHEL/CentOS/SL/Fedora: fftw, fftw-devel)
- If not, download from http://www.fftw.org/download.html and build with the --with-pic option enabled when configuring; you will then need to point ROOT to the location of the FFTW libraries with the --with-fftw3-incdir and --with-fftw-libdir options when configuring.
-
GSL
- If you have admin access, install the packages (Debian/Ubuntu: libgsl0-dev; RHEL/CentOS/SL/Fedora: gsl, gsl-devel)
- If not, download from http://www.gnu.org/software/gsl/ and build with the --with-pic option enabled when configuring; you will then need to point ROOT to the location of the GSL libraries with the --with-gsl-incdir and --with-gsl-libdir options when configuring.
-
ROOT
- Get the ROOT source tarball: ftp://root.cern.ch/root/root_v5.34.36.source.tar.gz
- 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.36.source.tar.gz
$ cd root
$ ./configure --enable-minuit2 --enable-python --enable-mathmore
$ make # Use -jN for N parallel job
- Source the ROOT environment: source /PATH/TO/ROOT/bin/thisroot.sh
-
GEANT4
- Get the source: http://geant4.cern.ch/support/source/geant4.10.00.p02.tar.gz
- 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
- Source the environment: $ source /PATH/TO/geant4.10.00.p02/bin/geant4.sh
- Source the development script: $source /PATH/TO/geant4.10.00.p02/share/Geant4-10.0.2/geant4make/geant4make.sh
-
cURL
- If you have admin access, install the packages (Debian/Ubuntu: curl, libcurl3; RHEL/CentOS/SL/Fedora: curl, curl-devel)
- If not, download from http://curl.haxx.se/download.html and build, and change RAT's config/EXTERNAL.scons to point to the correct location.
-
bzip2
- If you have admin access, install the packages (Debian/Ubuntu: bzip2, libbz2-1.0; RHEL/CentOS/SL/Fedora: bzip2, bzip2-devel)
- If not, download from http://bzip.org/downloads.html and build, and change RAT's config/EXTERNAL.scons to point to the correct location.
-
scons
- Download scons from http://downloads.sourceforge.net/project/scons/scons/2.1.0/scons-2.1.0.tar.gz
- Extract scons and set the RAT_SCONS environment by:
$ tar zxvf scons-2.1.0.tar.gz
$ export RAT_SCONS = PATH/TO/scons-2.1.0
-
RAT
- Clone the repository and configure:
$ git clone git@github.com:snoplus/rat
$ cd rat
$ ./configure
$ source env.sh
- 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
- scons profile=1, default 0, to turn on the profiling CFLAGS
- scons debug=1, default 0, to turn on the debug CFLAGS
- scons opt=0, default 1, to turn off the optimisation CFLAGS
- scons zmq=0, default 1, to turn off the zmq dependence (packed dispatcher requires zmq).
- scons xercesc=0, default 0, to turn off the xerces-c dependence (viewer GDML visualisation requires xerces-c).
- scons g4vis=0, default 1, to turn off all visualisation.
- scons verbose=1 or 2, default 0, to enable more RAT verbosity.
- scons sconsverbose=1, default 0, to print full build commands.
- scons define=DEF1,...,DEFN to set user defines to activate specific code sections useful for active development.
Home