forked from FairRootGroup/FairRoot
-
Notifications
You must be signed in to change notification settings - Fork 9
/
configure.sh
executable file
·39 lines (33 loc) · 1.08 KB
/
configure.sh
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
#!/bin/bash
#
if [ "x$SIMPATH" == "x" ]; then
# check if FairSoftInst exists one level up
if [ -d $PWD/../FairSoftInst ]; then
export SIMPATH=$PWD/../FairSoftInst
else
echo "*** No FairSoft installation directory is defined."
echo "*** Please set the environment variable SIMPATH to the Fairsoft installation directory."
exit 1
fi
fi
if `which lsb_release > /dev/null 2>&1` ; then
# if on lxplus
distribution=$(lsb_release -is)
version=$(lsb_release -rs | cut -f1 -d.)
if [ "$distribution$version" = "ScientificCERNSLC6" ]; then
# operating system of last century, need newer gcc / python
eval "$(/cvmfs/sft.cern.ch/lcg/releases/lcgenv/latest/lcgenv -p /cvmfs/sft.cern.ch/lcg/releases/LCG_87 x86_64-slc6-gcc62-opt Python)"
fi
fi
if [ ! -d build ]; then
mkdir build
fi
installDir="${PWD/FairRoot/FairRootInst}"
cd build
export PATH=$SIMPATH/bin:$PATH
xx=$($SIMPATH/bin/fairsoft-config --cxx)
yy=$($SIMPATH/bin/fairsoft-config --cc)
cmake .. -DCMAKE_INSTALL_PREFIX=$installDir -DCMAKE_CXX_COMPILER=$xx -DCMAKE_C_COMPILER=$yy
make
make install
make test