-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·60 lines (52 loc) · 2.56 KB
/
Copy pathdeploy.sh
File metadata and controls
executable file
·60 lines (52 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
# Marco Pizzichemi 11.1.2022 marco.pizzichemi@cern.ch
# This script compiles the simulation toolkit and all the support programs
# Run it from main git directory, with
#
# ./deploy.sh [OPTION]
#
# Argument OPTION is optional. If not given, machine compiler is used.
# The only other possible option is lxplus
#
# ./deploy.sh lxplus
#
# which will source LGC97python3 environment.
# If you want to add other options, you need to properly modify the SET ENV VARIABLES section
# exit when any command fails
set -e
# keep track of the last executed command
trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
# echo an error message before exiting
trap 'echo "Last command \"${last_command}\" returned with exit code $?."' EXIT
### MAKE BUILD FOLDER (IF NOT THERE ALREADY)
mkdir -p build
CMAKE_ARGS=""
if [ -z "$1" ]
then
echo "No argument supplied, so compiling with machine compiler..."
else
if [ $1 = "lxplus" ]; then
set --
echo "Sourcing compiler for lxplus..."
source /cvmfs/sft.cern.ch/lcg/views/LCG_97python3/x86_64-centos7-gcc9-opt/setup.sh
CMAKE_ARGS="--verbose -DCMAKE_CXX_COMPILER=`which g++` -DCMAKE_C_COMPILER=`which gcc`"
else
echo "Invalid argument $1 - You can either provide no arg (and the script will use machine compiler), or lxplus, and the script will source the lxplus variables"
fi
fi
### SUPPORT PROGRAMS
echo "Compiling support programs..."
g++ -o build/timeResolution timeResolution.cpp `root-config --cflags --glibs` -Wl,--no-as-needed -lHist -lCore -lMathCore -lTree -lTreePlayer -lgsl -lgslcblas
g++ -o build/extractConfiguration extractConfiguration.cpp `root-config --cflags --glibs` -Wl,--no-as-needed -lHist -lCore -lMathCore
g++ -o build/calcDOIres DeepLearningDOI/calcDOIres.cpp `root-config --cflags --glibs` -Wl,--no-as-needed -lHist -lCore -lMathCore -lTree -lTreePlayer -lgsl -lgslcblas
g++ -o build/filterForDeepLearning_MiniPET DeepLearningDOI/filterForDeepLearning_MiniPET.cpp `root-config --cflags --glibs` -Wl,--no-as-needed -lHist -lCore -lMathCore -lTree -lTreePlayer -lgsl -lgslcblas
g++ -o build/filterForDOIscan DeepLearningDOI/filterForDOIscan.cpp `root-config --cflags --glibs` -Wl,--no-as-needed -lHist -lCore -lMathCore -lTree -lTreePlayer -lgsl -lgslcblas
g++ -o build/compton_volumes Cluster/compton_volumes.cpp `root-config --cflags --glibs` -Wl,--no-as-needed -lHist -lCore -lMathCore -lTree -lTreePlayer -lgsl -lgslcblas
### MODULE CALIBRATION
echo "Compiling ModuleCalibration..."
cd build
echo "Running cmake command as: cmake $CMAKE_ARGS ../"
cmake $CMAKE_ARGS ../
make
cd ../
echo "Done."