summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAxel Huebl <axel.huebl@plasma.ninja>2024-04-10 14:33:32 +0200
committerGitHub <noreply@github.com>2024-04-10 06:33:32 -0600
commitc5a3e36ad03840df7b17c80bde4aaaf3d8a9e9a9 (patch)
treed4dbbbef225b168d83a26dc1c7a9f7f259354a15 /var
parent1c76ba1c3e0d277978a598f63aeca2ecfe55282f (diff)
downloadspack-c5a3e36ad03840df7b17c80bde4aaaf3d8a9e9a9.tar.gz
spack-c5a3e36ad03840df7b17c80bde4aaaf3d8a9e9a9.tar.bz2
spack-c5a3e36ad03840df7b17c80bde4aaaf3d8a9e9a9.tar.xz
spack-c5a3e36ad03840df7b17c80bde4aaaf3d8a9e9a9.zip
Update pyAMReX: 24.03, 24.04 (#42858)
Latest version of pyAMReX.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/py-amrex/package.py48
-rw-r--r--var/spack/repos/builtin/packages/warpx/package.py4
2 files changed, 44 insertions, 8 deletions
diff --git a/var/spack/repos/builtin/packages/py-amrex/package.py b/var/spack/repos/builtin/packages/py-amrex/package.py
index 218a3b4ac8..61f8aeadd0 100644
--- a/var/spack/repos/builtin/packages/py-amrex/package.py
+++ b/var/spack/repos/builtin/packages/py-amrex/package.py
@@ -10,6 +10,7 @@ class PyAmrex(PythonPackage, CudaPackage, ROCmPackage):
"""AMReX Python Bindings with pybind11"""
homepage = "https://amrex-codes.github.io/amrex/"
+ url = "https://github.com/AMReX-Codes/pyamrex/archive/refs/tags/24.04.tar.gz"
git = "https://github.com/AMReX-Codes/pyamrex.git"
maintainers("ax3l", "RTSandberg", "sayerhs", "WeiqunZhang")
@@ -17,8 +18,19 @@ class PyAmrex(PythonPackage, CudaPackage, ROCmPackage):
license("BSD-3-Clause-LBNL")
version("develop", branch="development")
+ version("24.04", sha256="ab85695bb9644b702d0fc84e77205d264d27ba94999cab912c8a3212a7eb77fc")
+ version("24.03", sha256="bf85b4ad35b623278cbaae2c07e22138545dec0732d15c4ab7c53be76a7f2315")
- variant("dimensions", default="3", description="Dimensionality", values=("1", "2", "3"))
+ for v in ["24.04", "24.03"]:
+ depends_on("amrex@{0}".format(v), when="@{0}".format(v), type=("build", "link"))
+
+ variant(
+ "dimensions",
+ default="1,2,3",
+ values=("1", "2", "3"),
+ multi=True,
+ description="Dimensionality",
+ )
variant("mpi", default=True, description="Build with MPI support")
variant("openmp", default=False, description="Build with OpenMP support")
variant(
@@ -29,21 +41,21 @@ class PyAmrex(PythonPackage, CudaPackage, ROCmPackage):
)
variant("tiny_profile", default=False, description="Enable tiny profiling")
- depends_on("python@3.7:", type=("build", "run"))
+ depends_on("python@3.8:", type=("build", "run"))
depends_on("py-numpy@1.15.0:1", type=("build", "run"))
depends_on("py-mpi4py@2.1.0:", type=("build", "run"), when="+mpi")
+ depends_on("py-packaging@23:", type="build")
depends_on("py-setuptools@42:", type="build")
# We just need a CMake binary, and py-cmake is notoriously hard to build on
# exotic architectures. So ignore the pyproject.toml declaration and use
# Spack's cmake package.
# depends_on('py-cmake@3.20:3', type='build')
depends_on("cmake@3.20:3", type="build")
- depends_on("py-pybind11@2.9.1:", type="link")
+ depends_on("py-pybind11@2.11.1:", type="link")
# AMReX options
- depends_on("amrex@22.08:", type=("build", "link"))
# required variants
- depends_on("amrex +pic +particles")
+ depends_on("amrex +shared +pic +particles")
# controllable variants
with when("dimensions=1"):
depends_on("amrex dimensions=1")
@@ -64,15 +76,23 @@ class PyAmrex(PythonPackage, CudaPackage, ROCmPackage):
depends_on("amrex +rocm")
# todo: how to forward amdgpu_target?
+ depends_on("py-pytest", type="test")
+ depends_on("py-pandas", type="test")
+ depends_on("py-cupy", type="test", when="+cuda")
+
+ tests_src_dir = "tests/"
+
def setup_build_environment(self, env):
spec = self.spec
# disable superbuilds: use external dependencies
env.set("AMREX_INTERNAL", "OFF")
+ env.set("PYAMREX_CCACHE", "ON")
+ env.set("PYAMREX_IPO", "ON")
env.set("PYBIND11_INTERNAL", "OFF")
# configure to require the exact AMReX configs provided by Spack
- env.set("AMREX_SPACEDIM", spec.variants["dimensions"].value)
+ env.set("AMREX_SPACEDIM", ";".join(spec.variants["dimensions"].value))
env.set("AMREX_MPI", "ON" if spec.satisfies("+mpi") else "OFF")
env.set("AMREX_OMP", "ON" if spec.satisfies("+omp") else "OFF")
env.set("AMREX_PRECISION", spec.variants["precision"].value.upper())
@@ -85,3 +105,19 @@ class PyAmrex(PythonPackage, CudaPackage, ROCmPackage):
# control build parallelism
env.set("CMAKE_BUILD_PARALLEL_LEVEL", make_jobs)
+
+ def check(self):
+ """Checks after the build phase"""
+ pytest = which("pytest")
+ pytest(join_path(self.stage.source_path, self.tests_src_dir))
+
+ @run_after("install")
+ def copy_test_sources(self):
+ """Copy the example test files after the package is installed to an
+ install test subdirectory for use during `spack test run`."""
+ cache_extra_test_sources(self, [self.tests_src_dir])
+
+ def test(self):
+ """Perform smoke tests on the installed package."""
+ pytest = which("pytest")
+ pytest(join_path(install_test_root(self), self.tests_src_dir))
diff --git a/var/spack/repos/builtin/packages/warpx/package.py b/var/spack/repos/builtin/packages/warpx/package.py
index 07068f950a..ed1fb87c5c 100644
--- a/var/spack/repos/builtin/packages/warpx/package.py
+++ b/var/spack/repos/builtin/packages/warpx/package.py
@@ -254,7 +254,7 @@ class Warpx(CMakePackage):
def _get_input_options(self, dim, post_install):
spec = self.spec
examples_dir = join_path(
- self.install_test_root if post_install else self.stage.source_path,
+ install_test_root(self) if post_install else self.stage.source_path,
self.examples_src_dir,
)
inputs_nD = {"1": "inputs_1d", "2": "inputs_2d", "3": "inputs_3d", "rz": "inputs_rz"}
@@ -289,7 +289,7 @@ class Warpx(CMakePackage):
def copy_test_sources(self):
"""Copy the example input files after the package is installed to an
install test subdirectory for use during `spack test run`."""
- self.cache_extra_test_sources([self.examples_src_dir])
+ cache_extra_test_sources(self, [self.examples_src_dir])
def test(self):
"""Perform smoke tests on the installed package."""