Update openmpi/package.py to allow for non-standard cxx name (#48168)

Allows user to define an alternative name for `mpic++` in `packages:openmpi:package_attributes:cxxname`.
This commit is contained in:
Tim Fuller 2025-01-05 03:22:57 -07:00 committed by GitHub
parent cf06b395b7
commit 8d5ece07d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,6 +32,7 @@ class Openmpi(AutotoolsPackage, CudaPackage):
url = "https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.0.tar.bz2"
list_url = "https://www.open-mpi.org/software/ompi/"
git = "https://github.com/open-mpi/ompi.git"
cxxname = "mpic++"
maintainers("hppritcha", "naughtont3")
@ -885,7 +886,7 @@ def setup_run_environment(self, env):
# Because MPI is both a runtime and a compiler, we have to setup the
# compiler components as part of the run environment.
env.set("MPICC", join_path(self.prefix.bin, "mpicc"))
env.set("MPICXX", join_path(self.prefix.bin, "mpic++"))
env.set("MPICXX", join_path(self.prefix.bin, self.cxxname))
env.set("MPIF77", join_path(self.prefix.bin, "mpif77"))
env.set("MPIF90", join_path(self.prefix.bin, "mpif90"))
# Open MPI also has had mpifort since v1.7, so we can set MPIFC to that
@ -927,7 +928,7 @@ def setup_dependent_build_environment(self, env, dependent_spec):
def setup_dependent_package(self, module, dependent_spec):
self.spec.mpicc = join_path(self.prefix.bin, "mpicc")
self.spec.mpicxx = join_path(self.prefix.bin, "mpic++")
self.spec.mpicxx = join_path(self.prefix.bin, self.cxxname)
self.spec.mpifc = join_path(self.prefix.bin, "mpif90")
self.spec.mpif77 = join_path(self.prefix.bin, "mpif77")