diff options
author | John W. Parent <45471568+johnwparent@users.noreply.github.com> | 2023-01-03 11:32:18 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-03 08:32:18 -0800 |
commit | 582f165871f796516f2c3d0937114fd4aa6bd2d3 (patch) | |
tree | ca8036bd380dfb430866419a4c57c7babfe68252 /var | |
parent | bf76f1e7746fad5e6319c62e87416f6cd2954459 (diff) | |
download | spack-582f165871f796516f2c3d0937114fd4aa6bd2d3.tar.gz spack-582f165871f796516f2c3d0937114fd4aa6bd2d3.tar.bz2 spack-582f165871f796516f2c3d0937114fd4aa6bd2d3.tar.xz spack-582f165871f796516f2c3d0937114fd4aa6bd2d3.zip |
Windows: package defaults and MPI detection (#34614)
* Update packages config to indicate that MSVC is the preferred compiler
* Update packages config to indicate that msmpi is the preferred MPI provider
* Fix msmpi external detection
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/msmpi/package.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/var/spack/repos/builtin/packages/msmpi/package.py b/var/spack/repos/builtin/packages/msmpi/package.py index a2206d797f..748732994d 100644 --- a/var/spack/repos/builtin/packages/msmpi/package.py +++ b/var/spack/repos/builtin/packages/msmpi/package.py @@ -6,6 +6,7 @@ import os import platform import re +import sys from spack.build_systems.generic import GenericBuilder from spack.package import * @@ -18,7 +19,7 @@ class Msmpi(Package): url = "https://github.com/microsoft/Microsoft-MPI/archive/refs/tags/v10.1.1.tar.gz" git = "https://github.com/microsoft/Microsoft-MPI.git" - executable = ["mpiexec.exe"] + executable = ["mpiexec"] version("10.1.1", sha256="63c7da941fc4ffb05a0f97bd54a67968c71f63389a0d162d3182eabba1beab3d") version("10.0.0", sha256="cfb53cf53c3cf0d4935ab58be13f013a0f7ccb1189109a5b8eea0fcfdcaef8c1") @@ -31,9 +32,13 @@ class Msmpi(Package): @classmethod def determine_version(cls, exe): - output = Executable(exe)() - ver_str = re.search("[Version ([0-9.]+)]", output) - return Version(ver_str.group(0)) if ver_str else None + # MSMPI is typically MS only, don't detect on other platforms + # to avoid potential collisions with other mpiexec executables + if sys.platform != "win32": + return None + output = Executable(exe)(output=str, error=str) + ver_str = re.search(r"Microsoft MPI Startup Program \[Version ([0-9.]+)\]", output) + return Version(ver_str.group(1)) if ver_str else None class GenericBuilder(GenericBuilder): |