Skip to content

Commit

Permalink
applied changes to run_in_compat_layer_env.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Top committed Jan 12, 2024
1 parent 41f8bc6 commit 5e2bb24
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions run_in_compat_layer_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,28 @@
base_dir=$(dirname $(realpath $0))
source ${base_dir}/init/eessi_defaults

if [ -z $EESSI_PILOT_VERSION ]; then
echo "ERROR: \$EESSI_PILOT_VERSION must be set!" >&2
if [ -z $EESSI_VERSION ]; then
echo "ERROR: \$EESSI_VERSION must be set!" >&2
exit 1
fi
EESSI_COMPAT_LAYER_DIR="${EESSI_CVMFS_REPO}/versions/${EESSI_PILOT_VERSION}/compat/linux/$(uname -m)"
EESSI_COMPAT_LAYER_DIR="${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/compat/linux/$(uname -m)"
if [ ! -d ${EESSI_COMPAT_LAYER_DIR} ]; then
echo "ERROR: ${EESSI_COMPAT_LAYER_DIR} does not exist!" >&2
exit 1
fi

INPUT=$(echo "$@")
if [ ! -z ${SLURM_JOB_ID} ]; then
INPUT="export SLURM_JOB_ID=${SLURM_JOB_ID}; ${INPUT}"
fi
if [ ! -z ${EESSI_SOFTWARE_SUBDIR_OVERRIDE} ]; then
INPUT="export EESSI_SOFTWARE_SUBDIR_OVERRIDE=${EESSI_SOFTWARE_SUBDIR_OVERRIDE}; ${INPUT}"
fi
if [ ! -z ${EESSI_CVMFS_REPO_OVERRIDE} ]; then
INPUT="export EESSI_CVMFS_REPO_OVERRIDE=${EESSI_CVMFS_REPO_OVERRIDE}; ${INPUT}"
fi
if [ ! -z ${EESSI_PILOT_VERSION_OVERRIDE} ]; then
INPUT="export EESSI_PILOT_VERSION_OVERRIDE=${EESSI_PILOT_VERSION_OVERRIDE}; ${INPUT}"
if [ ! -z ${EESSI_VERSION_OVERRIDE} ]; then
INPUT="export EESSI_VERSION_OVERRIDE=${EESSI_VERSION_OVERRIDE}; ${INPUT}"
fi
if [ ! -z ${http_proxy} ]; then
INPUT="export http_proxy=${http_proxy}; ${INPUT}"
Expand All @@ -30,5 +33,5 @@ if [ ! -z ${https_proxy} ]; then
INPUT="export https_proxy=${https_proxy}; ${INPUT}"
fi

echo "Running '${INPUT}' in EESSI (${EESSI_CVMFS_REPO}) ${EESSI_PILOT_VERSION} compatibility layer environment..."
echo "Running '${INPUT}' in EESSI (${EESSI_CVMFS_REPO}) ${EESSI_VERSION} compatibility layer environment..."
${EESSI_COMPAT_LAYER_DIR}/startprefix <<< "${INPUT}"

0 comments on commit 5e2bb24

Please sign in to comment.