-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSFrameInstall.sh
executable file
·80 lines (59 loc) · 3.87 KB
/
SFrameInstall.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/sh
if [ "$#" -ne 2 ] && [ "$#" -ne 3 ] ; then
echo "Usage: ./SFrameInstall.sh <directory to install sframe> <directory of fastjet lib directory> <revision branch>(optional)"
exit 1;
fi
if [ "${ROOTSYS}" = "" ] ; then
echo "Please setup ROOT before calling this script"
exit 1;
fi
BRANCH="master"
if [ "$#" = 3 ] ; then
BRANCH=$3
fi
SFRAMEDIR=`readlink -f $1`
FASTJETDIR=`readlink -f $2`
if [ -z $SFRAMEDIR ]; then
echo "Error: could not resolve given SFRAME target directory '$1'. Make sure to provide a path for which all components but the last exist, omitting the trailing '/'.";
exit 1
fi
if [[ -e $SFRAMEDIR ]]; then
echo "Error: directory $SFRAMEDIR already exists; please use a non-existent dir."
exit 1;
fi
if [ ! -e $FASTJETDIR/libfastjet.so ]; then
echo "Error: fastjet dir does not contain 'libfastjet.so'";
exit 1;
fi
function run_checked () {
$*
if [ $? -ne 0 ]; then
echo "Executing $* failed (pwd: $PWD)";
exit 1;
fi
}
run_checked svn co https://svn.code.sf.net/p/sframe/code/SFrame/tags/SFrame-03-06-27 $SFRAMEDIR
cd $SFRAMEDIR || { echo "svn co failed!"; exit 1; }
git clone --branch $BRANCH https://github.com/UHHAnalysis/NtupleWriter.git NtupleWriter
git clone --branch $BRANCH https://github.com/UHHAnalysis/SFrameTools.git SFrameTools
git clone --branch $BRANCH https://github.com/UHHAnalysis/SFrameAnalysis.git SFrameAnalysis
git clone https://github.com/UHHAnalysis/SFramePlotter.git SFramePlotter
# apply patches:
export SFRAME_DIR=$SFRAMEDIR
./SFrameTools/apply-sframe-patches.sh || { echo "Error applying sframe patched"; exit 1; }
# create and source fullsetup.sh:
echo -e 'echo "************************************************"\necho "* __ ____ * * * *"\necho "* / _| | __| * * *"\necho "* / / | |_ * *"\necho "* \ \ | _| __ __ _________ ___ *"\necho "* \ \ | | | / / | | _ _ | / . \ *"\necho "* _/ / | | | | | 0 | | | | | | | \ _/ *"\necho "* |__/ |_| |_| \__| |_| |_| |_| \__\ *"\necho "* *"\necho "************************************************"\nexport FASTJETDIR='${FASTJETDIR}' \nexport BOOSTDIR=/cvmfs/cms.cern.ch/slc5_amd64_gcc462/external/boost/1.47.0/include\nexport LD_LIBRARY_PATH="'$FASTJETDIR:${SFRAMEDIR}'/SFrameTools/JetMETObjects/lib:$LD_LIBRARY_PATH" \nsource '$PWD'/setup.sh' > fullsetup.sh
echo -e 'echo "************************************************"\necho "* __ ____ * * * *"\necho "* / _| | __| * * *"\necho "* / / | |_ * *"\necho "* \ \ | _| __ __ _________ ___ *"\necho "* \ \ | | | / / | | _ _ | / . \ *"\necho "* _/ / | | | | | 0 | | | | | | | \ _/ *"\necho "* |__/ |_| |_| \__| |_| |_| |_| \__\ *"\necho "* *"\necho "************************************************"\nsetenv FASTJETDIR '${FASTJETDIR}' \nsetenv BOOSTDIR /cvmfs/cms.cern.ch/slc5_amd64_gcc462/external/boost/1.47.0/include\nsetenv LD_LIBRARY_PATH "'$FASTJETDIR:${SFRAMEDIR}'/SFrameTools/JetMETObjects/lib:$LD_LIBRARY_PATH" \nsource '$PWD'/setup.csh' > fullsetup.csh
# SFrame's setup.sh does not like if there is already a SFRAME_DIR set, so unset it:
export SFRAME_DIR=""
source $PWD/fullsetup.sh
ln -s SFrameTools/makeall .
ln -s ../SFrameTools/python/bsframe.py ${SFRAMEDIR}/bin
# compile eveything:
run_checked ./makeall -j 8
echo "\n--------------------------------------------------------------"
echo "SFrame installed. Have fun!"
echo "Additional packages can be installed using:"
echo "git clone https://github.com/UHHAnalysis/XYZ.git XYZ"
echo "where XYZ is the name of the analysis package"
echo "\n--------------------------------------------------------------"