Skip to content

Commit 1207a3b

Browse files
committed
declare cmake hdf5_parallel option (future)
1 parent 8165715 commit 1207a3b

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

cmake/hdf5.cmake

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ ${zlib_root}
5757
-DHDF5_ENABLE_PARALLEL:BOOL=$<BOOL:${hdf5_parallel}>
5858
-DMPI_ROOT:PATH=${MPI_ROOT}
5959
)
60-
# https://github.com/HDFGroup/hdf5/issues/818 for broken ph5diff
60+
# https://github.com/HDFGroup/hdf5/issues/818 for broken ph5diff in HDF5_BUILD_TOOLS
6161

6262
ExternalProject_Add(HDF5
6363
URL ${hdf5_url}
@@ -82,6 +82,18 @@ target_link_libraries(HDF5::HDF5 INTERFACE "${HDF5_LIBRARIES}")
8282

8383
add_dependencies(HDF5::HDF5 HDF5)
8484

85+
# --- HDF5 parallel compression support
86+
# this could be improved by making it an ExternalProject post-build step instead of assumptions made here
87+
if(hdf5_parallel)
88+
if(MPI_VERSION VERSION_GREATER_EQUAL 3)
89+
message(STATUS "Building HDF5-MPI: MPI-3 available, assuming HDF5 parallel compression enabled")
90+
set(hdf5_parallel_compression ".true." CACHE STRING "configure variable for HDF5 parallel compression")
91+
else()
92+
message(STATUS "Building HDF5-MPI: MPI-3 NOT available => HDF5 parallel compression disabled")
93+
set(hdf5_parallel_compression ".false." CACHE STRING "configure variable for HDF5 parallel compression")
94+
endif()
95+
endif(hdf5_parallel)
96+
8597
# --- external deps
8698
find_package(Threads)
8799

cmake/libraries.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
},
66
"zlib2": {
77
"url" : "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.0.5.tar.gz",
8-
"sha256": "eca3fe72aea7036c31d00ca120493923c4d5b99fe02e6d3322f7c88dbdcd0085",
9-
"git": "https://github.com/zlib-ng/zlib-ng.git"
8+
"sha256": "eca3fe72aea7036c31d00ca120493923c4d5b99fe02e6d3322f7c88dbdcd0085"
109
},
1110
"hdf5": {
1211
"1.13.0": {

cmake/options.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
option(autobuild "auto-build HDF5 if missing/broken" on)
2+
option(hdf5_parallel "autobuild HDF5 parallel MPI")
23

34
option(ENABLE_COVERAGE "Code coverage tests")
45

cmake/zlib.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
include(ExternalProject)
55

6-
# need to be sure _ROOT isn't empty, defined is not enough
76
if(NOT ZLIB_ROOT)
87
set(ZLIB_ROOT ${CMAKE_INSTALL_PREFIX})
98
endif()

0 commit comments

Comments
 (0)