diff --git a/docs/CodeDevelopment.rst b/docs/CodeDevelopment.rst index bfb9de5225..98cf7822d7 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 d7eec3632c..e152b3b1f7 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/repos/c2sm/packages/clang-format/package.py b/repos/c2sm/packages/clang-format/package.py deleted file mode 100644 index 4c34a9a673..0000000000 --- a/repos/c2sm/packages/clang-format/package.py +++ /dev/null @@ -1,26 +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 356694824b..0000000000 --- a/repos/c2sm/packages/cosmo-eccodes-definitions/package.py +++ /dev/null @@ -1,49 +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 c7c610aa18..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 c0c74eaba7..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 80b075287d..0000000000 --- a/repos/c2sm/packages/flexpart-ifs/package.py +++ /dev/null @@ -1,42 +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 index ce36da25a7..2afab83977 100644 --- a/repos/c2sm/packages/ghex/package.py +++ b/repos/c2sm/packages/ghex/package.py @@ -21,6 +21,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") @@ -86,7 +87,7 @@ def cmake_args(self): 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")) + 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) diff --git a/repos/c2sm/packages/icon-exclaim/package.py b/repos/c2sm/packages/icon-exclaim/package.py old mode 100755 new mode 100644 index 14de3fb328..c624886315 --- a/repos/c2sm/packages/icon-exclaim/package.py +++ b/repos/c2sm/packages/icon-exclaim/package.py @@ -1,7 +1,10 @@ -from spack.pkg.c2sm.icon import Icon 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): @@ -13,10 +16,18 @@ def validate_variant_dsl(pkg, name, value): ) -class IconExclaim(Icon): +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("jonasjucker", "huppd") + maintainers("stelliom", "leclairm", "huppd") version("develop", branch="icon-dsl", submodules=True) diff --git a/repos/c2sm/packages/icon-ham/package.py b/repos/c2sm/packages/icon-ham/package.py deleted file mode 100644 index c70cae9114..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-nwp/package.py old mode 100755 new mode 100644 similarity index 86% rename from repos/c2sm/packages/icon/package.py rename to repos/c2sm/packages/icon-nwp/package.py index 3e8656a05e..9d36f71374 --- a/repos/c2sm/packages/icon/package.py +++ b/repos/c2sm/packages/icon-nwp/package.py @@ -1,11 +1,10 @@ -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 + +from spack_repo.builtin.packages.icon.package import Icon +from spack.package import * def check_variant_fcgroup(fcgroup): @@ -29,58 +28,28 @@ def check_variant_extra_config_args(extra_config_arg): return False -class Icon(SpackIcon): +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("huppd") + maintainers("stelliom", "leclairm", "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) + version("develop", branch="master") + version("main", branch="master") - # 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 + 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( @@ -164,13 +133,13 @@ class Icon(SpackIcon): 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") + depends_on("eccodes-cosmo-resources", type="run", when="+eccodes-definitions") with when("+emvorado"): depends_on("eccodes +fortran") @@ -181,7 +150,7 @@ class Icon(SpackIcon): 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: + for __x in Icon.serialization_values: depends_on( "serialbox+fortran %nvhpc", when="serialization={0} %nvhpc".format(__x) ) diff --git a/repos/c2sm/packages/icon4py/package.py b/repos/c2sm/packages/icon4py/package.py index ab270d6f13..7e1eab6f19 100644 --- a/repos/c2sm/packages/icon4py/package.py +++ b/repos/c2sm/packages/icon4py/package.py @@ -2,8 +2,8 @@ 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): @@ -14,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" @@ -34,7 +29,10 @@ 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") depends_on("git") depends_on("uv@0.7:", type="build") @@ -49,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.""" @@ -83,24 +84,30 @@ 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"] + + 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", - "CXX": "g++", + "CC": self.compiler.cc, + "CXX": self.compiler.cxx, }, ) @@ -119,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, }, ) diff --git a/repos/c2sm/packages/icontools/package.py b/repos/c2sm/packages/icontools/package.py deleted file mode 100644 index 8d6cac0a64..0000000000 --- a/repos/c2sm/packages/icontools/package.py +++ /dev/null @@ -1,214 +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 64fc570ae9..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 index b654d8d3ea..630eac3c1e 100644 --- a/repos/c2sm/packages/oomph/package.py +++ b/repos/c2sm/packages/oomph/package.py @@ -25,6 +25,7 @@ class Oomph(CMakePackage, CudaPackage, ROCmPackage): ) 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/py-cytoolz/package.py b/repos/c2sm/packages/py-cytoolz/package.py deleted file mode 100644 index 3236103361..0000000000 --- a/repos/c2sm/packages/py-cytoolz/package.py +++ /dev/null @@ -1,42 +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 519a7acd25..0000000000 --- a/repos/c2sm/packages/py-devtools/package.py +++ /dev/null @@ -1,29 +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 245d3fb9db..0000000000 --- a/repos/c2sm/packages/py-factory-boy/package.py +++ /dev/null @@ -1,21 +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 a5c0f6c960..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 057790fd62..0000000000 --- a/repos/c2sm/packages/py-hatchling/package.py +++ /dev/null @@ -1,59 +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 4021705364..0000000000 --- a/repos/c2sm/packages/py-inflection/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 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 dfcd9fd504..0000000000 --- a/repos/c2sm/packages/py-pytest-factoryboy/package.py +++ /dev/null @@ -1,42 +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 4dafb30aec..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 65306081e5..0000000000 --- a/repos/c2sm/packages/py-tabulate/package.py +++ /dev/null @@ -1,21 +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 6b21268f67..0000000000 --- a/repos/c2sm/packages/py-typing-extensions/package.py +++ /dev/null @@ -1,21 +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 index 16d7bdbe5d..5299ce6f1b 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" 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 591565cd0e..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 3a68d17f03..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 738c1966be..0000000000 --- a/repos/c2sm/packages/yaxt/package.py +++ /dev/null @@ -1,115 +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", - ) diff --git a/spack b/spack index 594a376c52..2e2169d528 160000 --- a/spack +++ b/spack @@ -1 +1 @@ -Subproject commit 594a376c521cc746978571b1181a47bbcff30a21 +Subproject commit 2e2169d5282d166f63e3ee4db8d4446c43cefa8a diff --git a/test/balfrin_system_test.py b/test/balfrin_system_test.py index e550f2fb0a..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 @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 3e960d791b..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 @{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 99e4bdcc93..ea9b6b6fd8 100644 --- a/test/integration_test.py +++ b/test/integration_test.py @@ -21,15 +21,17 @@ 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") + spack_spec( + "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 e4f8a7d7aa..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 @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" ) diff --git a/user-config/repos.yaml b/user-config/repos.yaml index 59de8fefc3..35940d64ac 100644 --- a/user-config/repos.yaml +++ b/user-config/repos.yaml @@ -1,2 +1,5 @@ repos: - - '$spack/../repos/c2sm' + c2sm: $spack/../repos/c2sm + builtin: + git: https://github.com/spack/spack-packages.git + commit: 5e506ab69aed5199b6d01083016fa592f4fb4296