summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/amrex/package.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/amrex/package.py b/var/spack/repos/builtin/packages/amrex/package.py
index 55bb65fc8f..b41bd126fa 100644
--- a/var/spack/repos/builtin/packages/amrex/package.py
+++ b/var/spack/repos/builtin/packages/amrex/package.py
@@ -342,8 +342,13 @@ class Amrex(CMakePackage, CudaPackage, ROCmPackage):
args = []
args.append("-S./cache/amrex/Tests/SpackSmokeTest")
args.append("-DAMReX_ROOT=" + self.prefix)
- args.append("-DMPI_C_COMPILER=" + self.spec["mpi"].mpicc)
- args.append("-DMPI_CXX_COMPILER=" + self.spec["mpi"].mpicxx)
+ if "+mpi" in self.spec:
+ args.append("-DMPI_C_COMPILER=" + self.spec["mpi"].mpicc)
+ args.append("-DMPI_CXX_COMPILER=" + self.spec["mpi"].mpicxx)
+
+ if "+cuda" in self.spec:
+ args.append("-DCMAKE_CUDA_COMPILER=" + join_path(self.spec["cuda"].prefix.bin, "nvcc"))
+
args.extend(self.cmake_args())
self.run_test(cmake_bin, args, purpose="Configure with CMake")