Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/HDFGroup/hdf5 into nvidi…
Browse files Browse the repository at this point in the history
…a_compiler_config

Adjust nvhpc compiler flags.
  • Loading branch information
lrknox committed Oct 12, 2023
2 parents 82f4c88 + 85c1762 commit 2f5d6cf
Show file tree
Hide file tree
Showing 115 changed files with 8,177 additions and 5,398 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/intel-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ jobs:
-DCMAKE_TOOLCHAIN_FILE=config/toolchain/intel.cmake \
-DMKL_ROOT="/opt/intel/oneapi/mkl/latest" \
-DTBB_ROOT="/opt/intel/oneapi/tbb/latest" \
-DBUILD_SZIP_WITH_FETCHCONTENT=ON \
-DLIBAEC_USE_LOCALCONTENT=OFF \
-DBUILD_ZLIB_WITH_FETCHCONTENT=ON \
-DZLIB_USE_LOCALCONTENT=OFF \
-DHDF5_BUILD_FORTRAN=OFF \
$GITHUB_WORKSPACE
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/main-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,7 @@ jobs:
-DHDF5_BUILD_FORTRAN=${{ matrix.fortran }} \
-DHDF5_BUILD_JAVA=${{ matrix.java }} \
-DHDF5_BUILD_DOC=${{ matrix.docs }} \
-DBUILD_SZIP_WITH_FETCHCONTENT=${{ matrix.libaecfc }} \
-DLIBAEC_USE_LOCALCONTENT=${{ matrix.localaec }} \
-DBUILD_ZLIB_WITH_FETCHCONTENT=${{ matrix.zlibfc }} \
-DZLIB_USE_LOCALCONTENT=${{ matrix.localzlib }} \
-DHDF5_ENABLE_MIRROR_VFD:BOOL=${{ matrix.mirror_vfd }} \
-DHDF5_ENABLE_DIRECT_VFD:BOOL=${{ matrix.direct_vfd }} \
Expand All @@ -213,9 +211,7 @@ jobs:
-DHDF5_BUILD_JAVA:BOOL=OFF \
-DHDF5_BUILD_HL_LIB:BOOL=OFF \
-DHDF5_BUILD_DOC=OFF \
-DBUILD_SZIP_WITH_FETCHCONTENT=${{ matrix.libaecfc }} \
-DLIBAEC_USE_LOCALCONTENT=${{ matrix.localaec }} \
-DBUILD_ZLIB_WITH_FETCHCONTENT=${{ matrix.zlibfc }} \
-DZLIB_USE_LOCALCONTENT=${{ matrix.localzlib }} \
-DHDF5_ENABLE_MIRROR_VFD:BOOL=${{ matrix.mirror_vfd }} \
-DHDF5_ENABLE_DIRECT_VFD:BOOL=${{ matrix.direct_vfd }} \
Expand Down
59 changes: 18 additions & 41 deletions CMakeFilters.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,24 @@ option (USE_LIBAEC_STATIC "Use static AEC library " OFF)
option (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 0)
option (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 0)

option (BUILD_ZLIB_WITH_FETCHCONTENT "Use FetchContent to use original source files" OFF)
if (BUILD_ZLIB_WITH_FETCHCONTENT)
set (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 1)
if (NOT ZLIB_USE_LOCALCONTENT)
set (ZLIB_URL ${ZLIB_TGZ_ORIGPATH}/${ZLIB_TGZ_ORIGNAME})
else ()
set (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_ORIGNAME})
endif ()
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Filter ZLIB file is ${ZLIB_URL}")
endif ()
set (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 1)
if (NOT ZLIB_USE_LOCALCONTENT)
set (ZLIB_URL ${ZLIB_TGZ_ORIGPATH}/${ZLIB_TGZ_NAME})
else ()
set (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_NAME})
endif ()
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Filter ZLIB file is ${ZLIB_URL}")
endif ()

option (BUILD_SZIP_WITH_FETCHCONTENT "Use FetchContent to use original source files" OFF)
if (BUILD_SZIP_WITH_FETCHCONTENT)
set (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 1)
if (NOT LIBAEC_USE_LOCALCONTENT)
set (SZIP_URL ${LIBAEC_TGZ_ORIGPATH}/${LIBAEC_TGZ_ORIGNAME})
else ()
set (SZIP_URL ${TGZPATH}/${LIBAEC_TGZ_ORIGNAME})
endif ()
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Filter SZIP file is ${SZIP_URL}")
endif ()
set (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 1)
if (NOT LIBAEC_USE_LOCALCONTENT)
set (SZIP_URL ${LIBAEC_TGZ_ORIGPATH}/${LIBAEC_TGZ_NAME})
else ()
set (SZIP_URL ${TGZPATH}/${LIBAEC_TGZ_NAME})
endif ()
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Filter SZIP file is ${SZIP_URL}")
endif ()

