Build The BambooMC (new version)
Get the source
git clone
git@pandax.physics.sjtu.edu.cn:software/BambooMC.git
Check out the new branchs
In this example, we checkout the factory branch
git checkout -b factory origin/factory
Make you new branch and check it out (optional)
If you want to add new features to the program, you may need to create a new branch. You need to give it a name. For example, panda.
git branch panda
git checkout panda
Then you are on the new branch.
Build the program
Prerequist
1. g++: version > 4.8 (for full C++11 support)
In our cluster bl-2, you may need to enable the devtoolset-3 (g++ 4.8) or devtoolset-4 (g++ 5.2, prefered).
scl enable devtoolset-4 bash
2. Geant4: version 10.02 and above
In our cluster, the installation is available at
/store/bl2/opt/geant4/10.02p01
. You can set the enviroment with following command
. /store/bl2/opt/geant4/10.02p01/bin/geant.sh
3. ROOT 6
In our cluster, you need to set the environment to use ROOT 6 with following command
. /store/bl2/opt/root/6.08.04_gcc52/bin/thisroot.sh
4. CMake 3 or higher
In the cluster, you can invoke
cmake3
directly. In other system, you may need to use
cmake
.
Build program
0. create the build directory in the source tree
mkdir build
1. Invoke cmake 3
cmake -DENABLE_DETECTOR_SETS=example_detector -DCMAKE_BUILD_TYPE=Release ..
The parameter
ENABLE_DETECTOR_SETS
tell the compiler that the sources of a detector set with the name
example_detector
will be compiled. You can find the directory in the
detectors
directory in the first level of the source tree.
2. run make
make
--
XunChen - 2018-04-12