File tree Expand file tree Collapse file tree 6 files changed +27
-6
lines changed Expand file tree Collapse file tree 6 files changed +27
-6
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,13 @@ set FC=ifort
9898This is necessary to workaround techniques used by HDF5 CMake files that don't pickup the CMake ` set(ENV{CC}) ` .
9999Otherwise, HDF5 build failures may result due to defaulting to icl-clang.
100100
101+ By default we use Zlib 2.x a.k.a. zlib-ng.
102+ If you have a problem with Zlib-ng on your system, try the unmaintained Zlib 1.x by:
103+
104+ ``` sh
105+ cmake -B build -Dzlib_legacy=on
106+ ```
107+
101108## Usage
102109
103110The simplest [ example] ( ./Examples/ ) h5fortran usage is like:
Original file line number Diff line number Diff line change 1- 3.7.1
1+ 3.7.2
Original file line number Diff line number Diff line change 33include (ExternalProject)
44
55if (WIN32 )
6- set (ZLIB_name ${CMAKE_STATIC_LIBRARY_PREFIX} zlib${CMAKE_STATIC_LIBRARY_SUFFIX} )
6+ if (zlib_legacy)
7+ set (ZLIB_name ${CMAKE_STATIC_LIBRARY_PREFIX} zlibstatic${CMAKE_STATIC_LIBRARY_SUFFIX} )
8+ else ()
9+ set (ZLIB_name ${CMAKE_STATIC_LIBRARY_PREFIX} zlib${CMAKE_STATIC_LIBRARY_SUFFIX} )
10+ endif ()
711else ()
812 set (ZLIB_name ${CMAKE_STATIC_LIBRARY_PREFIX} z${CMAKE_STATIC_LIBRARY_SUFFIX} )
913endif ()
@@ -24,7 +28,7 @@ ExternalProject_Add(ZLIB
2428URL ${zlib_url}
2529URL_HASH SHA256=${zlib_sha256}
2630CONFIGURE_HANDLED_BY_BUILD ON
27- INACTIVITY_TIMEOUT 30
31+ INACTIVITY_TIMEOUT 15
2832CMAKE_ARGS -DZLIB_COMPAT:BOOL =on -DZLIB_ENABLE_TESTS:BOOL =off -DBUILD_SHARED_LIBS:BOOL =off -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH =${ZLIB_ROOT}
2933BUILD_BYPRODUCTS ${ZLIB_LIBRARY}
3034)
Original file line number Diff line number Diff line change 99 # CMake >= 3.19
1010 file (READ ${CMAKE_CURRENT_LIST_DIR} /libraries.json _libj)
1111
12- string (JSON zlib_url GET ${_libj} zlib url)
13- string (JSON zlib_sha256 GET ${_libj} zlib sha256)
12+ if (zlib_legacy)
13+ string (JSON zlib_url GET ${_libj} zlib1 url)
14+ string (JSON zlib_sha256 GET ${_libj} zlib1 sha256)
15+ else ()
16+ string (JSON zlib_url GET ${_libj} zlib2 url)
17+ string (JSON zlib_sha256 GET ${_libj} zlib2 sha256)
18+ endif ()
1419
1520 string (JSON hdf5_url GET ${_libj} hdf5 url)
1621 string (JSON hdf5_sha256 GET ${_libj} hdf5 sha256)
Original file line number Diff line number Diff line change 33 "url" : " https://zlib.net/zlib1211.zip" ,
44 "sha256" : " d7510a8ee1918b7d0cad197a089c0a2cd4d6df05fee22389f67f115e738b178d"
55},
6- "zlib " : {
6+ "zlib2 " : {
77 "url" : " https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.0.2.zip" ,
88 "sha256" : " 58a86813746ac1e2354244b1e01f22d8b4814c69e7a8fca14c657d13f67bb5bc"
99},
Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ option(shaky "run shaky tests that may segfault since designed to fail" off)
66option (matlab "check HDF5 file writes with Matlab" off )
77option (concepts "conceptual testing, for devs only" off )
88
9+ option (zlib_legacy "use unmaintained ZLIB 1.x" )
10+ if (zlib_legacy AND CMAKE_VERSION VERSION_LESS 3.19)
11+ message (FATAL_ERROR "Zlib 1.x requires CMake >= 3.19" )
12+ endif ()
13+
914set (CMAKE_EXPORT_COMPILE_COMMANDS true )
1015
1116set (CMAKE_TLS_VERIFY true )
You can’t perform that action at this time.
0 commit comments