Skip to content
Snippets Groups Projects
Commit bb1a44b1 authored by Oriol Tintó's avatar Oriol Tintó
Browse files

Add template to build enstools with spack.

parent 5f77f29c
No related branches found
No related tags found
No related merge requests found
# Get some variables provided by autosubmit.
# TODO: What do we do to ensure that these variables are defined in the proj file?
WORKDIR=%HPCROOTDIR%
ICON_VERSION=%ICON_VERSION%
SPACK_URL=%spack.url%
SPACK_BRANCH=%spack.branch%
SPACK_COMPILER=%spack.compiler%
# If the workdir directory does not exist create it
if [ ! -d ${WORKDIR} ] ; then
mkdir -p ${WORKDIR}
fi
# Go to the working directory
cd ${WORKDIR}
# Check if experiment's spack installation already exists, if it doesn't, clone it.
SPACK_ENV=spack/share/spack/setup-env.sh
if [ ! -f ${SPACK_ENV} ] ; then
git clone ${SPACK_URL} -b ${SPACK_BRANCH}
#TODO: Would be good to enable the re-utilization of existing spack packages (via packages.yaml or upstreams.yaml)
fi
# Setup the environment
source ${SPACK_ENV}
if [ $( spack find py-enstools-compression &> /dev/null ; echo $? ) -ne 0 ]; then
echo "Installing enstools-compression."
# Compile openmpi with schedulers=slurm
spack install py-enstools-compression
else
echo "py-enstools-compression already installed!"
fi
# Link the python binary into the main folder so can be easily used later:
spack load py-enstools-compression
ln -sf $(which python3) ${WORKDIR}/python3
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment