-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathsetup.sh
78 lines (61 loc) · 1.88 KB
/
setup.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
#!/bin/bash
##############################################################################
# Setup script for CEPCSW:
# - setup the external libraries
#
# Usage:
# $ source setup.sh
#
# Author: Tao Lin <[email protected]>
##############################################################################
THISSCRITDIR=$(dirname $(readlink -e "${BASH_SOURCE[0]}" 2>/dev/null) 2>/dev/null) # Darwin readlink doesnt accept -e
function info:() {
echo "INFO: $*" 1>&2
}
function error:() {
echo "ERROR: $*" 1>&2
}
function lcg-version() {
echo ${CEPCSW_LCG_VERSION}
}
function cepcsw-base() {
echo /cvmfs/cepcsw.ihep.ac.cn/prototype
}
function cepcsw-external() {
echo $(cepcsw-base)/releases/externals/$(lcg-version)
}
function setup-external() {
local f=$(cepcsw-external)/setup-${CEPCSW_LCG_VERSION}.sh
if [ ! -f $f ]; then
error: "Failed to find setup script $f"
return
fi
info: "Setup CEPCSW externals: $f"
source $f
}
function setup-install-area() {
local installarea=$THISSCRITDIR/InstallArea
if [ ! -d "$installarea" ]; then
return
fi
export PATH=$installarea/bin:$PATH
export LD_LIBRARY_PATH=$installarea/lib:$LD_LIBRARY_PATH
export PYTHONPATH=$installarea/lib:$PYTHONPATH
export PYTHONPATH=$installarea/python:$PYTHONPATH
export ROOT_INCLUDE_PATH=$installarea/include:$ROOT_INCLUDE_PATH
local extrasetupscript=$installarea/setup.sh
if [ -f "$extrasetupscript" ]; then
source $extrasetupscript
fi
info: "Setup CEPCSW: $installarea"
}
##############################################################################
# Parse the command line options
##############################################################################
# CEPCSW_LCG_VERSION=${1}; shift
if [ -z "$CEPCSW_LCG_VERSION" ]; then
CEPCSW_LCG_VERSION=103.0.2
fi
export CEPCSW_LCG_VERSION
setup-external
setup-install-area