diff --git a/repos/c2sm/packages/ghex/package.py b/repos/c2sm/packages/ghex/package.py index 51df4f80eb..4a22142b17 100644 --- a/repos/c2sm/packages/ghex/package.py +++ b/repos/c2sm/packages/ghex/package.py @@ -12,21 +12,12 @@ class Ghex(CMakePackage, CudaPackage, ROCmPackage): """ homepage = "https://github.com/ghex-org/GHEX" - url = "https://github.com/ghex-org/GHEX/archive/refs/tags/v0.3.0.tar.gz" + url = "https://github.com/ghex-org/GHEX/archive/refs/tags/v0.0.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) - version( - "async-mpi", - git="https://github.com/msimberg/GHEX.git", - # Pinned commit from https://github.com/msimberg/GHEX/commits/async-mpi/ - commit="6d896166994cedbcfc50da1873239a5edb212e3f", - submodules=True, - ) + version("0.5.0", tag="v0.5.0", submodules=True) depends_on("cxx", type="build") @@ -48,12 +39,12 @@ class Ghex(CMakePackage, CudaPackage, ROCmPackage): depends_on("boost") depends_on("xpmem", when="+xpmem", type=("build", "run")) - depends_on("oomph@async-mpi", when="@async-mpi") + depends_on("oomph") + depends_on("oomph~cuda~rocm", when="~cuda~rocm") 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") diff --git a/repos/c2sm/packages/hwmalloc/package.py b/repos/c2sm/packages/hwmalloc/package.py index 1592c3a0cc..9ee87bfd78 100644 --- a/repos/c2sm/packages/hwmalloc/package.py +++ b/repos/c2sm/packages/hwmalloc/package.py @@ -12,23 +12,14 @@ class Hwmalloc(CMakePackage, CudaPackage, ROCmPackage): """ homepage = "https://github.com/ghex-org/hwmalloc" - url = "https://github.com/ghex-org/hwmalloc/archive/refs/tags/v0.3.0.tar.gz" + url = "https://github.com/ghex-org/hwmalloc/archive/refs/tags/v0.0.0.tar.gz" git = "https://github.com/ghex-org/hwmalloc.git" maintainers = ["boeschf"] version("master", branch="master") - version("async-mpi", commit="c3ddc35f58ad6709388c209dfaec59b1ff40d472") version( - "0.3.0", - sha256="d4d4ac6087a806600d79fb62c02719ca3d58a412968fe1ef4a2fd58d9e7ee950", - ) - version( - "0.2.0", - sha256="734758a390a3258b86307e4aef50a7ca2e5d0e2e579f18aeefcd05397e114419", - ) - version( - "0.1.0", - sha256="06e9bfcef0ecce4d19531ccbe03592b502d1281c7a092bc0ff51ca187899b21c", + "0.4.0", + sha256="1161048e915cf196a86a6241d7354dd56b0e02782000507bab19be5628763ab3", ) depends_on("cxx", type="build") @@ -39,6 +30,8 @@ class Hwmalloc(CMakePackage, CudaPackage, ROCmPackage): depends_on("boost", type=("build")) depends_on("cmake@3.19:", type="build") + conflicts("+cuda+rocm") + variant( "numa-throws", default=False, diff --git a/repos/c2sm/packages/icon-exclaim/package.py b/repos/c2sm/packages/icon-exclaim/package.py index a29565fa9b..d3a2b79ec0 100755 --- a/repos/c2sm/packages/icon-exclaim/package.py +++ b/repos/c2sm/packages/icon-exclaim/package.py @@ -19,7 +19,7 @@ class IconExclaim(Icon): maintainers("huppd", "leclairm", "stelliom") version("develop", branch="icon-dsl", submodules=True) - version("0.3.0", commit="5c5b742a969af2bd491e26cd0a05a35838f121c4", submodules=True) + version("0.3.0", commit="a0be2c3e0448ec2dc92024e3b38ec635435ac0dd", submodules=True) # EXCLAIM-GT4Py specific features: dsl_values = ("substitute", "verify") @@ -36,6 +36,16 @@ class IconExclaim(Icon): for x in dsl_values: depends_on("icon4py", type="build", when=f"dsl={x}") + + # TODO: Should this be set here or in the icon4py package? + def setup_build_environment(self, env): + if self.spec.variants['dsl'].value != ('none', ): + # TODO: clean up + print(f"adding {self.spec['icon4py'].prefix.share.venv.bin} to PATH for icon4py bindings because +dsl is enabled") + env.prepend_path("PATH", self.spec["icon4py"].prefix.share.venv.bin) + env.append_path("PATH", self.spec["icon4py"].prefix.share.venv.bin) + + def configure_args(self): raw_args = super().configure_args() @@ -59,22 +69,15 @@ def configure_args(self): dsl = self.spec.variants["dsl"].value if dsl != ("none",): if "substitute" in dsl: - args_flags.append("--enable-py2f=substitute") + args_flags.append("--enable-icon4py=substitute") elif "verify" in dsl: - args_flags.append("--enable-py2f=verify") + args_flags.append("--enable-icon4py=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)) @@ -90,24 +93,3 @@ def configure_args(self): 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/icon4py/package.py b/repos/c2sm/packages/icon4py/package.py index 60725bfbdc..90ed3204d0 100644 --- a/repos/c2sm/packages/icon4py/package.py +++ b/repos/c2sm/packages/icon4py/package.py @@ -14,7 +14,11 @@ class Icon4py(Package): # --- Versions --- version("main", branch="main") - version("0.0.15", commit="9a7f7d68f0e8be18f746044879c49e4d87e20ff6") + version( + "0.1.0", + sha256="0d48d34234af32243fe899a9e86edd90bbd57890cb89bfda8de906589a70e273", + extension="zip", + ) version( "0.0.14", sha256="8aadb6fe7af55fc41d09daa4e74739bd7ab01b4e", @@ -45,8 +49,7 @@ def url_for_version(self, version): depends_on("py-pybind11") depends_on("py-nanobind") depends_on("py-mpi4py") - depends_on("ghex@async-mpi", when="@0.0.15") - depends_on("ghex@async-mpi", when="@main") + depends_on("ghex") with when("+cuda"): depends_on("py-cupy +cuda") @@ -112,20 +115,10 @@ def install(self, spec, prefix): 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++", - }, - ) + +# TODO: Should this be set here or in the icon-exclaim package? +def setup_dependent_build_environment(self, env, dependent_spec): + env.prepend_path("PATH", self.prefix.share.venv.bin) def prepare_uv(): diff --git a/repos/c2sm/packages/oomph/package.py b/repos/c2sm/packages/oomph/package.py index f33027dd03..3def448a76 100644 --- a/repos/c2sm/packages/oomph/package.py +++ b/repos/c2sm/packages/oomph/package.py @@ -15,16 +15,15 @@ class Oomph(CMakePackage, CudaPackage, ROCmPackage): """ homepage = "https://github.com/ghex-org/oomph" - url = "https://github.com/ghex-org/oomph/archive/refs/tags/v0.4.0.tar.gz" + url = "https://github.com/ghex-org/oomph/archive/refs/tags/v0.0.0.tar.gz" git = "https://github.com/ghex-org/oomph.git" maintainers = ["boeschf"] + version("main", branch="main") version( - "0.4.0", - sha256="e342c872dfe4832be047f172dc55c12951950c79da2630b071c61607ef913144", + "0.5.0", + sha256="4c79ff50d14efcde7ce4d14122714efb16443ccff437ab60973cf1db1032fc3d", ) - version("main", branch="main") - version("async-mpi", commit="2814e2a7d66b96737f1845c510dadd1b816ab5eb") depends_on("cxx", type="build") depends_on("fortran", type="build", when="+fortran-bindings") @@ -57,10 +56,12 @@ class Oomph(CMakePackage, CudaPackage, ROCmPackage): description="Enable thread barrier (disable for task based runtime)", ) + depends_on("hwmalloc") + depends_on("hwmalloc~cuda~rocm", when="~cuda~rocm") depends_on("hwmalloc+cuda", when="+cuda") - depends_on("hwmalloc@async-mpi", when="@async-mpi") depends_on("hwmalloc+rocm", when="+rocm") - depends_on("hwmalloc", when="~cuda~rocm") + + conflicts("+cuda+rocm") with when("backend=ucx"): depends_on("ucx+thread_multiple")