forked from TreeMaker/TreeMaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·127 lines (113 loc) · 3.57 KB
/
setup.sh
File metadata and controls
executable file
·127 lines (113 loc) · 3.57 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/bash -e
CMSSWVER=CMSSW_9_4_11
FORK=LongLivedSusy
BRANCH=Run2_2017_autominiaod
ACCESS=ssh
CORES=8
NAME=""
DIR="${PWD}"
usage(){
EXIT=$1
echo "setup.sh [options]"
echo ""
echo "-f [fork] clone from specified fork (default = ${FORK})"
echo "-b [branch] clone specified branch (default = ${BRANCH})"
echo "-c [version] use specified CMSSW version (default = ${CMSSWVER})"
echo "-a [protocol] use protocol to clone (default = ${ACCESS}, alternative = https)"
echo "-j [cores] run CMSSW compilation on # cores (default = ${CORES})"
echo "-n [name] name of the CMSSW directory (default = ${CMSSWVER})"
echo "-d [dir] project installation area for the CMSSW directory (default = ${DIR})"
echo "-h display this message and exit"
exit $EXIT
}
# process options
while getopts "f:b:a:j:n:d:c:h" opt; do
case "$opt" in
f) FORK=$OPTARG
;;
b) BRANCH=$OPTARG
;;
c) CMSSWVER=$OPTARG
;;
a) ACCESS=$OPTARG
;;
j) CORES=$OPTARG
;;
n) NAME=$OPTARG
;;
d) DIR=$OPTARG
;;
h) usage 0
;;
esac
done
# check options
if [ "$ACCESS" = "ssh" ]; then
ACCESS_GITHUB=git@github.com:
ACCESS_GITLAB=ssh://git@gitlab.cern.ch:7999/
elif [ "$ACCESS" = "https" ]; then
ACCESS_GITHUB=https://github.com/
ACCESS_GITLAB=https://gitlab.cern.ch/
else
usage 1
fi
# get CMSSW release
if [[ "$CMSSWVER" == "CMSSW_9_4_"* ]]; then
GCC_VERSION=gcc630
elif [[ "$CMSSWVER" == "CMSSW_10_2_"* ]]; then
GCC_VERSION=gcc700
else
echo "Unsupported CMSSW version: $CMSSWVER"
exit 1
fi
if [[ `uname -r` == *"el6"* ]]; then
SLC_VERSION="slc6"
elif [[ `uname -r` == *"el7"* ]]; then
SLC_VERSION="slc7"
else
echo "WARNING::Unknown SLC version. Defaulting to SLC6."
SLC_VERSION="slc6"
fi
export SCRAM_ARCH=${SLC_VERSION}_amd64_${GCC_VERSION}
# cmsrel
SCRAM_PROJECT_OPTIONS=""
if [ "$DIR" != "${PWD}" ]; then
SCRAM_PROJECT_OPTIONS="$SCRAM_PROJECT_OPTIONS --dir ${DIR}"
fi
if [ "$NAME" != "" ]; then
SCRAM_PROJECT_OPTIONS="$SCRAM_PROJECT_OPTIONS --name ${NAME}"
else
NAME=${CMSSWVER}
fi
SCRAM_PROJECT_OPTIONS="$SCRAM_PROJECT_OPTIONS ${CMSSWVER}"
scram project ${SCRAM_PROJECT_OPTIONS}
cd ${DIR}/${NAME}/src
# cmsenv
eval `scramv1 runtime -sh`
git cms-init
git config gc.auto 0
# CMSSW patches
if [[ "$CMSSWVER" == "CMSSW_9_4_"* ]]; then
git cms-merge-topic TreeMaker:fixFormulaEvaluator_949 # this one has dependencies, might be in a future 9_4_X release
git cms-merge-topic -u TreeMaker:BoostedDoubleSVTaggerV4-WithWeightFiles-v1_from-CMSSW_9_4_2
git cms-merge-topic -u TreeMaker:storeJERFactorIndex942
git cms-merge-topic -u TreeMaker:AddJetAxis1_942
git cms-merge-topic -u TreeMaker:NjettinessAxis_948
git cms-merge-topic -u TreeMaker:METFixEE2017_949_v2
elif [[ "$CMSSWVER" == "CMSSW_10_2_"* ]]; then
git cms-merge-topic -u TreeMaker:BoostedDoubleSVTaggerV4-WithWeightFiles-v1_from-CMSSW_10_2_7
git cms-merge-topic -u TreeMaker:storeJERFactorIndex1027
git cms-merge-topic -u TreeMaker:AddJetAxis1_1027
git cms-merge-topic -u TreeMaker:NjettinessAxis_1027
fi
# outside repositories
git clone ${ACCESS_GITHUB}TreeMaker/JetToolbox.git JMEAnalysis/JetToolbox -b jetToolbox_94X
git clone ${ACCESS_GITHUB}kpedro88/CondorProduction.git Condor/Production
git clone ${ACCESS_GITHUB}${FORK}/TreeMaker.git -b ${BRANCH}
# get egamma config file without recompiling whole package
wget https://github.com/TreeMaker/cmssw/raw/EgammaPostRecoTools_940/RecoEgamma/EgammaTools/python/EgammaPostRecoTools.py -P TreeMaker/Utils/python/
# compile
scram b -j ${CORES}
# extra setup
cd TreeMaker/Production/test/condorSub/
python $CMSSW_BASE/src/Condor/Production/python/linkScripts.py