include (ExternalProject)
Expand All @@ -55,18 +49,12 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT
if (NOT TGZPATH)
set (TGZPATH ${HDF5_SOURCE_DIR})
endif ()
if (NOT BUILD_ZLIB_WITH_FETCHCONTENT)
set (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_NAME})
endif ()
if (ZLIB_USE_LOCALCONTENT)
if (NOT EXISTS "${ZLIB_URL}")
set (HDF5_ENABLE_Z_LIB_SUPPORT OFF CACHE BOOL "" FORCE)
message (VERBOSE "Filter ZLIB file ${ZLIB_URL} not found")
endif ()
endif ()
if (NOT BUILD_SZIP_WITH_FETCHCONTENT)
set (SZIP_URL ${TGZPATH}/${SZAEC_TGZ_NAME})
endif ()
if (LIBAEC_USE_LOCALCONTENT)
if (NOT EXISTS "${SZIP_URL}")
set (HDF5_ENABLE_SZIP_SUPPORT OFF CACHE BOOL "" FORCE)
Expand Down Expand Up @@ -97,12 +85,7 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT)
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES})
endif ()
else ()
if (BUILD_ZLIB_WITH_FETCHCONTENT)
# Only tgz files available
ORIGINAL_ZLIB_LIBRARY ("TGZ")
message (VERBOSE "HDF5_ZLIB is built from fetch content")
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_STATIC_LIBRARY})
elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
EXTERNAL_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT})
message (VERBOSE "Filter HDF5_ZLIB is built")
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_STATIC_LIBRARY})
Expand Down Expand Up @@ -153,13 +136,7 @@ if (HDF5_ENABLE_SZIP_SUPPORT)
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES})
endif ()
else ()
if (BUILD_SZIP_WITH_FETCHCONTENT)
# Only tgz files available
ORIGINAL_SZIP_LIBRARY ("TGZ" ${HDF5_ENABLE_SZIP_ENCODING})
message (VERBOSE "SZIP is built from fetch content")
message (VERBOSE "... with library AEC")
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY})
elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${HDF5_ENABLE_SZIP_ENCODING})
message (VERBOSE "Filter SZIP is built")
message (VERBOSE "... with library AEC")
Expand Down
2 changes: 1 addition & 1 deletion CMakeInstallation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES)
set (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
endif ()
# set the install/unistall icon used for the installer itself
# set the install/uninstall icon used for the installer itself
# There is a bug in NSI that does not handle full unix paths properly.
set (CPACK_NSIS_MUI_ICON "${HDF_RESOURCES_DIR}\\\\hdf.ico")
set (CPACK_NSIS_MUI_UNIICON "${HDF_RESOURCES_DIR}\\\\hdf.ico")
Expand Down
124 changes: 20 additions & 104 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,12 @@ include (${HDF_RESOURCES_DIR}/ConfigureChecks.cmake)

set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)

#-----------------------------------------------------------------------------
# Include directories in the source or build tree should come before other
# directories to prioritize headers in the sources over installed ones.
#-----------------------------------------------------------------------------
set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)

#-----------------------------------------------------------------------------
# Mac OS X Options
#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -671,6 +677,12 @@ if (HDF5_ENABLE_PARALLEL)
find_package(MPI REQUIRED)
if (MPI_C_FOUND)
set (H5_HAVE_PARALLEL 1)

# Require MPI standard 3.0 and greater
if (MPI_VERSION LESS 3)
message (FATAL_ERROR "HDF5 requires MPI standard 3.0 or greater")
endif ()

# MPI checks, only do these if MPI_C_FOUND is true, otherwise they always fail
# and once set, they are cached as false and not regenerated
set (CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}")
Expand Down Expand Up @@ -723,6 +735,9 @@ set (HDF5_SRC_INCLUDE_DIRS
)
option (HDF5_ENABLE_SUBFILING_VFD "Build Parallel HDF5 Subfiling VFD" OFF)
if (HDF5_ENABLE_SUBFILING_VFD)
if (WIN32)
message (FATAL_ERROR " **** Subfiling is not supported on Windows **** ")
endif ()
if (NOT HDF5_ENABLE_PARALLEL)
message (FATAL_ERROR "Subfiling VFD requires a parallel HDF5 build")
else ()
Expand All @@ -731,7 +746,7 @@ if (HDF5_ENABLE_SUBFILING_VFD)
if (NOT H5_HAVE_MPI_Comm_split_type)
message (FATAL_ERROR "Subfiling VFD requires MPI-3 support for MPI_Comm_split_type")
endif ()
endif()
endif ()

