summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorjdomke <28772296+jdomke@users.noreply.github.com>2024-05-14 03:15:45 +0900
committerGitHub <noreply@github.com>2024-05-13 11:15:45 -0700
commitd276f9700f2a8a16873e8bb46191ed7f20d16541 (patch)
tree2483be910ad3109a6c5c0a3deab3da756c26d194 /var
parent4f111659ec53fd1a4a898eef61d8ab818006ba8b (diff)
downloadspack-d276f9700f2a8a16873e8bb46191ed7f20d16541.tar.gz
spack-d276f9700f2a8a16873e8bb46191ed7f20d16541.tar.bz2
spack-d276f9700f2a8a16873e8bb46191ed7f20d16541.tar.xz
spack-d276f9700f2a8a16873e8bb46191ed7f20d16541.zip
fujitsu-mpi package: help CMake find wrappers (#43979)
Set MPI_C_COMPILER etc. env vars when building with fujitsu-mpi, which override CMake logic. Without using these variables to explicitly request the Fujitsu MPI wrappers, the builtin CMake logic is unwilling to use these wrappers unless the Fujitsu compiler is used, but they should be used for %clang as well. This avoids patching CMake module files like in #16864, primarily to avoid the possibility of altering behavior for specs that do not use %fj or ^fujitsu-mpi.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/fujitsu-mpi/package.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/fujitsu-mpi/package.py b/var/spack/repos/builtin/packages/fujitsu-mpi/package.py
index 91ba765750..475cec6ce7 100644
--- a/var/spack/repos/builtin/packages/fujitsu-mpi/package.py
+++ b/var/spack/repos/builtin/packages/fujitsu-mpi/package.py
@@ -53,6 +53,16 @@ class FujitsuMpi(Package):
self.spec.mpif77 = self.prefix.bin.mpifrt
self.spec.mpifc = self.prefix.bin.mpifrt
+ def setup_dependent_build_environment(self, env, dependent_spec):
+ if self.spec.satisfies("%gcc"):
+ env.set("MPI_C_COMPILER", self.prefix.bin.mpicc)
+ env.set("MPI_CXX_COMPILER", self.prefix.bin.mpicxx)
+ env.set("MPI_Fortran_COMPILER", self.prefix.bin.mpifort)
+ else:
+ env.set("MPI_C_COMPILER", self.prefix.bin.mpifcc)
+ env.set("MPI_CXX_COMPILER", self.prefix.bin.mpiFCC)
+ env.set("MPI_Fortran_COMPILER", self.prefix.bin.mpifrt)
+
def setup_run_environment(self, env):
# Because MPI are both compilers and runtimes, we set up the compilers
# as part of run environment