summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,