-
Notifications
You must be signed in to change notification settings - Fork 0
/
set_env.sh
executable file
·437 lines (371 loc) · 10.6 KB
/
set_env.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
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
#!/bin/bash -f
echo ">>> Setting Environment Variables for CLAS6 SIMULATIONS <<<"
export ARCH="64bit"
export ARCHT="64bit"
export SIMINDIR=${HOME}/simulations
export SOFT=/home/ahmede/software # external, ahmed dir
echo ""
echo " > SIMINDIR is set to $SIMINDIR"
echo " > SOFT is set to $SOFT"
echo " > ARCH is set to $ARCH"
echo " > ARCHT is set to $ARCHT"
##############
# QT settings
##############
echo ""
echo ">> Setting Environment Variables for QT"
echo ""
export QT_VER=5.10.1 # hardcoded
export QT_SYS=gcc_64
export QT_TOP=/site/12gev_phys/2.3/Linux_CentOS7.2.1511-x86_64-gcc4.8.5/qt/${QT_VER}/${QT_VER}/${QT_SYS} # external
export QT_BIN=${QT_TOP}/bin
export QT_LIB=${QT_TOP}/lib
if [ ! -d $QT_TOP ]; then
echo "QT Error: $QT_TOP Not Found"
return -1
fi
if [ ! -d $QT_BIN ]; then
echo "QT Error: $QT_BIN Not Found"
return -1
fi
if [ ! -d $QT_LIB ]; then
echo "QT Error: $QT_LIB Not Found"
return -1
fi
echo "QT_VER is set to ${QT_VER}"
echo "QT_SYS is set to ${QT_SYS}"
echo "QT_TOP is set to ${QT_TOP}"
echo "QT_BIN is set to ${QT_BIN}"
echo "QT_LIB is set to ${QT_LIB}"
if [ -z "${PATH}" ]; then
PATH=${QT_BIN}
else
PATH=${QT_BIN}:${PATH}
fi
if [ -z "${LIBRARY_PATH}" ]; then
LIBRARY_PATH=${QT_LIB}
else
LIBRARY_PATH=${QT_LIB}:${LIBRARY_PATH}
fi
if [ -z "${LD_LIBRARY_PATH}" ]; then
LD_LIBRARY_PATH=${QT_LIB}
else
LD_LIBRARY_PATH=${QT_LIB}:${LD_LIBRARY_PATH}
fi
################
# cern settings
################
echo ""
echo ">> Setting Environment Variables for CERN"
echo ""
export CERNVER=2005 # hardcoded
export CERN=/apps/cernlib/x86_64_rhel7 # external
export CERN_LEVEL=$CERNVER
export CERN_ROOT=${CERN}/${CERN_LEVEL}
export CERN_LIB=${CERN_ROOT}/lib
export CERN_BIN=${CERN_ROOT}/bin
export CERN_INC=${CERN_ROOT}/include
export CERNLIBDIR=${CERN_LIB}
export CERN_INCLUDEDIR=${CERN_INC}
if [ ! -d $CERN_LIB ]; then
echo "CERN Error: $CERN_LIB Not Found"
return -1
fi
if [ ! -d $CERN_BIN ]; then
echo "CERN Error: $CERN_BIN Not Found"
return -1
fi
if [ ! -d $CERN_INC ]; then
echo "CERN Error: $CERN_INC Not Found"
return -1
fi
echo "CERN_LEVEL is set to ${CERN_LEVEL}"
echo "CERN_ROOT is set to ${CERN_ROOT}"
echo "CERN_LIB is set to ${CERN_LIB}"
echo "CERN_BIN is set to ${CERN_BIN}"
echo "CERN_INC is set to ${CERN_INC}"
if [ -z "${PATH}" ]; then
PATH=${CERN_BIN}
else
PATH=${CERN_BIN}:${PATH}
fi
if [ -z "$LIBRARY_PATH" ]; then
export LIBRARY_PATH="${CERN_LIB}"
else
export LIBRARY_PATH="${CERN_LIB}:$LIBRARY_PATH"
fi
if [ -z "${LD_LIBRARY_PATH}" ]; then
LD_LIBRARY_PATH=${CERN_LIB}
else
LD_LIBRARY_PATH=${CERN_LIB}:${LD_LIBRARY_PATH}
fi
################
# root settings
################
echo ""
echo ">> Setting Environment Variables for ROOT"
echo ""
export ROOTVER=6.14.04 # hardcoded
export ROOTSYS=${SOFT}/root/${ROOTVER} # external, ahmed dir
export ROOTLIB=${ROOTSYS}/lib
export ROOTBIN=${ROOTSYS}/bin
export ROOTINC=${ROOTSYS}/include
if [ ! -d $ROOTLIB ]; then
echo "ROOT Error: $ROOTLIB Not Found"
return -1
fi
if [ ! -d $ROOTBIN ]; then
echo "ROOT Error: $ROOTBIN Not Found"
return -1
fi
if [ ! -d $ROOTINC ]; then
echo "ROOT Error: $ROOTINC Not Found"
return -1
fi
echo "ROOTVER is set to ${ROOTVER}"
echo "ROOTSYS is set to ${ROOTSYS}"
echo "ROOTLIB is set to ${ROOTLIB}"
echo "ROOTBIN is set to ${ROOTBIN}"
echo "ROOTINC is set to ${ROOTINC}"
if [ -z "$PATH" ]; then
export PATH="$ROOTBIN"
else
export PATH="$ROOTBIN:$PATH"
fi
if [ -z "$LIBRARY_PATH" ]; then
export LIBRARY_PATH="$ROOTLIB"
else
export LIBRARY_PATH="$ROOTLIB:$LIBRARY_PATH"
fi
if [ -z "$LD_LIBRARY_PATH" ]; then
export LD_LIBRARY_PATH="$ROOTLIB"
else
export LD_LIBRARY_PATH="$ROOTLIB:$LD_LIBRARY_PATH"
fi
#################
# mysql settings
#################
echo ""
echo ">> Setting Environment Variables for MySQL"
echo ""
MYSQL=/usr/bin
MYSQL_INCLUDE_PATH=/usr/include/mysql # external
if [ -f /etc/os-release ]; then
MYSQL_LIB_PATH=/usr/lib64/mysql
elif [ -f /etc/debian_version ]; then
MYSQL_LIB_PATH=/usr/lib/x86_64-linux-gnu
elif [ `uname -s` == "Darwin" ]; then
MYSQL_DIR=/usr/local/Cellar/mysql/5.7.19
MYSQL_INCLUDE_PATH=$MYSQL_DIR/include
MYSQL_LIB_PATH=$MYSQL_DIR/lib
MYSQL=$MYSQL_DIR/bin
fi
if [ ! -d $MYSQL ]; then
echo "MYSQL Error: $MYSQL Not Found"
return -1
fi
if [ ! -d $MYSQL_LIB_PATH ]; then
echo "MYSQL Error: $MYSQL_LIB_PATH Not Found"
return -1
fi
if [ ! -d $MYSQL_INCLUDE_PATH ]; then
echo "MYSQL Error: $MYSQL_INCLUDE_PATH Not Found"
return -1
fi
export MYSQL_INCLUDE_PATH
export MYSQL_LIB_PATH
export MYSQL
export MYSQLLIB=${MYSQL_LIB_PATH}
export MYSQLBIN=${MYSQL}
export MYSQLINC=${MYSQL_INCLUDE_PATH}
export MYSQL_LIB=${MYSQL_LIB_PATH}
export MYSQL_BIN=${MYSQL}
export MYSQL_INC=${MYSQL_INCLUDE_PATH}
export MYSQL_INCLUDE=${MYSQL_INCLUDE_PATH}
echo "MYSQL_LIB is set to ${MYSQL_LIB}"
echo "MYSQL_BIN is set to ${MYSQL_BIN}"
echo "MYSQL_INCLUDE is set to ${MYSQL_INCLUDE}"
if [ -z "${PATH}" ]; then
PATH=${MYSQL_BIN}
else
PATH=${MYSQL_BIN}:${PATH}
fi
if [ -z "${LIBRARY_PATH}" ]; then
LIBRARY_PATH=${MYSQL_LIB}
else
LIBRARY_PATH=${MYSQL_LIB}:${LIBRARY_PATH}
fi
if [ -z "${LD_LIBRARY_PATH}" ]; then
LD_LIBRARY_PATH=${MYSQL_LIB}
else
LD_LIBRARY_PATH=${MYSQL_LIB}:${LD_LIBRARY_PATH}
fi
##################
# Tcl/Tk settings
##################
echo ""
echo ">> Setting Environment Variables for tcl/tk"
echo ""
if [ -f /etc/os-release ]; then
TCL_INC=/usr/include # external
TCL_LIB=/usr/lib64
elif [ -f /etc/debian_version ]; then
TCL_INC=/usr/include/tcl$1
TCL_LIB=/usr/lib/x86_64-linux-gnu
elif [ `uname -s` == "Darwin" ]; then
TCL_INC=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/
TCL_LIB=/usr/lib
fi
if [ ! -d $TCL_LIB ]; then
echo "TCL Error: $TCL_LIB Not Found"
return -1
fi
if [ ! -d $TCL_INC ]; then
echo "TCL Error: $TCL_INC Not Found"
return -1
fi
export TCL_VERSION=8.5 # hardcoded
export TCL_VER=TCL85
export TCL_LIB
export TCL_INC
echo "TCL_VERSION is set to ${TCL_VERSION}"
echo "TCL_VER is set to ${TCL_VER}"
echo "TCL_LIB is set to ${TCL_LIB}"
echo "TCL_INC is set to ${TCL_INC}"
if [ -z "${LIBRARY_PATH}" ]; then
LIBRARY_PATH=${TCL_LIB}
else
LIBRARY_PATH=${TCL_LIB}:${LIBRARY_PATH}
fi
if [ -z "${LD_LIBRARY_PATH}" ]; then
LD_LIBRARY_PATH=${TCL_LIB}
else
LD_LIBRARY_PATH=${TCL_LIB}:${LD_LIBRARY_PATH}
fi
#################
# lhapdf setting
#################
# echo ""
# echo " >> Setting Environment Variables for lhapdf"
# echo ""
#
# export LHAVER=6.2.3 # hardcoded
# export LHAPDF=${SOFT}/lhapdf/${LHAVER}
# export LHABIN=${LHAPDF}/bin
# export LHALIB=${LHAPDF}/lib
# export LHAPATH=${SOFT}/lhapdf/pdfsets/${LHAVER}
# export LHAPDF_DATA_PATH=${LHAPATH}
#
# if [ ! -d $LHAPDF ]; then
# echo "LHAPDF Error: $LHAPDF ot Found"
# return -1
# fi
#
# if [ ! -d $LHABIN ]; then
# echo "LHAPDF Error: $LHALIB Not Found"
# return -1
# fi
#
# if [ ! -d $LHALIB ]; then
# echo "LHAPDF Error: $LHABIN Not Found"
# return -1
# fi
#
# if [ ! -d $LHAPATH ]; then
# echo "LHAPDF Error: $LHAPATH Not Found"
# return -1
# fi
#
# echo "LHAVER is set to ${LHAVER}"
# echo "LHAPDF is set to ${LHAPDF}"
# echo "LHABIN is set to ${LHABIN}"
# echo "LHALIB is set to ${LHALIB}"
# echo "LHAPATH is set to ${LHAPATH}"
#
# if [ -z "${PATH}" ]; then
# PATH=${LHABIN}
# else
# PATH=${LHABIN}:${PATH}
# fi
#
# if [ -z "${LIBRARY_PATH}" ]; then
# LIBRARY_PATH=${LHALIB}
# else
# LIBRARY_PATH=${LHALIB}:${LIBRARY_PATH}
# fi
#
# if [ -z "${LD_LIBRARY_PATH}" ]; then
# LD_LIBRARY_PATH=${LHALIB}
# else
# LD_LIBRARY_PATH=${LHALIB}:${LD_LIBRARY_PATH}
# fi
################
# CLAS settings
################
echo ""
echo ">> Setting Environment variables for CLAS"
echo ""
export CLAS_ROOT=${SOFT}/clas_software_ver1 # external, ahmed dir
export CVS_RSH="/usr/bin/ssh"
export CVSROOT="[email protected]:/group/clas/clas_cvs"
export TOP_DIR=${CLAS_ROOT}
export CLAS_BUILD=${CLAS_ROOT}
export CLAS_PACK=${CLAS_ROOT}/packages
export CLAS_CMS=${CLAS_PACK}/cms
export OSNAME=Linux64RHEL7 # hardcoded
export OS_NAME=${OSNAME}
export CLAS_TOOL=${CLAS_PACK}/ClasTool
export CLASTOOL=${CLAS_TOOL}
export CLAS_TOOL_BIN=${CLAS_TOOL}/bin/${OS_NAME}
export CLAS_SCRIPTS=${CLAS_PACK}/scripts
export CLAS_LIB=${CLAS_ROOT}/lib/${OS_NAME}
export CLAS_BIN=${CLAS_ROOT}/bin/${OS_NAME}
export HV_LOCATION=${CLAS_PACK}/Hv
export RECSIS=${CLAS_PACK}
export COBRASYS=${CLAS_PACK}/utilities/cobra
export CLAS_SLIB=${CLAS_ROOT}/slib/${OS_NAME}
export CLAS_PARMS=/group/clas/parms
export CLAS_CALDB_HOST=clasdb.jlab.org
export CLAS_CALDB_USER=clasuser
export CLAS_CALDB_DBNAME=calib
export CLAS_CALDB_RUNINDEX="calib.RunIndex"
export RECSIS_RUNTIME=/group/clas/clsrc/recsis/runtime
echo "CVS_RSH is set to ${CVS_RSH}"
echo "CVSROOT is set to ${CVSROOT}"
echo "CLAS_ROOT is set to ${CLAS_ROOT}"
echo "TOP_DIR is set to ${TOP_DIR}"
echo "CLAS_BUILD is set to ${CLAS_BUILD}"
echo "CLAS_PACK is set to ${CLAS_PACK}"
echo "CLAS_CMS is set to ${CLAS_CMS}"
echo "CLASTOOL is set to ${CLASTOOL}"
echo "CLAS_TOOL is set to ${CLAS_TOOL}"
echo "CLAS_SCRIPTS is set to ${CLAS_SCRIPTS}"
echo "OSNAME is set to ${OSNAME}"
echo "OS_NAME is set to ${OS_NAME}"
echo "CLAS_LIB is set to ${CLAS_LIB}"
echo "CLAS_BIN is set to ${CLAS_BIN}"
echo "HV_LOCATION is set to ${HV_LOCATION}"
echo "RECSIS is set to ${RECSIS}"
echo "COBRASYS is set to ${COBRASYS}"
echo "CLAS_SLIB is set to ${CLAS_SLIB}"
echo "CLAS_PARMS is set to ${CLAS_PARMS}"
echo "CLAS_CALDB_HOST is set to ${CLAS_CALDB_HOST}"
echo "CLAS_CALDB_USER is set to ${CLAS_CALDB_USER}"
echo "CLAS_CALDB_DBNAME is set to ${CLAS_CALDB_DBNAME}"
echo "CLAS_CALDB_RUNINDEX is set to ${CLAS_CALDB_RUNINDEX}"
echo "RECSIS_RUNTIME is set to ${RECSIS_RUNTIME}"
if [ -z "${PATH}" ]; then
PATH=${CLAS_BIN}:${CLAS_TOOL_BIN}:${CLAS_SCRIPTS}:${COBRASYS}/bin
else
PATH=${CLAS_BIN}:${CLAS_TOOL_BIN}:${CLAS_SCRIPTS}:${COBRASYS}/bin:${PATH}
fi
if [ -z "$LIBRARY_PATH" ]; then
export LIBRARY_PATH=${CLAS_LIB}:${COBRASYS}/lib:${CLAS_SLIB}
else
export LIBRARY_PATH=${CLAS_LIB}:${COBRASYS}/lib:${CLAS_SLIB}:$LIBRARY_PATH
fi
if [ -z "${LD_LIBRARY_PATH}" ]; then
LD_LIBRARY_PATH=${CLAS_LIB}:${COBRASYS}/lib:${CLAS_SLIB}
else
LD_LIBRARY_PATH=${CLAS_LIB}:${COBRASYS}/lib:${CLAS_SLIB}:${LD_LIBRARY_PATH}
fi