if (NOT DEFINED Threads_FOUND)
set (THREADS_PREFER_PTHREAD_FLAG ON)
Expand Down Expand Up @@ -855,13 +870,6 @@ option (HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF)
if (NOT HDF5_EXTERNALLY_CONFIGURED)
if (HDF5_PACKAGE_EXTLIBS)
set (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE)
if (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND AND NOT BUILD_ZLIB_WITH_FETCHCONTENT)
PACKAGE_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT})
endif ()

if (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND AND NOT BUILD_SZIP_WITH_FETCHCONTENT)
PACKAGE_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT})
endif ()
endif ()
endif ()

Expand All @@ -872,8 +880,9 @@ option (HDF5_ENABLE_THREADSAFE "Enable thread-safety" OFF)
if (HDF5_ENABLE_THREADSAFE)
# check for unsupported options
if (WIN32)
message (VERBOSE " **** thread-safety option not supported with static library **** ")
message (VERBOSE " **** thread-safety option will not be used building static library **** ")
if (BUILD_STATIC_LIBS)
message (FATAL_ERROR " **** thread-safety option not supported with static library **** ")
endif ()
endif ()
if (HDF5_BUILD_FORTRAN)
if (NOT ALLOW_UNSUPPORTED)
Expand Down Expand Up @@ -955,100 +964,7 @@ endif ()
#-----------------------------------------------------------------------------
option (BUILD_TESTING "Build HDF5 Unit Testing" ON)
if (BUILD_TESTING)
set (DART_TESTING_TIMEOUT 1200
CACHE STRING
"Timeout in seconds for each test (default 1200=20minutes)"
)

# Generate a list of timeouts based on DART_TESTING_TIMEOUT
math (EXPR CTEST_SHORT_TIMEOUT "${DART_TESTING_TIMEOUT} / 2")
math (EXPR CTEST_LONG_TIMEOUT "${DART_TESTING_TIMEOUT} * 2")
math (EXPR CTEST_VERY_LONG_TIMEOUT "${DART_TESTING_TIMEOUT} * 3")

option (HDF5_TEST_API "Execute HDF5 API tests" OFF)
mark_as_advanced (HDF5_TEST_API)
if (HDF5_TEST_API)
option (HDF5_TEST_API_INSTALL "Install HDF5 API tests" OFF)
mark_as_advanced (HDF5_TEST_API_INSTALL)

# Enable HDF5 Async API tests
option (HDF5_TEST_API_ENABLE_ASYNC "Enable HDF5 Async API tests" OFF)
mark_as_advanced (HDF5_TEST_API_ENABLE_ASYNC)

# Build and use HDF5 test driver program for API tests
option (HDF5_TEST_API_ENABLE_DRIVER "Enable HDF5 API test driver program" OFF)
mark_as_advanced (HDF5_TEST_API_ENABLE_DRIVER)
if (HDF5_TEST_API_ENABLE_DRIVER)
set (HDF5_TEST_API_SERVER "" CACHE STRING "Server executable for running API tests")
mark_as_advanced (HDF5_TEST_API_SERVER)
endif ()
endif ()

option (HDF5_TEST_VFD "Execute tests with different VFDs" OFF)
mark_as_advanced (HDF5_TEST_VFD)
if (HDF5_TEST_VFD)
option (HDF5_TEST_FHEAP_VFD "Execute tests with different VFDs" ON)
mark_as_advanced (HDF5_TEST_FHEAP_VFD)

# Initialize the list of VFDs to be used for testing and create a test folder for each VFD
H5_SET_VFD_LIST()
endif ()

option (HDF5_TEST_PASSTHROUGH_VOL "Execute tests with different passthrough VOL connectors" OFF)
mark_as_advanced (HDF5_TEST_PASSTHROUGH_VOL)
if (HDF5_TEST_PASSTHROUGH_VOL)
option (HDF5_TEST_FHEAP_PASSTHROUGH_VOL "Execute fheap test with different passthrough VOL connectors" ON)
mark_as_advanced (HDF5_TEST_FHEAP_PASSTHROUGH VOL)
endif ()

set (H5_TEST_EXPRESS_LEVEL_DEFAULT "3")
set (HDF_TEST_EXPRESS "${H5_TEST_EXPRESS_LEVEL_DEFAULT}"
CACHE STRING "Control testing framework (0-3) (0 = exhaustive testing; 3 = quicker testing)")
mark_as_advanced (HDF_TEST_EXPRESS)
if (NOT "${HDF_TEST_EXPRESS}" STREQUAL "")
set (H5_TEST_EXPRESS_LEVEL_DEFAULT "${HDF_TEST_EXPRESS}")
endif ()

