summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn W. Parent <45471568+johnwparent@users.noreply.github.com>2023-02-09 12:53:59 -0500
committerGitHub <noreply@github.com>2023-02-09 09:53:59 -0800
commit259a32e5e4f1e86345c9c556c7d307f1b302960a (patch)
tree86189216f0750e8f70c4a9e0d87c095d182c789b
parent8c0b8c785fd2a0a90b5798efaec94ba8c91d0fef (diff)
downloadspack-259a32e5e4f1e86345c9c556c7d307f1b302960a.tar.gz
spack-259a32e5e4f1e86345c9c556c7d307f1b302960a.tar.bz2
spack-259a32e5e4f1e86345c9c556c7d307f1b302960a.tar.xz
spack-259a32e5e4f1e86345c9c556c7d307f1b302960a.zip
Windows: MSMPI package fixes (#35112)
* Add "fake" mpi compiler wrappers to msmpi: msmpi doesn't actually provide wrappers, so this just assigns the wrappers to be whatever compiler that a dependent is using. Packages referencing the wrappers would otherwise break. This is assumed to be workable because build scripts will need to assemble appropriate information to pass to the compiler anyway * Fix msmpi detection stanza ('executable' is not the correct name of the property) * Fix compiler pkg dereference
-rw-r--r--var/spack/repos/builtin/packages/msmpi/package.py24
1 files changed, 17 insertions, 7 deletions
diff --git a/var/spack/repos/builtin/packages/msmpi/package.py b/var/spack/repos/builtin/packages/msmpi/package.py
index e8f147bd3c..de5206c20c 100644
--- a/var/spack/repos/builtin/packages/msmpi/package.py
+++ b/var/spack/repos/builtin/packages/msmpi/package.py
@@ -20,7 +20,7 @@ class Msmpi(Package):
git = "https://github.com/microsoft/Microsoft-MPI.git"
tags = ["windows"]
- executable = ["mpiexec"]
+ executables = ["mpiexec"]
version("10.1.1", sha256="63c7da941fc4ffb05a0f97bd54a67968c71f63389a0d162d3182eabba1beab3d")
version("10.0.0", sha256="cfb53cf53c3cf0d4935ab58be13f013a0f7ccb1189109a5b8eea0fcfdcaef8c1")
@@ -41,10 +41,20 @@ class Msmpi(Package):
ver_str = re.search(r"Microsoft MPI Startup Program \[Version ([0-9.]+)\]", output)
return Version(ver_str.group(1)) if ver_str else None
+ def setup_dependent_package(self, module, dependent_spec):
+ spec = self.spec
+ # MSMPI does not vendor compiler wrappers, instead arguments should
+ # be manually supplied to compiler by consuming package
+ # Note: This is not typical of MPI installations
+ spec.mpicc = spack_cc
+ spec.mpicxx = spack_cxx
+ spec.mpifc = spack_fc
+ spec.mpif77 = spack_f77
+
class GenericBuilder(GenericBuilder):
def setup_build_environment(self, env):
- ifort_root = os.path.join(*self.compiler.fc.split(os.path.sep)[:-2])
+ ifort_root = os.path.join(*self.pkg.compiler.fc.split(os.path.sep)[:-2])
env.set("SPACK_IFORT", ifort_root)
def is_64bit(self):
@@ -52,18 +62,18 @@ class GenericBuilder(GenericBuilder):
def build_command_line(self):
args = ["-noLogo"]
- ifort_bin = self.compiler.fc
+ ifort_bin = self.pkg.compiler.fc
if not ifort_bin:
raise InstallError(
"Cannot install MSMPI without fortran"
"please select a compiler with fortran support."
)
args.append("/p:IFORT_BIN=%s" % os.path.dirname(ifort_bin))
- args.append("/p:VCToolsVersion=%s" % self.compiler.msvc_version)
- args.append("/p:WindowsTargetPlatformVersion=%s" % str(self.spec["wdk"].version))
- args.append("/p:PlatformToolset=%s" % self.compiler.cc_version)
+ args.append("/p:VCToolsVersion=%s" % self.pkg.compiler.msvc_version)
+ args.append("/p:WindowsTargetPlatformVersion=%s" % str(self.pkg.spec["wdk"].version))
+ args.append("/p:PlatformToolset=%s" % self.pkg.compiler.cc_version)
return args
def install(self, spec, prefix):
- with working_dir(self.stage.build_directory, create=True):
+ with working_dir(self.pkg.stage.build_directory, create=True):
msbuild(*self.build_command_line())