From bfd9d484ffe1f0c26fe135b742923cbca6a1cc98 Mon Sep 17 00:00:00 2001 From: Matthieu Leclair Date: Wed, 4 Feb 2026 10:28:06 +0100 Subject: [PATCH 01/27] upd: target spack v1.1.1 --- spack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack b/spack index 594a376c52..2e2169d528 160000 --- a/spack +++ b/spack @@ -1 +1 @@ -Subproject commit 594a376c521cc746978571b1181a47bbcff30a21 +Subproject commit 2e2169d5282d166f63e3ee4db8d4446c43cefa8a From 976fd991b4e376e2d60e32aff847dec58a833ae2 Mon Sep 17 00:00:00 2001 From: Matthieu Leclair Date: Wed, 4 Feb 2026 12:20:31 +0100 Subject: [PATCH 02/27] del: remmove all C2SM packages --- repos/c2sm/packages/clang-format/package.py | 25 -- .../cosmo-eccodes-definitions/package.py | 51 --- repos/c2sm/packages/ecbuild/package.py | 9 - .../packages/flexpart-cosmo-icon/package.py | 52 --- repos/c2sm/packages/flexpart-ifs/package.py | 41 -- repos/c2sm/packages/ghex/package.py | 99 ----- .../hwmalloc/cmake_install_path.patch | 27 -- repos/c2sm/packages/hwmalloc/package.py | 67 ---- repos/c2sm/packages/icon-exclaim/package.py | 111 ------ repos/c2sm/packages/icon-ham/package.py | 21 - repos/c2sm/packages/icon/package.py | 364 ------------------ repos/c2sm/packages/icon4py/package.py | 150 -------- repos/c2sm/packages/icontools/package.py | 209 ---------- repos/c2sm/packages/makedepf90/package.py | 32 -- repos/c2sm/packages/oomph/package.py | 125 ------ repos/c2sm/packages/py-cytoolz/package.py | 40 -- repos/c2sm/packages/py-devtools/package.py | 28 -- repos/c2sm/packages/py-factory-boy/package.py | 20 - .../c2sm/packages/py-gridtools-cpp/package.py | 49 --- repos/c2sm/packages/py-hatchling/package.py | 50 --- repos/c2sm/packages/py-inflection/package.py | 27 -- .../packages/py-pytest-factoryboy/package.py | 41 -- .../patches/2.5.1/group.patch | 23 -- repos/c2sm/packages/py-tabulate/package.py | 19 - .../packages/py-typing-extensions/package.py | 16 - repos/c2sm/packages/uv/package.py | 81 ---- repos/c2sm/packages/yaxt/mpich/0.9.2.patch | 11 - repos/c2sm/packages/yaxt/mpirun/0.7.0.patch | 89 ----- .../packages/yaxt/no_2d_param/0.7.0.patch | 11 - repos/c2sm/packages/yaxt/package.py | 111 ------ 30 files changed, 1999 deletions(-) delete mode 100644 repos/c2sm/packages/clang-format/package.py delete mode 100644 repos/c2sm/packages/cosmo-eccodes-definitions/package.py delete mode 100644 repos/c2sm/packages/ecbuild/package.py delete mode 100644 repos/c2sm/packages/flexpart-cosmo-icon/package.py delete mode 100644 repos/c2sm/packages/flexpart-ifs/package.py delete mode 100644 repos/c2sm/packages/ghex/package.py delete mode 100644 repos/c2sm/packages/hwmalloc/cmake_install_path.patch delete mode 100644 repos/c2sm/packages/hwmalloc/package.py delete mode 100755 repos/c2sm/packages/icon-exclaim/package.py delete mode 100644 repos/c2sm/packages/icon-ham/package.py delete mode 100755 repos/c2sm/packages/icon/package.py delete mode 100644 repos/c2sm/packages/icon4py/package.py delete mode 100644 repos/c2sm/packages/icontools/package.py delete mode 100644 repos/c2sm/packages/makedepf90/package.py delete mode 100644 repos/c2sm/packages/oomph/package.py delete mode 100644 repos/c2sm/packages/py-cytoolz/package.py delete mode 100644 repos/c2sm/packages/py-devtools/package.py delete mode 100644 repos/c2sm/packages/py-factory-boy/package.py delete mode 100644 repos/c2sm/packages/py-gridtools-cpp/package.py delete mode 100644 repos/c2sm/packages/py-hatchling/package.py delete mode 100644 repos/c2sm/packages/py-inflection/package.py delete mode 100644 repos/c2sm/packages/py-pytest-factoryboy/package.py delete mode 100644 repos/c2sm/packages/py-pytest-factoryboy/patches/2.5.1/group.patch delete mode 100644 repos/c2sm/packages/py-tabulate/package.py delete mode 100644 repos/c2sm/packages/py-typing-extensions/package.py delete mode 100644 repos/c2sm/packages/uv/package.py delete mode 100644 repos/c2sm/packages/yaxt/mpich/0.9.2.patch delete mode 100644 repos/c2sm/packages/yaxt/mpirun/0.7.0.patch delete mode 100644 repos/c2sm/packages/yaxt/no_2d_param/0.7.0.patch delete mode 100644 repos/c2sm/packages/yaxt/package.py diff --git a/repos/c2sm/packages/clang-format/package.py b/repos/c2sm/packages/clang-format/package.py deleted file mode 100644 index bdbf55d5f1..0000000000 --- a/repos/c2sm/packages/clang-format/package.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2013-2022 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 import * - - -class ClangFormat(Package): - """Clang-Format is a widely-used C++ code formatter.""" - - homepage = "https://llvm.org/" - url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.6/clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz" - - maintainers = ['juckerj'] - - version('15.0.6', - sha256= - '38bc7f5563642e73e69ac5626724e206d6d539fbef653541b34cae0ba9c3f036') - - phases = ['install'] - - def install(self, spec, prefix): - mkdir(prefix.bin) - install('bin/clang-format', f'{prefix.bin}/clang-format') diff --git a/repos/c2sm/packages/cosmo-eccodes-definitions/package.py b/repos/c2sm/packages/cosmo-eccodes-definitions/package.py deleted file mode 100644 index 1666160a2d..0000000000 --- a/repos/c2sm/packages/cosmo-eccodes-definitions/package.py +++ /dev/null @@ -1,51 +0,0 @@ -from spack import * - - -class CosmoEccodesDefinitions(Package): - """To simplify the usage of the GRIB 2 format within the COSMO Consortium, a COSMO GRIB 2 Policy has been defined. One element of this policy is to define a unified ecCodes system for the COSMO community, which is compatible with all COSMO software. This unified system is split into two parts, the vendor distribution of the ecCodes, available from ECMWF and the modified samples and definitions used by the COSMO consortium, available in the current repository.""" - - homepage = "https://github.com/COSMO-ORG/eccodes-cosmo-resources.git" - url = "https://github.com/COSMO-ORG/eccodes-cosmo-resources.git" - git = 'https://github.com/COSMO-ORG/eccodes-cosmo-resources.git' - - maintainers = ['huppd,lxavier'] - - version('2.36.0.3', tag='v2.36.0.3') - version('2.25.0.3', tag='v2.25.0.3') - version('2.25.0.2', tag='v2.25.0.2') - version('2.25.0.1', tag='v2.25.0.1') - version('2.18.0.1', tag='v2.18.0.1') - - depends_on('eccodes') - depends_on('eccodes@2.36.4', - type=('build', 'link', 'run'), - when='@2.36.0.3') - depends_on('eccodes@2.25.0', - type=('build', 'link', 'run'), - when='@2.25.0.1:2.25.0.3') - depends_on('eccodes@2.18.0', - type=('build', 'link', 'run'), - when='@2.18.0.1') - - def setup_run_environment(self, env): - eccodes_definition_path = ':'.join([ - self.prefix + '/cosmoDefinitions/definitions/', - self.spec['eccodes'].prefix + '/share/eccodes/definitions/' - ]) - env.prepend_path('GRIB_DEFINITION_PATH', eccodes_definition_path) - env.prepend_path('ECCODES_DEFINITION_PATH', eccodes_definition_path) - - eccodes_samples_path = self.prefix + '/cosmoDefinitions/samples/' - env.prepend_path('GRIB_SAMPLES_PATH', eccodes_samples_path) - env.prepend_path('ECCODES_SAMPLES_PATH', eccodes_samples_path) - - def setup_dependent_build_environment(self, env, dependent_spec): - self.setup_run_environment(env) - - def install(self, spec, prefix): - mkdir(prefix.cosmoDefinitions) - mkdir(prefix.cosmoDefinitions + '/definitions') - mkdir(prefix.cosmoDefinitions + '/samples') - install_tree('definitions', prefix.cosmoDefinitions + '/definitions') - install_tree('samples', prefix.cosmoDefinitions + '/samples') - install('RELEASE', prefix.cosmoDefinitions) diff --git a/repos/c2sm/packages/ecbuild/package.py b/repos/c2sm/packages/ecbuild/package.py deleted file mode 100644 index 360f9c0d93..0000000000 --- a/repos/c2sm/packages/ecbuild/package.py +++ /dev/null @@ -1,9 +0,0 @@ -from spack.package import * -from spack.pkg.builtin.ecbuild import Ecbuild as SpackEcbuild - - -class Ecbuild(SpackEcbuild): - - version('3.7.2', - sha256= - '7a2d192cef1e53dc5431a688b2e316251b017d25808190faed485903594a3fb9') diff --git a/repos/c2sm/packages/flexpart-cosmo-icon/package.py b/repos/c2sm/packages/flexpart-cosmo-icon/package.py deleted file mode 100644 index c9bce63b21..0000000000 --- a/repos/c2sm/packages/flexpart-cosmo-icon/package.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 2013-2020 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 import * -from llnl.util.filesystem import working_dir, install_tree - - -class FlexpartCosmoIcon(MakefilePackage): - """flexpart is a Lagrangian dispersion model""" - - homepage = 'https://github.com/C2SM/flexpart-cosmo-icon' - git = 'git@github.com:C2SM/flexpart-cosmo-icon.git' - maintainers = ['pirmink'] - - version('V8C4.0', tag='V8C4.0') - version('main', branch='main') - - depends_on('eccodes +fortran') - # WORKAROUND: '%gcc' should not be necessary, but without it, spack concretizes to nvhpc. - depends_on('netcdf-fortran %gcc') - depends_on('makedepf90') - - requires('%gcc@11:') - - build_directory = 'src' - - makefile_file = "Makefile.spack" - - @property - def build_targets(self): - return ['ncf=yes', 'VERBOSE=1'] - - def setup_build_environment(self, env): - env.set('GRIB_API', self.spec['eccodes'].prefix) - env.set('NETCDF', self.spec['netcdf-fortran'].prefix) - - def build(self, spec, prefix): - - with working_dir(self.build_directory): - make.jobs = 1 - make('-f', self.makefile_file) - - def install(self, spec, prefix): - mkdir(prefix.bin) - mkdir(prefix.share) - mkdir(prefix.share + '/test/') - mkdir(prefix.share + '/options/') - install_tree('options/', prefix.share + '/options/') - install('bin/FLEXPART', prefix.bin) diff --git a/repos/c2sm/packages/flexpart-ifs/package.py b/repos/c2sm/packages/flexpart-ifs/package.py deleted file mode 100644 index 2eea6ddb43..0000000000 --- a/repos/c2sm/packages/flexpart-ifs/package.py +++ /dev/null @@ -1,41 +0,0 @@ -from spack import * - - -class FlexpartIfs(MakefilePackage): - """flexpart is a Lagrangian dispersion model""" - - homepage = 'https://github.com/MeteoSwiss/flexpart' - url = 'https://github.com/MeteoSwiss/flexpart/archive/refs/tags/v10.4.4.tar.gz' - git = 'git@github.com:MeteoSwiss/flexpart.git' - maintainers = ['pirmink'] - - version('main', branch='main') - version('10.4.4', tag='10.4.4') - - depends_on('eccodes +fortran') - # WORKAROUND: '%gcc' should not be necessary, but without it, spack concretizes to nvhpc. - depends_on('netcdf-fortran %gcc') - - requires('%gcc') - - build_directory = 'src' - - def setup_build_environment(self, env): - env.set('ECCODES_DIR', self.spec['eccodes'].prefix) - env.set('ECCODES_LD_FLAGS', self.spec['eccodes:fortran'].libs.ld_flags) - env.set('NETCDF_FORTRAN_INCLUDE', - '-I' + self.spec['netcdf-fortran'].prefix.include) - env.set('NETCDF_FORTRAN_LD_FLAGS', - self.spec['netcdf-fortran'].libs.ld_flags) - - def build(self, spec, prefix): - with working_dir(self.build_directory): - make('-f', 'makefile_meteoswiss') - - def install(self, spec, prefix): - mkdir(prefix.bin) - install(join_path(self.build_directory, 'FLEXPART'), prefix.bin) - install_tree('test_meteoswiss', prefix.share.test_meteoswiss) - install_tree('options', join_path(prefix.share, 'options')) - install_tree('options.meteoswiss', - join_path(prefix.share, 'options.meteoswiss')) diff --git a/repos/c2sm/packages/ghex/package.py b/repos/c2sm/packages/ghex/package.py deleted file mode 100644 index b90e862e19..0000000000 --- a/repos/c2sm/packages/ghex/package.py +++ /dev/null @@ -1,99 +0,0 @@ -from spack.package import * - - -class Ghex(CMakePackage, CudaPackage, ROCmPackage): - """ - GHEX is a generic halo-exchange library. - - This Spack package was originally copied from: - https://github.com/ghex-org/spack-repos/blob/main/packages/ghex/package.py - - License: ghex-org - """ - - homepage = "https://github.com/ghex-org/GHEX" - url = "https://github.com/ghex-org/GHEX/archive/refs/tags/v0.3.0.tar.gz" - git = "https://github.com/ghex-org/GHEX.git" - maintainers = ["boeschf"] - - version("0.4.1", tag="v0.4.1", submodules=True) - version("0.4.0", tag="v0.4.0", submodules=True) - version("0.3.0", tag="v0.3.0", submodules=True) - version("master", branch="master", submodules=True) - - depends_on("cxx", type="build") - - generator("ninja") - - backends = ("mpi", "ucx", "libfabric") - variant( - "backend", - default="mpi", - description="Transport backend", - values=backends, - multi=False, - ) - variant("xpmem", default=False, description="Use xpmem shared memory") - variant("python", default=True, description="Build Python bindings") - - depends_on("cmake@3.21:", type="build") - depends_on("mpi") - depends_on("boost") - depends_on("xpmem", when="+xpmem", type=("build", "run")) - - depends_on("oomph") - for backend in backends: - depends_on(f"oomph backend={backend}", when=f"backend={backend}") - depends_on("oomph+cuda", when="+cuda") - depends_on("oomph+rocm", when="+rocm") - depends_on("oomph@0.3:", when="@0.3:") - - conflicts("+cuda+rocm") - - with when("+python"): - extends("python") - depends_on("python@3.7:", type="build") - depends_on("py-pip", type="build") - depends_on("py-pybind11", type="build") - depends_on("py-mpi4py", type=("build", "run")) - depends_on("py-numpy", type=("build", "run")) - - depends_on("py-pytest", when="+python", type=("test")) - - def cmake_args(self): - spec = self.spec - - args = [ - self.define("GHEX_USE_BUNDLED_LIBS", True), - self.define("GHEX_USE_BUNDLED_GRIDTOOLS", True), - self.define("GHEX_USE_BUNDLED_GTEST", self.run_tests), - self.define("GHEX_USE_BUNDLED_OOMPH", False), - self.define("GHEX_TRANSPORT_BACKEND", - spec.variants["backend"].value.upper()), - self.define_from_variant("GHEX_USE_XPMEM", "xpmem"), - self.define_from_variant("GHEX_BUILD_PYTHON_BINDINGS", "python"), - self.define("GHEX_WITH_TESTING", self.run_tests), - ] - - if spec.satisfies("+python"): - args.append(self.define("GHEX_PYTHON_LIB_PATH", python_platlib)) - - if self.run_tests and spec.satisfies("^openmpi"): - args.append(self.define("MPIEXEC_PREFLAGS", "--oversubscribe")) - - if "+cuda" in spec and spec.variants["cuda_arch"].value != "none": - arch_str = ";".join(spec.variants["cuda_arch"].value) - args.append(self.define("CMAKE_CUDA_ARCHITECTURES", arch_str)) - args.append(self.define("GHEX_USE_GPU", True)) - args.append(self.define("GHEX_GPU_TYPE", "NVIDIA")) - - if "+rocm" in spec and spec.variants["amdgpu_target"].value != "none": - arch_str = ";".join(spec.variants["amdgpu_target"].value) - args.append(self.define("CMAKE_HIP_ARCHITECTURES", arch_str)) - args.append(self.define("GHEX_USE_GPU", True)) - args.append(self.define("GHEX_GPU_TYPE", "AMD")) - - if spec.satisfies("~cuda~rocm"): - args.append(self.define("GHEX_USE_GPU", False)) - - return args diff --git a/repos/c2sm/packages/hwmalloc/cmake_install_path.patch b/repos/c2sm/packages/hwmalloc/cmake_install_path.patch deleted file mode 100644 index fa6fde13d8..0000000000 --- a/repos/c2sm/packages/hwmalloc/cmake_install_path.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d5420e0..35dbe56 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -105,11 +105,11 @@ install(FILES ${PROJECT_BINARY_DIR}/include/hwmalloc/config.hpp - install(EXPORT HWMALLOC-targets - FILE HWMALLOC-targets.cmake - NAMESPACE HWMALLOC:: -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/hwmalloc/cmake) - - configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/HWMALLOCConfig.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/HWMALLOCConfig.cmake -- INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) -+ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/hwmalloc/cmake) - - write_basic_package_version_file(HWMALLOCConfigVersion.cmake - VERSION ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion) -@@ -120,7 +120,7 @@ install( - ${CMAKE_CURRENT_BINARY_DIR}/HWMALLOCConfigVersion.cmake - ${CMAKE_CURRENT_LIST_DIR}/cmake/FindNUMA.cmake - DESTINATION -- ${CMAKE_INSTALL_LIBDIR}/cmake) -+ ${CMAKE_INSTALL_LIBDIR}/hwmalloc/cmake) - - export(EXPORT HWMALLOC-targets - FILE "${CMAKE_CURRENT_BINARY_DIR}/HWMALLOC-targets.cmake") diff --git a/repos/c2sm/packages/hwmalloc/package.py b/repos/c2sm/packages/hwmalloc/package.py deleted file mode 100644 index b24ed67b4c..0000000000 --- a/repos/c2sm/packages/hwmalloc/package.py +++ /dev/null @@ -1,67 +0,0 @@ -from spack.package import * - - -class Hwmalloc(CMakePackage, CudaPackage, ROCmPackage): - """ - HWMALLOC is a allocator which supports memory registration for e.g. remote memory access - - This Spack package was originally copied from: - https://github.com/ghex-org/spack-repos/blob/main/packages/hwmalloc/package.py - - License: ghex-org - """ - - homepage = "https://github.com/ghex-org/hwmalloc" - url = "https://github.com/ghex-org/hwmalloc/archive/refs/tags/v0.3.0.tar.gz" - git = "https://github.com/ghex-org/hwmalloc.git" - maintainers = ["boeschf"] - - version("0.3.0", - sha256= - "d4d4ac6087a806600d79fb62c02719ca3d58a412968fe1ef4a2fd58d9e7ee950") - version("0.2.0", - sha256= - "734758a390a3258b86307e4aef50a7ca2e5d0e2e579f18aeefcd05397e114419") - version("0.1.0", - sha256= - "06e9bfcef0ecce4d19531ccbe03592b502d1281c7a092bc0ff51ca187899b21c") - version("master", branch="master") - - depends_on("cxx", type="build") - - generator("ninja") - - depends_on("numactl", type=("build", "run")) - depends_on("boost", type=("build")) - depends_on("cmake@3.19:", type="build") - - variant( - "numa-throws", - default=False, - description="True if numa_tools may throw during initialization", - ) - variant("numa-local", - default=True, - description="Use numa_tools for local node allocations") - variant("logging", default=False, description="print logging info to cerr") - - patch("cmake_install_path.patch", when="@:0.3.0", level=1) - - def cmake_args(self): - args = [ - self.define_from_variant("HWMALLOC_NUMA_THROWS", "numa-throws"), - self.define_from_variant("HWMALLOC_NUMA_FOR_LOCAL", "numa-local"), - self.define_from_variant("HWMALLOC_ENABLE_LOGGING", "logging"), - self.define("HWMALLOC_WITH_TESTING", self.run_tests), - ] - - if "+cuda" in self.spec: - args.append(self.define("HWMALLOC_ENABLE_DEVICE", True)) - args.append(self.define("HWMALLOC_DEVICE_RUNTIME", "cuda")) - elif "+rocm" in self.spec: - args.append(self.define("HWMALLOC_ENABLE_DEVICE", True)) - args.append(self.define("HWMALLOC_DEVICE_RUNTIME", "hip")) - else: - args.append(self.define("HWMALLOC_ENABLE_DEVICE", False)) - - return args diff --git a/repos/c2sm/packages/icon-exclaim/package.py b/repos/c2sm/packages/icon-exclaim/package.py deleted file mode 100755 index f67bc43b69..0000000000 --- a/repos/c2sm/packages/icon-exclaim/package.py +++ /dev/null @@ -1,111 +0,0 @@ -from spack.pkg.c2sm.icon import Icon -import shutil -import os -import re -from collections import defaultdict -import spack.error as error - - -def validate_variant_dsl(pkg, name, value): - set_mutual_excl = set(['substitute', 'verify', 'serialize']) - set_input_var = set(value) - if len(set_mutual_excl.intersection(set_input_var)) > 1: - raise error.SpecError( - 'Cannot have more than one of (substitute, verify, serialize) in the same build' - ) - - -class IconExclaim(Icon): - git = 'git@github.com:C2SM/icon-exclaim.git' - - maintainers('jonasjucker', 'huppd') - - version('develop', branch='icon-dsl', submodules=True) - - # EXCLAIM-GT4Py specific features: - dsl_values = ('substitute', 'verify') - variant('dsl', - default='none', - validator=validate_variant_dsl, - values=('none', ) + dsl_values, - description='Build with GT4Py dynamical core', - multi=True) - - for x in dsl_values: - depends_on('icon4py', type="build", when=f"dsl={x}") - - def configure_args(self): - raw_args = super().configure_args() - - # Split into categories - args_flags = [] - icon_ldflags = [] - ldflags = [] - libs = [] - - for a in raw_args: - if a.startswith("LIBS="): - libs.append(a.split("=", 1)[1].strip()) - elif a.startswith("ICON_LDFLAGS="): - icon_ldflags.append(a.split("=", 1)[1].strip()) - elif a.startswith("LDFLAGS="): - ldflags.append(a.split("=", 1)[1].strip()) - else: - args_flags.append(a) - - # Handle DSL variants - dsl = self.spec.variants['dsl'].value - if dsl != ('none', ): - if 'substitute' in dsl: - args_flags.append('--enable-py2f=substitute') - elif 'verify' in dsl: - args_flags.append('--enable-py2f=verify') - else: - raise ValueError( - f"Unknown DSL variant '{dsl}'. " - f"Valid options are: {', '.join(('none',) + dsl_values)}") - - # Add icon4py paths and libs - icon4py_prefix = self.spec["icon4py"].prefix - bindings_dir = os.path.join(icon4py_prefix, "src") - - ldflags.append(f"-L{bindings_dir} -Wl,-rpath,{bindings_dir}") - libs.append("-licon4py_bindings") - - # Remove duplicates - icon_ldflags = list(dict.fromkeys(icon_ldflags)) - ldflags = list(dict.fromkeys(ldflags)) - libs = list(dict.fromkeys(libs)) - - # Reconstruct final configure args - final_args = args_flags - if icon_ldflags: - final_args.append("ICON_LDFLAGS=" + " ".join(icon_ldflags)) - if ldflags: - final_args.append("LDFLAGS=" + " ".join(ldflags)) - if libs: - final_args.append("LIBS=" + " ".join(libs)) - - return final_args - - def build(self, spec, prefix): - # Check the variant - dsl = self.spec.variants['dsl'].value - if dsl != ('none', ): - file = "icon4py_bindings.f90" - - bindings_dir = os.path.join(self.spec["icon4py"].prefix, "src") - src_file = os.path.join(bindings_dir, file) - - build_py2f_dir = os.path.join(self.stage.source_path, "src", - "build_py2f") - os.makedirs(build_py2f_dir, exist_ok=True) - dest_file = os.path.join(build_py2f_dir, file) - - shutil.copy2(src_file, dest_file) - print( - f"Copied {src_file} to build directory {dest_file} because +dsl is enabled" - ) - - # Proceed with the normal build - super().build(spec, prefix) diff --git a/repos/c2sm/packages/icon-ham/package.py b/repos/c2sm/packages/icon-ham/package.py deleted file mode 100644 index 8ba3b6222b..0000000000 --- a/repos/c2sm/packages/icon-ham/package.py +++ /dev/null @@ -1,21 +0,0 @@ -from spack import * -from spack.pkg.builtin.icon import Icon as SpackIcon - - -class IconHam(SpackIcon): - - maintainers('stelliom') - - @run_before('build') - def generate_hammoz_nml(self): - with working_dir(self.configure_directory + - '/externals/atm_phy_echam_submodels/namelists'): - make() - - def configure_args(self): - args = super().configure_args() - - args.append('--enable-atm-phy-echam-submodels') - args.append('--enable-hammoz') - - return args diff --git a/repos/c2sm/packages/icon/package.py b/repos/c2sm/packages/icon/package.py deleted file mode 100755 index 4993344399..0000000000 --- a/repos/c2sm/packages/icon/package.py +++ /dev/null @@ -1,364 +0,0 @@ -from spack.pkg.builtin.icon import Icon as SpackIcon -import os -import re -import glob -from collections import defaultdict -from llnl.util import tty -from spack.util.environment import is_system_path -import spack.error as error - - -def check_variant_fcgroup(fcgroup): - pattern = re.compile(r"^[A-Z]+\..+\..") - # fcgroup is False as default - if pattern.match(fcgroup) or fcgroup == 'none': - return True - else: - tty.warn('Variant fcgroup needs format GROUP.files.flag') - return False - - -def check_variant_extra_config_args(extra_config_arg): - pattern = re.compile(r'--(enable|disable)-\S+') - if pattern.match(extra_config_arg) or extra_config_arg == 'none': - return True - else: - tty.warn( - f'The value "{extra_config_arg}" for the extra_config_args variant must follow the format "--enable-arg" or "--disable-arg"' - ) - return False - - -class Icon(SpackIcon): - git = 'git@gitlab.dkrz.de:icon/icon-nwp.git' - - maintainers('huppd') - - version('develop', submodules=True) - version("icon-2025.10", - tag="icon-2025.10", - git='git@gitlab.dkrz.de:icon/icon.git', - submodules=True) - version("icon-2025.04-2", - tag="icon-2025.04-2", - git='git@gitlab.dkrz.de:icon/icon.git', - submodules=True) - version("icon-2025.04-1", - tag="icon-2025.04-1", - git='git@gitlab.dkrz.de:icon/icon.git', - submodules=True) - version("icon-2025.04", - tag="icon-2025.04", - git='git@gitlab.dkrz.de:icon/icon.git', - submodules=True) - version("2024.10", - tag="icon-2024.10", - git='git@gitlab.dkrz.de:icon/icon.git', - submodules=True) - version("2024.01-1", - tag="icon-2024.01-1", - git='git@gitlab.dkrz.de:icon/icon.git', - submodules=True) - version('2024.10-mch-1.0', tag='icon-2024.10-mch-1.0', submodules=True) - version('2024.01-mch-2.1', tag='icon-2024.01-mch-2.1', submodules=True) - version('2024.01-mch-2.0', tag='icon-2024.01-mch-2.0', submodules=True) - version('2.6.6-mch2b', tag='icon-nwp/icon-2.6.6-mch2b', submodules=True) - version('2.6.6-mch2a', tag='icon-nwp/icon-2.6.6-mch2a', submodules=True) - version('nwp-master', submodules=True) - - # The variants' default follow those of ICON - # as described here - # https://gitlab.dkrz.de/icon/icon/-/blob/icon-2024.01/configure?ref_type=tags#L1492-1638 - - # Model Features: - variant('dace', - default=False, - description='Enable the DACE modules for data assimilation') - requires("+mpi", when="+dace") - - variant('emvorado', - default=False, - description='Enable the radar forward operator EMVORADO') - requires("+mpi", when="+emvorado") - - variant('art-gpl', - default=False, - description='Enable GPL-licensed code parts of the ART component') - variant( - 'acm-license', - default=False, - description= - 'Enable code parts that require accepting the ACM Software License') - - # Infrastructural Features: - variant( - 'active-target-sync', - default=False, - description= - 'Enable MPI active target mode (otherwise, passive target mode is used)' - ) - variant('async-io-rma', - default=True, - description='Enable remote memory access (RMA) for async I/O') - variant('realloc-buf', - default=False, - description='Enable reallocatable communication buffer') - variant('sct', default=False, description='Enable the SCT timer') - variant( - 'extra-config-args', - default='none', - multi=True, - values=check_variant_extra_config_args, - description= - 'Inject any configure argument not yet available as variant\nUse this feature cautiously, as injecting non-variant configure arguments may potentially disrupt the build process' - ) - - # Optimization Features: - variant('loop-exchange', default=False, description='Enable loop exchange') - variant('vectorized-lrtm', - default=False, - description='Enable the parallelization-invariant version of LRTM') - variant( - 'pgi-inlib', - default=False, - description= - 'Enable PGI/NVIDIA cross-file function inlining via an inline library') - variant('nccl', default=False, description='Enable NCCL for communication') - - variant('cuda-graphs', default=False, description='Enable CUDA graphs.') - requires('%nvhpc@23.3:', when='+cuda-graphs') - - variant( - 'fcgroup', - default='none', - multi=True, - values=check_variant_fcgroup, - description= - 'Create a Fortran compile group: GROUP;files;flag \nNote: flag can only be one single value, i.e. -O1' - ) - - # verbosity - variant('silent-rules', - default=True, - description='Enable silent-rules for build-process') - variant( - 'eccodes-definitions', - default=False, - description= - 'Enable extension of eccodes with center specific definition files') - - depends_on('cosmo-eccodes-definitions', - type='run', - when='+eccodes-definitions') - - with when('+emvorado'): - depends_on('eccodes +fortran') - depends_on('hdf5 +szip +hl +fortran') - depends_on('zlib-ng') - # WORKAROUND: A build and link dependency should imply that the same compiler is used. This enforces it. - depends_on('eccodes %nvhpc', when='%nvhpc') - depends_on('eccodes %gcc', when='%gcc') - - # WORKAROUND: A build and link dependency should imply that the same compiler is used. This enforces it. - for __x in SpackIcon.serialization_values: - depends_on('serialbox+fortran %nvhpc', - when='serialization={0} %nvhpc'.format(__x)) - depends_on('serialbox+fortran %gcc', - when='serialization={0} %gcc'.format(__x)) - - # WORKAROUND: A build and link dependency should imply that the same compiler is used. This enforces it. - depends_on('netcdf-fortran %nvhpc', when='%nvhpc') - depends_on('netcdf-fortran %gcc', when='%gcc') - - depends_on('hdf5 +szip', when='+sct') - - # patch_libtool is a function from Autotoolspackage. - # For BB we cannot use it because it finds all files - # named "libtool". spack-c2sm is cloned into icon-repo, - # therefore this function detects not only "libtool" files, but - # also the folder where libtool package itself is installed. - patch_libtool = False - - def configure_args(self): - args = super().configure_args() - super_libs = args.pop() - - libs = LibraryList([]) - flags = defaultdict(list) - - for x in [ - 'dace', - 'emvorado', - 'art-gpl', - 'acm-license', - 'active-target-sync', - 'async-io-rma', - 'realloc-buf', - 'parallel-netcdf', - 'sct', - 'loop-exchange', - 'vectorized-lrtm', - 'pgi-inlib', - 'nccl', - 'cuda-graphs', - 'silent-rules', - ]: - args += self.enable_or_disable(x) - - if '+emvorado' in self.spec: - libs += self.spec['eccodes:fortran'].libs - libs += self.spec['hdf5:fortran,hl'].libs - libs += self.spec['zlib-ng'].libs - - if '+sct' in self.spec: - libs += self.spec['hdf5'].libs - - fcgroup = self.spec.variants['fcgroup'].value - # ('none',) is the values spack assign if fcgroup is not set - if fcgroup != ('none', ): - args.extend(self.fcgroup_to_config_arg()) - flags.update(self.fcgroup_to_config_var()) - - # add configure arguments not yet available as variant - extra_config_args = self.spec.variants['extra-config-args'].value - if extra_config_args != ('none', ): - for x in extra_config_args: - # prevent configure-args already available as variant - # to be set through variant extra_config_args - self.validate_extra_config_args(x) - args.append(x) - tty.warn( - 'You use variant extra-config-args. Injecting non-variant configure arguments may potentially disrupt the build process!' - ) - - # Help the libtool scripts of the bundled libraries find the correct - # paths to the external libraries. Specify the library search (-L) flags - # in the reversed order - # (see https://gitlab.dkrz.de/icon/icon#icon-dependencies): - # and for non-system directories only: - flags['LDFLAGS'].extend([ - '-L{0}'.format(d) for d in reversed(libs.directories) - if not is_system_path(d) - ]) - - # Temporary back port fix from upstream package for building comin on cpu - # See https://github.com/spack/spack-packages/commit/b992c44bb52d034fe57637f3da42483501442af3 - # TODO: Remove this dupplicate once spack-c2sm points to an upstream spack containing the fix. - if self.spec.variants[ - "gpu"].value in self.nvidia_targets or self.spec.satisfies( - "+comin"): - flags["ICON_LDFLAGS"].extend(self.compiler.stdcxx_libs) - - args.extend([ - "{0}={1}".format(name, " ".join(value)) - for name, value in flags.items() - ]) - args.append(f"{super_libs} {libs.link_flags}") - return args - - def fcgroup_to_config_arg(self): - arg = [] - for group in self.spec.variants['fcgroup'].value: - name = group.split('.')[0] - files = group.split('.')[1] - arg.append(f'--enable-fcgroup-{name}={files}') - return arg - - def fcgroup_to_config_var(self): - var = {} - for group in self.spec.variants['fcgroup'].value: - name = group.split('.')[0] - flag = group.split('.')[2] - # Note: flag needs to be a list - var[f'ICON_{name}_FCFLAGS'] = [flag] - return var - - def strip_variant_prefix(self, variant_string): - prefixes = ["--enable-", "--disable-"] - - for prefix in prefixes: - if variant_string.startswith(prefix): - return variant_string[len(prefix):] - - raise ValueError - - def validate_extra_config_args(self, arg): - variant_from_arg = self.strip_variant_prefix(arg) - if variant_from_arg in self.spec.variants: - raise error.SpecError( - f'The value "{arg}" for the extra_config_args variant conflicts ' - f'with the existing variant {variant_from_arg}. Set this variant instead.' - ) - - def configure(self, spec, prefix): - if os.path.exists( - os.path.join(self.build_directory, - 'icon.mk')) and self.build_uses_same_spec(): - tty.warn( - 'icon.mk already present -> skip configure stage', - '\t delete "icon.mk" or run "make distclean" to not skip configure' - ) - return - - # Call configure of Autotools - super().configure(spec, prefix) - - def build_uses_same_spec(self): - """ - Ensure that configure is rerun in case spec has changed, - otherwise for the case below - - $ spack dev-build icon @develop ~dace - $ spack dev-build icon @develop +dace - - configure is skipped for the latter. - """ - - is_same_spec = False - - previous_spec = os.path.join(self.build_directory, - '.previous_spec.yaml') - - # not the first build in self.build_directory - if os.path.exists(previous_spec): - with open(previous_spec, mode='r') as f: - if self.spec == Spec.from_yaml(f): - is_same_spec = True - else: - is_same_spec = False - tty.warn( - 'Cannot skip configure phase because spec changed') - - # first build in self.build_directory, no worries - else: - is_same_spec = True - - # dump spec of new build - with open(previous_spec, mode='w') as f: - f.write(self.spec.to_yaml()) - - return is_same_spec - - @run_after('configure') - def copy_runscript_related_input_files(self): - with working_dir(self.build_directory): - icon_dir = self.configure_directory - # only synchronize if out-of-source build - if os.path.abspath(icon_dir) != os.path.abspath( - self.build_directory): - Rsync = which('rsync', required=True) - Rsync("-uavz", f"{icon_dir}/run", ".", "--exclude=*.in", - "--exclude=.*", "--exclude=standard_*") - Rsync("-uavz", f"{icon_dir}/externals", ".", "--exclude=.git", - "--exclude=*.f90", "--exclude=*.F90", "--exclude=*.c", - "--exclude=*.h", "--exclude=*.Po", "--exclude=tests", - "--exclude=*.mod", "--exclude=*.o") - Rsync("-uavz", f"{icon_dir}/make_runscripts", ".") - - Ln = which('ln', required=True) - dirs = glob.glob(f"{icon_dir}/run/standard_*") - for dir in dirs: - Ln("-sf", "-t", "run/", f"{dir}") - Ln("-sf", f"{icon_dir}/data") - Ln("-sf", f"{icon_dir}/vertical_coord_tables") - Ln("-sf", f"{icon_dir}/scripts") diff --git a/repos/c2sm/packages/icon4py/package.py b/repos/c2sm/packages/icon4py/package.py deleted file mode 100644 index dc4b40a5af..0000000000 --- a/repos/c2sm/packages/icon4py/package.py +++ /dev/null @@ -1,150 +0,0 @@ -import json -import os -import pathlib - -from llnl.util import tty -from spack import * - - -class Icon4py(Package): - """ICON4Py Python interface package.""" - - homepage = "https://github.com/C2SM/icon4py" - git = "https://github.com/C2SM/icon4py.git" - - # --- Versions --- - version("main", branch="main") - version( - "0.0.14", - sha256="8aadb6fe7af55fc41d09daa4e74739bd7ab01b4e", - extension="zip", - ) - - def url_for_version(self, version): - return f"https://github.com/C2SM/icon4py/archive/refs/tags/v{version}.zip" - - # --- Variants --- - variant("cuda", default=True, description="Enable CUDA support") - variant( - "cuda_arch", - default="none", - description="CUDA architecture (e.g. 80 for A100, 90 for H100)", - values=lambda x: True, # accept any user-specified string - ) - - # --- Dependencies --- - extends("python") - depends_on("python@3.11:") - - depends_on("git") - depends_on("uv@0.7:", type="build") - depends_on("bzip2", type="build") - depends_on("py-numpy") - depends_on("py-cffi") - depends_on("py-pybind11") - depends_on("py-nanobind") - depends_on("py-mpi4py") - - with when("+cuda"): - depends_on("py-cupy +cuda") - depends_on("ghex +python +cuda") - - # --- Environment setup --- - def setup_build_environment(self, env): - """Propagate CUDA architecture to dependencies.""" - cuda_arch = self.spec.variants["cuda_arch"].value - if "+cuda" in self.spec: - if cuda_arch == "none": - tty.warn( - "Building with +cuda but no cuda_arch set. " - "Consider specifying e.g. cuda_arch=80 or cuda_arch=90.") - else: - env.set("SPACK_CUDA_ARCH", cuda_arch) - tty.msg(f"Building for CUDA architecture: {cuda_arch}") - - # --- Build/install logic --- - def install(self, spec, prefix): - uv = prepare_uv() - python_spec = spec["python"] - venv_path = prefix.share.venv - - tty.msg( - f"Creating venv using Spack Python at: {python_spec.command.path}") - uv( - "venv", - "--seed", - "--relocatable", - "--system-site-packages", - str(venv_path), - "--python", - python_spec.command.path, - ) - - tty.msg("Grabbing Spack-installed packages (distributions)") - pip = Executable(venv_path.bin.pip) - spack_installed = get_installed_pkg(pip) - - tty.msg("Installing missing packages via uv sync") - uv( - "sync", - "--active", - "--extra", - "all", - "--extra", - "cuda12", - "--inexact", - "--no-editable", - "--python", - str(venv_path.bin.python), - *no_install_options([*spack_installed, "cupy-cuda12x", "ghex"]), - extra_env={ - "VIRTUAL_ENV": str(venv_path), - "CC": "gcc", - "CXX": "g++", - }, - ) - - tty.msg("Linking Spack-installed packages into venv") - pathlib.Path( - f"{venv_path.lib.python}{python_spec.version.up_to(2)}/site-packages/spack_installed.pth" - ).write_text(pythonpath_to_pth()) - - tty.msg("Running py2fgen code generator") - py2fgen = Executable(venv_path.bin.py2fgen) - py2fgen( - "icon4py.tools.py2fgen.wrappers.all_bindings", - "diffusion_init,diffusion_run,grid_init,solve_nh_init,solve_nh_run", - "icon4py_bindings", - "-o", - prefix.src, - extra_env={ - "VIRTUAL_ENV": str(venv_path), - "CC": "gcc", - "CXX": "g++", - }, - ) - - -def prepare_uv(): - uv = which("uv") - uv.add_default_env("UV_NO_CACHE", "true") - uv.add_default_env("UV_NO_MANAGED_PYTHON", "true") - uv.add_default_env("UV_PYTHON_DOWNLOADS", "never") - return uv - - -def get_installed_pkg(pip): - return [ - item["name"] - for item in json.loads(pip("list", "--format", "json", output=str)) - ] - - -def no_install_options(installed): - for name in installed: - yield "--no-install-package" - yield name - - -def pythonpath_to_pth(): - return "\n".join(os.environ.get("PYTHONPATH", "").split(":")) diff --git a/repos/c2sm/packages/icontools/package.py b/repos/c2sm/packages/icontools/package.py deleted file mode 100644 index 68a9ee7691..0000000000 --- a/repos/c2sm/packages/icontools/package.py +++ /dev/null @@ -1,209 +0,0 @@ -# Copyright 2013-2020 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) - -import os -import re -from collections import defaultdict - -from spack.util.environment import is_system_path -from llnl.util import tty - - -class Icontools(AutotoolsPackage): - """A set of routines which may be suitable for reading, remapping and - writing of fields from and to predefined grids, e.g. regular (lat-lon, - gaussian) or triangular (ICON).""" - - homepage = 'https://gitlab.dkrz.de/dwd-sw/dwd_icon_tools' - url = 'https://gitlab.dkrz.de/dwd-sw/dwd_icon_tools' - dkrz = 'git@gitlab.dkrz.de:dwd-sw/dwd_icon_tools.git' - c2sm = 'git@github.com:C2SM/icontools.git' - - version('c2sm-master', git=c2sm, branch='master', submodules=True) - version('dkrz-master', git=dkrz, branch='master', submodules=True) - version('2.5.2', git=dkrz, tag='icontools-2.5.2', submodules=True) - - variant('mpi', default=True, description='enable MPI support') - variant('grib2', default=True, description='enable GRIB2 support') - variant('szip', - default=True, - description='enable szip compression for GRIB1') - - depends_on('python', type='build') - - depends_on('netcdf-fortran') - depends_on('netcdf-c') - depends_on('hdf5') - depends_on('eccodes') - - depends_on('mpi', when='+mpi') - depends_on('eccodes', when='+grib2') - depends_on('szip', when='+szip') - - # There are currently several issues related to NAG: - # 1. File libicontools/src/libicontools/mo_util_nml.f90 is empty after - # preprocessing. - # 2. Error: libiconremap/mo_rbfqr_math.f90, line 934: KIND value (8) does - # not specify a valid representation method. - # 3. It's yet unclear what additional flags g++ needs to link - # OpenMP-enabled Fortran code compiled with NAG. - # 4. It's yet unclear what additional NAG runtime libraries we need to - # link to. - conflicts('%nag') - - # There is currently an issue related to PGI: - # PGF90-S-0081-Illegal selector - KIND value must be non-negative - # (libiconbase/mo_delaunay_types.f90: 332) - conflicts('%pgi') - conflicts('%nvhpc') - - def flag_handler(self, name, flags): - if name == 'cflags' or name == 'cxxflags': - # Set OpenMP flags: - flags.append(self.compiler.openmp_flag - # We assume that NAG is mixed with GCC: - if self.compiler.name != 'nag' else '-fopenmp') - elif name == 'fflags': - # Enable building with 'gcc@10:': - if self.spec.satisfies('%gcc@10:'): - flags.append('-fallow-argument-mismatch') - # Set OpenMP flags: - flags.append(self.compiler.openmp_flag) - # Disable MPI support: - if '~mpi' in self.spec: - flags.append('-DNOMPI') - elif name == 'cppflags': - # Disable MPI support: - if '~mpi' in self.spec: - flags.append('-DNOMPI') - - return flags, None, None - - def configure_args(self): - args = [ - # Get verbose output in the logs: - '--disable-silent-rules', - # Do not trigger regeneration of the source files: - '--disable-maintainer-mode', - # Simplify linking of the bundled libraries: - '--enable-static', - '--disable-shared', - # Tune CDI: - '--disable-cdi-app', - '--disable-cf-interface', - '--disable-extra', - '--disable-ieg', - '--disable-service', - '--enable-cgribex', - '--enable-grib', - '--enable-iso-c-interface', - '--disable-util-linux-uuid', - '--disable-ossp-uuid', - '--disable-dce-uuid', - '--without-grib_api', - '--without-threads', - # Do not install CDI: - 'CDO_DISABLE_CDILIB=1', - # There is only one argument for netcdf-c and netcdf-fortran but - # we specify path to netcdf-c here to make CDI happy (we also have - # to provide the prefix regardless of whether it is in the system - # path because the configure script of icontools fails otherwise): - '--with-netcdf={0}'.format(self.spec['netcdf-c'].prefix) - ] - - flags = defaultdict(list) - - def help_libtool(spec): - # Help libtool to find the right library in case it is installed to - # a non-system directory by extending LDFLAGS. - if not is_system_path(spec.prefix): - flags['LDFLAGS'].append(spec.libs.search_flags) - - # Help the libtool script of CDI to find the right HDF5 library: - hdf5_spec = self.spec['hdf5'] - help_libtool(hdf5_spec) - # The package links directly to libcdi.a giving Libtool no chance to - # figure out that it should link to libhdf5: - flags['LIBS'].append(hdf5_spec.libs.link_flags) - - if '+szip' in self.spec: - args.append('--with-szlib') - szip_spec = self.spec['szip'] - help_libtool(szip_spec) - # The package links directly to libcdi.a giving Libtool no chance to - # figure out that it should link to libsz: - flags['LIBS'].append(szip_spec.libs.link_flags) - else: - args.append('--without-szlib') - - if '+grib2' in self.spec: - args.append('--with-eccodes') - eccodes_spec = self.spec['eccodes'] - help_libtool(eccodes_spec) - # The package links directly to libcdi.a giving Libtool no chance to - # figure out that it should link to libeccodes: - flags['LIBS'].append(eccodes_spec.libs.link_flags) - else: - args.append('--without-eccodes') - args.append('--without-grib_api') - - if '+mpi' in self.spec: - mpi_spec = self.spec['mpi'] - args.extend(['FC=' + mpi_spec.mpifc, 'CXX=' + mpi_spec.mpicxx]) - - # We need to link C++ programs to Fortran MPI libraries: - mpifc_libs = None - try: - mpifc_exe = Executable(mpi_spec.mpifc) - mpifc_libs = ' '.join( - re.findall( - r'\s(-l\s*[^\s]+)', - mpifc_exe('-show', output=str, error=os.devnull))) - except ProcessError: - - def find_mpi_fc_link_flags(*libnames): - for shared in [True, False]: - libraries = find_libraries(libnames, - mpi_spec.prefix, - shared=shared, - recursive=True) - if libraries: - return libraries.link_flags - return None - - if mpi_spec.name.endswith('mpich'): - # Check for the new name of the library (in this case, - # libmpichf90 is just a symlink, which we do not want to - # overlink to): - mpifc_libs = find_mpi_fc_link_flags('libmpifort') - if not mpifc_libs: - # Check for the old name of the library (this is - # usually the case on Cray platforms): - mpifc_libs = find_mpi_fc_link_flags('libmpichf90') - elif mpi_spec.name == 'openmpi': - mpifc_libs = find_mpi_fc_link_flags( - 'lib*_usempif08', 'lib*_usempi_ignore_tkr', - 'lib*_usempi', 'lib*_mpifh') - - if mpifc_libs: - flags['LIBS'].append(mpifc_libs) - else: - tty.warn('unable to detect Fortran MPI libraries') - - # We need to link C++ programs to Fortran runtime libraries: - if self.compiler.name == 'gcc': - flags['LIBS'].append('-lgfortran') - elif self.compiler.name == 'intel': - flags['LIBS'].append('-lifcore') - elif self.compiler.name == 'pgi': - flags['LIBS'].append('-pgf90libs') - else: - tty.warn('unable to detect Fortran runtime libraries') - - args.extend([ - '{0}={1}'.format(var, ' '.join(val)) for var, val in flags.items() - ]) - - return args diff --git a/repos/c2sm/packages/makedepf90/package.py b/repos/c2sm/packages/makedepf90/package.py deleted file mode 100644 index 569ac2466c..0000000000 --- a/repos/c2sm/packages/makedepf90/package.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 Makedepf90(AutotoolsPackage): - """ Makedepf90 is a program for automatic creation of - Makefile-style dependency lists for Fortran source code.""" - - homepage = "https://salsa.debian.org/science-team/makedepf90" - git = "https://salsa.debian.org/science-team/makedepf90.git" - url = "https://salsa.debian.org/science-team/makedepf90/-/archive/debian/3.0.1-1/makedepf90-debian-3.0.1-1.tar.gz" - parallel = False # Makefile is not thread-safe. - - maintainers("mjaehn") - - depends_on("gmake@4:") - depends_on("autoconf", type="build") - depends_on("automake", type="build") - depends_on("libtool", type="build") - depends_on("m4", type="build") - - version('3.0.1', branch='debian/3.0.1-1') - - def configure_args(self): - return ['--bindir={0}'.format(self.prefix.bin)] - - def autoreconf(self, spec, prefix): - autoreconf("--install", "--verbose", "--force") diff --git a/repos/c2sm/packages/oomph/package.py b/repos/c2sm/packages/oomph/package.py deleted file mode 100644 index fc7d18080e..0000000000 --- a/repos/c2sm/packages/oomph/package.py +++ /dev/null @@ -1,125 +0,0 @@ -from spack.package import * - - -class Oomph(CMakePackage, CudaPackage, ROCmPackage): - """ - Oomph is a non-blocking callback-based point-to-point communication library. - - This Spack package was originally copied from: - https://github.com/ghex-org/spack-repos/tree/main/packages/oomph - - Modifications from the original version: - - removed version below 0.4 - - License: ghex-org - """ - - homepage = "https://github.com/ghex-org/oomph" - url = "https://github.com/ghex-org/oomph/archive/refs/tags/v0.4.0.tar.gz" - git = "https://github.com/ghex-org/oomph.git" - maintainers = ["boeschf"] - - version("0.4.0", - sha256= - "e342c872dfe4832be047f172dc55c12951950c79da2630b071c61607ef913144") - version("main", branch="main") - - depends_on("cxx", type="build") - depends_on("fortran", type="build", when="+fortran-bindings") - - generator("ninja") - - backends = ("mpi", "ucx", "libfabric") - variant("backend", - default="mpi", - description="Transport backend", - values=backends, - multi=False) - - variant("fortran-bindings", - default=False, - description="Build Fortran bindings") - with when("+fortran-bindings"): - variant( - "fortran-fp", - default="float", - description="Floating point type", - values=("float", "double"), - multi=False, - ) - variant("fortran-openmp", - default=True, - description="Compile with OpenMP") - - variant( - "enable-barrier", - default=True, - description="Enable thread barrier (disable for task based runtime)", - ) - - depends_on("hwmalloc+cuda", when="+cuda") - depends_on("hwmalloc+rocm", when="+rocm") - depends_on("hwmalloc", when="~cuda~rocm") - - with when("backend=ucx"): - depends_on("ucx+thread_multiple") - depends_on("ucx+cuda", when="+cuda") - depends_on("ucx+rocm", when="+rocm") - variant("use-pmix", - default="False", - description="Use PMIx to establish out-of-band setup") - variant("use-spin-lock", - default="False", - description="Use pthread spin locks") - depends_on("pmix", when="+use-pmix") - - libfabric_providers = ("cxi", "efa", "gni", "psm2", "tcp", "verbs") - with when("backend=libfabric"): - variant( - "libfabric-provider", - default="tcp", - description="fabric", - values=libfabric_providers, - multi=False, - ) - for provider in libfabric_providers: - depends_on(f"libfabric fabrics={provider}", - when=f"libfabric-provider={provider}") - - depends_on("mpi") - depends_on("boost+thread") - depends_on("googletest", type=("build", "test")) - - def cmake_args(self): - args = [ - self.define_from_variant("OOMPH_BUILD_FORTRAN", - "fortran-bindings"), - self.define_from_variant("OOMPH_FORTRAN_OPENMP", "fortran-openmp"), - self.define_from_variant("OOMPH_UCX_USE_PMI", "use-pmix"), - self.define_from_variant("OOMPH_UCX_USE_SPIN_LOCK", - "use-spin-lock"), - self.define_from_variant("OOMPH_ENABLE_BARRIER", "enable-barrier"), - self.define("OOMPH_WITH_TESTING", self.run_tests), - self.define("OOMPH_GIT_SUBMODULE", False), - self.define("OOMPH_USE_BUNDLED_LIBS", False), - ] - - if self.run_tests and self.spec.satisfies("^openmpi"): - args.append(self.define("MPIEXEC_PREFLAGS", "--oversubscribe")) - - if self.spec.variants["fortran-bindings"].value == True: - args.append( - self.define("OOMPH_FORTRAN_FP", - self.spec.variants["fortran-fp"].value)) - - for backend in self.backends: - args.append( - self.define(f"OOMPH_WITH_{backend.upper()}", - self.spec.variants["backend"].value == backend)) - - if self.spec.satisfies("backend=libfabric"): - args.append( - self.define("OOMPH_LIBFABRIC_PROVIDER", - self.spec.variants["libfabric-provider"].value)) - - return args diff --git a/repos/c2sm/packages/py-cytoolz/package.py b/repos/c2sm/packages/py-cytoolz/package.py deleted file mode 100644 index b3e8f72b83..0000000000 --- a/repos/c2sm/packages/py-cytoolz/package.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2013-2022 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 import * - - -class PyCytoolz(PythonPackage): - """Python implementation of the toolz package, - which provides high performance utility functions for iterables, - functions, and dictionaries.""" - - homepage = "https://github.com/pytoolz/cytoolz" - - pypi = 'cytoolz/cytoolz-0.12.0.tar.gz' - - maintainers = ['samkellerhals'] - - version('0.12.3', - sha256= - '4503dc59f4ced53a54643272c61dc305d1dbbfbd7d6bdf296948de9f34c3a282') - version('0.12.0', - sha256= - 'c105b05f85e03fbcd60244375968e62e44fe798c15a3531c922d531018d22412') - - depends_on('py-setuptools', type='build') - depends_on('py-cython', type='build') - - # py-cytoolz@0.12.0 not compatible with py-cython@3:, see - # https://www.layerzrozero.network/?_=%2Fpytoolz%2Fcytoolz%2Fissues%2F202%23w2n%2BddnGqHIZTHHkluHJC3Vn - depends_on('py-cython@:2', when='@0.12.0', type='build') - - depends_on('python@3.5:', type=('build', 'run')) - depends_on('py-toolz@0.8.0:', type=('build', 'run')) - - def global_options(self, spec, prefix): - options = [] - options.append('--with-cython') - return options diff --git a/repos/c2sm/packages/py-devtools/package.py b/repos/c2sm/packages/py-devtools/package.py deleted file mode 100644 index 32046de306..0000000000 --- a/repos/c2sm/packages/py-devtools/package.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2013-2022 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 import * - - -class PyDevtools(PythonPackage): - """Python's missing debug print command and other development tools.""" - - homepage = "https://github.com/samuelcolvin/python-devtools" - - pypi = "devtools/devtools-0.10.0.tar.gz" - - maintainers = ['samkellerhals'] - - version('0.10.0', - sha256= - '6eb7c4fa7c4b90e5cfe623537a9961d1dc3199d8be0981802c6931cd8f02418f') - - depends_on('py-setuptools', type='build') - - depends_on('python@3.7:', type=('build', 'run')) - depends_on('py-hatchling', type=('build', 'run')) - - depends_on('py-executing@1.1.1:', type=('build', 'run')) - depends_on('py-asttokens@2.0.0:2.9', type=('build', 'run')) diff --git a/repos/c2sm/packages/py-factory-boy/package.py b/repos/c2sm/packages/py-factory-boy/package.py deleted file mode 100644 index f51838bfcd..0000000000 --- a/repos/c2sm/packages/py-factory-boy/package.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2013-2022 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 PyFactoryBoy(PythonPackage): - """factory_boy is a fixtures replacement based on thoughtbot factory_bot""" - - pypi = "factory_boy/factory_boy-3.2.1.tar.gz" - - version("3.2.1", - sha256= - "a98d277b0c047c75eb6e4ab8508a7f81fb03d2cb21986f627913546ef7a2a55e") - - depends_on("python@3.7:") - depends_on('py-faker@0.7.0:', type=('build', 'run')) - depends_on("py-setuptools", type="build") diff --git a/repos/c2sm/packages/py-gridtools-cpp/package.py b/repos/c2sm/packages/py-gridtools-cpp/package.py deleted file mode 100644 index 889265423f..0000000000 --- a/repos/c2sm/packages/py-gridtools-cpp/package.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2013-2022 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 PyGridtoolsCpp(PythonPackage): - """Python package for GridTools headers and CMake files""" - - homepage = "https://gridtools.github.io/gridtools/latest/index.html" - - whl_url_prefix = "https://pypi.io/packages/py3/g/gridtools-cpp/" - - maintainers = ['havogt'] - version("2.3.6", - url=whl_url_prefix + "gridtools_cpp-2.3.6-py3-none-any.whl", - sha256= - "9d047e66558fd5b8b677f6805c61a41b4add0cafde0969e5ee09c339108c4e1f", - expand=False) - - depends_on("python@3.10:") - depends_on("py-setuptools", type="build") - - @property - def headers(self): - '''Workaround to hide the details of the installation path, - i.e "lib/python3.10/site-packages/icon4py/atm_dyn_iconam" - from upstream packages. It needs to be part of the "Spec" object, - therefore choose the headers-function - ''' - - query_parameters = self.spec.last_query.extra_parameters - if len(query_parameters) > 1: - raise ValueError('Only one query parameter allowed') - - if 'data' in query_parameters: - header = self._find_folder_and_add_dummy_header( - self.prefix, 'data') - else: - header = HeaderList([]) - - return header - - def _find_folder_and_add_dummy_header(self, prefix, name): - folder = find(prefix, name) - headerlist = HeaderList(f'{folder[0]}/dummy.h') - return headerlist diff --git a/repos/c2sm/packages/py-hatchling/package.py b/repos/c2sm/packages/py-hatchling/package.py deleted file mode 100644 index 2afe34325d..0000000000 --- a/repos/c2sm/packages/py-hatchling/package.py +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2013-2024 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) - - -class PyHatchling(PythonPackage): - """Modern, extensible Python build backend.""" - homepage = "https://hatch.pypa.io/latest/" - pypi = "hatchling/hatchling-1.4.1.tar.gz" - git = "https://github.com/pypa/hatch" - - license("MIT", checked_by="tgamblin") - - version("1.21.0", - sha256= - "5c086772357a50723b825fd5da5278ac7e3697cdf7797d07541a6c90b6ff754c") - version("1.18.0", - sha256= - "50e99c3110ce0afc3f7bdbadff1c71c17758e476731c27607940cfa6686489ca") - version("1.17.0", - sha256= - "b1244db3f45b4ef5a00106a46612da107cdfaf85f1580b8e1c059fefc98b0930") - version("1.14.0", - sha256= - "462ea91df03ff5d52813b5613fec1313a1a2059d2e37343e572b3f979867c5da") - version("1.13.0", - sha256= - "f8d275a2cc720735286b7c2e2bc35da05761e6d3695c2fa416550395f10c53c7") - version("1.10.0", - sha256= - "5d31f43dffaf6265c808e1b5353662ffa5146d844278b55caa6c7f74f427ec50") - version("1.8.1", - sha256= - "448b04b23faed669b2b565b998ac955af4feea66c5deed3a1212ac9399d2e1cd") - version("1.4.1", - sha256= - "13461b42876ade4f75ee5d2a2c656b288ca0aab7f048ef66657ef166996b2118") - - depends_on("py-editables@0.3:", type=("build", "run")) - depends_on("py-packaging@21.3:", type=("build", "run")) - depends_on("py-pathspec@0.10.1:", when="@1.9:", type=("build", "run")) - depends_on("py-pathspec@0.9:", type=("build", "run")) - - #WORKAROUND: py-pluggy@1: and py-tox' py-pluggy@0.12.0:0 are incompatible - #depends_on("py-pluggy@1:", type=("build", "run")) - depends_on("py-pluggy@0.12:", type=("build", "run")) - - depends_on("py-tomli@1.2.2:", when="^python@:3.10", type=("build", "run")) - depends_on("py-trove-classifiers", when="@1.14:", type=("build", "run")) diff --git a/repos/c2sm/packages/py-inflection/package.py b/repos/c2sm/packages/py-inflection/package.py deleted file mode 100644 index 91da5eaba0..0000000000 --- a/repos/c2sm/packages/py-inflection/package.py +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright 2013-2022 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 import * - - -class PyInflection(PythonPackage): - """Inflection is a string transformation library.""" - - homepage = "https://github.com/jpvanhal/inflection" - - pypi = "inflection/inflection-0.5.1.tar.gz" - - maintainers = ['samkellerhals'] - - version('0.5.1', - sha256= - '1a29730d366e996aaacffb2f1f1cb9593dc38e2ddd30c91250c6dde09ea9b417') - - depends_on('python@3.5:', type=('build', 'run')) - depends_on('py-isort', type=('build', 'run')) - depends_on('py-flake8', type=('build', 'run')) - depends_on('py-pytest', type=('build', 'run')) - - depends_on('py-setuptools', type='build') diff --git a/repos/c2sm/packages/py-pytest-factoryboy/package.py b/repos/c2sm/packages/py-pytest-factoryboy/package.py deleted file mode 100644 index 5b05f97ba4..0000000000 --- a/repos/c2sm/packages/py-pytest-factoryboy/package.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2013-2022 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 import * - - -class PyPytestFactoryboy(PythonPackage): - """factory_boy integration with the pytest runner""" - - homepage = "https://pytest-factoryboy.readthedocs.io/en/stable/" - - pypi = "pytest-factoryboy/pytest_factoryboy-2.5.1.tar.gz" - - maintainers = ['samkellerhals'] - - version('2.5.1', - sha256= - '7275a52299b20c0f58b63fdf7326b3fd2b7cbefbdaa90fdcfc776bbe92197484') - - # TODO: These two deps had to be excluded, otherwise - # conretizer had problems with py-gt4py spec - - #depends_on('py-tox@4.0.8:', type=('build', 'run')) - #depends_on('py-packaging@22.0:', type=('build', 'run')) - - depends_on('python@3.7:', type=('build', 'run')) - depends_on('py-factory-boy@2.10.0:', type=('build', 'run')) - depends_on('py-pytest@5.0.0:', type=('build', 'run')) - depends_on('py-typing-extensions', type=('build', 'run')) - depends_on('py-inflection', type=('build', 'run')) - depends_on('py-mypy', type=('build', 'run')) - depends_on('py-tox@3.14.2:', type=('build', 'run')) - depends_on('py-packaging@21.3:', type=('build', 'run')) - depends_on('py-importlib-metadata', type=('build', 'run')) - depends_on('py-coverage +toml', type=('build', 'run')) - - patch('patches/2.5.1/group.patch', when='@2.5.1') - - depends_on('py-poetry-core@1.0.0:', type='build') diff --git a/repos/c2sm/packages/py-pytest-factoryboy/patches/2.5.1/group.patch b/repos/c2sm/packages/py-pytest-factoryboy/patches/2.5.1/group.patch deleted file mode 100644 index 57b18d05fa..0000000000 --- a/repos/c2sm/packages/py-pytest-factoryboy/patches/2.5.1/group.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/pyproject.toml b/pyproject.toml -index 37f632d..21c27f0 100644 ---- a/pyproject.toml -+++ b/pyproject.toml -@@ -37,12 +37,12 @@ factory_boy = ">=2.10.0" - pytest = ">=5.0.0" - typing_extensions = "*" - --[tool.poetry.group.dev.dependencies] --mypy = "^0.991" --tox = "^3.27.0" --packaging = "^21.3" --importlib-metadata = { version = "^5.0.0", python = "<3.8" } --coverage = {extras = ["toml"], version = "^6.5.0"} -+#[tool.poetry.group.dev.dependencies] -+#mypy = "^0.991" -+#tox = "^3.27.0" -+#packaging = "^21.3" -+#importlib-metadata = { version = "^5.0.0", python = "<3.8" } -+#coverage = {extras = ["toml"], version = "^6.5.0"} - - [build-system] - requires = ["poetry-core>=1.0.0"] diff --git a/repos/c2sm/packages/py-tabulate/package.py b/repos/c2sm/packages/py-tabulate/package.py deleted file mode 100644 index b6a8f08b4b..0000000000 --- a/repos/c2sm/packages/py-tabulate/package.py +++ /dev/null @@ -1,19 +0,0 @@ -# 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 * -from spack.pkg.builtin.py_tabulate import PyTabulate as SpackPyTabulate - - -class PyTabulate(SpackPyTabulate): - """Pretty-print tabular data""" - - #BACKPORT: Add missing versions - version("0.9.0", - sha256= - "0095b12bf5966de529c0feb1fa08671671b3368eec77d7ef7ab114be2c068b3c") - version("0.8.10", - sha256= - "6c57f3f3dd7ac2782770155f3adb2db0b1a269637e42f27599925e64b114f519") diff --git a/repos/c2sm/packages/py-typing-extensions/package.py b/repos/c2sm/packages/py-typing-extensions/package.py deleted file mode 100644 index d3b0981791..0000000000 --- a/repos/c2sm/packages/py-typing-extensions/package.py +++ /dev/null @@ -1,16 +0,0 @@ -from spack.package import * -from spack.pkg.builtin.py_typing_extensions import PyTypingExtensions as SpackPyTypingExtensions - - -class PyTypingExtensions(SpackPyTypingExtensions): - """Backported and Experimental Type Hints for Python 3.7+""" - - version("4.10.0", - sha256= - "b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb") - version("4.5.0", - sha256= - "5cb5f4a79139d699607b3ef622a1dedafa84e115ab0024e0d9c044a9479ca7cb") - version("4.2.0", - sha256= - "f1c24655a0da0d1b67f07e17a5e6b2a105894e6824b92096378bb3668ef02376") diff --git a/repos/c2sm/packages/uv/package.py b/repos/c2sm/packages/uv/package.py deleted file mode 100644 index f0700fe744..0000000000 --- a/repos/c2sm/packages/uv/package.py +++ /dev/null @@ -1,81 +0,0 @@ -from spack.package import * - - -def translate_platform(platform_name: str) -> str: - if platform_name is None: - return "unknown-linux-gnu" - if platform_name == "darwin": - return "apple-darwin" - elif platform_name == "linux": - return "unknown-linux-gnu" - return "unknown-linux-gnu" - - -def translate_arch(arch_name: str) -> str: - if arch_name is None: - return "aarch64" - if arch_name in ["m1", "m2", "neoverse_v2"]: - return "aarch64" - if arch_name in ["zen3"]: - return "x86_64" - return "aarch64" - - -class Uv(Package): - """Install UV from binary releases""" - - url = "https://github.com/astral-sh/uv/releases/download/0.0.0/uv-ARCH-PLATFORM.tar.gz" - - version("0.7.12", sha256="dummy") - version("0.7.20", sha256="dummy") - version("0.9.3", sha256="dummy") - version("0.9.4", sha256="dummy") - - # Platform-specific checksums - checksums = { - ("0.7.12", "apple-darwin", "aarch64"): - "189108cd026c25d40fb086eaaf320aac52c3f7aab63e185bac51305a1576fc7e", - ("0.7.12", "unknown-linux-gnu", "aarch64"): - "23233d2e950ed8187858350da5c6803b14cbbeaef780382093bb2f2bc4ba1200", - ("0.7.12", "unknown-linux-gnu", "x86_64"): - "735891fb553d0be129f3aa39dc8e9c4c49aaa76ec17f7dfb6a732e79a714873a", - ("0.7.20", "unknown-linux-gnu", "aarch64"): - "675165f879d6833aa313ecb25ac44781e131933a984727e180b3218d2cd6c1e9", - ("0.7.20", "unknown-linux-gnu", "x86_64"): - "10f204426ff188925d22a53c1d0310d190a8d4d24513712e1b8e2ca9873f0666", - ("0.9.3", "unknown-linux-gnu", "aarch64"): - "2094a3ead5a026a2f6894c4d3f71026129c8878939a57f17f0c8246a737bed1d", - ("0.9.3", "unknown-linux-gnu", "x86_64"): - "4d6f84490da4b21bb6075ffc1c6b22e0cf37bc98d7cca8aff9fbb759093cdc23", - ("0.9.4", "unknown-linux-gnu", "aarch64"): - "c507e8cc4df18ed16533364013d93c2ace2c7f81a2a0d892a0dc833915b02e8b", - ("0.9.4", "unknown-linux-gnu", "x86_64"): - "e02f7fc102d6a1ebfa3b260b788e9adf35802be28c8d85640e83246e61519c1e", - } - - def url_for_version(self, version): - arch = translate_arch(getattr(self.spec, "target", "aarch64")) - platform = translate_platform( - getattr(self.spec, "platform", "unknown-linux-gnu")) - return f"https://github.com/astral-sh/uv/releases/download/{version}/uv-{arch}-{platform}.tar.gz" - - def do_stage(self, mirror_only=False): - version = str(self.spec.version) - arch = translate_arch(getattr(self.spec, "target", "aarch64")) - platform = translate_platform( - getattr(self.spec, "platform", "unknown-linux-gnu")) - key = (version, platform, arch) - - if key not in self.checksums: - raise InstallError( - f"Unsupported platform/arch for version {version}: {platform}-{arch}." - ) - - # Override fetcher digest with the correct checksum - self.fetcher.digest = self.checksums[key] - super().do_stage(mirror_only) - - def install(self, spec, prefix): - mkdir(prefix.bin) - install("uv", prefix.bin.uv) - install("uvx", prefix.bin.uvx) diff --git a/repos/c2sm/packages/yaxt/mpich/0.9.2.patch b/repos/c2sm/packages/yaxt/mpich/0.9.2.patch deleted file mode 100644 index eb429c7a20..0000000000 --- a/repos/c2sm/packages/yaxt/mpich/0.9.2.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/Makefile.in -+++ b/src/Makefile.in -@@ -1102,7 +1102,7 @@ mpich_workaround.lo: mpich_workaround.c - @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mpich_workaround.Tpo $(DEPDIR)/mpich_workaround.Plo - @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mpich_workaround.c' object='mpich_workaround.lo' libtool=yes @AMDEPBACKSLASH@ - @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ --@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=cmpichle $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) -I../config/workarounds/mpich34_yaksa_patch $(CFLAGS) -c -o $@ `test -f 'mpich_workaround.c' || echo '$(srcdir)/'`mpich_workaround.c -+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) -I../config/workarounds/mpich34_yaksa_patch $(CFLAGS) -c -o $@ `test -f 'mpich_workaround.c' || echo '$(srcdir)/'`mpich_workaround.c - - xt_redist_real_sp.f90: \ - m4-templates/xt_redist_template_module.f90.m4 \ diff --git a/repos/c2sm/packages/yaxt/mpirun/0.7.0.patch b/repos/c2sm/packages/yaxt/mpirun/0.7.0.patch deleted file mode 100644 index 82473c3aae..0000000000 --- a/repos/c2sm/packages/yaxt/mpirun/0.7.0.patch +++ /dev/null @@ -1,89 +0,0 @@ ---- a/configure -+++ b/configure -@@ -22092,6 +22092,15 @@ saved_LIBS=$LIBS - CFLAGS="$CFLAGS $MPI_C_INCLUDE" - FCFLAGS="$FCFLAGS $MPI_FC_MOD" - LIBS="$LIBS $MPI_C_LIB" -+# check MPI defects -+ -+# Check whether --with-regard-for-quality was given. -+if test "${with_regard_for_quality+set}" = set; then : -+ withval=$with_regard_for_quality; -+else -+ with_regard_for_quality=yes -+fi -+ - for ac_prog in mpirun mpiexec - do - # Extract the first word of "$ac_prog", so it can be a program name with args. -@@ -22214,25 +22223,19 @@ fi - if test x"$MPI_LAUNCH" = xtrue; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 - $as_echo "no" >&6; } -- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -+ if test "x$with_regard_for_quality" = xyes; then : -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 - $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} --as_fn_error $? "$MPI_LAUNCH_failMsg -+as_fn_error $? "unable to find a working MPI launch program, which is required for checks for known MPI defects (see --without-regard-for-quality) - See \`config.log' for more details" "$LINENO" 5; } -+fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 - $as_echo "yes" >&6; } - fi - --# check MPI defects -- --# Check whether --with-regard-for-quality was given. --if test "${with_regard_for_quality+set}" = set; then : -- withval=$with_regard_for_quality; --else -- with_regard_for_quality=yes --fi -- --# Check whether --enable-cross-mpi-defect-checks was given. -+if test "x$with_regard_for_quality" = xyes; then : -+ # Check whether --enable-cross-mpi-defect-checks was given. - if test "${enable_cross_mpi_defect_checks+set}" = set; then : - enableval=$enable_cross_mpi_defect_checks; if test x"$enable_cross_mpi_defect_checks" != xno; then : - enable_cross_mpi_defect_checks=yes -@@ -22326,26 +22329,22 @@ $as_echo "error" >&6; } - if test -r "$srcdir/config/checkdoc/${acx_subtestname}.txt"; then : - cat "$srcdir/config/checkdoc/${acx_subtestname}.txt" >&2 - fi -- if test "$with_regard_for_quality" != no; then : -- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 - $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} --as_fn_error $? "test for known defect $subtestname failed, re-configure with --without-regard-for-quality in case you must use the given MPI implementation, but some tests might fail -+as_fn_error $? "test for known defect $acx_subtestname failed, re-configure with --without-regard-for-quality in case you must use the given MPI implementation, but some tests might fail - See \`config.log' for more details" "$LINENO" 5; } - fi --fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: error" >&5 - $as_echo "error" >&6; } - if test -r "$srcdir/config/checkdoc/${acx_subtestname}.txt"; then : - cat "$srcdir/config/checkdoc/${acx_subtestname}.txt" >&2 - fi -- if test "$with_regard_for_quality" != no; then : -- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 - $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} --as_fn_error $? "test for known defect $subtestname failed, re-configure with --without-regard-for-quality in case you must use the given MPI implementation, but some tests might fail -+as_fn_error $? "test for known defect $acx_subtestname failed, re-configure with --without-regard-for-quality in case you must use the given MPI implementation, but some tests might fail - See \`config.log' for more details" "$LINENO" 5; } - fi --fi - rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - case $acx_suffix in #( -@@ -22376,6 +22375,7 @@ done - unset acx_suffix - unset acx_subtestname - -+fi - fi - if test "x$MPI_LAUNCH" = xtrue; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: MPI launch command unavailable" >&5 diff --git a/repos/c2sm/packages/yaxt/no_2d_param/0.7.0.patch b/repos/c2sm/packages/yaxt/no_2d_param/0.7.0.patch deleted file mode 100644 index b64fedaa78..0000000000 --- a/repos/c2sm/packages/yaxt/no_2d_param/0.7.0.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/tests/test_redist_repeat_f.f90 -+++ b/tests/test_redist_repeat_f.f90 -@@ -142,7 +142,7 @@ CONTAINS - DOUBLE PRECISION, PARAMETER :: src_data(5, 5) = RESHAPE((/& - (DBLE(i), i = 1, 25)/), (/ 5, 5 /)) - DOUBLE PRECISION :: dst_data(3, 5) --#if defined(__PGI) || defined(_CRAYFTN) -+#if defined(__PGI) || defined(_CRAYFTN) || defined(NO_2D_PARAM) - DOUBLE PRECISION :: ref_dst_data(3, 5) - ref_dst_data & - = RESHAPE((/ ((DBLE((i + j)*MOD(j+1,2)-MOD(j,2)), i = 1,5,2), & diff --git a/repos/c2sm/packages/yaxt/package.py b/repos/c2sm/packages/yaxt/package.py deleted file mode 100644 index c7b82b1821..0000000000 --- a/repos/c2sm/packages/yaxt/package.py +++ /dev/null @@ -1,111 +0,0 @@ -class Yaxt(AutotoolsPackage): - """Yet Another eXchange Tool""" - - homepage = "https://www.dkrz.de/redmine/projects/yaxt/wiki" - git = "https://gitlab.dkrz.de/dkrz-sw/yaxt.git" - - version('0.9.2.1', branch='release-0.9.2.1') - version('0.9.2', branch='release-0.9.2') - version('0.9.1', branch='release-0.9.1') - version('0.9.0', branch='release-0.9.0') - version('0.8.1', branch='release-0.8.1') - version('0.8.0', branch='release-0.8.0') - version('0.7.0-p1', branch='release-0.7.0-patched', preferred=True) - version('0.7.0', branch='release-0.7.0') - - variant('shared', default=True, description='Enable shared libraries') - variant('fortran', default=True, description='Enable Fortran interface') - - conflicts('~fortran', when='@:0.8.999') - - depends_on('mpi') - - # Do not fail if MPI_LAUNCH does not work and MPI defect checks are disabled - # (see https://gitlab.dkrz.de/dkrz-sw/yaxt/-/commit/ff5dd54576620e35b6b93b85e791787eb53c9764): - patch( - 'mpirun/0.7.0.patch', - # The condition matches version 0.7.0 but not 0.7.0-p1: - when='@:0.7.0-p0') - - # Fix a typo in the makefile - # (see https://gitlab.dkrz.de/dkrz-sw/yaxt/-/merge_requests/8) - patch( - 'mpich/0.9.2.patch', - # We do not put ^mpich to the condition because there are other - # MPICH-based MPI packages that might need this: - when='@0.9.2:0.9.2.1') - - # Enable the PGI/Cray workaround also when macro NO_2D_PARAM is defined: - patch('no_2d_param/0.7.0.patch', when='@:0.7%aocc+fortran') - - def flag_handler(self, name, flags): - if name == 'fflags': - if self.compiler.name == 'aocc': - flags.append('-DNO_2D_PARAM') - return flags, None, None - - @property - def libs(self): - lib_names = [] - if 'fortran' in self.spec.last_query.extra_parameters: - lib_names.append('libyaxt') - lib_names.append('libyaxt_c') - - shared = '+shared' in self.spec - libs = find_libraries(lib_names, - root=self.prefix, - shared=shared, - recursive=True) - - if libs: - return libs - - msg = 'Unable to recursively locate {0} libraries in {1}' - raise spack.error.NoLibrariesError( - msg.format(self.spec.name, self.spec.prefix)) - - def configure_args(self): - args = [ - '--enable-static', - 'CC={0}'.format(self.spec['mpi'].mpicc), - 'FC={0}'.format(self.spec['mpi'].mpifc if '+fortran' in - self.spec else 'no'), - # We cannot provide a universal value for MPI_LAUNCH, therefore - # we have to disable the MPI checks: - '--without-regard-for-quality' - ] - - # Do not build examples and test programs by default: - if self.version >= ver('0.8.0'): - args.extend([ - '--with-on-demand-check-programs', '--without-example-programs' - ]) - - args += self.enable_or_disable('shared') - - return args - - @run_after('configure') - def patch_libtool(self): - if not self.spec.satisfies('+fortran+shared'): - return - - if self.compiler.name in ['nvhpc', 'aocc']: - # Libtool does not fully support the compiler toolchains, therefore - # we have to patch the script. The C compilers normally get - # configured correctly, the variables of interest in the - # 'BEGIN LIBTOOL CONFIG' section are set to non-empty values and, - # therefore, are not affected by the replacements below. A more - # robust solution would be to extend the filter_file function with - # an additional argument start_at and perform the replacements - # between the '# ### BEGIN LIBTOOL TAG CONFIG: FC' and - # '# ### END LIBTOOL TAG CONFIG: FC' markers. - - # How to pass a linker flag through the compiler: - filter_file(r'^wl=""$', - 'wl="{0}"'.format(self.compiler.linker_arg), 'libtool') - - # How to compile PIC objects: - filter_file(r'^pic_flag=""$', - 'pic_flag=" {0}"'.format(self.compiler.fc_pic_flag), - 'libtool') From e7e3d26caff3a0ccf1841b855aa77dc61d39007a Mon Sep 17 00:00:00 2001 From: Matthieu Leclair Date: Wed, 4 Feb 2026 14:34:29 +0100 Subject: [PATCH 03/27] add: uv package --- repos/c2sm/packages/uv/package.py | 81 +++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 repos/c2sm/packages/uv/package.py diff --git a/repos/c2sm/packages/uv/package.py b/repos/c2sm/packages/uv/package.py new file mode 100644 index 0000000000..f0700fe744 --- /dev/null +++ b/repos/c2sm/packages/uv/package.py @@ -0,0 +1,81 @@ +from spack.package import * + + +def translate_platform(platform_name: str) -> str: + if platform_name is None: + return "unknown-linux-gnu" + if platform_name == "darwin": + return "apple-darwin" + elif platform_name == "linux": + return "unknown-linux-gnu" + return "unknown-linux-gnu" + + +def translate_arch(arch_name: str) -> str: + if arch_name is None: + return "aarch64" + if arch_name in ["m1", "m2", "neoverse_v2"]: + return "aarch64" + if arch_name in ["zen3"]: + return "x86_64" + return "aarch64" + + +class Uv(Package): + """Install UV from binary releases""" + + url = "https://github.com/astral-sh/uv/releases/download/0.0.0/uv-ARCH-PLATFORM.tar.gz" + + version("0.7.12", sha256="dummy") + version("0.7.20", sha256="dummy") + version("0.9.3", sha256="dummy") + version("0.9.4", sha256="dummy") + + # Platform-specific checksums + checksums = { + ("0.7.12", "apple-darwin", "aarch64"): + "189108cd026c25d40fb086eaaf320aac52c3f7aab63e185bac51305a1576fc7e", + ("0.7.12", "unknown-linux-gnu", "aarch64"): + "23233d2e950ed8187858350da5c6803b14cbbeaef780382093bb2f2bc4ba1200", + ("0.7.12", "unknown-linux-gnu", "x86_64"): + "735891fb553d0be129f3aa39dc8e9c4c49aaa76ec17f7dfb6a732e79a714873a", + ("0.7.20", "unknown-linux-gnu", "aarch64"): + "675165f879d6833aa313ecb25ac44781e131933a984727e180b3218d2cd6c1e9", + ("0.7.20", "unknown-linux-gnu", "x86_64"): + "10f204426ff188925d22a53c1d0310d190a8d4d24513712e1b8e2ca9873f0666", + ("0.9.3", "unknown-linux-gnu", "aarch64"): + "2094a3ead5a026a2f6894c4d3f71026129c8878939a57f17f0c8246a737bed1d", + ("0.9.3", "unknown-linux-gnu", "x86_64"): + "4d6f84490da4b21bb6075ffc1c6b22e0cf37bc98d7cca8aff9fbb759093cdc23", + ("0.9.4", "unknown-linux-gnu", "aarch64"): + "c507e8cc4df18ed16533364013d93c2ace2c7f81a2a0d892a0dc833915b02e8b", + ("0.9.4", "unknown-linux-gnu", "x86_64"): + "e02f7fc102d6a1ebfa3b260b788e9adf35802be28c8d85640e83246e61519c1e", + } + + def url_for_version(self, version): + arch = translate_arch(getattr(self.spec, "target", "aarch64")) + platform = translate_platform( + getattr(self.spec, "platform", "unknown-linux-gnu")) + return f"https://github.com/astral-sh/uv/releases/download/{version}/uv-{arch}-{platform}.tar.gz" + + def do_stage(self, mirror_only=False): + version = str(self.spec.version) + arch = translate_arch(getattr(self.spec, "target", "aarch64")) + platform = translate_platform( + getattr(self.spec, "platform", "unknown-linux-gnu")) + key = (version, platform, arch) + + if key not in self.checksums: + raise InstallError( + f"Unsupported platform/arch for version {version}: {platform}-{arch}." + ) + + # Override fetcher digest with the correct checksum + self.fetcher.digest = self.checksums[key] + super().do_stage(mirror_only) + + def install(self, spec, prefix): + mkdir(prefix.bin) + install("uv", prefix.bin.uv) + install("uvx", prefix.bin.uvx) From 7f61483175b76da109a6c70ab59638f2299c376d Mon Sep 17 00:00:00 2001 From: Matthieu Leclair Date: Wed, 4 Feb 2026 15:39:33 +0100 Subject: [PATCH 04/27] add: ghex, hwmalloc, oomph --- repos/c2sm/packages/ghex/package.py | 87 ++++++++++++ .../hwmalloc/cmake_install_path.patch | 27 ++++ repos/c2sm/packages/hwmalloc/package.py | 67 ++++++++++ repos/c2sm/packages/oomph/package.py | 125 ++++++++++++++++++ 4 files changed, 306 insertions(+) create mode 100644 repos/c2sm/packages/ghex/package.py create mode 100644 repos/c2sm/packages/hwmalloc/cmake_install_path.patch create mode 100644 repos/c2sm/packages/hwmalloc/package.py create mode 100644 repos/c2sm/packages/oomph/package.py diff --git a/repos/c2sm/packages/ghex/package.py b/repos/c2sm/packages/ghex/package.py new file mode 100644 index 0000000000..fc03b88fbc --- /dev/null +++ b/repos/c2sm/packages/ghex/package.py @@ -0,0 +1,87 @@ +from spack.package import * + + +class Ghex(CMakePackage, CudaPackage, ROCmPackage): + """GHEX is a generic halo-exchange library.""" + + homepage = "https://github.com/ghex-org/GHEX" + url = "https://github.com/ghex-org/GHEX/archive/refs/tags/v0.3.0.tar.gz" + git = "https://github.com/ghex-org/GHEX.git" + maintainers = ["boeschf"] + + version("0.4.1", tag="v0.4.1", submodules=True) + version("0.4.0", tag="v0.4.0", submodules=True) + version("0.3.0", tag="v0.3.0", submodules=True) + version("master", branch="master", submodules=True) + + depends_on("cxx", type="build") + + generator("ninja") + + backends = ("mpi", "ucx", "libfabric") + variant( + "backend", default="mpi", description="Transport backend", values=backends, multi=False + ) + variant("xpmem", default=False, description="Use xpmem shared memory") + variant("python", default=True, description="Build Python bindings") + + depends_on("cmake@3.21:", type="build") + depends_on("mpi") + depends_on("boost") + depends_on("xpmem", when="+xpmem", type=("build", "run")) + + depends_on("oomph") + for backend in backends: + depends_on(f"oomph backend={backend}", when=f"backend={backend}") + depends_on("oomph+cuda", when="+cuda") + depends_on("oomph+rocm", when="+rocm") + depends_on("oomph@0.3:", when="@0.3:") + + conflicts("+cuda+rocm") + + with when("+python"): + extends("python") + depends_on("python@3.7:", type="build") + depends_on("py-pip", type="build") + depends_on("py-pybind11", type="build") + depends_on("py-mpi4py", type=("build", "run")) + depends_on("py-numpy", type=("build", "run")) + + depends_on("py-pytest", when="+python", type=("test")) + + def cmake_args(self): + spec = self.spec + + args = [ + self.define("GHEX_USE_BUNDLED_LIBS", True), + self.define("GHEX_USE_BUNDLED_GRIDTOOLS", True), + self.define("GHEX_USE_BUNDLED_GTEST", self.run_tests), + self.define("GHEX_USE_BUNDLED_OOMPH", False), + self.define("GHEX_TRANSPORT_BACKEND", spec.variants["backend"].value.upper()), + self.define_from_variant("GHEX_USE_XPMEM", "xpmem"), + self.define_from_variant("GHEX_BUILD_PYTHON_BINDINGS", "python"), + self.define("GHEX_WITH_TESTING", self.run_tests), + ] + + if spec.satisfies("+python"): + args.append(self.define("GHEX_PYTHON_LIB_PATH", python_platlib)) + + if self.run_tests and spec.satisfies("^openmpi"): + args.append(self.define("MPIEXEC_PREFLAGS", "--oversubscribe")) + + if "+cuda" in spec and spec.variants["cuda_arch"].value != "none": + arch_str = ";".join(spec.variants["cuda_arch"].value) + args.append(self.define("CMAKE_CUDA_ARCHITECTURES", arch_str)) + args.append(self.define("GHEX_USE_GPU", True)) + args.append(self.define("GHEX_GPU_TYPE", "CUDA")) + + if "+rocm" in spec and spec.variants["amdgpu_target"].value != "none": + arch_str = ";".join(spec.variants["amdgpu_target"].value) + args.append(self.define("CMAKE_HIP_ARCHITECTURES", arch_str)) + args.append(self.define("GHEX_USE_GPU", True)) + args.append(self.define("GHEX_GPU_TYPE", "AMD")) + + if spec.satisfies("~cuda~rocm"): + args.append(self.define("GHEX_USE_GPU", False)) + + return args diff --git a/repos/c2sm/packages/hwmalloc/cmake_install_path.patch b/repos/c2sm/packages/hwmalloc/cmake_install_path.patch new file mode 100644 index 0000000000..fa6fde13d8 --- /dev/null +++ b/repos/c2sm/packages/hwmalloc/cmake_install_path.patch @@ -0,0 +1,27 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d5420e0..35dbe56 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -105,11 +105,11 @@ install(FILES ${PROJECT_BINARY_DIR}/include/hwmalloc/config.hpp + install(EXPORT HWMALLOC-targets + FILE HWMALLOC-targets.cmake + NAMESPACE HWMALLOC:: +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/hwmalloc/cmake) + + configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/HWMALLOCConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/HWMALLOCConfig.cmake +- INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) ++ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/hwmalloc/cmake) + + write_basic_package_version_file(HWMALLOCConfigVersion.cmake + VERSION ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion) +@@ -120,7 +120,7 @@ install( + ${CMAKE_CURRENT_BINARY_DIR}/HWMALLOCConfigVersion.cmake + ${CMAKE_CURRENT_LIST_DIR}/cmake/FindNUMA.cmake + DESTINATION +- ${CMAKE_INSTALL_LIBDIR}/cmake) ++ ${CMAKE_INSTALL_LIBDIR}/hwmalloc/cmake) + + export(EXPORT HWMALLOC-targets + FILE "${CMAKE_CURRENT_BINARY_DIR}/HWMALLOC-targets.cmake") diff --git a/repos/c2sm/packages/hwmalloc/package.py b/repos/c2sm/packages/hwmalloc/package.py new file mode 100644 index 0000000000..b24ed67b4c --- /dev/null +++ b/repos/c2sm/packages/hwmalloc/package.py @@ -0,0 +1,67 @@ +from spack.package import * + + +class Hwmalloc(CMakePackage, CudaPackage, ROCmPackage): + """ + HWMALLOC is a allocator which supports memory registration for e.g. remote memory access + + This Spack package was originally copied from: + https://github.com/ghex-org/spack-repos/blob/main/packages/hwmalloc/package.py + + License: ghex-org + """ + + homepage = "https://github.com/ghex-org/hwmalloc" + url = "https://github.com/ghex-org/hwmalloc/archive/refs/tags/v0.3.0.tar.gz" + git = "https://github.com/ghex-org/hwmalloc.git" + maintainers = ["boeschf"] + + version("0.3.0", + sha256= + "d4d4ac6087a806600d79fb62c02719ca3d58a412968fe1ef4a2fd58d9e7ee950") + version("0.2.0", + sha256= + "734758a390a3258b86307e4aef50a7ca2e5d0e2e579f18aeefcd05397e114419") + version("0.1.0", + sha256= + "06e9bfcef0ecce4d19531ccbe03592b502d1281c7a092bc0ff51ca187899b21c") + version("master", branch="master") + + depends_on("cxx", type="build") + + generator("ninja") + + depends_on("numactl", type=("build", "run")) + depends_on("boost", type=("build")) + depends_on("cmake@3.19:", type="build") + + variant( + "numa-throws", + default=False, + description="True if numa_tools may throw during initialization", + ) + variant("numa-local", + default=True, + description="Use numa_tools for local node allocations") + variant("logging", default=False, description="print logging info to cerr") + + patch("cmake_install_path.patch", when="@:0.3.0", level=1) + + def cmake_args(self): + args = [ + self.define_from_variant("HWMALLOC_NUMA_THROWS", "numa-throws"), + self.define_from_variant("HWMALLOC_NUMA_FOR_LOCAL", "numa-local"), + self.define_from_variant("HWMALLOC_ENABLE_LOGGING", "logging"), + self.define("HWMALLOC_WITH_TESTING", self.run_tests), + ] + + if "+cuda" in self.spec: + args.append(self.define("HWMALLOC_ENABLE_DEVICE", True)) + args.append(self.define("HWMALLOC_DEVICE_RUNTIME", "cuda")) + elif "+rocm" in self.spec: + args.append(self.define("HWMALLOC_ENABLE_DEVICE", True)) + args.append(self.define("HWMALLOC_DEVICE_RUNTIME", "hip")) + else: + args.append(self.define("HWMALLOC_ENABLE_DEVICE", False)) + + return args diff --git a/repos/c2sm/packages/oomph/package.py b/repos/c2sm/packages/oomph/package.py new file mode 100644 index 0000000000..fc7d18080e --- /dev/null +++ b/repos/c2sm/packages/oomph/package.py @@ -0,0 +1,125 @@ +from spack.package import * + + +class Oomph(CMakePackage, CudaPackage, ROCmPackage): + """ + Oomph is a non-blocking callback-based point-to-point communication library. + + This Spack package was originally copied from: + https://github.com/ghex-org/spack-repos/tree/main/packages/oomph + + Modifications from the original version: + - removed version below 0.4 + + License: ghex-org + """ + + homepage = "https://github.com/ghex-org/oomph" + url = "https://github.com/ghex-org/oomph/archive/refs/tags/v0.4.0.tar.gz" + git = "https://github.com/ghex-org/oomph.git" + maintainers = ["boeschf"] + + version("0.4.0", + sha256= + "e342c872dfe4832be047f172dc55c12951950c79da2630b071c61607ef913144") + version("main", branch="main") + + depends_on("cxx", type="build") + depends_on("fortran", type="build", when="+fortran-bindings") + + generator("ninja") + + backends = ("mpi", "ucx", "libfabric") + variant("backend", + default="mpi", + description="Transport backend", + values=backends, + multi=False) + + variant("fortran-bindings", + default=False, + description="Build Fortran bindings") + with when("+fortran-bindings"): + variant( + "fortran-fp", + default="float", + description="Floating point type", + values=("float", "double"), + multi=False, + ) + variant("fortran-openmp", + default=True, + description="Compile with OpenMP") + + variant( + "enable-barrier", + default=True, + description="Enable thread barrier (disable for task based runtime)", + ) + + depends_on("hwmalloc+cuda", when="+cuda") + depends_on("hwmalloc+rocm", when="+rocm") + depends_on("hwmalloc", when="~cuda~rocm") + + with when("backend=ucx"): + depends_on("ucx+thread_multiple") + depends_on("ucx+cuda", when="+cuda") + depends_on("ucx+rocm", when="+rocm") + variant("use-pmix", + default="False", + description="Use PMIx to establish out-of-band setup") + variant("use-spin-lock", + default="False", + description="Use pthread spin locks") + depends_on("pmix", when="+use-pmix") + + libfabric_providers = ("cxi", "efa", "gni", "psm2", "tcp", "verbs") + with when("backend=libfabric"): + variant( + "libfabric-provider", + default="tcp", + description="fabric", + values=libfabric_providers, + multi=False, + ) + for provider in libfabric_providers: + depends_on(f"libfabric fabrics={provider}", + when=f"libfabric-provider={provider}") + + depends_on("mpi") + depends_on("boost+thread") + depends_on("googletest", type=("build", "test")) + + def cmake_args(self): + args = [ + self.define_from_variant("OOMPH_BUILD_FORTRAN", + "fortran-bindings"), + self.define_from_variant("OOMPH_FORTRAN_OPENMP", "fortran-openmp"), + self.define_from_variant("OOMPH_UCX_USE_PMI", "use-pmix"), + self.define_from_variant("OOMPH_UCX_USE_SPIN_LOCK", + "use-spin-lock"), + self.define_from_variant("OOMPH_ENABLE_BARRIER", "enable-barrier"), + self.define("OOMPH_WITH_TESTING", self.run_tests), + self.define("OOMPH_GIT_SUBMODULE", False), + self.define("OOMPH_USE_BUNDLED_LIBS", False), + ] + + if self.run_tests and self.spec.satisfies("^openmpi"): + args.append(self.define("MPIEXEC_PREFLAGS", "--oversubscribe")) + + if self.spec.variants["fortran-bindings"].value == True: + args.append( + self.define("OOMPH_FORTRAN_FP", + self.spec.variants["fortran-fp"].value)) + + for backend in self.backends: + args.append( + self.define(f"OOMPH_WITH_{backend.upper()}", + self.spec.variants["backend"].value == backend)) + + if self.spec.satisfies("backend=libfabric"): + args.append( + self.define("OOMPH_LIBFABRIC_PROVIDER", + self.spec.variants["libfabric-provider"].value)) + + return args From a0a2154f507e7326ca90e30b0ca0b2f0290b4fbf Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 4 Feb 2026 14:40:12 +0000 Subject: [PATCH 05/27] GitHub Action: Apply Pep8-formatting --- repos/c2sm/packages/ghex/package.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/repos/c2sm/packages/ghex/package.py b/repos/c2sm/packages/ghex/package.py index fc03b88fbc..7a481c1bb4 100644 --- a/repos/c2sm/packages/ghex/package.py +++ b/repos/c2sm/packages/ghex/package.py @@ -19,9 +19,11 @@ class Ghex(CMakePackage, CudaPackage, ROCmPackage): generator("ninja") backends = ("mpi", "ucx", "libfabric") - variant( - "backend", default="mpi", description="Transport backend", values=backends, multi=False - ) + variant("backend", + default="mpi", + description="Transport backend", + values=backends, + multi=False) variant("xpmem", default=False, description="Use xpmem shared memory") variant("python", default=True, description="Build Python bindings") @@ -57,7 +59,8 @@ def cmake_args(self): self.define("GHEX_USE_BUNDLED_GRIDTOOLS", True), self.define("GHEX_USE_BUNDLED_GTEST", self.run_tests), self.define("GHEX_USE_BUNDLED_OOMPH", False), - self.define("GHEX_TRANSPORT_BACKEND", spec.variants["backend"].value.upper()), + self.define("GHEX_TRANSPORT_BACKEND", + spec.variants["backend"].value.upper()), self.define_from_variant("GHEX_USE_XPMEM", "xpmem"), self.define_from_variant("GHEX_BUILD_PYTHON_BINDINGS", "python"), self.define("GHEX_WITH_TESTING", self.run_tests), From 1da2f65b631360b869c57e710e17a47620aa5385 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Wed, 4 Feb 2026 16:40:25 +0100 Subject: [PATCH 06/27] cleanup --- repos/c2sm/packages/icon-nwp/package.py | 362 ++++++++++++++++++++++++ user-config/repos.yaml | 4 +- 2 files changed, 365 insertions(+), 1 deletion(-) create mode 100644 repos/c2sm/packages/icon-nwp/package.py diff --git a/repos/c2sm/packages/icon-nwp/package.py b/repos/c2sm/packages/icon-nwp/package.py new file mode 100644 index 0000000000..072e37829a --- /dev/null +++ b/repos/c2sm/packages/icon-nwp/package.py @@ -0,0 +1,362 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install icon-nwp +# +# You can edit this file again by typing: +# +# spack edit icon-nwp +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack_repo.builtin.packages.icon.package import Icon +from spack.package import * + + + +def check_variant_fcgroup(fcgroup): + pattern = re.compile(r"^[A-Z]+\..+\..") + # fcgroup is False as default + if pattern.match(fcgroup) or fcgroup == 'none': + return True + else: + tty.warn('Variant fcgroup needs format GROUP.files.flag') + return False + +def check_variant_extra_config_args(extra_config_arg): + pattern = re.compile(r'--(enable|disable)-\S+') + if pattern.match(extra_config_arg) or extra_config_arg == 'none': + return True + else: + tty.warn( + f'The value "{extra_config_arg}" for the extra_config_args variant must follow the format "--enable-arg" or "--disable-arg"' + ) + return False + + +class IconNwp(Icon): + """ICON - is a modeling framework for weather, climate, and environmental prediction. It solves + the full three-dimensional non-hydrostatic and compressible Navier-Stokes equations on an + icosahedral grid and allows seamless predictions from local to global scales. + This is for additional options from the upstream ICON for NWP specific features.""" + + homepage = "https://gitlab.dkrz.de/icon/icon-nwp" + git = 'git@gitlab.dkrz.de:icon/icon-nwp.git' + submodules = True + + maintainers('stelliom', 'leclairm', 'huppd') + + version('develop', submodules=True) + version('2024.10-mch-1.0', tag='icon-2024.10-mch-1.0', submodules=True) + version('2024.01-mch-2.1', tag='icon-2024.01-mch-2.1', submodules=True) + version('2024.01-mch-2.0', tag='icon-2024.01-mch-2.0', submodules=True) + version('2.6.6-mch2b', tag='icon-nwp/icon-2.6.6-mch2b', submodules=True) + version('2.6.6-mch2a', tag='icon-nwp/icon-2.6.6-mch2a', submodules=True) + version('nwp-master', submodules=True) + + # Model Features: + variant('dace', + default=False, + description='Enable the DACE modules for data assimilation') + requires("+mpi", when="+dace") + + variant('emvorado', + default=False, + description='Enable the radar forward operator EMVORADO') + requires("+mpi", when="+emvorado") + + variant('art-gpl', + default=False, + description='Enable GPL-licensed code parts of the ART component') + variant( + 'acm-license', + default=False, + description= + 'Enable code parts that require accepting the ACM Software License') + + # Infrastructural Features: + variant( + 'active-target-sync', + default=False, + description= + 'Enable MPI active target mode (otherwise, passive target mode is used)' + ) + variant('async-io-rma', + default=True, + description='Enable remote memory access (RMA) for async I/O') + variant('realloc-buf', + default=False, + description='Enable reallocatable communication buffer') + variant('sct', default=False, description='Enable the SCT timer') + variant( + 'extra-config-args', + default='none', + multi=True, + values=check_variant_extra_config_args, + description= + 'Inject any configure argument not yet available as variant\nUse this feature cautiously, as injecting non-variant configure arguments may potentially disrupt the build process' + ) + + # Optimization Features: + variant('loop-exchange', default=False, description='Enable loop exchange') + variant('vectorized-lrtm', + default=False, + description='Enable the parallelization-invariant version of LRTM') + variant( + 'pgi-inlib', + default=False, + description= + 'Enable PGI/NVIDIA cross-file function inlining via an inline library') + variant('nccl', default=False, description='Enable NCCL for communication') + + variant('cuda-graphs', default=False, description='Enable CUDA graphs.') + requires('%nvhpc@23.3:', when='+cuda-graphs') + + variant( + 'fcgroup', + default='none', + multi=True, + values=check_variant_fcgroup, + description= + 'Create a Fortran compile group: GROUP;files;flag \nNote: flag can only be one single value, i.e. -O1' + ) + + # verbosity + variant('silent-rules', + default=True, + description='Enable silent-rules for build-process') + + variant( + 'eccodes-definitions', + default=False, + description= + 'Enable extension of eccodes with center specific definition files') + depends_on( + 'eccodes-cosmo-resources', + type='run', + when='+eccodes-definitions' + ) + + with when('+emvorado'): + depends_on('eccodes +fortran') + depends_on('hdf5 +szip +hl +fortran') + depends_on('zlib-ng') + # WORKAROUND: A build and link dependency should imply that the same compiler is used. This enforces it. + depends_on('eccodes %nvhpc', when='%nvhpc') + depends_on('eccodes %gcc', when='%gcc') + + # WORKAROUND: A build and link dependency should imply that the same compiler is used. This enforces it. + for __x in Icon.serialization_values: + depends_on('serialbox+fortran %nvhpc', + when='serialization={0} %nvhpc'.format(__x)) + depends_on('serialbox+fortran %gcc', + when='serialization={0} %gcc'.format(__x)) + + # WORKAROUND: A build and link dependency should imply that the same compiler is used. This enforces it. + depends_on('netcdf-fortran %nvhpc', when='%nvhpc') + depends_on('netcdf-fortran %gcc', when='%gcc') + + depends_on('hdf5 +szip', when='+sct') + + # patch_libtool is a function from Autotoolspackage. + # For BB we cannot use it because it finds all files + # named "libtool". spack-c2sm is cloned into icon-repo, + # therefore this function detects not only "libtool" files, but + # also the folder where libtool package itself is installed. + patch_libtool = False + + def configure_args(self): + args = super().configure_args() + super_libs = args.pop() + + libs = LibraryList([]) + flags = defaultdict(list) + + for x in [ + 'dace', + 'emvorado', + 'art-gpl', + 'acm-license', + 'active-target-sync', + 'async-io-rma', + 'realloc-buf', + 'parallel-netcdf', + 'sct', + 'loop-exchange', + 'vectorized-lrtm', + 'pgi-inlib', + 'nccl', + 'cuda-graphs', + 'silent-rules', + ]: + args += self.enable_or_disable(x) + + if '+emvorado' in self.spec: + libs += self.spec['eccodes:fortran'].libs + libs += self.spec['hdf5:fortran,hl'].libs + libs += self.spec['zlib-ng'].libs + + if '+sct' in self.spec: + libs += self.spec['hdf5'].libs + + fcgroup = self.spec.variants['fcgroup'].value + # ('none',) is the values spack assign if fcgroup is not set + if fcgroup != ('none', ): + args.extend(self.fcgroup_to_config_arg()) + flags.update(self.fcgroup_to_config_var()) + + # add configure arguments not yet available as variant + extra_config_args = self.spec.variants['extra-config-args'].value + if extra_config_args != ('none', ): + for x in extra_config_args: + # prevent configure-args already available as variant + # to be set through variant extra_config_args + self.validate_extra_config_args(x) + args.append(x) + tty.warn( + 'You use variant extra-config-args. Injecting non-variant configure arguments may potentially disrupt the build process!' + ) + + # Help the libtool scripts of the bundled libraries find the correct + # paths to the external libraries. Specify the library search (-L) flags + # in the reversed order + # (see https://gitlab.dkrz.de/icon/icon#icon-dependencies): + # and for non-system directories only: + flags['LDFLAGS'].extend([ + '-L{0}'.format(d) for d in reversed(libs.directories) + if not is_system_path(d) + ]) + + # Temporary back port fix from upstream package for building comin on cpu + # See https://github.com/spack/spack-packages/commit/b992c44bb52d034fe57637f3da42483501442af3 + # TODO: Remove this dupplicate once spack-c2sm points to an upstream spack containing the fix. + if self.spec.variants[ + "gpu"].value in self.nvidia_targets or self.spec.satisfies( + "+comin"): + flags["ICON_LDFLAGS"].extend(self.compiler.stdcxx_libs) + + args.extend([ + "{0}={1}".format(name, " ".join(value)) + for name, value in flags.items() + ]) + args.append(f"{super_libs} {libs.link_flags}") + return args + + def fcgroup_to_config_arg(self): + arg = [] + for group in self.spec.variants['fcgroup'].value: + name = group.split('.')[0] + files = group.split('.')[1] + arg.append(f'--enable-fcgroup-{name}={files}') + return arg + + def fcgroup_to_config_var(self): + var = {} + for group in self.spec.variants['fcgroup'].value: + name = group.split('.')[0] + flag = group.split('.')[2] + # Note: flag needs to be a list + var[f'ICON_{name}_FCFLAGS'] = [flag] + return var + + def strip_variant_prefix(self, variant_string): + prefixes = ["--enable-", "--disable-"] + + for prefix in prefixes: + if variant_string.startswith(prefix): + return variant_string[len(prefix):] + + raise ValueError + + def validate_extra_config_args(self, arg): + variant_from_arg = self.strip_variant_prefix(arg) + if variant_from_arg in self.spec.variants: + raise error.SpecError( + f'The value "{arg}" for the extra_config_args variant conflicts ' + f'with the existing variant {variant_from_arg}. Set this variant instead.' + ) + + def configure(self, spec, prefix): + if os.path.exists( + os.path.join(self.build_directory, + 'icon.mk')) and self.build_uses_same_spec(): + tty.warn( + 'icon.mk already present -> skip configure stage', + '\t delete "icon.mk" or run "make distclean" to not skip configure' + ) + return + + # Call configure of Autotools + super().configure(spec, prefix) + + def build_uses_same_spec(self): + """ + Ensure that configure is rerun in case spec has changed, + otherwise for the case below + + $ spack dev-build icon @develop ~dace + $ spack dev-build icon @develop +dace + + configure is skipped for the latter. + """ + + is_same_spec = False + + previous_spec = os.path.join(self.build_directory, + '.previous_spec.yaml') + + # not the first build in self.build_directory + if os.path.exists(previous_spec): + with open(previous_spec, mode='r') as f: + if self.spec == Spec.from_yaml(f): + is_same_spec = True + else: + is_same_spec = False + tty.warn( + 'Cannot skip configure phase because spec changed') + + # first build in self.build_directory, no worries + else: + is_same_spec = True + + # dump spec of new build + with open(previous_spec, mode='w') as f: + f.write(self.spec.to_yaml()) + + return is_same_spec + + @run_after('configure') + def copy_runscript_related_input_files(self): + with working_dir(self.build_directory): + icon_dir = self.configure_directory + # only synchronize if out-of-source build + if os.path.abspath(icon_dir) != os.path.abspath( + self.build_directory): + Rsync = which('rsync', required=True) + Rsync("-uavz", f"{icon_dir}/run", ".", "--exclude=*.in", + "--exclude=.*", "--exclude=standard_*") + Rsync("-uavz", f"{icon_dir}/externals", ".", "--exclude=.git", + "--exclude=*.f90", "--exclude=*.F90", "--exclude=*.c", + "--exclude=*.h", "--exclude=*.Po", "--exclude=tests", + "--exclude=*.mod", "--exclude=*.o") + Rsync("-uavz", f"{icon_dir}/make_runscripts", ".") + + Ln = which('ln', required=True) + dirs = glob.glob(f"{icon_dir}/run/standard_*") + for dir in dirs: + Ln("-sf", "-t", "run/", f"{dir}") + Ln("-sf", f"{icon_dir}/data") + Ln("-sf", f"{icon_dir}/vertical_coord_tables") + Ln("-sf", f"{icon_dir}/scripts") + + \ No newline at end of file diff --git a/user-config/repos.yaml b/user-config/repos.yaml index 59de8fefc3..4eb687af01 100644 --- a/user-config/repos.yaml +++ b/user-config/repos.yaml @@ -1,2 +1,4 @@ repos: - - '$spack/../repos/c2sm' + c2sm: $spack/../repos/c2sm + builtin: + commit: 5e506ab69aed5199b6d01083016fa592f4fb4296 From a22a3dbd774af5f874cee2a60d5eda4da5826bef Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 4 Feb 2026 15:44:35 +0000 Subject: [PATCH 07/27] GitHub Action: Apply Pep8-formatting --- repos/c2sm/packages/icon-nwp/package.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/repos/c2sm/packages/icon-nwp/package.py b/repos/c2sm/packages/icon-nwp/package.py index 072e37829a..d9f48159cb 100644 --- a/repos/c2sm/packages/icon-nwp/package.py +++ b/repos/c2sm/packages/icon-nwp/package.py @@ -23,7 +23,6 @@ from spack.package import * - def check_variant_fcgroup(fcgroup): pattern = re.compile(r"^[A-Z]+\..+\..") # fcgroup is False as default @@ -33,6 +32,7 @@ def check_variant_fcgroup(fcgroup): tty.warn('Variant fcgroup needs format GROUP.files.flag') return False + def check_variant_extra_config_args(extra_config_arg): pattern = re.compile(r'--(enable|disable)-\S+') if pattern.match(extra_config_arg) or extra_config_arg == 'none': @@ -141,11 +141,9 @@ class IconNwp(Icon): default=False, description= 'Enable extension of eccodes with center specific definition files') - depends_on( - 'eccodes-cosmo-resources', - type='run', - when='+eccodes-definitions' - ) + depends_on('eccodes-cosmo-resources', + type='run', + when='+eccodes-definitions') with when('+emvorado'): depends_on('eccodes +fortran') @@ -358,5 +356,3 @@ def copy_runscript_related_input_files(self): Ln("-sf", f"{icon_dir}/data") Ln("-sf", f"{icon_dir}/vertical_coord_tables") Ln("-sf", f"{icon_dir}/scripts") - - \ No newline at end of file From 0d1e151e4f2f6048655891239b67cab1d6a99c0c Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 5 Feb 2026 10:35:34 +0100 Subject: [PATCH 08/27] polish --- repos/c2sm/packages/icon-nwp/package.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/repos/c2sm/packages/icon-nwp/package.py b/repos/c2sm/packages/icon-nwp/package.py index d9f48159cb..0878567013 100644 --- a/repos/c2sm/packages/icon-nwp/package.py +++ b/repos/c2sm/packages/icon-nwp/package.py @@ -19,6 +19,12 @@ # See the Spack documentation for more information on packaging. # ---------------------------------------------------------------------------- +import os +import os +import re +import glob +from collections import defaultdict + from spack_repo.builtin.packages.icon.package import Icon from spack.package import * @@ -56,13 +62,14 @@ class IconNwp(Icon): maintainers('stelliom', 'leclairm', 'huppd') - version('develop', submodules=True) - version('2024.10-mch-1.0', tag='icon-2024.10-mch-1.0', submodules=True) - version('2024.01-mch-2.1', tag='icon-2024.01-mch-2.1', submodules=True) - version('2024.01-mch-2.0', tag='icon-2024.01-mch-2.0', submodules=True) - version('2.6.6-mch2b', tag='icon-nwp/icon-2.6.6-mch2b', submodules=True) - version('2.6.6-mch2a', tag='icon-nwp/icon-2.6.6-mch2a', submodules=True) - version('nwp-master', submodules=True) + version('develop', branch='master') + version('main', branch='master') + + version('2024.10-mch-1.0', tag='icon-2024.10-mch-1.0', preferred=True) + version('2024.01-mch-2.1', tag='icon-2024.01-mch-2.1') + version('2024.01-mch-2.0', tag='icon-2024.01-mch-2.0') + version('2.6.6-mch2b', tag='icon-nwp/icon-2.6.6-mch2b') + version('2.6.6-mch2a', tag='icon-nwp/icon-2.6.6-mch2a') # Model Features: variant('dace', From 3230acfbdd01a1af9bd45727b487ba5ade18e0fd Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 5 Feb 2026 13:48:59 +0100 Subject: [PATCH 09/27] init icon4py --- repos/c2sm/packages/icon4py/package.py | 150 +++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 repos/c2sm/packages/icon4py/package.py diff --git a/repos/c2sm/packages/icon4py/package.py b/repos/c2sm/packages/icon4py/package.py new file mode 100644 index 0000000000..dc4b40a5af --- /dev/null +++ b/repos/c2sm/packages/icon4py/package.py @@ -0,0 +1,150 @@ +import json +import os +import pathlib + +from llnl.util import tty +from spack import * + + +class Icon4py(Package): + """ICON4Py Python interface package.""" + + homepage = "https://github.com/C2SM/icon4py" + git = "https://github.com/C2SM/icon4py.git" + + # --- Versions --- + version("main", branch="main") + version( + "0.0.14", + sha256="8aadb6fe7af55fc41d09daa4e74739bd7ab01b4e", + extension="zip", + ) + + def url_for_version(self, version): + return f"https://github.com/C2SM/icon4py/archive/refs/tags/v{version}.zip" + + # --- Variants --- + variant("cuda", default=True, description="Enable CUDA support") + variant( + "cuda_arch", + default="none", + description="CUDA architecture (e.g. 80 for A100, 90 for H100)", + values=lambda x: True, # accept any user-specified string + ) + + # --- Dependencies --- + extends("python") + depends_on("python@3.11:") + + depends_on("git") + depends_on("uv@0.7:", type="build") + depends_on("bzip2", type="build") + depends_on("py-numpy") + depends_on("py-cffi") + depends_on("py-pybind11") + depends_on("py-nanobind") + depends_on("py-mpi4py") + + with when("+cuda"): + depends_on("py-cupy +cuda") + depends_on("ghex +python +cuda") + + # --- Environment setup --- + def setup_build_environment(self, env): + """Propagate CUDA architecture to dependencies.""" + cuda_arch = self.spec.variants["cuda_arch"].value + if "+cuda" in self.spec: + if cuda_arch == "none": + tty.warn( + "Building with +cuda but no cuda_arch set. " + "Consider specifying e.g. cuda_arch=80 or cuda_arch=90.") + else: + env.set("SPACK_CUDA_ARCH", cuda_arch) + tty.msg(f"Building for CUDA architecture: {cuda_arch}") + + # --- Build/install logic --- + def install(self, spec, prefix): + uv = prepare_uv() + python_spec = spec["python"] + venv_path = prefix.share.venv + + tty.msg( + f"Creating venv using Spack Python at: {python_spec.command.path}") + uv( + "venv", + "--seed", + "--relocatable", + "--system-site-packages", + str(venv_path), + "--python", + python_spec.command.path, + ) + + tty.msg("Grabbing Spack-installed packages (distributions)") + pip = Executable(venv_path.bin.pip) + spack_installed = get_installed_pkg(pip) + + tty.msg("Installing missing packages via uv sync") + uv( + "sync", + "--active", + "--extra", + "all", + "--extra", + "cuda12", + "--inexact", + "--no-editable", + "--python", + str(venv_path.bin.python), + *no_install_options([*spack_installed, "cupy-cuda12x", "ghex"]), + extra_env={ + "VIRTUAL_ENV": str(venv_path), + "CC": "gcc", + "CXX": "g++", + }, + ) + + tty.msg("Linking Spack-installed packages into venv") + pathlib.Path( + f"{venv_path.lib.python}{python_spec.version.up_to(2)}/site-packages/spack_installed.pth" + ).write_text(pythonpath_to_pth()) + + tty.msg("Running py2fgen code generator") + py2fgen = Executable(venv_path.bin.py2fgen) + py2fgen( + "icon4py.tools.py2fgen.wrappers.all_bindings", + "diffusion_init,diffusion_run,grid_init,solve_nh_init,solve_nh_run", + "icon4py_bindings", + "-o", + prefix.src, + extra_env={ + "VIRTUAL_ENV": str(venv_path), + "CC": "gcc", + "CXX": "g++", + }, + ) + + +def prepare_uv(): + uv = which("uv") + uv.add_default_env("UV_NO_CACHE", "true") + uv.add_default_env("UV_NO_MANAGED_PYTHON", "true") + uv.add_default_env("UV_PYTHON_DOWNLOADS", "never") + return uv + + +def get_installed_pkg(pip): + return [ + item["name"] + for item in json.loads(pip("list", "--format", "json", output=str)) + ] + + +def no_install_options(installed): + for name in installed: + yield "--no-install-package" + yield name + + +def pythonpath_to_pth(): + return "\n".join(os.environ.get("PYTHONPATH", "").split(":")) From de384e548db908f4dd7676ee583470fbc5748f62 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 5 Feb 2026 13:57:28 +0100 Subject: [PATCH 10/27] fix icon4py --- repos/c2sm/packages/icon4py/package.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/repos/c2sm/packages/icon4py/package.py b/repos/c2sm/packages/icon4py/package.py index dc4b40a5af..02664fe31c 100644 --- a/repos/c2sm/packages/icon4py/package.py +++ b/repos/c2sm/packages/icon4py/package.py @@ -2,8 +2,9 @@ import os import pathlib -from llnl.util import tty -from spack import * +from spack.package import * + +from spack_repo.builtin.build_systems.generic import Package class Icon4py(Package): From 6f519e959c33e020d21e7fb2a0fe511e54d364bd Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Thu, 5 Feb 2026 18:32:42 +0100 Subject: [PATCH 11/27] fixes to install on local linux --- repos/c2sm/packages/ghex/package.py | 1 + repos/c2sm/packages/oomph/package.py | 1 + repos/c2sm/packages/uv/package.py | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/repos/c2sm/packages/ghex/package.py b/repos/c2sm/packages/ghex/package.py index 7a481c1bb4..b8f8d99637 100644 --- a/repos/c2sm/packages/ghex/package.py +++ b/repos/c2sm/packages/ghex/package.py @@ -14,6 +14,7 @@ class Ghex(CMakePackage, CudaPackage, ROCmPackage): version("0.3.0", tag="v0.3.0", submodules=True) version("master", branch="master", submodules=True) + depends_on("c", type="build") depends_on("cxx", type="build") generator("ninja") diff --git a/repos/c2sm/packages/oomph/package.py b/repos/c2sm/packages/oomph/package.py index fc7d18080e..1b53a7563c 100644 --- a/repos/c2sm/packages/oomph/package.py +++ b/repos/c2sm/packages/oomph/package.py @@ -24,6 +24,7 @@ class Oomph(CMakePackage, CudaPackage, ROCmPackage): "e342c872dfe4832be047f172dc55c12951950c79da2630b071c61607ef913144") version("main", branch="main") + depends_on("c", type="build") depends_on("cxx", type="build") depends_on("fortran", type="build", when="+fortran-bindings") diff --git a/repos/c2sm/packages/uv/package.py b/repos/c2sm/packages/uv/package.py index f0700fe744..688213037f 100644 --- a/repos/c2sm/packages/uv/package.py +++ b/repos/c2sm/packages/uv/package.py @@ -16,7 +16,7 @@ def translate_arch(arch_name: str) -> str: return "aarch64" if arch_name in ["m1", "m2", "neoverse_v2"]: return "aarch64" - if arch_name in ["zen3"]: + if arch_name in ["zen3", "icelake", "sapphirerapids", "skylake"]: return "x86_64" return "aarch64" From 08bf256166b9d91cfff49e2344482ae98ed80002 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Fri, 6 Feb 2026 11:37:30 +0100 Subject: [PATCH 12/27] cleanup --- repos/c2sm/packages/icon4py/package.py | 29 ++++++++++++++++---------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/repos/c2sm/packages/icon4py/package.py b/repos/c2sm/packages/icon4py/package.py index 02664fe31c..ee471a929d 100644 --- a/repos/c2sm/packages/icon4py/package.py +++ b/repos/c2sm/packages/icon4py/package.py @@ -3,7 +3,6 @@ import pathlib from spack.package import * - from spack_repo.builtin.build_systems.generic import Package @@ -15,11 +14,6 @@ class Icon4py(Package): # --- Versions --- version("main", branch="main") - version( - "0.0.14", - sha256="8aadb6fe7af55fc41d09daa4e74739bd7ab01b4e", - extension="zip", - ) def url_for_version(self, version): return f"https://github.com/C2SM/icon4py/archive/refs/tags/v{version}.zip" @@ -37,6 +31,9 @@ def url_for_version(self, version): extends("python") depends_on("python@3.11:") + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("git") depends_on("uv@0.7:", type="build") depends_on("bzip2", type="build") @@ -50,6 +47,9 @@ def url_for_version(self, version): depends_on("py-cupy +cuda") depends_on("ghex +python +cuda") + with when("~cuda"): + depends_on("ghex +python ~cuda") + # --- Environment setup --- def setup_build_environment(self, env): """Propagate CUDA architecture to dependencies.""" @@ -84,20 +84,27 @@ def install(self, spec, prefix): tty.msg("Grabbing Spack-installed packages (distributions)") pip = Executable(venv_path.bin.pip) spack_installed = get_installed_pkg(pip) + tty.msg(f"Found spack_installed packages: {spack_installed}") + + # --- Handle CUDA vs non-CUDA extras --- + extras = ["all"] + # no_install = [*spack_installed, "ghex", "numba", "llvmlite"] + no_install = [*spack_installed, "ghex"] + + if "+cuda" in spec: + extras.append("cuda12") + no_install.append("cupy-cuda12x") tty.msg("Installing missing packages via uv sync") uv( "sync", "--active", - "--extra", - "all", - "--extra", - "cuda12", + *sum([["--extra", e] for e in extras], []), "--inexact", "--no-editable", "--python", str(venv_path.bin.python), - *no_install_options([*spack_installed, "cupy-cuda12x", "ghex"]), + *no_install_options(no_install), extra_env={ "VIRTUAL_ENV": str(venv_path), "CC": "gcc", From 96a0cd82ba9f3104dcd77ec18737c9944f99400e Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Fri, 6 Feb 2026 12:27:39 +0100 Subject: [PATCH 13/27] rm flf --- repos/c2sm/packages/icon4py/package.py | 1 - 1 file changed, 1 deletion(-) diff --git a/repos/c2sm/packages/icon4py/package.py b/repos/c2sm/packages/icon4py/package.py index ee471a929d..3ae2561a44 100644 --- a/repos/c2sm/packages/icon4py/package.py +++ b/repos/c2sm/packages/icon4py/package.py @@ -88,7 +88,6 @@ def install(self, spec, prefix): # --- Handle CUDA vs non-CUDA extras --- extras = ["all"] - # no_install = [*spack_installed, "ghex", "numba", "llvmlite"] no_install = [*spack_installed, "ghex"] if "+cuda" in spec: From 933724003a8f60afb12b7e3d86f47b1e78971d11 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 6 Feb 2026 11:28:01 +0000 Subject: [PATCH 14/27] GitHub Action: Apply Pep8-formatting --- repos/c2sm/packages/icon4py/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/c2sm/packages/icon4py/package.py b/repos/c2sm/packages/icon4py/package.py index 3ae2561a44..4bd0f4df02 100644 --- a/repos/c2sm/packages/icon4py/package.py +++ b/repos/c2sm/packages/icon4py/package.py @@ -98,7 +98,7 @@ def install(self, spec, prefix): uv( "sync", "--active", - *sum([["--extra", e] for e in extras], []), + *sum([["--extra", e] for e in extras], []), "--inexact", "--no-editable", "--python", From 363a4b5ecf8f31c2e56db66badff112dc850c7c3 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Fri, 6 Feb 2026 17:46:42 +0100 Subject: [PATCH 15/27] fix icon4py --- repos/c2sm/packages/icon4py/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/c2sm/packages/icon4py/package.py b/repos/c2sm/packages/icon4py/package.py index 4bd0f4df02..dc4d1b50a0 100644 --- a/repos/c2sm/packages/icon4py/package.py +++ b/repos/c2sm/packages/icon4py/package.py @@ -29,7 +29,7 @@ def url_for_version(self, version): # --- Dependencies --- extends("python") - depends_on("python@3.11:") + depends_on("python@3.11:3.12") depends_on("c", type="build") depends_on("cxx", type="build") From 09501e1b98ab9b058d1b9be4501b83a2b43b29aa Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Fri, 6 Feb 2026 18:00:40 +0100 Subject: [PATCH 16/27] fix doc and test --- docs/CodeDevelopment.rst | 6 +++--- docs/QuickStart.rst | 14 +++++++------- test/balfrin_system_test.py | 2 +- test/common_system_test.py | 2 +- test/integration_test.py | 6 +++--- test/santis_system_test.py | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/CodeDevelopment.rst b/docs/CodeDevelopment.rst index ce73988233..aae67de242 100644 --- a/docs/CodeDevelopment.rst +++ b/docs/CodeDevelopment.rst @@ -21,7 +21,7 @@ For more information about environments in general, consider reading the spack: # add package specs to the `specs` list specs: - - icon@develop%nvhpc +ecrad +rte-rrtmgp +cuda + - icon-nwp@develop%nvhpc +ecrad +rte-rrtmgp +cuda - eccodes@2.19.0%nvhpc - nvidia-blas%nvhpc - nvidia-lapack%nvhpc @@ -30,8 +30,8 @@ For more information about environments in general, consider reading the concretizer: unify: true develop: - icon: - spec: icon@develop%nvhpc +ecrad +rte-rrtmgp +cuda + icon-nwp: + spec: icon-nwp@develop%nvhpc +ecrad +rte-rrtmgp +cuda path: ../../../../ The key part of the environments is the ``develop`` keyword. diff --git a/docs/QuickStart.rst b/docs/QuickStart.rst index d569257336..1caca43ea3 100644 --- a/docs/QuickStart.rst +++ b/docs/QuickStart.rst @@ -43,7 +43,7 @@ To get information about a package, query Spack $ spack info # e.g. - $ spack info icon + $ spack info icon-nwp To see what ``spack install`` would install, ask for a spec @@ -51,7 +51,7 @@ To see what ``spack install`` would install, ask for a spec $ spack spec # e.g. - $ spack spec icon @master +ocean + $ spack spec icon-nwp @master +ocean An unspecfied variant (e.g. ``ocean``) can be concretized to ANY of its values. Spack isn't required to use the default value when a variant is unspecified. The default value only serves as a tiebreaker. @@ -61,7 +61,7 @@ To install a package $ spack install # e.g. - $ spack install icon @master %gcc +ocean + $ spack install icon-nwp @master %gcc +ocean To locate your install, query Spack @@ -131,7 +131,7 @@ To install the environment and so ICON, type .. code-block:: console - $ spack develop --path $(pwd) icon@develop + $ spack develop --path $(pwd) icon-nwp@develop $ spack install Example to build ICON for CPU with NVHPC on Balfrin: @@ -140,7 +140,7 @@ Example to build ICON for CPU with NVHPC on Balfrin: $ SPACK_TAG=$(cat "config/cscs/SPACK_TAG_MCH") $ spack env activate -d config/cscs/spack/mch_cpu_double - $ spack develop --path $(pwd) icon@develop + $ spack develop --path $(pwd) icon-nwp@develop $ spack install .. attention:: @@ -154,7 +154,7 @@ Out-of-source builds are possible as follows: $ mkdir cpu $ spack env activate -d config/cscs/spack/mch_cpu_double $ # tell spack to build icon in folder cpu - $ spack develop --path $(pwd) --build-directory cpu icon@develop + $ spack develop --path $(pwd) --build-directory cpu icon-nwp@develop $ spack install By executing the commands above, spack will add some lines directly into ``spack.yaml``: @@ -163,7 +163,7 @@ By executing the commands above, spack will add some lines directly into ``spack spack: packages: - icon: + icon-nwp: package_attributes: build_directory: /scratch/mch/juckerj/icon-nwp/cpu diff --git a/test/balfrin_system_test.py b/test/balfrin_system_test.py index 966aaeea96..3434b7d10a 100644 --- a/test/balfrin_system_test.py +++ b/test/balfrin_system_test.py @@ -12,7 +12,7 @@ def test_install_icon_conditional_dependencies(): # WORKAROUND: A build and link dependency should imply that the same compiler is used. ^cray-mpich%nvhpc enforces it. spack_install( - 'icon @2024.10-mch-1.0 %nvhpc +coupling serialization=create +emvorado +mpi gpu=nvidia-80 ^cray-mpich%nvhpc' + 'icon-nwp @2024.10-mch-1.0 %nvhpc +coupling serialization=create +emvorado +mpi gpu=nvidia-80 ^cray-mpich%nvhpc' ) diff --git a/test/common_system_test.py b/test/common_system_test.py index 439a9642f0..a1e6b2f915 100644 --- a/test/common_system_test.py +++ b/test/common_system_test.py @@ -32,7 +32,7 @@ def test_install_makedepf90(): ['2024.10', '2024.10-mch-1.0', '2.6.6-mch2b']) def test_install_icon(version): # WORKAROUND: A build and link dependency should imply that the same compiler is used. ^cray-mpich%nvhpc enforces it. - spack_install(f'icon @{version} %nvhpc ^cray-mpich%nvhpc') + spack_install(f'icon-nwp @{version} %nvhpc ^cray-mpich%nvhpc') # make check of external cdi fails with diff --git a/test/integration_test.py b/test/integration_test.py index c462417075..4931db57f5 100644 --- a/test/integration_test.py +++ b/test/integration_test.py @@ -21,16 +21,16 @@ def test_spec(package: str): def test_icon_serialization(): - spack_spec("icon serialization=create") + spack_spec("icon-nwp serialization=create") def test_icon_fcgroup(): - spack_spec("icon fcgroup=DACE.externals/dace_icon.-O1") + spack_spec("icon-nwp fcgroup=DACE.externals/dace_icon.-O1") def test_icon_extra_config_args(): spack_spec( - "icon extra-config-args=--disable-new_feature,--enable-old_config_arg") + "icon-nwp extra-config-args=--disable-new_feature,--enable-old_config_arg") def test_compilers(): diff --git a/test/santis_system_test.py b/test/santis_system_test.py index 7e4e238337..3163249f4c 100644 --- a/test/santis_system_test.py +++ b/test/santis_system_test.py @@ -13,5 +13,5 @@ def test_install_icon_conditional_dependencies(): # WORKAROUND: A build and link dependency should imply that the same compiler is used. ^cray-mpich%nvhpc enforces it. spack_install( - 'icon @2024.10-mch-1.0 %nvhpc +coupling +emvorado +mpi gpu=nvidia-90 ^cray-mpich%nvhpc' + 'icon-nwp @2024.10-mch-1.0 %nvhpc +coupling +emvorado +mpi gpu=nvidia-90 ^cray-mpich%nvhpc' ) From f7415fc4fdadb8686e511b631dd10adbaacfd42f Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 6 Feb 2026 17:00:59 +0000 Subject: [PATCH 17/27] GitHub Action: Apply Pep8-formatting --- test/integration_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/integration_test.py b/test/integration_test.py index 4931db57f5..ea9b6b6fd8 100644 --- a/test/integration_test.py +++ b/test/integration_test.py @@ -30,7 +30,8 @@ def test_icon_fcgroup(): def test_icon_extra_config_args(): spack_spec( - "icon-nwp extra-config-args=--disable-new_feature,--enable-old_config_arg") + "icon-nwp extra-config-args=--disable-new_feature,--enable-old_config_arg" + ) def test_compilers(): From c8a1e2ba173caf35bb15fdcfd3b4a7e160842846 Mon Sep 17 00:00:00 2001 From: Mikael Stellio <67868694+stelliom@users.noreply.github.com> Date: Fri, 6 Feb 2026 10:10:44 +0100 Subject: [PATCH 18/27] Update CI (#1068) --- .github/workflows/short_pr_tests.yml | 43 ++++++++++++++++++++++++++++ Jenkinsfile | 17 ----------- README.md | 12 ++++++++ cscs.yml | 19 ------------ 4 files changed, 55 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/short_pr_tests.yml diff --git a/.github/workflows/short_pr_tests.yml b/.github/workflows/short_pr_tests.yml new file mode 100644 index 0000000000..c2a7ae8d00 --- /dev/null +++ b/.github/workflows/short_pr_tests.yml @@ -0,0 +1,43 @@ +name: Short tests for PR +on: + pull_request: + branches: + - main + push: + branches: + - main + workflow_dispatch: + +env: + NTHREADS: 2 +jobs: + short-tests: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 1 # --depth 1 and --shallow-submodules + submodules: recursive # --recurse-submodules + + - name: Create Python VENV + run: | + python3 -m venv .venv + source .venv/bin/activate + pip install -r requirements.txt + + - name: Spack spec test + run: | + source ./setup-env.sh + spack spec gnuconfig + + - name: Unit test + run: | + source .venv/bin/activate + python3 test/unit_test.py + + - name: Integration test + run: | + source ./setup-env.sh + source .venv/bin/activate + pytest -v -n ${NTHREADS} test/integration_test.py \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index f520fcc44c..dea9ea4f89 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,23 +45,6 @@ pipeline { """ } } - stage('Unit Tests') { - steps { - sh """ - source .venv/bin/activate - python3 test/unit_test.py - """ - } - } - stage('Integration Tests') { - steps { - sh """ - source ./setup-env.sh ${upstream} - source .venv/bin/activate - pytest -v -n ${NTHREADS} test/integration_test.py - """ - } - } stage('System Tests') { steps { sh """ diff --git a/README.md b/README.md index 15107dea25..e56b00803e 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,18 @@ rm -rf ~/.spack ``` After an update we advice to rebuild packages, preferably in a new shell so that no outdated shell variables are retained. +## Testing strategy +For more information on the different types of tests see the [README in the test directory](test/README.md). + +### PR tests +To merge PRs into the `main` branch we require short (taking ~5 minutes) [unit](test/unit_test.py) and [integration](test/intergation_test.py) tests to run successfully. These tests are ran via a GitHub Action that runs automatically after any push to a PR branch. + +### Nightly tests +Each day at 3 a.m. [system tests](test/common_system_test.py) run on [Säntis](test/santis_system_test.py) (via CSCS CI) and [Balfrin](test/balfrin_system_test.py) (via Jenkins) to test the installation of different packages with Spack on the systems. Since these tests may take longer to complete we decided to not require them to merge PRs, however special comments can still be used on PRs to trigger them nonetheless: + +- For Säntis: type `cscs-ci run` in a PR comment. +- For Balfrin: type `launch jenkins` in a PR comment. + ## Releases/Tags Release tags are created by the Spack-Admin GitHub Team as needed or upon request. The creation of a new release tag is coordinated within the admin team. diff --git a/cscs.yml b/cscs.yml index 29719c4aa5..13897c5870 100644 --- a/cscs.yml +++ b/cscs.yml @@ -36,16 +36,6 @@ stages: - uenv image pull ${UENV} -Unit Test: - extends: .baremetal-runner-santis-gh200 - stage: test - timeout: 6h - script: - - !reference [.setup_python, script] - - python3 test/unit_test.py - variables: - SLURM_TIMELIMIT: 00:10:00 - .test_common: extends: .baremetal-runner-santis-gh200 variables: @@ -61,14 +51,6 @@ Unit Test: - log/**/* when: always -Integration Test: - extends: .test_common - timeout: 6h - stage: test - variables: - TEST: test/integration_test.py - SLURM_TIMELIMIT: '01:00:00' - System Test: extends: .test_common timeout: 6h @@ -89,7 +71,6 @@ Collect Logfiles: - cat log/artifacts_summary.html when: always needs: - - Integration Test - System Test artifacts: paths: From 2e495129714ae076c5aa21a7e14a6591be60b8ff Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 9 Feb 2026 09:22:07 +0100 Subject: [PATCH 19/27] make compiler more flexible --- repos/c2sm/packages/icon4py/package.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/repos/c2sm/packages/icon4py/package.py b/repos/c2sm/packages/icon4py/package.py index dc4d1b50a0..03750ebd0a 100644 --- a/repos/c2sm/packages/icon4py/package.py +++ b/repos/c2sm/packages/icon4py/package.py @@ -106,8 +106,8 @@ def install(self, spec, prefix): *no_install_options(no_install), extra_env={ "VIRTUAL_ENV": str(venv_path), - "CC": "gcc", - "CXX": "g++", + "CC": self.compiler.cc, + "CXX": self.compiler.cxx, }, ) @@ -126,8 +126,8 @@ def install(self, spec, prefix): prefix.src, extra_env={ "VIRTUAL_ENV": str(venv_path), - "CC": "gcc", - "CXX": "g++", + "CC": self.compiler.cc, + "CXX": self.compiler.cxx, }, ) From 9f9f14689897413b6a58be152a1de28c6a1c53dc Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 9 Feb 2026 09:57:23 +0100 Subject: [PATCH 20/27] rm header --- repos/c2sm/packages/icon-nwp/package.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/repos/c2sm/packages/icon-nwp/package.py b/repos/c2sm/packages/icon-nwp/package.py index 0878567013..3d88d60935 100644 --- a/repos/c2sm/packages/icon-nwp/package.py +++ b/repos/c2sm/packages/icon-nwp/package.py @@ -1,24 +1,3 @@ -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install icon-nwp -# -# You can edit this file again by typing: -# -# spack edit icon-nwp -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- - import os import os import re From 3ade49e5061513f8bc2e0b3d5196cbbfa152548b Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 9 Feb 2026 12:57:13 +0100 Subject: [PATCH 21/27] add icon-exclaim --- repos/c2sm/packages/icon-exclaim/package.py | 119 ++++++++ repos/c2sm/packages/icon-nwp/package.py | 322 +++++++++++--------- 2 files changed, 293 insertions(+), 148 deletions(-) create mode 100644 repos/c2sm/packages/icon-exclaim/package.py diff --git a/repos/c2sm/packages/icon-exclaim/package.py b/repos/c2sm/packages/icon-exclaim/package.py new file mode 100644 index 0000000000..85abfc518b --- /dev/null +++ b/repos/c2sm/packages/icon-exclaim/package.py @@ -0,0 +1,119 @@ +import shutil +import os + +import spack.error as error +from spack.package import * + +from spack.pkg.c2sm.icon_nwp import IconNwp + + +def validate_variant_dsl(pkg, name, value): + set_mutual_excl = set(['substitute', 'verify', 'serialize']) + set_input_var = set(value) + if len(set_mutual_excl.intersection(set_input_var)) > 1: + raise error.SpecError( + 'Cannot have more than one of (substitute, verify, serialize) in the same build' + ) + +class IconExclaim(IconNwp): + """ICON - is a modeling framework for weather, climate, and environmental + prediction. + It solves the full three-dimensional non-hydrostatic and compressible + Navier-Stokes equations on an icosahedral grid and allows seamless + predictions from local to global scales. + This is for additional options from the upstream ICON-NWP for exclaime + specific features.""" + + git = 'git@github.com:C2SM/icon-exclaim.git' + + maintainers('stelliom', 'leclairm', 'huppd') + + version('develop', branch='icon-dsl', submodules=True) + + # EXCLAIM-GT4Py specific features: + dsl_values = ('substitute', 'verify') + variant('dsl', + default='none', + validator=validate_variant_dsl, + values=('none', ) + dsl_values, + description='Build with GT4Py dynamical core', + multi=True) + + for x in dsl_values: + depends_on('icon4py', type="build", when=f"dsl={x}") + + def configure_args(self): + raw_args = super().configure_args() + + # Split into categories + args_flags = [] + icon_ldflags = [] + ldflags = [] + libs = [] + + for a in raw_args: + if a.startswith("LIBS="): + libs.append(a.split("=", 1)[1].strip()) + elif a.startswith("ICON_LDFLAGS="): + icon_ldflags.append(a.split("=", 1)[1].strip()) + elif a.startswith("LDFLAGS="): + ldflags.append(a.split("=", 1)[1].strip()) + else: + args_flags.append(a) + + # Handle DSL variants + dsl = self.spec.variants['dsl'].value + if dsl != ('none', ): + if 'substitute' in dsl: + args_flags.append('--enable-py2f=substitute') + elif 'verify' in dsl: + args_flags.append('--enable-py2f=verify') + else: + raise ValueError( + f"Unknown DSL variant '{dsl}'. " + f"Valid options are: {', '.join(('none',) + dsl_values)}") + + # Add icon4py paths and libs + icon4py_prefix = self.spec["icon4py"].prefix + bindings_dir = os.path.join(icon4py_prefix, "src") + + ldflags.append(f"-L{bindings_dir} -Wl,-rpath,{bindings_dir}") + libs.append("-licon4py_bindings") + + # Remove duplicates + icon_ldflags = list(dict.fromkeys(icon_ldflags)) + ldflags = list(dict.fromkeys(ldflags)) + libs = list(dict.fromkeys(libs)) + + # Reconstruct final configure args + final_args = args_flags + if icon_ldflags: + final_args.append("ICON_LDFLAGS=" + " ".join(icon_ldflags)) + if ldflags: + final_args.append("LDFLAGS=" + " ".join(ldflags)) + if libs: + final_args.append("LIBS=" + " ".join(libs)) + + return final_args + + def build(self, spec, prefix): + # Check the variant + dsl = self.spec.variants['dsl'].value + if dsl != ('none', ): + file = "icon4py_bindings.f90" + + bindings_dir = os.path.join(self.spec["icon4py"].prefix, "src") + src_file = os.path.join(bindings_dir, file) + + build_py2f_dir = os.path.join(self.stage.source_path, "src", + "build_py2f") + os.makedirs(build_py2f_dir, exist_ok=True) + dest_file = os.path.join(build_py2f_dir, file) + + shutil.copy2(src_file, dest_file) + print( + f"Copied {src_file} to build directory {dest_file} because +dsl is enabled" + ) + + # Proceed with the normal build + super().build(spec, prefix) \ No newline at end of file diff --git a/repos/c2sm/packages/icon-nwp/package.py b/repos/c2sm/packages/icon-nwp/package.py index 3d88d60935..9d36f71374 100644 --- a/repos/c2sm/packages/icon-nwp/package.py +++ b/repos/c2sm/packages/icon-nwp/package.py @@ -1,5 +1,4 @@ import os -import os import re import glob from collections import defaultdict @@ -11,16 +10,16 @@ def check_variant_fcgroup(fcgroup): pattern = re.compile(r"^[A-Z]+\..+\..") # fcgroup is False as default - if pattern.match(fcgroup) or fcgroup == 'none': + if pattern.match(fcgroup) or fcgroup == "none": return True else: - tty.warn('Variant fcgroup needs format GROUP.files.flag') + tty.warn("Variant fcgroup needs format GROUP.files.flag") return False def check_variant_extra_config_args(extra_config_arg): - pattern = re.compile(r'--(enable|disable)-\S+') - if pattern.match(extra_config_arg) or extra_config_arg == 'none': + pattern = re.compile(r"--(enable|disable)-\S+") + if pattern.match(extra_config_arg) or extra_config_arg == "none": return True else: tty.warn( @@ -30,127 +29,138 @@ def check_variant_extra_config_args(extra_config_arg): class IconNwp(Icon): - """ICON - is a modeling framework for weather, climate, and environmental prediction. It solves - the full three-dimensional non-hydrostatic and compressible Navier-Stokes equations on an - icosahedral grid and allows seamless predictions from local to global scales. + """ICON - is a modeling framework for weather, climate, and environmental + prediction. + It solves the full three-dimensional non-hydrostatic and compressible + Navier-Stokes equations on an icosahedral grid and allows seamless + predictions from local to global scales. This is for additional options from the upstream ICON for NWP specific features.""" homepage = "https://gitlab.dkrz.de/icon/icon-nwp" - git = 'git@gitlab.dkrz.de:icon/icon-nwp.git' + git = "git@gitlab.dkrz.de:icon/icon-nwp.git" submodules = True - maintainers('stelliom', 'leclairm', 'huppd') + maintainers("stelliom", "leclairm", "huppd") - version('develop', branch='master') - version('main', branch='master') + version("develop", branch="master") + version("main", branch="master") - version('2024.10-mch-1.0', tag='icon-2024.10-mch-1.0', preferred=True) - version('2024.01-mch-2.1', tag='icon-2024.01-mch-2.1') - version('2024.01-mch-2.0', tag='icon-2024.01-mch-2.0') - version('2.6.6-mch2b', tag='icon-nwp/icon-2.6.6-mch2b') - version('2.6.6-mch2a', tag='icon-nwp/icon-2.6.6-mch2a') + version("2024.10-mch-1.0", tag="icon-2024.10-mch-1.0", preferred=True) + version("2024.01-mch-2.1", tag="icon-2024.01-mch-2.1") + version("2024.01-mch-2.0", tag="icon-2024.01-mch-2.0") + version("2.6.6-mch2b", tag="icon-nwp/icon-2.6.6-mch2b") + version("2.6.6-mch2a", tag="icon-nwp/icon-2.6.6-mch2a") # Model Features: - variant('dace', - default=False, - description='Enable the DACE modules for data assimilation') + variant( + "dace", + default=False, + description="Enable the DACE modules for data assimilation", + ) requires("+mpi", when="+dace") - variant('emvorado', - default=False, - description='Enable the radar forward operator EMVORADO') + variant( + "emvorado", + default=False, + description="Enable the radar forward operator EMVORADO", + ) requires("+mpi", when="+emvorado") - variant('art-gpl', - default=False, - description='Enable GPL-licensed code parts of the ART component') variant( - 'acm-license', + "art-gpl", default=False, - description= - 'Enable code parts that require accepting the ACM Software License') + description="Enable GPL-licensed code parts of the ART component", + ) + variant( + "acm-license", + default=False, + description="Enable code parts that require accepting the ACM Software License", + ) # Infrastructural Features: variant( - 'active-target-sync', + "active-target-sync", default=False, - description= - 'Enable MPI active target mode (otherwise, passive target mode is used)' + description="Enable MPI active target mode (otherwise, passive target mode is used)", ) - variant('async-io-rma', - default=True, - description='Enable remote memory access (RMA) for async I/O') - variant('realloc-buf', - default=False, - description='Enable reallocatable communication buffer') - variant('sct', default=False, description='Enable the SCT timer') variant( - 'extra-config-args', - default='none', + "async-io-rma", + default=True, + description="Enable remote memory access (RMA) for async I/O", + ) + variant( + "realloc-buf", + default=False, + description="Enable reallocatable communication buffer", + ) + variant("sct", default=False, description="Enable the SCT timer") + variant( + "extra-config-args", + default="none", multi=True, values=check_variant_extra_config_args, - description= - 'Inject any configure argument not yet available as variant\nUse this feature cautiously, as injecting non-variant configure arguments may potentially disrupt the build process' + description="Inject any configure argument not yet available as variant\nUse this feature cautiously, as injecting non-variant configure arguments may potentially disrupt the build process", ) # Optimization Features: - variant('loop-exchange', default=False, description='Enable loop exchange') - variant('vectorized-lrtm', - default=False, - description='Enable the parallelization-invariant version of LRTM') + variant("loop-exchange", default=False, description="Enable loop exchange") variant( - 'pgi-inlib', + "vectorized-lrtm", default=False, - description= - 'Enable PGI/NVIDIA cross-file function inlining via an inline library') - variant('nccl', default=False, description='Enable NCCL for communication') + description="Enable the parallelization-invariant version of LRTM", + ) + variant( + "pgi-inlib", + default=False, + description="Enable PGI/NVIDIA cross-file function inlining via an inline library", + ) + variant("nccl", default=False, description="Enable NCCL for communication") - variant('cuda-graphs', default=False, description='Enable CUDA graphs.') - requires('%nvhpc@23.3:', when='+cuda-graphs') + variant("cuda-graphs", default=False, description="Enable CUDA graphs.") + requires("%nvhpc@23.3:", when="+cuda-graphs") variant( - 'fcgroup', - default='none', + "fcgroup", + default="none", multi=True, values=check_variant_fcgroup, - description= - 'Create a Fortran compile group: GROUP;files;flag \nNote: flag can only be one single value, i.e. -O1' + description="Create a Fortran compile group: GROUP;files;flag \nNote: flag can only be one single value, i.e. -O1", ) # verbosity - variant('silent-rules', - default=True, - description='Enable silent-rules for build-process') + variant( + "silent-rules", + default=True, + description="Enable silent-rules for build-process", + ) variant( - 'eccodes-definitions', + "eccodes-definitions", default=False, - description= - 'Enable extension of eccodes with center specific definition files') - depends_on('eccodes-cosmo-resources', - type='run', - when='+eccodes-definitions') - - with when('+emvorado'): - depends_on('eccodes +fortran') - depends_on('hdf5 +szip +hl +fortran') - depends_on('zlib-ng') + description="Enable extension of eccodes with center specific definition files", + ) + depends_on("eccodes-cosmo-resources", type="run", when="+eccodes-definitions") + + with when("+emvorado"): + depends_on("eccodes +fortran") + depends_on("hdf5 +szip +hl +fortran") + depends_on("zlib-ng") # WORKAROUND: A build and link dependency should imply that the same compiler is used. This enforces it. - depends_on('eccodes %nvhpc', when='%nvhpc') - depends_on('eccodes %gcc', when='%gcc') + depends_on("eccodes %nvhpc", when="%nvhpc") + depends_on("eccodes %gcc", when="%gcc") # WORKAROUND: A build and link dependency should imply that the same compiler is used. This enforces it. for __x in Icon.serialization_values: - depends_on('serialbox+fortran %nvhpc', - when='serialization={0} %nvhpc'.format(__x)) - depends_on('serialbox+fortran %gcc', - when='serialization={0} %gcc'.format(__x)) + depends_on( + "serialbox+fortran %nvhpc", when="serialization={0} %nvhpc".format(__x) + ) + depends_on("serialbox+fortran %gcc", when="serialization={0} %gcc".format(__x)) # WORKAROUND: A build and link dependency should imply that the same compiler is used. This enforces it. - depends_on('netcdf-fortran %nvhpc', when='%nvhpc') - depends_on('netcdf-fortran %gcc', when='%gcc') + depends_on("netcdf-fortran %nvhpc", when="%nvhpc") + depends_on("netcdf-fortran %gcc", when="%gcc") - depends_on('hdf5 +szip', when='+sct') + depends_on("hdf5 +szip", when="+sct") # patch_libtool is a function from Autotoolspackage. # For BB we cannot use it because it finds all files @@ -167,48 +177,48 @@ def configure_args(self): flags = defaultdict(list) for x in [ - 'dace', - 'emvorado', - 'art-gpl', - 'acm-license', - 'active-target-sync', - 'async-io-rma', - 'realloc-buf', - 'parallel-netcdf', - 'sct', - 'loop-exchange', - 'vectorized-lrtm', - 'pgi-inlib', - 'nccl', - 'cuda-graphs', - 'silent-rules', + "dace", + "emvorado", + "art-gpl", + "acm-license", + "active-target-sync", + "async-io-rma", + "realloc-buf", + "parallel-netcdf", + "sct", + "loop-exchange", + "vectorized-lrtm", + "pgi-inlib", + "nccl", + "cuda-graphs", + "silent-rules", ]: args += self.enable_or_disable(x) - if '+emvorado' in self.spec: - libs += self.spec['eccodes:fortran'].libs - libs += self.spec['hdf5:fortran,hl'].libs - libs += self.spec['zlib-ng'].libs + if "+emvorado" in self.spec: + libs += self.spec["eccodes:fortran"].libs + libs += self.spec["hdf5:fortran,hl"].libs + libs += self.spec["zlib-ng"].libs - if '+sct' in self.spec: - libs += self.spec['hdf5'].libs + if "+sct" in self.spec: + libs += self.spec["hdf5"].libs - fcgroup = self.spec.variants['fcgroup'].value + fcgroup = self.spec.variants["fcgroup"].value # ('none',) is the values spack assign if fcgroup is not set - if fcgroup != ('none', ): + if fcgroup != ("none",): args.extend(self.fcgroup_to_config_arg()) flags.update(self.fcgroup_to_config_var()) # add configure arguments not yet available as variant - extra_config_args = self.spec.variants['extra-config-args'].value - if extra_config_args != ('none', ): + extra_config_args = self.spec.variants["extra-config-args"].value + if extra_config_args != ("none",): for x in extra_config_args: # prevent configure-args already available as variant # to be set through variant extra_config_args self.validate_extra_config_args(x) args.append(x) tty.warn( - 'You use variant extra-config-args. Injecting non-variant configure arguments may potentially disrupt the build process!' + "You use variant extra-config-args. Injecting non-variant configure arguments may potentially disrupt the build process!" ) # Help the libtool scripts of the bundled libraries find the correct @@ -216,41 +226,43 @@ def configure_args(self): # in the reversed order # (see https://gitlab.dkrz.de/icon/icon#icon-dependencies): # and for non-system directories only: - flags['LDFLAGS'].extend([ - '-L{0}'.format(d) for d in reversed(libs.directories) - if not is_system_path(d) - ]) + flags["LDFLAGS"].extend( + [ + "-L{0}".format(d) + for d in reversed(libs.directories) + if not is_system_path(d) + ] + ) # Temporary back port fix from upstream package for building comin on cpu # See https://github.com/spack/spack-packages/commit/b992c44bb52d034fe57637f3da42483501442af3 # TODO: Remove this dupplicate once spack-c2sm points to an upstream spack containing the fix. if self.spec.variants[ - "gpu"].value in self.nvidia_targets or self.spec.satisfies( - "+comin"): + "gpu" + ].value in self.nvidia_targets or self.spec.satisfies("+comin"): flags["ICON_LDFLAGS"].extend(self.compiler.stdcxx_libs) - args.extend([ - "{0}={1}".format(name, " ".join(value)) - for name, value in flags.items() - ]) + args.extend( + ["{0}={1}".format(name, " ".join(value)) for name, value in flags.items()] + ) args.append(f"{super_libs} {libs.link_flags}") return args def fcgroup_to_config_arg(self): arg = [] - for group in self.spec.variants['fcgroup'].value: - name = group.split('.')[0] - files = group.split('.')[1] - arg.append(f'--enable-fcgroup-{name}={files}') + for group in self.spec.variants["fcgroup"].value: + name = group.split(".")[0] + files = group.split(".")[1] + arg.append(f"--enable-fcgroup-{name}={files}") return arg def fcgroup_to_config_var(self): var = {} - for group in self.spec.variants['fcgroup'].value: - name = group.split('.')[0] - flag = group.split('.')[2] + for group in self.spec.variants["fcgroup"].value: + name = group.split(".")[0] + flag = group.split(".")[2] # Note: flag needs to be a list - var[f'ICON_{name}_FCFLAGS'] = [flag] + var[f"ICON_{name}_FCFLAGS"] = [flag] return var def strip_variant_prefix(self, variant_string): @@ -258,7 +270,7 @@ def strip_variant_prefix(self, variant_string): for prefix in prefixes: if variant_string.startswith(prefix): - return variant_string[len(prefix):] + return variant_string[len(prefix) :] raise ValueError @@ -267,16 +279,17 @@ def validate_extra_config_args(self, arg): if variant_from_arg in self.spec.variants: raise error.SpecError( f'The value "{arg}" for the extra_config_args variant conflicts ' - f'with the existing variant {variant_from_arg}. Set this variant instead.' + f"with the existing variant {variant_from_arg}. Set this variant instead." ) def configure(self, spec, prefix): - if os.path.exists( - os.path.join(self.build_directory, - 'icon.mk')) and self.build_uses_same_spec(): + if ( + os.path.exists(os.path.join(self.build_directory, "icon.mk")) + and self.build_uses_same_spec() + ): tty.warn( - 'icon.mk already present -> skip configure stage', - '\t delete "icon.mk" or run "make distclean" to not skip configure' + "icon.mk already present -> skip configure stage", + '\t delete "icon.mk" or run "make distclean" to not skip configure', ) return @@ -296,46 +309,59 @@ def build_uses_same_spec(self): is_same_spec = False - previous_spec = os.path.join(self.build_directory, - '.previous_spec.yaml') + previous_spec = os.path.join(self.build_directory, ".previous_spec.yaml") # not the first build in self.build_directory if os.path.exists(previous_spec): - with open(previous_spec, mode='r') as f: + with open(previous_spec, mode="r") as f: if self.spec == Spec.from_yaml(f): is_same_spec = True else: is_same_spec = False - tty.warn( - 'Cannot skip configure phase because spec changed') + tty.warn("Cannot skip configure phase because spec changed") # first build in self.build_directory, no worries else: is_same_spec = True # dump spec of new build - with open(previous_spec, mode='w') as f: + with open(previous_spec, mode="w") as f: f.write(self.spec.to_yaml()) return is_same_spec - @run_after('configure') + @run_after("configure") def copy_runscript_related_input_files(self): with working_dir(self.build_directory): icon_dir = self.configure_directory # only synchronize if out-of-source build - if os.path.abspath(icon_dir) != os.path.abspath( - self.build_directory): - Rsync = which('rsync', required=True) - Rsync("-uavz", f"{icon_dir}/run", ".", "--exclude=*.in", - "--exclude=.*", "--exclude=standard_*") - Rsync("-uavz", f"{icon_dir}/externals", ".", "--exclude=.git", - "--exclude=*.f90", "--exclude=*.F90", "--exclude=*.c", - "--exclude=*.h", "--exclude=*.Po", "--exclude=tests", - "--exclude=*.mod", "--exclude=*.o") + if os.path.abspath(icon_dir) != os.path.abspath(self.build_directory): + Rsync = which("rsync", required=True) + Rsync( + "-uavz", + f"{icon_dir}/run", + ".", + "--exclude=*.in", + "--exclude=.*", + "--exclude=standard_*", + ) + Rsync( + "-uavz", + f"{icon_dir}/externals", + ".", + "--exclude=.git", + "--exclude=*.f90", + "--exclude=*.F90", + "--exclude=*.c", + "--exclude=*.h", + "--exclude=*.Po", + "--exclude=tests", + "--exclude=*.mod", + "--exclude=*.o", + ) Rsync("-uavz", f"{icon_dir}/make_runscripts", ".") - Ln = which('ln', required=True) + Ln = which("ln", required=True) dirs = glob.glob(f"{icon_dir}/run/standard_*") for dir in dirs: Ln("-sf", "-t", "run/", f"{dir}") From 05dc5518d8a7e07cf34f31adeaa27c0a99ffac85 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 9 Feb 2026 11:57:33 +0000 Subject: [PATCH 22/27] GitHub Action: Apply Pep8-formatting --- repos/c2sm/packages/icon-exclaim/package.py | 3 +- repos/c2sm/packages/icon-nwp/package.py | 103 +++++++++++--------- 2 files changed, 57 insertions(+), 49 deletions(-) diff --git a/repos/c2sm/packages/icon-exclaim/package.py b/repos/c2sm/packages/icon-exclaim/package.py index 85abfc518b..dc248e1cdc 100644 --- a/repos/c2sm/packages/icon-exclaim/package.py +++ b/repos/c2sm/packages/icon-exclaim/package.py @@ -15,6 +15,7 @@ def validate_variant_dsl(pkg, name, value): 'Cannot have more than one of (substitute, verify, serialize) in the same build' ) + class IconExclaim(IconNwp): """ICON - is a modeling framework for weather, climate, and environmental prediction. @@ -116,4 +117,4 @@ def build(self, spec, prefix): ) # Proceed with the normal build - super().build(spec, prefix) \ No newline at end of file + super().build(spec, prefix) diff --git a/repos/c2sm/packages/icon-nwp/package.py b/repos/c2sm/packages/icon-nwp/package.py index 9d36f71374..501c4a833d 100644 --- a/repos/c2sm/packages/icon-nwp/package.py +++ b/repos/c2sm/packages/icon-nwp/package.py @@ -74,14 +74,16 @@ class IconNwp(Icon): variant( "acm-license", default=False, - description="Enable code parts that require accepting the ACM Software License", + description= + "Enable code parts that require accepting the ACM Software License", ) # Infrastructural Features: variant( "active-target-sync", default=False, - description="Enable MPI active target mode (otherwise, passive target mode is used)", + description= + "Enable MPI active target mode (otherwise, passive target mode is used)", ) variant( "async-io-rma", @@ -99,7 +101,8 @@ class IconNwp(Icon): default="none", multi=True, values=check_variant_extra_config_args, - description="Inject any configure argument not yet available as variant\nUse this feature cautiously, as injecting non-variant configure arguments may potentially disrupt the build process", + description= + "Inject any configure argument not yet available as variant\nUse this feature cautiously, as injecting non-variant configure arguments may potentially disrupt the build process", ) # Optimization Features: @@ -112,7 +115,8 @@ class IconNwp(Icon): variant( "pgi-inlib", default=False, - description="Enable PGI/NVIDIA cross-file function inlining via an inline library", + description= + "Enable PGI/NVIDIA cross-file function inlining via an inline library", ) variant("nccl", default=False, description="Enable NCCL for communication") @@ -124,7 +128,8 @@ class IconNwp(Icon): default="none", multi=True, values=check_variant_fcgroup, - description="Create a Fortran compile group: GROUP;files;flag \nNote: flag can only be one single value, i.e. -O1", + description= + "Create a Fortran compile group: GROUP;files;flag \nNote: flag can only be one single value, i.e. -O1", ) # verbosity @@ -137,9 +142,12 @@ class IconNwp(Icon): variant( "eccodes-definitions", default=False, - description="Enable extension of eccodes with center specific definition files", + description= + "Enable extension of eccodes with center specific definition files", ) - depends_on("eccodes-cosmo-resources", type="run", when="+eccodes-definitions") + depends_on("eccodes-cosmo-resources", + type="run", + when="+eccodes-definitions") with when("+emvorado"): depends_on("eccodes +fortran") @@ -151,10 +159,10 @@ class IconNwp(Icon): # WORKAROUND: A build and link dependency should imply that the same compiler is used. This enforces it. for __x in Icon.serialization_values: - depends_on( - "serialbox+fortran %nvhpc", when="serialization={0} %nvhpc".format(__x) - ) - depends_on("serialbox+fortran %gcc", when="serialization={0} %gcc".format(__x)) + depends_on("serialbox+fortran %nvhpc", + when="serialization={0} %nvhpc".format(__x)) + depends_on("serialbox+fortran %gcc", + when="serialization={0} %gcc".format(__x)) # WORKAROUND: A build and link dependency should imply that the same compiler is used. This enforces it. depends_on("netcdf-fortran %nvhpc", when="%nvhpc") @@ -177,21 +185,21 @@ def configure_args(self): flags = defaultdict(list) for x in [ - "dace", - "emvorado", - "art-gpl", - "acm-license", - "active-target-sync", - "async-io-rma", - "realloc-buf", - "parallel-netcdf", - "sct", - "loop-exchange", - "vectorized-lrtm", - "pgi-inlib", - "nccl", - "cuda-graphs", - "silent-rules", + "dace", + "emvorado", + "art-gpl", + "acm-license", + "active-target-sync", + "async-io-rma", + "realloc-buf", + "parallel-netcdf", + "sct", + "loop-exchange", + "vectorized-lrtm", + "pgi-inlib", + "nccl", + "cuda-graphs", + "silent-rules", ]: args += self.enable_or_disable(x) @@ -205,13 +213,13 @@ def configure_args(self): fcgroup = self.spec.variants["fcgroup"].value # ('none',) is the values spack assign if fcgroup is not set - if fcgroup != ("none",): + if fcgroup != ("none", ): args.extend(self.fcgroup_to_config_arg()) flags.update(self.fcgroup_to_config_var()) # add configure arguments not yet available as variant extra_config_args = self.spec.variants["extra-config-args"].value - if extra_config_args != ("none",): + if extra_config_args != ("none", ): for x in extra_config_args: # prevent configure-args already available as variant # to be set through variant extra_config_args @@ -226,25 +234,23 @@ def configure_args(self): # in the reversed order # (see https://gitlab.dkrz.de/icon/icon#icon-dependencies): # and for non-system directories only: - flags["LDFLAGS"].extend( - [ - "-L{0}".format(d) - for d in reversed(libs.directories) - if not is_system_path(d) - ] - ) + flags["LDFLAGS"].extend([ + "-L{0}".format(d) for d in reversed(libs.directories) + if not is_system_path(d) + ]) # Temporary back port fix from upstream package for building comin on cpu # See https://github.com/spack/spack-packages/commit/b992c44bb52d034fe57637f3da42483501442af3 # TODO: Remove this dupplicate once spack-c2sm points to an upstream spack containing the fix. if self.spec.variants[ - "gpu" - ].value in self.nvidia_targets or self.spec.satisfies("+comin"): + "gpu"].value in self.nvidia_targets or self.spec.satisfies( + "+comin"): flags["ICON_LDFLAGS"].extend(self.compiler.stdcxx_libs) - args.extend( - ["{0}={1}".format(name, " ".join(value)) for name, value in flags.items()] - ) + args.extend([ + "{0}={1}".format(name, " ".join(value)) + for name, value in flags.items() + ]) args.append(f"{super_libs} {libs.link_flags}") return args @@ -270,7 +276,7 @@ def strip_variant_prefix(self, variant_string): for prefix in prefixes: if variant_string.startswith(prefix): - return variant_string[len(prefix) :] + return variant_string[len(prefix):] raise ValueError @@ -283,10 +289,8 @@ def validate_extra_config_args(self, arg): ) def configure(self, spec, prefix): - if ( - os.path.exists(os.path.join(self.build_directory, "icon.mk")) - and self.build_uses_same_spec() - ): + if (os.path.exists(os.path.join(self.build_directory, "icon.mk")) + and self.build_uses_same_spec()): tty.warn( "icon.mk already present -> skip configure stage", '\t delete "icon.mk" or run "make distclean" to not skip configure', @@ -309,7 +313,8 @@ def build_uses_same_spec(self): is_same_spec = False - previous_spec = os.path.join(self.build_directory, ".previous_spec.yaml") + previous_spec = os.path.join(self.build_directory, + ".previous_spec.yaml") # not the first build in self.build_directory if os.path.exists(previous_spec): @@ -318,7 +323,8 @@ def build_uses_same_spec(self): is_same_spec = True else: is_same_spec = False - tty.warn("Cannot skip configure phase because spec changed") + tty.warn( + "Cannot skip configure phase because spec changed") # first build in self.build_directory, no worries else: @@ -335,7 +341,8 @@ def copy_runscript_related_input_files(self): with working_dir(self.build_directory): icon_dir = self.configure_directory # only synchronize if out-of-source build - if os.path.abspath(icon_dir) != os.path.abspath(self.build_directory): + if os.path.abspath(icon_dir) != os.path.abspath( + self.build_directory): Rsync = which("rsync", required=True) Rsync( "-uavz", From b0b27a182730395a003ecf784e6feab7e5ee2dd0 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 9 Feb 2026 16:15:18 +0100 Subject: [PATCH 23/27] fix readme --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index faa3708d3d..1e92fc6d62 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,33 @@ rm -rf ~/.spack ``` After an update we advice to rebuild packages, preferably in a new shell so that no outdated shell variables are retained. +## Workflow for Local Spack Development (Linting & Testing) + +Create a virtual environment +```bash +python3 -m venv .venv +source .venv/bin/activate +``` +Install pinned dev tools +```bash +pip install --upgrade pip +pip install -r requirements/dev.txt +pip install -r requirements/test.txt +``` +Install pre-commit hooks locally (optional) +```bash +pre-commit install +``` +> Hooks run automatically on `git commit` + +Run all hooks manually (recommended before push) +```bash +pre-commit run --all-files +``` +> * Lints and auto-fixes safe issues (like unused imports) +> * Checks YAML, formatting, and other configured hooks +> * Shows errors/warnings for anything that cannot be auto-fixed + ## Testing strategy For more information on the different types of tests see the [README in the test directory](test/README.md). From 2fbe2e6864c94613538a5ef2bfd422f0f453d656 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 9 Feb 2026 16:17:12 +0100 Subject: [PATCH 24/27] fix style --- .github/workflows/short_pr_tests.yml | 4 +- docs/QuickStart.rst | 10 +- repos/c2sm/packages/ghex/package.py | 12 ++- repos/c2sm/packages/icon-exclaim/package.py | 4 +- repos/c2sm/packages/icon-nwp/package.py | 103 +++++++++----------- test/balfrin_system_test.py | 2 +- test/common_system_test.py | 2 +- test/santis_system_test.py | 2 +- 8 files changed, 67 insertions(+), 72 deletions(-) diff --git a/.github/workflows/short_pr_tests.yml b/.github/workflows/short_pr_tests.yml index c2a7ae8d00..fbab582a8c 100644 --- a/.github/workflows/short_pr_tests.yml +++ b/.github/workflows/short_pr_tests.yml @@ -24,7 +24,7 @@ jobs: run: | python3 -m venv .venv source .venv/bin/activate - pip install -r requirements.txt + pip install -r requirements/test.txt - name: Spack spec test run: | @@ -40,4 +40,4 @@ jobs: run: | source ./setup-env.sh source .venv/bin/activate - pytest -v -n ${NTHREADS} test/integration_test.py \ No newline at end of file + pytest -v -n ${NTHREADS} test/integration_test.py diff --git a/docs/QuickStart.rst b/docs/QuickStart.rst index 1caca43ea3..e152b3b1f7 100644 --- a/docs/QuickStart.rst +++ b/docs/QuickStart.rst @@ -130,7 +130,7 @@ To activate the Spack environment, type To install the environment and so ICON, type .. code-block:: console - + $ spack develop --path $(pwd) icon-nwp@develop $ spack install @@ -161,10 +161,10 @@ By executing the commands above, spack will add some lines directly into ``spack .. code-block:: yaml - spack: - packages: - icon-nwp: - package_attributes: + spack: + packages: + icon-nwp: + package_attributes: build_directory: /scratch/mch/juckerj/icon-nwp/cpu Any further ``spack install`` command will use the build directory specified in the ``spack.yaml`` file. diff --git a/repos/c2sm/packages/ghex/package.py b/repos/c2sm/packages/ghex/package.py index 4b7cbfd86a..3a7be2d3ea 100644 --- a/repos/c2sm/packages/ghex/package.py +++ b/repos/c2sm/packages/ghex/package.py @@ -20,11 +20,13 @@ class Ghex(CMakePackage, CudaPackage, ROCmPackage): generator("ninja") backends = ("mpi", "ucx", "libfabric") - variant("backend", - default="mpi", - description="Transport backend", - values=backends, - multi=False) + variant( + "backend", + default="mpi", + description="Transport backend", + values=backends, + multi=False, + ) variant("xpmem", default=False, description="Use xpmem shared memory") variant("python", default=True, description="Build Python bindings") diff --git a/repos/c2sm/packages/icon-exclaim/package.py b/repos/c2sm/packages/icon-exclaim/package.py index 92450fb49f..c624886315 100644 --- a/repos/c2sm/packages/icon-exclaim/package.py +++ b/repos/c2sm/packages/icon-exclaim/package.py @@ -25,9 +25,9 @@ class IconExclaim(IconNwp): This is for additional options from the upstream ICON-NWP for exclaime specific features.""" - git = 'git@github.com:C2SM/icon-exclaim.git' + git = "git@github.com:C2SM/icon-exclaim.git" - maintainers('stelliom', 'leclairm', 'huppd') + maintainers("stelliom", "leclairm", "huppd") version("develop", branch="icon-dsl", submodules=True) diff --git a/repos/c2sm/packages/icon-nwp/package.py b/repos/c2sm/packages/icon-nwp/package.py index 501c4a833d..9d36f71374 100644 --- a/repos/c2sm/packages/icon-nwp/package.py +++ b/repos/c2sm/packages/icon-nwp/package.py @@ -74,16 +74,14 @@ class IconNwp(Icon): variant( "acm-license", default=False, - description= - "Enable code parts that require accepting the ACM Software License", + description="Enable code parts that require accepting the ACM Software License", ) # Infrastructural Features: variant( "active-target-sync", default=False, - description= - "Enable MPI active target mode (otherwise, passive target mode is used)", + description="Enable MPI active target mode (otherwise, passive target mode is used)", ) variant( "async-io-rma", @@ -101,8 +99,7 @@ class IconNwp(Icon): default="none", multi=True, values=check_variant_extra_config_args, - description= - "Inject any configure argument not yet available as variant\nUse this feature cautiously, as injecting non-variant configure arguments may potentially disrupt the build process", + description="Inject any configure argument not yet available as variant\nUse this feature cautiously, as injecting non-variant configure arguments may potentially disrupt the build process", ) # Optimization Features: @@ -115,8 +112,7 @@ class IconNwp(Icon): variant( "pgi-inlib", default=False, - description= - "Enable PGI/NVIDIA cross-file function inlining via an inline library", + description="Enable PGI/NVIDIA cross-file function inlining via an inline library", ) variant("nccl", default=False, description="Enable NCCL for communication") @@ -128,8 +124,7 @@ class IconNwp(Icon): default="none", multi=True, values=check_variant_fcgroup, - description= - "Create a Fortran compile group: GROUP;files;flag \nNote: flag can only be one single value, i.e. -O1", + description="Create a Fortran compile group: GROUP;files;flag \nNote: flag can only be one single value, i.e. -O1", ) # verbosity @@ -142,12 +137,9 @@ class IconNwp(Icon): variant( "eccodes-definitions", default=False, - description= - "Enable extension of eccodes with center specific definition files", + description="Enable extension of eccodes with center specific definition files", ) - depends_on("eccodes-cosmo-resources", - type="run", - when="+eccodes-definitions") + depends_on("eccodes-cosmo-resources", type="run", when="+eccodes-definitions") with when("+emvorado"): depends_on("eccodes +fortran") @@ -159,10 +151,10 @@ class IconNwp(Icon): # WORKAROUND: A build and link dependency should imply that the same compiler is used. This enforces it. for __x in Icon.serialization_values: - depends_on("serialbox+fortran %nvhpc", - when="serialization={0} %nvhpc".format(__x)) - depends_on("serialbox+fortran %gcc", - when="serialization={0} %gcc".format(__x)) + depends_on( + "serialbox+fortran %nvhpc", when="serialization={0} %nvhpc".format(__x) + ) + depends_on("serialbox+fortran %gcc", when="serialization={0} %gcc".format(__x)) # WORKAROUND: A build and link dependency should imply that the same compiler is used. This enforces it. depends_on("netcdf-fortran %nvhpc", when="%nvhpc") @@ -185,21 +177,21 @@ def configure_args(self): flags = defaultdict(list) for x in [ - "dace", - "emvorado", - "art-gpl", - "acm-license", - "active-target-sync", - "async-io-rma", - "realloc-buf", - "parallel-netcdf", - "sct", - "loop-exchange", - "vectorized-lrtm", - "pgi-inlib", - "nccl", - "cuda-graphs", - "silent-rules", + "dace", + "emvorado", + "art-gpl", + "acm-license", + "active-target-sync", + "async-io-rma", + "realloc-buf", + "parallel-netcdf", + "sct", + "loop-exchange", + "vectorized-lrtm", + "pgi-inlib", + "nccl", + "cuda-graphs", + "silent-rules", ]: args += self.enable_or_disable(x) @@ -213,13 +205,13 @@ def configure_args(self): fcgroup = self.spec.variants["fcgroup"].value # ('none',) is the values spack assign if fcgroup is not set - if fcgroup != ("none", ): + if fcgroup != ("none",): args.extend(self.fcgroup_to_config_arg()) flags.update(self.fcgroup_to_config_var()) # add configure arguments not yet available as variant extra_config_args = self.spec.variants["extra-config-args"].value - if extra_config_args != ("none", ): + if extra_config_args != ("none",): for x in extra_config_args: # prevent configure-args already available as variant # to be set through variant extra_config_args @@ -234,23 +226,25 @@ def configure_args(self): # in the reversed order # (see https://gitlab.dkrz.de/icon/icon#icon-dependencies): # and for non-system directories only: - flags["LDFLAGS"].extend([ - "-L{0}".format(d) for d in reversed(libs.directories) - if not is_system_path(d) - ]) + flags["LDFLAGS"].extend( + [ + "-L{0}".format(d) + for d in reversed(libs.directories) + if not is_system_path(d) + ] + ) # Temporary back port fix from upstream package for building comin on cpu # See https://github.com/spack/spack-packages/commit/b992c44bb52d034fe57637f3da42483501442af3 # TODO: Remove this dupplicate once spack-c2sm points to an upstream spack containing the fix. if self.spec.variants[ - "gpu"].value in self.nvidia_targets or self.spec.satisfies( - "+comin"): + "gpu" + ].value in self.nvidia_targets or self.spec.satisfies("+comin"): flags["ICON_LDFLAGS"].extend(self.compiler.stdcxx_libs) - args.extend([ - "{0}={1}".format(name, " ".join(value)) - for name, value in flags.items() - ]) + args.extend( + ["{0}={1}".format(name, " ".join(value)) for name, value in flags.items()] + ) args.append(f"{super_libs} {libs.link_flags}") return args @@ -276,7 +270,7 @@ def strip_variant_prefix(self, variant_string): for prefix in prefixes: if variant_string.startswith(prefix): - return variant_string[len(prefix):] + return variant_string[len(prefix) :] raise ValueError @@ -289,8 +283,10 @@ def validate_extra_config_args(self, arg): ) def configure(self, spec, prefix): - if (os.path.exists(os.path.join(self.build_directory, "icon.mk")) - and self.build_uses_same_spec()): + if ( + os.path.exists(os.path.join(self.build_directory, "icon.mk")) + and self.build_uses_same_spec() + ): tty.warn( "icon.mk already present -> skip configure stage", '\t delete "icon.mk" or run "make distclean" to not skip configure', @@ -313,8 +309,7 @@ def build_uses_same_spec(self): is_same_spec = False - previous_spec = os.path.join(self.build_directory, - ".previous_spec.yaml") + previous_spec = os.path.join(self.build_directory, ".previous_spec.yaml") # not the first build in self.build_directory if os.path.exists(previous_spec): @@ -323,8 +318,7 @@ def build_uses_same_spec(self): is_same_spec = True else: is_same_spec = False - tty.warn( - "Cannot skip configure phase because spec changed") + tty.warn("Cannot skip configure phase because spec changed") # first build in self.build_directory, no worries else: @@ -341,8 +335,7 @@ def copy_runscript_related_input_files(self): with working_dir(self.build_directory): icon_dir = self.configure_directory # only synchronize if out-of-source build - if os.path.abspath(icon_dir) != os.path.abspath( - self.build_directory): + if os.path.abspath(icon_dir) != os.path.abspath(self.build_directory): Rsync = which("rsync", required=True) Rsync( "-uavz", diff --git a/test/balfrin_system_test.py b/test/balfrin_system_test.py index d230d94c36..9226f99d92 100644 --- a/test/balfrin_system_test.py +++ b/test/balfrin_system_test.py @@ -11,7 +11,7 @@ def test_install_icon_conditional_dependencies(): # WORKAROUND: A build and link dependency should imply that the same compiler is used. ^cray-mpich%nvhpc enforces it. spack_install( - 'icon-nwp @2024.10-mch-1.0 %nvhpc +coupling serialization=create +emvorado +mpi gpu=nvidia-80 ^cray-mpich%nvhpc' + "icon-nwp @2024.10-mch-1.0 %nvhpc +coupling serialization=create +emvorado +mpi gpu=nvidia-80 ^cray-mpich%nvhpc" ) diff --git a/test/common_system_test.py b/test/common_system_test.py index 5009d1b452..b7da3d6723 100644 --- a/test/common_system_test.py +++ b/test/common_system_test.py @@ -31,7 +31,7 @@ def test_install_makedepf90(): @pytest.mark.parametrize("version", ["2024.10", "2024.10-mch-1.0", "2.6.6-mch2b"]) def test_install_icon(version): # WORKAROUND: A build and link dependency should imply that the same compiler is used. ^cray-mpich%nvhpc enforces it. - spack_install(f'icon-nwp @{version} %nvhpc ^cray-mpich%nvhpc') + spack_install(f"icon-nwp @{version} %nvhpc ^cray-mpich%nvhpc") # make check of external cdi fails with diff --git a/test/santis_system_test.py b/test/santis_system_test.py index 9cefa1d5c1..5a8b9ab624 100644 --- a/test/santis_system_test.py +++ b/test/santis_system_test.py @@ -12,5 +12,5 @@ def test_install_icon_conditional_dependencies(): # WORKAROUND: A build and link dependency should imply that the same compiler is used. ^cray-mpich%nvhpc enforces it. spack_install( - 'icon-nwp @2024.10-mch-1.0 %nvhpc +coupling +emvorado +mpi gpu=nvidia-90 ^cray-mpich%nvhpc' + "icon-nwp @2024.10-mch-1.0 %nvhpc +coupling +emvorado +mpi gpu=nvidia-90 ^cray-mpich%nvhpc" ) From 945eb1514049d4254e58578205c1d4e2c739d223 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 9 Feb 2026 16:20:52 +0100 Subject: [PATCH 25/27] minor cleanup --- repos/c2sm/packages/ghex/package.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/repos/c2sm/packages/ghex/package.py b/repos/c2sm/packages/ghex/package.py index 3a7be2d3ea..5861d71a64 100644 --- a/repos/c2sm/packages/ghex/package.py +++ b/repos/c2sm/packages/ghex/package.py @@ -2,7 +2,14 @@ class Ghex(CMakePackage, CudaPackage, ROCmPackage): - """GHEX is a generic halo-exchange library.""" + """ + GHEX is a generic halo-exchange library. + + This Spack package was originally copied from: + https://github.com/ghex-org/spack-repos/blob/main/packages/ghex/package.py + + License: ghex-org + """ homepage = "https://github.com/ghex-org/GHEX" url = "https://github.com/ghex-org/GHEX/archive/refs/tags/v0.3.0.tar.gz" From 0ff27975042788e6e00cb9c37758464ea8ea7961 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Mon, 9 Feb 2026 16:28:43 +0100 Subject: [PATCH 26/27] fix indentation --- repos/c2sm/packages/ghex/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/c2sm/packages/ghex/package.py b/repos/c2sm/packages/ghex/package.py index 5861d71a64..2afab83977 100644 --- a/repos/c2sm/packages/ghex/package.py +++ b/repos/c2sm/packages/ghex/package.py @@ -2,7 +2,7 @@ class Ghex(CMakePackage, CudaPackage, ROCmPackage): - """ + """ GHEX is a generic halo-exchange library. This Spack package was originally copied from: From be2cb814a9b5fa3876ab560fce28d4d88123c786 Mon Sep 17 00:00:00 2001 From: Daniel Hupp Date: Wed, 18 Feb 2026 16:37:21 +0100 Subject: [PATCH 27/27] somehow this lead to an error with the uenv --- user-config/repos.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/user-config/repos.yaml b/user-config/repos.yaml index 4eb687af01..35940d64ac 100644 --- a/user-config/repos.yaml +++ b/user-config/repos.yaml @@ -1,4 +1,5 @@ repos: c2sm: $spack/../repos/c2sm builtin: + git: https://github.com/spack/spack-packages.git commit: 5e506ab69aed5199b6d01083016fa592f4fb4296