forked from ANNIEsoft/ToolAnalysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GetToolDAQ.sh
executable file
·302 lines (238 loc) · 4.98 KB
/
GetToolDAQ.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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
#!/bin/bash
# rpms prerequisits needs root
#yum install make gcc-c++ gcc binutils libX11-devel libXpm-devel libXft-devel libXext-devel git bzip2-devel python-devel
init=1
tooldaq=1
rootflag=1
root6flag=0
boostflag=1
zmq=1
final=1
MrdTrackLib=1
WCSimlib=1
Python=1
fnalflag=0
while [ ! $# -eq 0 ]
do
case "$1" in
--help | -h)
helpmenu
exit
;;
--no_root | -r)
echo "Installing ToolDAQ without root"
rootflag=0
;;
--no_boost | -b)
echo "Installing ToolDAQ without boost"
boostflag=0
;;
--FNAL | -f)
echo "Installing ToolDAQ for FNAL"
boostflag=0
rootflag=0
fnalflag=1
Python=0
cp Makefile.FNAL Makefile
;;
--no_init )
echo "Installing ToolDAQ without creating ToolDAQ Folder"
init=0;
;;
--no_zmq )
echo "Installing ToolDAQ without zmq"
zmq=0
;;
--no_tooldaq )
echo "Installing dependancies without ToolDAQ"
tooldaq=0
;;
--no_final )
echo "Installing ToolDAQ without compiling ToolAnalysis"
final=0
;;
--ToolDAQ_ZMQ )
echo "Installing ToolDAQ & ZMQ"
rootflag=0
boostflag=0
final=0
MrdTrackLib=0
WCSimlib=0
Python=0
;;
--Boost )
echo "Installing Boost"
init=0
tooldaq=0
rootflag=0
zmq=0
final=0
MrdTrackLib=0
WCSimlib=0
Python=0
;;
--Root )
echo "Installing ToolDAQ"
init=0
tooldaq=0
boostflag=0
zmq=0
final=0
MrdTrackLib=0
WCSimlib=0
Python=0
;;
--Root6 )
echo "Installing ToolDAQ"
init=0
tooldaq=0
boostflag=0
zmq=0
final=0
MrdTrackLib=0
WCSimlib=0
rootflag=0
root6flag=1
Python=0
;;
--WCSim )
echo "Installing WCSim libs"
init=0
tooldaq=0
rootflag=0
boostflag=0
zmq=0
final=0
Python=0
;;
--Python )
echo "Compiling ToolDAQ"
init=0
tooldaq=0
rootflag=0
boostflag=0
zmq=0
MrdTrackLib=0
WCSimlib=0
final=0
;;
--Final )
echo "Compiling ToolDAQ"
init=0
tooldaq=0
rootflag=0
boostflag=0
zmq=0
MrdTrackLib=0
WCSimlib=0
Python=0
;;
esac
shift
done
if [ $init -eq 1 ]
then
mkdir ToolDAQ
fi
cd ToolDAQ
if [ $tooldaq -eq 1 ]
then
git clone https://github.com/ToolDAQ/ToolDAQFramework.git
fi
if [ $zmq -eq 1 ]
then
git clone https://github.com/ToolDAQ/zeromq-4.0.7.git
cd zeromq-4.0.7
./configure --prefix=`pwd`
make -j8
make install
export LD_LIBRARY_PATH=`pwd`/lib:$LD_LIBRARY_PATH
cd ../
fi
if [ $boostflag -eq 1 ]
then
wget http://downloads.sourceforge.net/project/boost/boost/1.66.0/boost_1_66_0.tar.gz
tar zxf boost_1_66_0.tar.gz
rm -rf boost_1_66_0.tar.gz
cd boost_1_66_0
mkdir install
./bootstrap.sh --prefix=`pwd`/install/ > /dev/null 2>/dev/null
./b2 install iostreams
export LD_LIBRARY_PATH=`pwd`/install/lib:$LD_LIBRARY_PATH
cd ../
fi
if [ $rootflag -eq 1 ]
then
wget https://root.cern.ch/download/root_v5.34.34.source.tar.gz
tar zxvf root_v5.34.34.source.tar.gz
rm -rf root_v5.34.34.source.tar.gz
cd root
./configure --enable-rpath
make -j8
source ./bin/thisroot.sh
cd ../
fi
if [ $root6flag -eq 1 ]
then
wget https://root.cern.ch/download/root_v6.14.04.Linux-centos7-x86_64-gcc4.8.tar.gz
tar zxvf root_v6.14.04.Linux-centos7-x86_64-gcc4.8.tar.gz
rm -rf root_v6.14.04.Linux-centos7-x86_64-gcc4.8.tar.gz
cd root
./configure --enable-rpath
make -j8
source ./bin/thisroot.sh
cd ../
fi
if [ $WCSimlib -eq 1 ]
then
cd ../
if [ $fnalflag -eq 1 ]; then
source SetupFNAL.sh
else
source Setup.sh
fi
cd -
git clone https://github.com/ANNIEsoft/WCSimLib.git
cd WCSimLib
if [ $fnalflag -eq 1 ]; then
make -f GNUmakefile.FNAL
else
make
make # run twice, some sort of circular dependancy, works with ROOT 5.34
fi
cd ../
fi
if [ $MrdTrackLib -eq 1 ]
then
cd ../
if [ $fnalflag -eq 1 ]; then
source SetupFNAL.sh
else
source Setup.sh
fi
cd -
git clone https://github.com/ANNIEsoft/MrdTrackLib.git
cd MrdTrackLib
if [ $fnalflag -eq 1 ]; then
cp Makefile.FNAL Makefile
fi
make
cd ../
fi
#cd ../
if [ $Python -eq 1 ]
then
if [ $fnalflag -eq 0 ]; then
source Setup.sh
pip install numpy pandas tensorflow sklearn root_numpy
fi
fi
if [ $final -eq 1 ]
then
cd ..
echo "current directory"
echo `pwd`
make clean
make
export LD_LIBRARY_PATH=`pwd`/lib:$LD_LIBRARY_PATH
fi