Skip to content

Commit

Permalink
Merge pull request #281 from kjvbrt/stacklink
Browse files Browse the repository at this point in the history
Sourcing Key4hep stable stack directly
  • Loading branch information
kjvbrt authored May 3, 2023
2 parents 554e1cc + 97b1744 commit 3e853e5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,34 @@ 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."
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 "----> Info: Sourcing pinned Key4hep stack..."
echo " ${STACK_PATH}"
source ${STACK_PATH}
else
source /cvmfs/fcc.cern.ch/sw/latest/setup.sh
source /cvmfs/sw.hsf.org/key4hep/setup.sh
fi

echo "----> Info: Setting up environment variables..."
export PYTHONPATH=${LOCAL_DIR}:${PYTHONPATH}
export PYTHONPATH=${LOCAL_DIR}/python:${PYTHONPATH}
export PYTHONPATH=${LOCAL_DIR}/install/python:${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=${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..."
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
else
echo "ERROR: This script is meant to be sourced!"
echo "----> Error: This script is meant to be sourced!"
fi

0 comments on commit 3e853e5

Please sign in to comment.