Installing & running PandaRoot

Install the external packages

The external packages are a bundle of large and small software packages that are the backbone. Geant3 & Geant4 are provided as well as ROOT, boost and many more. The selection is managed by the FairRoot team. The process of installing them takes a long time, so if a preinstalled version is available it is recommended to use it.

The fundamental packages are cmake and git. Be sure to install them before starting the procedure. Once you will start the installation, if an important package is missing the system will detect it and print an error message, so that you can install it by yourself.

Please check with the github website of FairSoft and FairRoot for requirements and the installation procedures. If you use OS X, you need to install gfortran and XQuartz. The recommendation is to use brew to manage the dependencies if you don’t have anything set up, yet.

The current recommendation is to use FairSoft apr21 and FairRoot v.18.6_patches. Please replace <release> in the commands below as well as the folder names with the X’s.

mkdir fairsoft_XXX
cd fairsoft_XXX
git clone -b <release> https://github.com/FairRootGroup/FairSoft source

We recommend to use the legacy installation process, but choose a out-of-source installation. You may change the -j4 flag to match the number of cpu cores you have available.

cmake -S ./source -B ./build -C ./source/FairSoftConfig.cmake -DCMAKE_INSTALL_PREFIX=./install
cmake --build ./build -j4

This will take a few hours on a desktop machine. If you need to save space, you may remove the source and build folders.

FairRoot has to be cloned from GitHub as well.

mkdir ~/FairRoot-vXX.X.X
cd ~/FairRoot-vXX.X.X
git clone -b <release> https://github.com/FairRootGroup/FairRoot.git source

The installation is a similar process. You may change the -j4 flag to match the number of cpu cores you have available.

export SIMPATH=/home/pandauser/fairsoft_XXX/install
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=../install ../source
make install -j4

Mac users may need to add -DUSE_DIFFERENT_COMPILER=TRUE to the cmake command.

If you wish to build without the QA tests and googletests, add -DBUILD_PANDA_WITHOUT_TESTS=TRUE. If you wish to build without CUDA, add -DBUILD_PANDA_WITHOUT_CUDA=TRUE. If you wish to build without VC, add -DBUILD_PANDA_WITHOUT_VC=TRUE.

If you need to save space, you may remove the source and build folders.

Working with the latest release

Get the source code

Get the latest release version from the repository into a folder, e.g. PandaRoot. The master branch of the repository will always be the latest release.

git clone https://git.panda.gsi.de/PandaRootGroup/PandaRoot.git PandaRoot

In case you want to update your existing copy of PandaRoot to the latest release, make sure you’re on the master branch with git branch which should highlight the master. Then you can do that inside your source directory by:

git pull

Sometimes it may be necessary to use a specific release. For that we have Tags. Those can be listed and then you may choose to switch to a tagged version branch.

git tag
git checkout -b <yourtag> <yourtag>

Installation process

First you need to set the environment variables SIMPATH and FAIRROOTPATH, which are the folders where you have the installed the external packages and FairRoot. If the installation was done with Spack, both folders may be the same. On a cluster this may be already pre-installed for you, e.g. on a CVMFS.

export SIMPATH=/home/pandauser/fairsoft_XXX/install
export FAIRROOTPATH=/home/pandauser/FairRoot-vXX.X.X/install

Create a build directory and build PandaRoot:

mkdir build
cd build
cmake ../PandaRoot
make -j4

You can change the -j4 to the number of CPU cores you have available to speed up the process.

If your CMake installation on your system is too old, then the external packages installed a new one. You can use this line instead:

$SIMPATH/bin/cmake ../PandaRoot

Quick Running PandaRoot

Each new shell needs to receive the proper environment variables, that PandaRoot can run. Simply load the config.sh which was created during the build process.

. Build/config.sh -p

Mind the space between the dot and the file name. You can provide a flag -a to append or -p to prepend to the current PATH and LD_LIBRARY_PATH variables. Appending is the least invasive to your environment, prepend is to prefer installed executables & libraries form FairSoft, FairRoot and PandaRoot. Giving no option will overwrite the environment.

Now you can call root, which has the appropriate version and the connection to PandaRoot. Execute any root macro, e.g:

cp -r PandaRoot/macro/master MyMacros
cd MyMacros
root -l -b -q sim_complete'(100, "TGeant3", 6.231552, "mytestsim")'
root -l -b -q full_complete'(100, "mytestsim")'

In your Build/bin you will find a few executables, mainly some bare event generators for the use in the terminal, if necessary.