From 44306d3492e6dbe8d722f0370303e6de5e275452 Mon Sep 17 00:00:00 2001 From: "John W. Parent" <45471568+johnwparent@users.noreply.github.com> Date: Tue, 4 Apr 2023 14:40:30 -0400 Subject: 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 --- var/spack/repos/builtin/packages/hdf5/package.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'var') 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, -- cgit v1.2.3-60-g2f50