forked from FairRootGroup/FairSoft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.sh
executable file
·413 lines (336 loc) · 9.6 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
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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
#!/bin/bash
#
# CBM package compilation script
# [email protected], June 2006
# [email protected], June 2006
# update of the script
# include debug version and
# intel compiler switches
# [email protected], July 2007
# debug options on :set -xv
# debug options off:set +xv
#
set +xv
# unset ROOTSYS. If it is set this can make problems when compiling Geant3
unset ROOTSYS
#Clean the enviroment
unset ROOTBUILD
unset THREAD
unset ZLIB
unset LZMA
unset OPENGL
unset MYSQL
unset ORACLE
unset PGSQL
unset SQLITE
unset QTDIR
unset SAPDB
unset RFIO
unset CASTOR
unset GFAL
unset GSL
unset HDFS
unset PYTHIA6
unset PYTHIA8
unset FFTW3
unset CFITSIO
unset GVIZ
unset PYTHONDIR
unset DCACHE
unset CHIRP
unset DNSSD
unset AVAHI
unset ALIEN
unset ASIMAGE
unset LDAP
unset GLOBUS_LOCATION
unset GLITE
unset MEMSTAT
unset MONALISA
unset SRP
unset SSL
unset AFS
unset ROOFIT
unset MINUIT2
unset TABLE
unset XMLDIR
unset ROOTDICTTYPE
unset PLATFORM
export SIMPATH=$PWD
# Set the cache file name
cache_file="config.cache"
# define the logfile
datum=$(date +%d%m%y_%H%M%S)
logfile=$PWD/Install_$datum.log
logfile_lib=$PWD/libraries_$datum.log
echo "The build process for the external packages for the FairRoot Project was started at" $datum | tee -a $logfile
source scripts/functions.sh
# check if there was a parameter given to the script.
# if yes then use some standard parameters and don't
# show the menus. Else get some input interactively.
if [ $# == "0" ];
then
source scripts/menu.sh
elif [ $# == "1" ];
then
# test if the file exist and if all needed varaibles are defined in the script
if [ -e $1 ]; then
source $1
check_variables
else
echo "The file passed as parameter does not exist."
exit 1
fi
else
echo "Call the script either with no parameter, then your are guided through the installation procedure,"
echo "or with one parameter which defines an input file with the needed parameters."
exit 1
fi
if [ "$build_MQOnly" = "yes" ]
then
mqonly=1
else
mqonly=0
fi
if [ "$install_sim" = "yes" ]
then
onlyreco=0
export Fortran_Needed=TRUE
elif [ "$install_sim" = "no" ]
then
onlyreco=1
export Fortran_Needed=FALSE
fi
if [ "$build_MQOnly" = "no" ]
then
if [ "$build_root6" = "yes" ]
then
pluto=0
export Root_Version=6
elif [ "$build_root6" = "no" ]
then
pluto=1
export Root_Version=5
fi
elif [ "$build_MQOnly" = "yes" ];
then
pluto=0
export Root_Version=0
fi
if [ "$installation_type" = "grid" ];
then
export BUILD_BATCH=TRUE
else
export BUILD_BATCH=FALSE
fi
if [ "$build_python" = "yes" ];
then
export BUILD_PYTHON=TRUE
else
export BUILD_PYTHON=FALSE
fi
export SIMPATH_INSTALL
# check the architecture automatically
# set the compiler options according to architecture, compiler
# debug and optimization options
source scripts/check_system.sh
# generate the config.cache file
generate_config_cache
echo "The following parameters are set." | tee -a $logfile
echo "System : " $system | tee -a $logfile
echo "C++ compiler : " $CXX | tee -a $logfile
echo "C compiler : " $CC | tee -a $logfile
echo "Fortran compiler : " $FC | tee -a $logfile
echo "CXXFLAGS : " $CXXFLAGS | tee -a $logfile
echo "CFLAGS : " $CFLAGS | tee -a $logfile
echo "FFLAGS : " $FFLAGS | tee -a $logfile
echo "CMAKE BUILD TYPE : " $BUILD_TYPE | tee -a $logfile
echo "Compiler : " $compiler | tee -a $logfile
echo "Fortran compiler : " $FC
echo "Debug : " $debug | tee -a $logfile
echo "Optimization : " $optimize | tee -a $logfile
echo "Platform : " $platform | tee -a $logfile
echo "Architecture : " $arch | tee -a $logfile
echo "G4System : " $geant4_system | tee -a $logfile
echo "g4_data_files : " $geant4_data_files | tee -a $logfile
echo "g4_get_data : " $geant4_get_data | tee -a $logfile
echo "Number of parallel " | tee -a $logfile
echo "processes for build : " $number_of_processes | tee -a $logfile
echo "Installation Directory: " $SIMPATH_INSTALL | tee -a $logfile
if [ "$onlyreco" = "1" ];
then
echo "Reco Only Installation "
fi
check=1
# set the versions of packages to be build
source scripts/package_versions.sh
# Create the installation directory and its substructure
create_installation_directories
# Now start compilations with checks
######################## CMake ################################
# This is only for safety reasons. If we find a machine where
# cmake is not installed, we install cmake and add the path
# to the environment variable PATH
if [ "$check" = "1" ];
then
source scripts/install_cmake.sh
fi
############ Google Test framework ###############################
if [ "$check" = "1" ];
then
source scripts/install_gtest.sh
fi
############ GNU scientific library ###############################
if [ "$check" = "1" ];
then
source scripts/install_gsl.sh
fi
############ ICU libraries ###############################
if [ "$check" = "1" -a "$compiler" = "Clang" -a "$platform" = "linux" ];
then
source scripts/install_icu.sh
fi
############ Boost libraries ###############################
if [ "$check" = "1" ];
then
source scripts/install_boost.sh
fi
##################### Pythia 6 #############################################
if [ "$check" = "1" -a "$onlyreco" = "0" ];
then
source scripts/install_pythia6.sh
fi
##################### HepMC ## #############################################
if [ "$check" = "1" -a "$onlyreco" = "0" ];
then
source scripts/install_hepmc.sh
fi
##################### Pythia 8 #############################################
if [ "$check" = "1" -a "$onlyreco" = "0" ];
then
source scripts/install_pythia8.sh
fi
##################### XercesC #############################################
if [ "$build_python" = "yes" ];
then
if [ "$check" = "1" -a "$onlyreco" = "0" ];
then
source scripts/install_xercesc.sh
fi
fi
############ Mesa libraries ###############################
if [ "$check" = "1" -a "$compiler" = "Clang" -a "$platform" = "linux" -a "$mqonly" = "0" ];
then
source scripts/install_mesa.sh
fi
##################### GEANT 4 #############################################
if [ "$check" = "1" -a "$onlyreco" = "0" ];
then
source scripts/install_geant4.sh
fi
###################### GEANT 4 Data ########################################
if [ "$check" = "1" -a "$geant4_install_data_from_dir" = "yes" -a "$onlyreco" = "0" ];
then
source scripts/install_geant4_data.sh
fi
##################### ROOT #############################################
if [ "$check" = "1" -a "$mqonly" = "0" ];
then
source scripts/install_root6.sh
fi
##################### G4Py #############################################
if [ "$build_python" = "yes" ];
then
if [ "$check" = "1" -a "$onlyreco" = "0" -a "$mqonly" = "0" ];
then
source scripts/install_g4py.sh
fi
fi
##################### Pluto #############################################
if [ "$check" = "1" -a "$onlyreco" = "0" -a "$pluto" = "1" -a "$mqonly" = "0" ];
then
source scripts/install_pluto.sh
fi
##################### Geant 3 VMC #############################################
if [ "$check" = "1" -a "$onlyreco" = "0" -a "$mqonly" = "0" ];
then
source scripts/install_geant3.sh
fi
##################### VGM #############################################
if [ "$check" = "1" -a "$onlyreco" = "0" ];
then
source scripts/install_vgm.sh
fi
##################### Geant 4 VMC #############################################
if [ "$check" = "1" -a "$onlyreco" = "0" ];
then
source scripts/install_geant4_vmc.sh
fi
##################### Millepede #############################################
if [ "$check" = "1" -a "$onlyreco" = "0" ];
then
source scripts/install_millepede.sh
fi
##################### LibSodium ##################################################
#if [ "$check" = "1" ];
#then
# source scripts/install_sodium.sh
#fi
##################### ZeroMQ ##################################################
if [ "$check" = "1" ];
then
source scripts/install_zeromq.sh
fi
##################### Protocoll Buffers #######################################
if [ "$check" = "1" ];
then
source scripts/install_protobuf.sh
fi
##################### FlatBuffers ##############################################
if [ "$check" = "1" ];
then
source scripts/install_flatbuffers.sh
fi
##################### MessagePack ##############################################
if [ "$check" = "1" ];
then
source scripts/install_msgpack.sh
fi
##################### nanomsg ##################################################
if [ "$check" = "1" ];
then
source scripts/install_nanomsg.sh
fi
##################### DDS ###############################################
if [ "$check" = "1" ];
then
source scripts/install_DDS.sh
fi
##################### FairLogger ###############################################
if [ "$check" = "1" ];
then
source scripts/install_fairlogger.sh
fi
##################### FairMQ ###############################################
if [ "$check" = "1" ];
then
source scripts/install_fairmq.sh
fi
if [ "$check" = "1" ];
then
echo "*** End installation of external packages without Errors***" | tee -a $logfile
echo ""
if [ "$install_cmake" = "yes" ]; then
echo "During the installation a new version of CMake has been installed in $SIMPATH_INSTALL/bin."
echo "Please add this path to your environment variable PATH to use this new version of CMake."
fi
if [ "$install_alfasoft" = "yes" ];
then
echo "----------------- End of FairSoft installation ---------------"
else
exit 0
fi
else
echo "*** End installation of external packages with Errors***" | tee -a $logfile
exit 42
fi