Skip to content

Commit

Permalink
CMake check for parallel and threadsafe redo (#41)
Browse files Browse the repository at this point in the history
Reworked the check for parallel and threadsafe HDF5 builds to use CMake variables if available; I temporarily disabled the check for threadsafe HDF5 builds.
  • Loading branch information
brtnfld authored Jun 5, 2024
1 parent cde8445 commit e666851
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,19 @@ endif()

include(CheckSymbolExists)
list(APPEND CMAKE_REQUIRED_INCLUDES ${HDF5_INCLUDE_DIRS})
check_symbol_exists(H5_HAVE_PARALLEL "H5pubconf.h" HDF5_HAVE_PARALLEL)
if(NOT HDF5_HAVE_PARALLEL)
message(FATAL_ERROR "HDF5 library needs to enable parallel support.")
if(NOT HDF5_IS_PARALLEL)
check_symbol_exists(H5_HAVE_PARALLEL "H5pubconf.h" HDF5_HAVE_PARALLEL)
if(NOT HDF5_HAVE_PARALLEL)
message(FATAL_ERROR "HDF5 library needs to enable parallel support.")
endif()
endif()

check_symbol_exists(H5_HAVE_THREADSAFE "H5pubconf.h" HDF5_HAVE_THREADSAFE)
if(NOT HDF5_HAVE_THREADSAFE)
message(FATAL_ERROR "HDF5 library needs to enable threadsafe support.")
endif()
# Comment out until H5_IS_THREADSAFE is added as a CMake variable. Otherwise,
# this may fail when fetch content is used in VOL testing with HDF5 actions.
#check_symbol_exists(H5_HAVE_THREADSAFE "H5pubconf.h" HDF5_HAVE_THREADSAFE)
#if(NOT HDF5_HAVE_THREADSAFE)
# message(FATAL_ERROR "HDF5 library needs to enable threadsafe support.")
#endif()

# Check if HDF5 version is 1.14 or greater
if(HDF5_FOUND)
Expand Down

0 comments on commit e666851

Please sign in to comment.