diff options
author | Satish Balay <balay@mcs.anl.gov> | 2024-10-04 14:55:46 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-04 22:55:46 +0300 |
commit | be21b0b3bf632112a0d61dc22e9544da36b9cedb (patch) | |
tree | b018dc651e85a80700e7ae78a858b08a52e586b5 /var | |
parent | 8f798c01ec7b2ec62148d1052b33989edc25f8fd (diff) | |
download | spack-be21b0b3bf632112a0d61dc22e9544da36b9cedb.tar.gz spack-be21b0b3bf632112a0d61dc22e9544da36b9cedb.tar.bz2 spack-be21b0b3bf632112a0d61dc22e9544da36b9cedb.tar.xz spack-be21b0b3bf632112a0d61dc22e9544da36b9cedb.zip |
hdf5: use spack installed zlib (#46612)
Avoid that hdf5 searches all search paths for ZLIB.cmake config files (inluding /usr/lib), before it looks for zlib without cmake config files, which is how Spack installs it
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/hdf5/find_package_zlib.patch | 12 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/hdf5/package.py | 6 |
2 files changed, 18 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/hdf5/find_package_zlib.patch b/var/spack/repos/builtin/packages/hdf5/find_package_zlib.patch new file mode 100644 index 0000000000..73b65e826d --- /dev/null +++ b/var/spack/repos/builtin/packages/hdf5/find_package_zlib.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake +index dbd68fd110..3d06b13d57 100644 +--- a/CMakeFilters.cmake ++++ b/CMakeFilters.cmake +@@ -70,7 +70,6 @@ option (HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" ON) + if (HDF5_ENABLE_Z_LIB_SUPPORT) + if (NOT H5_ZLIB_HEADER) + if (NOT ZLIB_USE_EXTERNAL) +- find_package (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) + if (NOT ZLIB_FOUND) + find_package (ZLIB) # Legacy find + endif () diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index 112e1acb52..b4cef37ebf 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -164,6 +164,12 @@ class Hdf5(CMakePackage): "+fortran", when="@1.13.3:^cmake@:3.22", msg="cmake_minimum_required is not set correctly." ) + # HDF5 searches for zlib CMake config files before it falls back to + # FindZLIB.cmake. We don't build zlib with CMake by default, so have to + # delete the first search, otherwise it may find a system zlib. See + # https://github.com/HDFGroup/hdf5/issues/4904 + patch("find_package_zlib.patch", when="@1.8.16:") + # There are several officially unsupported combinations of the features: # 1. Thread safety is not guaranteed via high-level C-API but in some cases # it works. |