Here are given the basic steps to use REST-for-physics on the CC IN2P3 cluster.
A common version of this framework has been deployed here /pbs/throng/liquido/REST-for-physics
.
In case you don't have a CCIN2P3 account, you could install REST-for-physics on your personal machine. For that see the 2nd section.
Conda is an open-source package management system and environment management system. For the moment we will use this tool at CCIN2P3 to all work on common version of Root and Geant4. This may change, following the recent discussion about Singularity.
Miniconda has already been installed here /pbs/throng/liquido
.
This step allows to set conda in your bashrc.
REST-for-physics has been deployed @CCIN2P3 using these common versions of Root and Geant4. REST will most probably run correctly only using these versions. If you try to run REST with other versions than the one it has been installed with, no guarantee can be given.
To initialize conda in your .bashrc.
/pbs/throng/liquido/miniconda3/bin/conda init bash
It's important to initiate conda in the shell (bash, zsh...) you will use for work. If, at one point, you decide to change your shell, you will have to run this command again with your new shell.
You can open a new bash session for the changes to be active.
To activate the common LiquidO conda environement (containing common version of Root and Geant4):
conda activate liquido_install
root-config --version
should give you 6.26/10, and
geant4-config --version
should give you 11.0.3.
source /pbs/throng/liquido/REST-for-physics/rest-framework/install/master/thisREST.sh
There is also a thisREST.csh
at the same location.
This section is for people that would like to have their own installation of REST-for-physics, for example for development purpose.
We need Root and Geant4 (for simulations with restG4), in order to install and use REST-for-physics.
- Root version 6.26/10 is required
- Geant4 version 11.0.3 is recommended and support will be given with this version. You can decide to use version 10.7 but in case of crash we can't guaranty support.
The first section explains how to install and use Miniconda in order to get the good versions of Root and Geant4. It allows to create environments enclosing the desired versions, without interfering with the version that you may already have installed for other purposes. This step is not mandatory, and you can directly go to the REST-for-physics installation step.
For any problem with the installation of REST, please see the REST-for-physics forum, or the Github page. Also, if you encounter any problem which is not listed in the troubleshooting sections of this document, please report your problem (and possible solution) here, for improvement of this documentation.
Some helpful documentation for Miniconda installation.
- Get the last version of miniconda
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
- Use the executable
sh Miniconda3-latest-Linux-x86_64.sh
Then follow the instruction on your console.
- You can choose to initiate conda in your shell. This step is not mandatory.
miniconda3/bin/conda init <shell_name>
- Creating an environment with the right version of Geant4.
If you need extra information, here is some help for installing Geant4 with conda.
- We need the conda-forge channel
conda config --add channels conda-forge
conda config --set channel_priority strict
- Now we can create our environement that will eventually contain Geant4 and Root.
conda create -n <environment_name> geant4==11.0.3
This step can take several minutes.
- Once it's done you can activate your environement. This is really important for the installation of Root in the same environement.
conda activate <environment_name>
- Installing in this environement the right version of Root
- For Root we need to change the priority of the conda-forge channel.
conda config --set channel_priority false
- Now we can install Root
conda install root==6.26.14
This step can take several minutes, even half an hour. Time for coffee ☕
It's really important here to precise the version of Root. Otherwise this step can take hours.
- packages not found
PackagesNotFoundError: The following packages are not available from current channels:
- geant4==11.0.3
because conda-forge isn't setup as priority channel. Please do
conda config --add channels conda-forge
conda config --set channel_priority strict
- conda command does not exist
command not found: conda
You have to set up conda with conda init <shell>
or create a conda command corresponding to miniconda3/bin/conda
in the .bashrc or other shell.
Now we have the right versions of Root and Geant4, let's install REST.
- REST user's guide
- Useful slides for installation
- REST-for-physics github page
Careful:
- Please adapt the path to your corresponding repository!
- If not already done, first activate the conda environement we just created by doing
conda activate <environment_name>
- Clone the Github repository
cd ~/
mkdir REST-for-physics
cd REST-for-physics
mkdir rest-framework
cd rest-framework
git clone https://github.com/rest-for-physics/framework.git .
python pull-submodules.py –latest:master
At this step probably some submodules will failed. If only iaxo and detector-template fail, that's normal. If other modules fail, that's not a good sign.
- Then build and install the project
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/REST-for-physics/rest-framework/install/master -DREST_ALL_LIBS=ON -DREST_G4=ON -DREST_GARFIELD=OFF -DREST_MPFR=OFF
make install
If you are on your personal machine, you could use make -j6 install
for example (to be matched with your nproc).
At CCIN2P3, this is forbidden.
Note that at CCIN2P3, options like
make -j install
orninja
are not allowed.
The installation of REST is completed !! 👏
Know you can source REST by doing
source <path_to_REST>/REST-for-physics/rest-framework/install/master/thisREST.sh
You can write this line in you .bashrc if needed.
Have fun!
- At the make step, if there is a crash with the mpfr library, in the style:
cannot find -lmpfr: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [source/libraries/axion/libRestAxion.so] Error 1
make[1]: *** [source/libraries/axion/CMakeFiles/RestAxion.dir/all] Error 2
make: *** [all] Error 2
then you can install the mpfr library in the same environement:
conda install mpfr
- A problem with the cmake version at Lyon
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
CMake 3.16 or higher is required. You are running version 2.8.12.2
Install in your conda environement the last version of cmake
conda install cmake==3.18.4
And then deactivate and activate again your conda environement for the changes to be updated.
You could also choose to update cmake directly with apt-get. That depends on the requirements of the other softwares you usually run.
- when entering a restRoot session, errors at library loading
- /pbs/home/g/girardca/REST-for-physics/rest-framework/install/master/lib/libRestAxion.so
cling::DynamicLibraryManager::loadLibrary(): /pbs/home/g/girardca/REST-for-physics/rest-framework/install/master/lib/libRestAxion.so: undefined symbol: _ZN23TRestAxionMagneticFieldC1Ev
This could come from a too recent version of cmake. Try to downgrade (version 3.18.4 should be working).
-
Binary files not appearing after installation. See this discussion
-
When trying to simulate with restG4
cling::DynamicLibraryManager::loadLibrary(): libgsl.so.25: cannot open shared object file: No such file or directory
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libMathMore.so for ROOT::Math::GSLIntegrator
Probably for some reason the gsl library have not been installed properly. Try
conda install -c conda-forge gsl==2.7
A priori no need to build or install again REST.
Just try again the restG4
command