From 1931fbca16653c14390f3550fdc39bdf9b6728a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Einar=20El=C3=A9n?= Date: Fri, 10 Feb 2023 17:20:23 +0100 Subject: [PATCH] Add installation and environment for fluka --- Dockerfile | 2 ++ entry.sh | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/Dockerfile b/Dockerfile index 018adad..260a3ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -321,6 +321,8 @@ RUN mkdir -p /usr/local/root &&\ COPY ./certs/ /usr/local/share/ca-certificates RUN update-ca-certificates +COPY fluka_4-3.1.x86-Linux-gfor7_amd64.deb / +RUN apt-get install /fluka_4-3.1.x86-Linux-gfor7_amd64.deb #run environment setup when docker container is launched and decide what to do from there # will require the environment variable LDMX_BASE defined COPY ./entry.sh /etc/ diff --git a/entry.sh b/entry.sh index 9cd3cdb..058ca1a 100644 --- a/entry.sh +++ b/entry.sh @@ -51,12 +51,32 @@ do done unset _external_path + # helps simplify any cmake nonsense export CMAKE_PREFIX_PATH=/usr/local/:$LDMX_SW_INSTALL # puts a config/cache directory for matplotlib to use export MPLCONFIGDIR=$LDMX_BASE/.config/matplotlib +# FLUKA Environment +# From env_FLUKA.sh +export PATH=$PATH:/usr/local/fluka/bin +export FLUKA_PATH=$(realpath $(dirname $(which fluka))/..) +if [ ! -d "$FLUKA_PATH" ]; then + echo "!!! fluka not found. FLUKA_REPO=$FLUKA_PATH. Add your fluka_repo/bin to the PATH. !!!"; +fi + +export FLUKADATA=$FLUKA_PATH/data +if [ ! -d "$FLUKADATA" ]; then + echo "!!! fluka data repo not found. FLUKADATA=$FLUKADATA. Add your fluka_repo/bin to the PATH. !!!"; +fi + +export FLUKA_LIB_DIR=$FLUKA_PATH/lib +if [ ! -d "$FLUKA_LIB_DIR" ]; then + echo "!!! fluka lib repo not found. FLUKA_LIB_DIR=$FLUKA_LIB_DIR. Add your fluka_repo/bin to the PATH. !!!"; +fi + +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$FLUKA_LIB_DIR # go to first argument cd "$1"