summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorJohn W. Parent <45471568+johnwparent@users.noreply.github.com>2023-04-04 14:40:30 -0400
committerGitHub <noreply@github.com>2023-04-04 11:40:30 -0700
commit44306d3492e6dbe8d722f0370303e6de5e275452 (patch)
tree268c7acbe418996b6aedb7448432cdbfa09c0226 /var
parent354d49897153ce92e3cfc9a98c78d885959672cd (diff)
downloadspack-44306d3492e6dbe8d722f0370303e6de5e275452.tar.gz
spack-44306d3492e6dbe8d722f0370303e6de5e275452.tar.bz2
spack-44306d3492e6dbe8d722f0370303e6de5e275452.tar.xz
spack-44306d3492e6dbe8d722f0370303e6de5e275452.zip
hdf5 package: fix wrapper handling on Windows(#36265)
* msmpi has no wrappers so don't set MPI_CXX_COMPILER etc. for that MPI implementation * hdf5 on Windows does not have h5cc etc., so do not try to filter them on Windows
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/hdf5/package.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py
index d507870e00..7de1672306 100644
--- a/var/spack/repos/builtin/packages/hdf5/package.py
+++ b/var/spack/repos/builtin/packages/hdf5/package.py
@@ -205,7 +205,7 @@ class Hdf5(CMakePackage):
# The compiler wrappers (h5cc, h5fc, etc.) run 'pkg-config'.
# Skip this on Windows since pkgconfig is autotools
for plat in ["cray", "darwin", "linux"]:
- depends_on("pkgconfig", when="platform=%s" % plat, type="run")
+ depends_on("pkgconfig", when=f"platform={plat}", type="run")
conflicts("+mpi", "^mpich@4.0:4.0.3")
conflicts("api=v116", when="@1.6:1.14", msg="v116 is not compatible with this release")
@@ -343,9 +343,19 @@ class Hdf5(CMakePackage):
# The parallel compiler wrappers (i.e. h5pcc, h5pfc, etc.) reference MPI
# compiler wrappers and do not need to be changed.
- filter_compiler_wrappers(
- "h5cc", "h5hlcc", "h5fc", "h5hlfc", "h5c++", "h5hlc++", relative_root="bin"
- )
+ # These do not exist on Windows.
+ # Enable only for supported target platforms.
+ for spack_spec_target_platform in ["linux", "darwin", "cray"]:
+ filter_compiler_wrappers(
+ "h5cc",
+ "h5hlcc",
+ "h5fc",
+ "h5hlfc",
+ "h5c++",
+ "h5hlc++",
+ relative_root="bin",
+ when=f"platform={spack_spec_target_platform}",
+ )
def url_for_version(self, version):
url = (
@@ -580,7 +590,10 @@ class Hdf5(CMakePackage):
if api != "default":
args.append(self.define("DEFAULT_API_VERSION", api))
- if "+mpi" in spec:
+ # MSMPI does not provide compiler wrappers
+ # and pointing these variables at the MSVC compilers
+ # breaks CMake's mpi detection for MSMPI.
+ if "+mpi" in spec and "msmpi" not in spec:
args.extend(
[
"-DMPI_CXX_COMPILER:PATH=%s" % spec["mpi"].mpicxx,