From 8b5644a0cd008e470692fb2870e0daacd4dc2408 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Tue, 2 Apr 2024 13:24:02 -0500 Subject: [PATCH] Report build options of VFDs (#4304) * 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 --- CMakeLists.txt | 7 +++++++ config/cmake/ConfigureChecks.cmake | 7 +++++-- config/cmake/libhdf5.settings.cmake.in | 12 ++++++------ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 879e7307bf0..1fbaad21cbe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 () @@ -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) @@ -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 () #----------------------------------------------------------------------------- diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 9f707dfca05..81633da8909 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -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 () @@ -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 () @@ -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() @@ -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" ) diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index bbe6674007d..deb07ed82d6 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -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: @@ -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@