Skip to content
Snippets Groups Projects
Commit 44b564de authored by Fabian.Jakub's avatar Fabian.Jakub
Browse files

Merge remote-tracking branch 'origin/minimal-configuration' into FJ/spack_icon_install

parents d139e7ef 9d5dddb7
No related branches found
No related tags found
1 merge request!4Switching to the advanced configuration method and fixing spack build.
......@@ -8,6 +8,7 @@ spack:
compiler: "gcc@12.2.0" # desired compiler for spack
root: "%HPCROOTDIR%/spack" # path to a spack install, will be downloaded to if not present
user_cache_path: "%HPCROOTDIR%/spack_user_cache_path" # spack puts data here when bootstrapping, leave empty to use home folder
user_config_path: "%HPCROOTDIR%/spack_user_config_path" # spack puts data here when bootstrapping, leave empty to use home folder
disable_local_config: true # if false, spack install into home folder
icon:
......
......@@ -16,8 +16,8 @@ function _install_spack() {
}
function _init_spack() {
#SPACK_INIT_CMD=$1
#SPACK_ROOT=$2
SPACK_INIT_CMD=$1
SPACK_ROOT=$2
if [ -z "$SPACK_INIT_CMD" ] && [ ! -z "${SPACK_ROOT}" ]; then
echo "Empty SPACK_INIT_CMD -> trying to source config file of spack root: $SPACK_ROOT/share/spack/setup-env.sh"
. $SPACK_ROOT/share/spack/setup-env.sh
......@@ -29,20 +29,26 @@ function _init_spack() {
function load_spack() {
export SPACK_INIT_CMD=$1
export SPACK_ROOT=${2:-spack}
export SPACK_URL=${3:-https://github.com/spack/spack.git}
export SPACK_BRANCH=${4:-develop}
export SPACK_COMPILER=${5:-gcc@12.2.0}
export SPACK_DISABLE_LOCAL_CONFIG=${6:-true}
export SPACK_USER_CACHE_PATH=${7:-${SPACK_ROOT}/spack_user_cache_path}
export SPACK_ROOT=$2 # i.e.: spack
export SPACK_URL=$3 # i.e.: https://github.com/spack/spack.git
export SPACK_BRANCH=$4 # i.e.: develop
export SPACK_COMPILER=$5 # i.e.: gcc@12.2.0
export SPACK_DISABLE_LOCAL_CONFIG=$6 # i.e.: true
export SPACK_USER_CACHE_PATH=$7 # i.e.: ${SPACK_ROOT}/spack_user_cache_path
export SPACK_USER_CONFIG_PATH=$8 # i.e.: ${SPACK_ROOT}/spack_user_config_path
if [ "$SPACK_DISABLE_LOCAL_CONFIG" != "True" ]; then
unset SPACK_DISABLE_LOCAL_CONFIG
fi
echo "SPACK_INIT_CMD = $SPACK_INIT_CMD"
echo "SPACK_ROOT = $SPACK_ROOT"
echo "SPACK_URL = $SPACK_URL"
echo "SPACK_BRANCH = $SPACK_BRANCH"
echo "SPACK_COMPILER = $SPACK_COMPILER"
echo "SPACK_DISABLE_LOCAL_CONFIG = $SPACK_DISABLE_LOCAL_CONFIG"
echo "SPACK_DISABLE_LOCAL_CONFIG = ${SPACK_DISABLE_LOCAL_CONFIG:-False}"
echo "SPACK_USER_CACHE_PATH = $SPACK_USER_CACHE_PATH"
echo "SPACK_USER_CONFIG_PATH = $SPACK_USER_CONFIG_PATH"
if [ -z "$SPACK_USER_CACHE_PATH" ]; then
unset SPACK_USER_CACHE_PATH
......@@ -50,6 +56,10 @@ function load_spack() {
if [ ! -z "${SPACK_ROOT}" ] ; then _install_spack; fi
if [ -z "$SPACK_USER_CONFIG_PATH" ]; then
unset SPACK_USER_CONFIG_PATH
fi
_init_spack "$SPACK_INIT_CMD" "$SPACK_ROOT"
echo "Using spack from $(which spack)"
......
......@@ -28,6 +28,7 @@ class DwdIconTools(Package):
"""DWD Icon Tools"""
homepage = "https://www.example.com"
# maintainers("oriol.tinto")
git = "ssh://git@gitlab.lrz.de/dkrz-mirror/dwd_icon_tools.git"
version("2.5.2", branch="icontools-2.5.2")
......
......@@ -13,6 +13,7 @@ class IconNwp(Package):
"""
homepage = "https://code.mpimet.mpg.de/projects/iconpublic"
# maintainers("oriol.tinto")
# Main repository (pointing to LMU's gitlab)
git = "ssh://git@gitlab.physik.uni-muenchen.de/w2w/icon.git"
......
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class Sz3(CMakePackage):
"""SZ3 is the next generation of the SZ compressor framework"""
homepage = "https://github.com/szcompressor/SZ3"
git = "https://github.com/szcompressor/SZ3"
# maintainers("disheng222")
tags = ["e4s"]
version("master")
version("3.1.7", commit="c49fd17f2d908835c41000c1286c510046c0480e")
version("3.1.5.4", commit="4c6ddf628f27d36b28d1bbda02174359cd05573d")
version("3.1.5.1", commit="5736a63b917e439dd62248b4ff6234e96726af5d")
version("3.1.3.1", commit="323cb17b412d657c4be681b52c34beaf933fe7af")
version("3.1.3", commit="695dff8dc326f3b165f6676d810f46add088a585")
variant("hdf5", default=False, description="enable hdf5 filter support")
variant("mdz", default=True, description="build mdz executable")
depends_on("zstd")
depends_on("gsl")
depends_on("pkgconfig")
depends_on("hdf5", when="+hdf5")
def setup_run_environment(self, env):
if "+hdf5" in self.spec:
env.prepend_path("HDF5_PLUGIN_PATH", self.prefix.lib64)
def cmake_args(self):
return [
"-DSZ3_USE_BUNDLED_ZSTD=OFF",
"-DSZ3_DEBUG_TIMINGS=OFF",
self.define_from_variant("BUILD_MDZ", "mdz"),
self.define_from_variant("BUILD_H5Z_FILTER", "hdf5"),
]
def test(self):
if self.spec.satisfies("@:3.1.6"):
print("smoke tests are only supported on 3.1.7 and later, skipping")
return
self.run_test(self.prefix.bin.sz3_smoke_test, purpose="sz3 works")
if "+mdz" in self.spec:
self.run_test(self.prefix.bin.mdz_smoke_test, purpose="mdz works")
......@@ -11,15 +11,20 @@ fi
# Go to the working directory
cd ${WORKDIR}
. ${WORKDIR}/proj/platforms/common/spack_utils.sh
load_spack "%spack.init%" "%spack.root%" "%spack.url%" "%spack.branch%" "%spack.compiler%" "%spack.disable_local_config%" "%spack.user_cache_path%"
load_spack "%spack.init%" "%spack.root%" "%spack.url%" "%spack.branch%" "%spack.compiler%" "%spack.disable_local_config%" "%spack.user_cache_path%" "%spack.user_config_path%"
SPACK_BUILD_ICON="%spack.build_cmd%"
if [ ! -z "$SPACK_BUILD_ICON" ]; then
echo "Installing ICON with spack!"
echo "cmd=$SPACK_BUILD_ICON"
# In case the autosubmit repository with the icon-nwp receipt doesn't exist, add it
if [ $(spack repo list | grep autosubmit-icon-repository -q) ]; then
if [[ $(spack repo list | grep "${WORKDIR}/proj/spack_repo") ]]; then
echo "icon spack repo was already added to repo list"
else
spack repo add ${WORKDIR}/proj/spack_repo
fi
spack install $SPACK_BUILD_ICON
......
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