summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVeselin Dobrev <v-dobrev@users.noreply.github.com>2024-11-25 01:13:22 -0800
committerGitHub <noreply@github.com>2024-11-25 10:13:22 +0100
commit347ec87fc522b93de2549d14bd937b36fda15f0c (patch)
treed6f70dfb6a99498b5db41cbc38cabfd463248f34
parentcd8c46e54e21d0317e0538481e54dac01a55bc8e (diff)
downloadspack-347ec87fc522b93de2549d14bd937b36fda15f0c.tar.gz
spack-347ec87fc522b93de2549d14bd937b36fda15f0c.tar.bz2
spack-347ec87fc522b93de2549d14bd937b36fda15f0c.tar.xz
spack-347ec87fc522b93de2549d14bd937b36fda15f0c.zip
mfem: add logic for the C++ standard level when using rocPRIM (#47751)
-rw-r--r--var/spack/repos/builtin/packages/mfem/package.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/mfem/package.py b/var/spack/repos/builtin/packages/mfem/package.py
index 2b5d75706c..f5d564854f 100644
--- a/var/spack/repos/builtin/packages/mfem/package.py
+++ b/var/spack/repos/builtin/packages/mfem/package.py
@@ -361,6 +361,8 @@ class Mfem(Package, CudaPackage, ROCmPackage):
# MUMPS (and SuiteSparse in older versions). On the other hand, PETSc built
# with MUMPS is not strictly required, so we do not require it here.
depends_on("petsc@3.8:+mpi+hypre", when="+petsc")
+ # rocPRIM is a dependency when using petsc+rocm and requires C++14 or newer:
+ conflicts("cxxstd=11", when="^rocprim@5.5.0:")
depends_on("slepc@3.8.0:", when="+slepc")
# If petsc is built with +cuda, propagate cuda_arch to petsc and slepc
for sm_ in CudaPackage.cuda_arch_values:
@@ -635,6 +637,9 @@ class Mfem(Package, CudaPackage, ROCmPackage):
cxxstd = "14"
if self.spec.satisfies("^ginkgo"):
cxxstd = "14"
+ # When rocPRIM is used (e.g. by PETSc + ROCm) we need C++14:
+ if self.spec.satisfies("^rocprim@5.5.0:"):
+ cxxstd = "14"
cxxstd_req = spec.variants["cxxstd"].value
if cxxstd_req != "auto":
# Constraints for valid standard level should be imposed during