From 347ec87fc522b93de2549d14bd937b36fda15f0c Mon Sep 17 00:00:00 2001 From: Veselin Dobrev Date: Mon, 25 Nov 2024 01:13:22 -0800 Subject: mfem: add logic for the C++ standard level when using rocPRIM (#47751) --- var/spack/repos/builtin/packages/mfem/package.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'var') 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 -- cgit v1.2.3-70-g09d2