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

Including an icon.load_cmd for the cases where the build command includes a...

Including an icon.load_cmd for the cases where the build command includes a hash that can't be used for load. Defaults to the value of icon.build_cmd
parent 4d36cb31
No related branches found
No related tags found
No related merge requests found
Pipeline #18807 failed
......@@ -23,6 +23,12 @@ icon:
# spack.compiler: "gcc@11.2.0/bcn7mbu"
# spack.upstreams: "/sw/spack-levante/"
# build_cmd: "icon-nwp@%ICON.VERSION%%gcc@11.2.0 source=dkrz_https ^openmpi@4.1.2%gcc@11.2.0 ^hdf5%gcc@11.2.0+fortran+hl"
# The load_cmd will be used to load icon-nwp with spack
# in most cases it can be the same value as the build_cmd, but for some cases where using dependencies with a
# specific hash it doesn't work anymore. For those cases, the default value can be replaced by the build_cmd without
# the dependencies with hash.
load_cmd: "%icon.build_cmd%"
version: master # The latest release at the moment of creating this file was 2.6.5-nwp0
python_environment:
......
......@@ -23,6 +23,8 @@ if [ ! $(rpm -qa | grep bzip2) ]; then
fi
SPACK_BUILD_ICON="%ICON.BUILD_CMD%"
SPACK_LOAD_ICON="%ICON.LOAD_CMD%"
if [ ! -z "$SPACK_BUILD_ICON" ]; then
echo "Installing ICON with spack!"
echo "cmd=$SPACK_BUILD_ICON"
......@@ -36,7 +38,7 @@ if [ ! -z "$SPACK_BUILD_ICON" ]; then
spack install --reuse $SPACK_BUILD_ICON
#TODO: had some problems with spack load when more than one version is available, adding --first to overcome that
# although in principle we should not install the model if its already installed.
spack load --first $SPACK_BUILD_ICON
spack load --first ${SPACK_LOAD_ICON}
else
echo "\%icon.build_cmd\% is not defined. If you want to compile icon with spack, please provide a spack compile instruction string in your build.yml"
fi
......
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