-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathinit.sh
executable file
·67 lines (50 loc) · 1.64 KB
/
init.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
#!/bin/bash
# copied from @Brian Petersen
if [ "$0" != "TBDataPreparation/init.sh" ]
then
echo "init.sh must be run as 'TBDataPreparation/init.sh'"
exit 1
fi
if [ $# != 1 ]
then
echo "USAGE: TBDataPreparation/init.sh [TBVER]"
echo "where [TBVER] is the version of the test beam to be run"
echo "Currently available are 2023_SPS or 2024_SPS"
exit 1
fi
TBVER=$1
shift 1
#LCGVER=/cvmfs/sw.hsf.org/key4hep/setup.sh
LCGVER=/cvmfs/sft.cern.ch/lcg/views/LCG_106/x86_64-el9-gcc13-opt/setup.sh
if [ -f ${LCGVER} ]
then
source ${LCGVER}
else
echo 'Cannot find LCG setup script ${LCGVER}. If this is expected, try using the setup_noLCG,sh scriipt'
fi
# Use cvmfs-venv to hack back against PYTHONPATH pollution
# c.f. https://github.com/matthewfeickert/cvmfs-venv for more information and examples
# download and run directly to avoid temporary files or adding a Git submodule
#bash <(curl -sL https://raw.githubusercontent.com/matthewfeickert/cvmfs-venv/v0.0.3/cvmfs-venv.sh) ideadr-env
#source ideadr-env/bin/activate
# FIXME: hack due to unversioned library in LCG
#ln -sf /lib64/libtiff.so "ideadr-env/lib/"
#ln -sf /lib64/libtiff.so.5 "ideadr-env/lib/"
export LD_LIBRARY_PATH="ideadr-env/lib:${LD_LIBRARY_PATH}"
# Generate a Env setup script for every log-in
echo "Generating settings file: 'setup.sh'"
if [ -e setup.sh ]
then
echo " Moving existing 'setup.sh' to 'setup.sh.old'"
mv setup.sh setup.sh.old
fi
cp TBDataPreparation/setup_noLCG.sh .
cat <<EOF > setup.sh
#source LCG
source ${LCGVER}
#set working directory
export IDEADIR=$PWD
export SamplePath=$PWD
#standard setup
source $PWD/TBDataPreparation/setup.sh ${TBVER}
EOF