From 259a32e5e4f1e86345c9c556c7d307f1b302960a Mon Sep 17 00:00:00 2001 From: "John W. Parent" <45471568+johnwparent@users.noreply.github.com> Date: Thu, 9 Feb 2023 12:53:59 -0500 Subject: 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 --- var/spack/repos/builtin/packages/msmpi/package.py | 24 ++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'var') 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()) -- cgit v1.2.3-60-g2f50