forked from HEP-FCC/FCCAnalyses
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
56 lines (46 loc) · 2.12 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
if [ "${0}" != "${BASH_SOURCE}" ]; then
# Determinig the location of this setup script
export LOCAL_DIR=$(cd $(dirname "${BASH_SOURCE}") && pwd)
echo "----> Info: Setting up Key4hep stack..."
# Sourcing of the stack
if [ -n "${KEY4HEP_STACK}" ]; then
echo "----> Info: Key4hep stack already set up. Skipping..."
elif [ -f "${LOCAL_DIR}/.fccana/stackpin" ]; then
STACK_PATH=$(<${LOCAL_DIR}/.fccana/stackpin)
echo "----> Info: Sourcing pinned Key4hep stack..."
echo " ${STACK_PATH}"
source ${STACK_PATH}
else
source /cvmfs/sw.hsf.org/key4hep/setup.sh -r 2024-03-10
fi
if [ -z "${KEY4HEP_STACK}" ]; then
echo "----> Error: Key4hep stack not setup correctly! Aborting..."
return 1
fi
echo "----> Info: Setting up environment variables..."
export PYTHONPATH=${LOCAL_DIR}/python:${PYTHONPATH}
export PYTHONPATH=${LOCAL_DIR}/install/python:${PYTHONPATH}
export PYTHONPATH=${LOCAL_DIR}/install/share/examples:${PYTHONPATH}
export PATH=${LOCAL_DIR}/bin:${PATH}
export PATH=${LOCAL_DIR}/install/bin:${PATH}
export LD_LIBRARY_PATH=${LOCAL_DIR}/install/lib:${LD_LIBRARY_PATH}
export CMAKE_PREFIX_PATH=${LOCAL_DIR}/install:${CMAKE_PREFIX_PATH}
export ROOT_INCLUDE_PATH=`fastjet-config --prefix`/include:${ROOT_INCLUDE_PATH}
export ROOT_INCLUDE_PATH=${LOCAL_DIR}/install/include:${ROOT_INCLUDE_PATH}
export ONNXRUNTIME_ROOT_DIR=`python -c "import onnxruntime; print(onnxruntime.__path__[0]+'/../../../..')" 2> /dev/null`
if [ -z "${ONNXRUNTIME_ROOT_DIR}" ]; then
echo "----> Warning: ONNX Runtime not found! Related analyzers won't be build..."
else
export LD_LIBRARY_PATH=${ONNXRUNTIME_ROOT_DIR}/lib:${LD_LIBRARY_PATH}
fi
export MANPATH=${LOCAL_DIR}/man:${MANPATH}
export MANPATH=${LOCAL_DIR}/install/share/man:${MANPATH}
export FCCDICTSDIR=/cvmfs/fcc.cern.ch/FCCDicts:${FCCDICTSDIR}
else
echo "----> Error: This script is meant to be sourced!"
fi
#Modified this to set up MELA
export ROOFITSYS=${ROOTSYS}
#cd ./JHUGenerator.v7.5.5/JHUGenMELA
source ${LOCAL_DIR}/JHUGenerator.v7.5.5/JHUGenMELA/setup.sh
eval $(${LOCAL_DIR}/JHUGenerator.v7.5.5/JHUGenMELA//setup.sh env)