As several libraries are available to the users, compiling on the
cluster can be challenging. Here we described how to get the software
up and running for job submissions. We assumed you are already part of
the T2K computing group, i.e. you can access the SPS storage: ls /sps/t2k/
.
Nowadays, the computing cluster of Lyon uses module load
command to setup the
bash environement. Here is my environment:
module load Compilers/gcc/9.3.1
module load Analysis/root
module load Programming_Languages/perl
module load python
module load fortran
module load Collaborative_Tools/git
module load Production/cmake
module load HPC_GPU_Cloud/openmpi
module load geant4
Since all the available versions of ROOT on the CC are compiled either with a quite
old compiler or with missing features, a shared ROOT library has been installed
in T2K folder /sps/t2k/common/software
. As we also need the yaml-cpp
library
we advise to source the dedicated env file:
source /sps/t2k/common/software/env.sh
The output should look like this:
Setting up T2K libs...
Linking libs in /sps/t2k/common/software/install
├─ Adding : nano-5.9
├─ Adding : root-v6-24-06
├─ Adding : yaml-cpp
Selecting ROOT v6-24-06...
├─ ROOT Prefix : /sps/t2k/common/software/install/root-v6-24-06
├─ ROOT Version : 6.24/06
T2K common software has been setup.
Alright! You are now ready to compile :-).
As for the general guide we propose to compile the software with this tree directory:
export WORK_DIR="/sps/t2k/<YOURUSERNAME>/work"
export INSTALL_DIR="$WORK_DIR/install/"
export BUILD_DIR="$WORK_DIR/build/"
export REPO_DIR="$WORK_DIR/repositories/"
Then create these path:
mkdir -p $INSTALL_DIR
mkdir -p $BUILD_DIR
mkdir -p $REPO_DIR
Let's clone Gundam with git:
cd $REPO_DIR
git clone https://github.com/nadrino/gundam.git
cd $REPO_DIR/gundam
# fetch the latest tagged version
git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
# don't forget to initialize the submodules
git submodule update --init --recursive
Now let's build the thing. In the cmake command, we explicitly specify where
to find yaml-cpp
:
mkdir -p $BUILD_DIR/gundam
mkdir -p $INSTALL_DIR/gundam
cd $BUILD_DIR/gundam
cmake \
-D CMAKE_INSTALL_PREFIX:PATH=$INSTALL_DIR/gundam \
-D CMAKE_BUILD_TYPE=Release \
-D YAMLCPP_DIR=/sps/t2k/common/software/install/yaml-cpp \
$REPO_DIR/gundam/.
make install -j4
In principle in should be compiling fine... Or this guide is failing to do his job!! Please report any issue!
Once the software is installed, let's link the bin
and lib
folders:
export PATH="$INSTALL_DIR/gundam/bin:$PATH"
export LD_LIBRARY_PATH="$INSTALL_DIR/gundam/lib:$LD_LIBRARY_PATH"
Now you should be able to run your first gundam command:
gundamFitter
The program should stop while complaining that you didn't provide a config file:
11:59:42 [gundamFitter.cxx]: Usage:
11:59:42 [gundamFitter.cxx]: dry-run {--dry-run,-d}: Perform the full sequence of initialization, but don't do the actual fit. (trigger)
11:59:42 [gundamFitter.cxx]: config-file {-c,--config-file}: Specify path to the fitter config file (1 value expected)
11:59:42 [gundamFitter.cxx]: nb-threads {-t,--nb-threads}: Specify nb of parallel threads (1 value expected)
11:59:42 [gundamFitter.cxx]: output-file {-o,--out-file}: Specify the output file (1 value expected)
11:59:42 [gundamFitter.cxx]: Provided arguments:
11:59:42 [gundamFitter.cxx]: No options were set.
11:59:42 [gundamFitter.cxx]: Usage:
11:59:42 [gundamFitter.cxx]: dry-run {--dry-run,-d}: Perform the full sequence of initialization, but don't do the actual fit. (trigger)
11:59:42 [gundamFitter.cxx]: config-file {-c,--config-file}: Specify path to the fitter config file (1 value expected)
11:59:42 [gundamFitter.cxx]: nb-threads {-t,--nb-threads}: Specify nb of parallel threads (1 value expected)
11:59:42 [gundamFitter.cxx]: output-file {-o,--out-file}: Specify the output file (1 value expected)
11:59:42 [gundamFitter.cxx]: Provided arguments:
11:59:42 [gundamFitter.cxx]: No options were set.
11:59:42 [gundamFitter.cxx]: ��
terminate called after throwing an instance of 'std::runtime_error'
what(): "config-file" option was not specified.
Aborted
Congrats! Now gundam is installed on your cluster! :-D