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
This commit is contained in:
parent
bf76f1e774
commit
582f165871
21
etc/spack/defaults/windows/packages.yaml
Normal file
21
etc/spack/defaults/windows/packages.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# -------------------------------------------------------------------------
|
||||||
|
# This file controls default concretization preferences for Spack.
|
||||||
|
#
|
||||||
|
# Settings here are versioned with Spack and are intended to provide
|
||||||
|
# sensible defaults out of the box. Spack maintainers should edit this
|
||||||
|
# file to keep it current.
|
||||||
|
#
|
||||||
|
# Users can override these settings by editing the following files.
|
||||||
|
#
|
||||||
|
# Per-spack-instance settings (overrides defaults):
|
||||||
|
# $SPACK_ROOT/etc/spack/packages.yaml
|
||||||
|
#
|
||||||
|
# Per-user settings (overrides default and site settings):
|
||||||
|
# ~/.spack/packages.yaml
|
||||||
|
# -------------------------------------------------------------------------
|
||||||
|
packages:
|
||||||
|
all:
|
||||||
|
compiler:
|
||||||
|
- msvc
|
||||||
|
providers:
|
||||||
|
mpi: [msmpi]
|
@ -6,6 +6,7 @@
|
|||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
from spack.build_systems.generic import GenericBuilder
|
from spack.build_systems.generic import GenericBuilder
|
||||||
from spack.package import *
|
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"
|
url = "https://github.com/microsoft/Microsoft-MPI/archive/refs/tags/v10.1.1.tar.gz"
|
||||||
git = "https://github.com/microsoft/Microsoft-MPI.git"
|
git = "https://github.com/microsoft/Microsoft-MPI.git"
|
||||||
|
|
||||||
executable = ["mpiexec.exe"]
|
executable = ["mpiexec"]
|
||||||
|
|
||||||
version("10.1.1", sha256="63c7da941fc4ffb05a0f97bd54a67968c71f63389a0d162d3182eabba1beab3d")
|
version("10.1.1", sha256="63c7da941fc4ffb05a0f97bd54a67968c71f63389a0d162d3182eabba1beab3d")
|
||||||
version("10.0.0", sha256="cfb53cf53c3cf0d4935ab58be13f013a0f7ccb1189109a5b8eea0fcfdcaef8c1")
|
version("10.0.0", sha256="cfb53cf53c3cf0d4935ab58be13f013a0f7ccb1189109a5b8eea0fcfdcaef8c1")
|
||||||
@ -31,9 +32,13 @@ class Msmpi(Package):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def determine_version(cls, exe):
|
def determine_version(cls, exe):
|
||||||
output = Executable(exe)()
|
# MSMPI is typically MS only, don't detect on other platforms
|
||||||
ver_str = re.search("[Version ([0-9.]+)]", output)
|
# to avoid potential collisions with other mpiexec executables
|
||||||
return Version(ver_str.group(0)) if ver_str else None
|
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):
|
class GenericBuilder(GenericBuilder):
|
||||||
|
Loading…
Reference in New Issue
Block a user