From d431fcd9044d7536a53a0a5e6d8b71ba1f7c775b Mon Sep 17 00:00:00 2001 From: "David M. Rogers" Date: Mon, 12 Oct 2020 05:28:06 -0400 Subject: [PATCH] Added CUDAHOSTCXX variable needed to compile with cuda and mpi. (#19254) * Added CUDAHOSTCXX variable needed to compile with cuda and mpi. * Added guard for setting CUDAHOSTCXX with MPI. * Acceptable working version of dealii+cuda+mpi. --- var/spack/repos/builtin/packages/dealii/package.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index d674c00098..edc73b6cfc 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -394,6 +394,11 @@ def cmake_args(self): self.define('MPI_CXX_COMPILER', spec['mpi'].mpicxx), self.define('MPI_Fortran_COMPILER', spec['mpi'].mpifc) ]) + if '+cuda' in spec: + options.extend([ + self.define('DEAL_II_MPI_WITH_CUDA_SUPPORT', True), + self.define('CUDA_HOST_COMPILER', spec['mpi'].mpicxx) + ]) # Python bindings if spec.satisfies('@8.5.0:'): @@ -526,3 +531,8 @@ def cmake_args(self): def setup_run_environment(self, env): env.set('DEAL_II_DIR', self.prefix) + + def setup_build_environment(self, env): + spec = self.spec + if '+cuda' in spec and '+mpi' in spec: + env.set('CUDAHOSTCXX', spec['mpi'].mpicxx)