enable_testing ()
include (CTest)

include (${HDF5_SOURCE_DIR}/CTestConfig.cmake)
configure_file (${HDF_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY)

option (HDF5_TEST_SERIAL "Execute non-parallel tests" ON)
mark_as_advanced (HDF5_TEST_SERIAL)

option (HDF5_TEST_TOOLS "Execute tools tests" ON)
mark_as_advanced (HDF5_TEST_TOOLS)

option (HDF5_TEST_EXAMPLES "Execute tests on examples" ON)
mark_as_advanced (HDF5_TEST_EXAMPLES)

option (HDF5_TEST_SWMR "Execute SWMR tests" ON)
mark_as_advanced (HDF5_TEST_SWMR)

option (HDF5_TEST_PARALLEL "Execute parallel tests" ON)
mark_as_advanced (HDF5_TEST_PARALLEL)

option (HDF5_TEST_FORTRAN "Execute fortran tests" ON)
mark_as_advanced (HDF5_TEST_FORTRAN)

option (HDF5_TEST_CPP "Execute cpp tests" ON)
mark_as_advanced (HDF5_TEST_CPP)

option (HDF5_TEST_JAVA "Execute java tests" ON)
mark_as_advanced (HDF5_TEST_JAVA)

if (NOT HDF5_EXTERNALLY_CONFIGURED)
if (EXISTS "${HDF5_TEST_SRC_DIR}" AND IS_DIRECTORY "${HDF5_TEST_SRC_DIR}")
add_subdirectory (test)
endif ()
if (H5_HAVE_PARALLEL)
if (EXISTS "${HDF5_TEST_PAR_DIR}" AND IS_DIRECTORY "${HDF5_TEST_PAR_DIR}")
add_subdirectory (testpar)
endif ()
endif ()
endif ()
include (CMakeTests.cmake)
endif ()

#-----------------------------------------------------------------------------
Expand Down
28 changes: 21 additions & 7 deletions CMakePlugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,41 @@
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
option (PLUGIN_USE_EXTERNAL "Use External Library Building for filter PLUGIN" 0)

set (PLUGIN_USE_EXTERNAL "Use External Library Building for PLUGIN" 1)
if (NOT PLUGIN_USE_LOCALCONTENT)
set (PLUGIN_URL ${PLUGIN_TGZ_ORIGPATH}/${PLUGIN_TGZ_NAME})
else ()
if (NOT H5PL_TGZPATH)
set (H5PL_TGZPATH ${TGZPATH})
endif ()
set (PLUGIN_URL ${H5PL_TGZPATH}/${PLUGIN_TGZ_NAME})
endif ()
message (STATUS "Filter PLUGIN file is ${PLUGIN_URL}")

include (ExternalProject)
#option (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO GIT TGZ)" "NO")
set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)")
set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ)
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
option (PLUGIN_USE_EXTERNAL "Use External Library Building for filter PLUGIN" 1)
set (PLUGIN_USE_EXTERNAL "Use External Library Building for PLUGIN" 1)
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT")
set (PLUGIN_URL ${PLUGIN_GIT_URL} CACHE STRING "Path to PLUGIN git repository")
set (PLUGIN_BRANCH ${PLUGIN_GIT_BRANCH})
elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
if (NOT TGZPATH)
set (TGZPATH ${HDF5_SOURCE_DIR})
if (NOT H5PL_TGZPATH)
set (H5PL_TGZPATH ${TGZPATH})
endif ()
set (PLUGIN_URL ${TGZPATH}/${PLUGIN_TGZ_NAME})
if (NOT EXISTS "${PLUGIN_URL}")
set (HDF5_ENABLE_PLUGIN_SUPPORT OFF CACHE BOOL "" FORCE)
message (STATUS "Filter PLUGIN file ${PLUGIN_URL} not found")
if (PLUGIN_USE_LOCALCONTENT)
if (NOT EXISTS "${PLUGIN_URL}")
set (HDF5_ENABLE_PLUGIN_SUPPORT OFF CACHE BOOL "" FORCE)
message (VERBOSE "Filter PLUGIN file ${PLUGIN_URL} not found")
endif ()
endif ()
else ()
set (PLUGIN_USE_EXTERNAL 0)
message (VERBOSE "Filter PLUGIN not built")
endif ()
endif ()

Expand Down
Loading

0 comments on commit 2f5d6cf

Please sign in to comment.