Skip to content

Commit

Permalink
Report build options of VFDs (#4304)
Browse files Browse the repository at this point in the history
* changed to if string contains instead

* return status of VFDs in libhdf5.settings

* use *_ENABLE_* settings instead to report the state

* added map state

* updated resetting status if cmake option fails
  • Loading branch information
brtnfld authored Apr 2, 2024
1 parent 9148f7c commit 8b5644a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ if (HDF5_ENABLE_HDFS)
list (APPEND LINK_LIBS -pthread)
endif ()
else ()
set (HDF5_ENABLE_HDFS OFF CACHE BOOL "Enable HDFS" FORCE)
message (FATAL_ERROR "Set to use libhdfs library, but could not find or use libhdfs. Please verify that the path to HADOOP_HOME is valid, and/or reconfigure without HDF5_ENABLE_HDFS")
endif ()
endif ()
Expand Down Expand Up @@ -806,8 +807,12 @@ if (HDF5_ENABLE_SUBFILING_VFD)

unset (CMAKE_EXTRA_INCLUDE_FILES)
unset (CMAKE_REQUIRED_LIBRARIES)
if(NOT H5_HAVE_SUBFILING_VFD EQUAL 1)
set (HDF5_ENABLE_SUBFILING_VFD OFF CACHE BOOL "Build Parallel HDF5 Subfiling VFD" FORCE)
endif()
endif()


#option (DEFAULT_API_VERSION "Enable v1.16 API (v16, v18, v110, v112, v114, v116)" "v116")
set (DEFAULT_API_VERSION "v116" CACHE STRING "Enable v1.16 API (v16, v18, v110, v112, v114, v116)")
set_property (CACHE DEFAULT_API_VERSION PROPERTY STRINGS v16 v18 v110 v112 v114 v116)
Expand Down Expand Up @@ -940,6 +945,8 @@ endif ()
option (HDF5_ENABLE_MAP_API "Build the map API" OFF)
if (HDF5_ENABLE_MAP_API)
set (H5_HAVE_MAP_API 1)
else ()
set (HDF5_ENABLE_MAP_API OFF CACHE BOOL "Build the map API" FORCE)
endif ()

#-----------------------------------------------------------------------------
Expand Down
7 changes: 5 additions & 2 deletions config/cmake/ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,7 @@ if (HDF5_ENABLE_DIRECT_VFD)
if (HAVE_O_DIRECT AND HAVE_POSIX_MEMALIGN)
set (${HDF_PREFIX}_HAVE_DIRECT 1)
else ()
set (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE)
message (FATAL_ERROR "The direct VFD was requested but cannot be built.\nIt requires O_DIRECT flag support and posix_memalign()")
endif ()
endif ()
Expand All @@ -629,6 +630,7 @@ option (HDF5_ENABLE_ROS3_VFD "Build the ROS3 Virtual File Driver" OFF)
list (APPEND LINK_LIBS ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES})
INCLUDE_DIRECTORIES (${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR})
else ()
set (HDF5_ENABLE_ROS3_VFD OFF CACHE BOOL "Build the ROS3 Virtual File Driver" FORCE)
message (WARNING "The Read-Only S3 VFD was requested but cannot be built.\nPlease check that openssl and cURL are available on your\nsystem, and/or re-configure without option HDF5_ENABLE_ROS3_VFD.")
endif ()
endif ()
Expand All @@ -645,7 +647,8 @@ if (HDF5_ENABLE_MIRROR_VFD)
${HDF_PREFIX}_HAVE_FORK)
set (${HDF_PREFIX}_HAVE_MIRROR_VFD 1)
else()
message(WARNING "The socket-based Mirror VFD was requested but cannot be built. System prerequisites are not met.")
set (HDF5_ENABLE_MIRROR_VFD OFF CACHE BOOL "Build the Mirror Virtual File Driver" FORCE)
message(WARNING "The socket-based Mirror VFD was requested but cannot be built. System prerequisites are not met.")
endif()
endif()

Expand Down Expand Up @@ -799,7 +802,7 @@ macro (H5ConversionTests TEST def msg)
message (VERBOSE "${msg}... no")
file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
"Test ${TEST} Compile succeeded with the following output:\n ${${TEST}_COMPILE_OUTPUT}\n"
)
)
file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
"Test ${TEST} Run failed with exit code ${${TEST}_RUN} and with the following output:\n ${${TEST}_RUN_OUTPUT}\n"
)
Expand Down
12 changes: 6 additions & 6 deletions config/cmake/libhdf5.settings.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Linking Options:
AM_LDFLAGS: @AM_LDFLAGS@
Extra libraries: @LINK_LIBS@
Archiver: @CMAKE_AR@
AR_FLAGS:
AR_FLAGS:
Ranlib: @CMAKE_RANLIB@

Languages:
Expand Down Expand Up @@ -79,12 +79,12 @@ Dimension scales w/ new references: @DIMENSION_SCALES_WITH_NEW_REF@
With deprecated public symbols: @HDF5_ENABLE_DEPRECATED_SYMBOLS@
I/O filters (external): @EXTERNAL_FILTERS@
_Float16 support: @HDF5_ENABLE_NONSTANDARD_FEATURE_FLOAT16@
Map (H5M) API: @H5_HAVE_MAP_API@
Map (H5M) API: @HDF5_ENABLE_MAP_API@
Direct VFD: @HDF5_ENABLE_DIRECT_VFD@
Mirror VFD: @H5_HAVE_MIRROR_VFD@
Subfiling VFD: @H5_HAVE_SUBFILING_VFD@
(Read-Only) S3 VFD: @H5_HAVE_ROS3_VFD@
(Read-Only) HDFS VFD: @H5_HAVE_LIBHDFS@
Mirror VFD: @HDF5_ENABLE_MIRROR_VFD@
Subfiling VFD: @HDF5_ENABLE_SUBFILING_VFD@
(Read-Only) S3 VFD: @HDF5_ENABLE_ROS3_VFD@
(Read-Only) HDFS VFD: @HDF5_ENABLE_HDFS@
Packages w/ extra debug output: @INTERNAL_DEBUG_OUTPUT@
API Tracing: @HDF5_ENABLE_TRACE@
Using memory checker: @HDF5_ENABLE_USING_MEMCHECKER@
Expand Down

0 comments on commit 8b5644a

Please sign in to comment.