forked from ascarpel/pmt_analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.sh
executable file
·69 lines (55 loc) · 2.06 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
#!/bin/bash
################################################################################
# Prepare the environment for pmt_analysis. It uses UPS producs on gpvm machines
# It requres a local installtion of ROOT, Eigen and CMake otherwise
# mailto:[email protected]
################################################################################
# Setup manually the EIGEN_INSTALL variable which is the most opportune for you
export EIGEN_INSTALL=""
# This part of the code is effective only on a fnal.gov domain
if [ "${HOSTNAME#*.}" == "fnal.gov" ]; then
# Setup the general icaruscode ups packages
source /cvmfs/fermilab.opensciencegrid.org/products/larsoft/setup
source /cvmfs/icarus.opensciencegrid.org/products/icarus/setup_icarus.sh
remove_quotes()
{
var=$1
temp="${var%\"}"
temp="${temp#\"}"
echo "$temp"
}
# Find the location of the eigen heders and replace the value set before
EIGEN_INSTALL="/cvmfs/larsoft.opensciencegrid.org/products/eigen/v3_3_5/include/eigen3/"
# Now setup the latest version of Eigen using ups producs
out=( "$(ups list -aK+ eigen | tail -1)" )
line=( $out )
version=$( remove_quotes ${line[1]} )
setup eigen -v ${version} -q ${qualifier}
# Now setup the latest version of ROOT using ups producs
out=( "$(ups list -aK+ root | tail -1)" )
line=( $out )
version=$( remove_quotes ${line[1]} )
qualifier=$( remove_quotes ${line[3]} )
setup root -v ${version} -q ${qualifier}
#now setup CMAKE
out=( "$(ups list -aK+ cmake | tail -1)" )
line=( $out )
version=$( remove_quotes ${line[1]} )
setup cmake -v ${version}
fi
# Check if the EIGEN_INSTALL variable is configured
if [ $EIGEN_INSTALL == "" ]; then
echo "DON'T FORGET TO SET THE EIGEN_INSTALL VARIABLE!"
return
fi
# Check if root is configured
if [ $ROOTSYS == "" ]; then
echo "DON'T FORGET TO SET A ROOT VERSION!"
return
fi
# Get the current dir
currentdir=$(pwd)
# Add directories to the local path
export PATH="$currentdir/build/:$PATH"
export LD_LIBRARY_PATH="$currentdir/build/:$LD_LIBRARY_PATH"
export PROJECT_PATH="$currentdir"