forked from yorkiva/NeuralReweighting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
56 lines (51 loc) · 1.63 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
#!/bin/bash
unset NEURWT_MGTAR
unset NEURWT_MGLOC
unset NEURWT_BASE_PATH
unset NEURWT_LHAPDFLOC
unset NEURWT_LHAPDFTAR
unset NEURWT_LHAPDFSRC
export NEURWT_BASE_PATH=`pwd`
ALL_FILES=`ls $NEWRWT_BASE_PATH`
for file in ${ALL_FILES[*]}
do
if [[ $file == "MG5"*"tar.gz" ]]; then
echo "MG5 tar file found"
export NEURWT_MGTAR=$NEURWT_BASE_PATH/$file
elif [[ $file == "MG5"* ]]; then
echo "MG5 directory found"
export NEURWT_MGLOC=$NEURWT_BASE_PATH/$file
elif [[ $file == "LHAPDF"*"tar.gz" ]]; then
echo "LHAPDF tar file found"
export NEURWT_LHAPDFTAR=$NEURWT_BASE_PATH/$file
elif [[ $file == "LHAPDF"* ]]; then
echo "LHAPDF source loc found"
export NEURWT_LHAPDFSRC=$NEURWT_BASE_PATH/$file
elif [[ $file == "lhapdf" ]]; then
echo "LHAPDF install loc found"
export NEURWT_LHAPDFLOC=$NEURWT_BASE_PATH/$file
export PATH=$PATH:$NEURWT_LHAPDFLOC/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NEURWT_LHAPDFLOC/lib
LHAPDF_PYTHON_PATH=`ls -d $NEURWT_LHAPDFLOC/lib/python*`
if [[ -z LHAPDF_PYTHON_PATH ]]; then
echo "LHAPDF Python Path not found!"
exit 1
else
if [[ -z $PYTHONPATH ]]; then
export PYTHONPATH=$LHAPDF_PYTHON_PATH
else
export PYTHONPATH=$PYTHONPATH:$LHAPDF_PYTHON_PATH
fi
fi
unset LHAPDF_PYTHON_PATH
fi
done
if [[ -z $NEURWT_MGLOC ]]; then ## MG is not there!
echo "No MG is found! Please Run the script 'setup_FirstTime.sh' before starting!"
exit 1
elif [[ -z $NEURWT_LHAPDFLOC ]]; then ## LHAPDF is not there!
echo "No LHAPDF is found! Please Run the script 'setup_FirstTime.sh' before starting!"
exit 1
else
echo "Setup Successful!"
fi