forked from afropapp13/BuildEventGenerators
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_genie.sh
executable file
·61 lines (53 loc) · 1.56 KB
/
build_genie.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
#!/bin/bash
write_genie_env_script() {
cat > ./genie_env.sh << 'EOF'
#!/bin/bash
source ../global_vars.sh
echo "Setting GENIE environment variables..."
# Finds the directory where this script is located. This method isn't
# foolproof. See https://stackoverflow.com/a/246128/4081973 if you need
# something more robust for edge cases (e.g., you're calling the script using
# symlinks).
THIS_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export GENIEBASE=$THIS_DIRECTORY
export GENIE=$GENIEBASE/Generator
export PYTHIA6=$PYTHIA_FQ_DIR/lib
export LHAPDF5_INC=$LHAPDF_INC
export LHAPDF5_LIB=$LHAPDF_LIB
export XSECSPLINEDIR=$GENIEBASE/data
export GENIE_REWEIGHT=$GENIEBASE/Reweight
export PATH=$GENIE/bin:$GENIE_REWEIGHT/bin:$PATH
export LD_LIBRARY_PATH=$GENIE/lib:$GENIE_REWEIGHT/lib:$LD_LIBRARY_PATH
unset GENIEBASE
EOF
}
write_do_configure_script() {
cat > ./do_configure.sh << 'EOF'
#!/bin/bash
source ../genie_env.sh
./configure \
--enable-gsl \
--enable-rwght \
--with-optimiz-level=O2 \
--with-log4cpp-inc=${LOG4CPP_INC} \
--with-log4cpp-lib=${LOG4CPP_LIB} \
--with-libxml2-inc=${LIBXML2_INC} \
--with-libxml2-lib=${LIBXML2_LIB} \
--with-lhapdf5-lib=${LHAPDF_LIB} \
--with-lhapdf5-inc=${LHAPDF_INC} \
--with-pythia6-lib=${PYTHIA_LIB}
EOF
}
git clone https://github.com/GENIE-MC/Generator.git
git clone https://github.com/GENIE-MC/Reweight.git
write_genie_env_script
cd Generator
git checkout -b v3.4.0 R-3_04_00
write_do_configure_script
source do_configure.sh
make -j4
cd ../Reweight
git checkout -b v1.2.0 R-1_02_00
make -j4
cd ..
echo "DONE!"