diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2023-06-19 05:21:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-19 05:21:40 (GMT) |
commit | d31a017e6c15fcb5f8ed16806b7259eadb8c350a (patch) | |
tree | 03bff3009a78b2fdded29b96c5f4efd151a3a97b /config/cmake | |
parent | 622e3b762917061cd226e2d1659ec8e7076bece3 (diff) | |
download | hdf5-d31a017e6c15fcb5f8ed16806b7259eadb8c350a.zip hdf5-d31a017e6c15fcb5f8ed16806b7259eadb8c350a.tar.gz hdf5-d31a017e6c15fcb5f8ed16806b7259eadb8c350a.tar.bz2 |
Various merges from develop (#3135)
* Merges from develop/1.14
* Fix doxygen warnings
* Fix spelling
* Fix doxygen ref
* Add braces
* Fix format
* Remove unused file
Diffstat (limited to 'config/cmake')
-rw-r--r-- | config/cmake/ConfigureChecks.cmake | 10 | ||||
-rw-r--r-- | config/cmake/FindSZIP.cmake | 129 | ||||
-rw-r--r-- | config/cmake/HDF5UseFortran.cmake | 35 | ||||
-rw-r--r-- | config/cmake/HDFCompilerFlags.cmake | 4 | ||||
-rw-r--r-- | config/cmake/HDFLibMacros.cmake | 4 | ||||
-rw-r--r-- | config/cmake/HDFTests.c | 4 | ||||
-rw-r--r-- | config/cmake/UserMacros/Windows_MT.cmake | 1 | ||||
-rw-r--r-- | config/cmake/scripts/HDF5options.cmake | 2 |
8 files changed, 38 insertions, 151 deletions
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index dbf395b..8900d4c 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -272,6 +272,7 @@ if (MINGW OR NOT WINDOWS) set (HDF_EXTRA_C_FLAGS ${HDF_EXTRA_C_FLAGS} -D_GNU_SOURCE) option (HDF_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) + mark_as_advanced (HDF_ENABLE_LARGE_FILE) if (HDF_ENABLE_LARGE_FILE AND NOT DEFINED TEST_LFS_WORKS_RUN) set (msg "Performing TEST_LFS_WORKS") try_run (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE @@ -694,11 +695,6 @@ endif () #----------------------------------------------------------------------------- set (${HDF_PREFIX}_CONVERT_DENORMAL_FLOAT 1) -# ---------------------------------------------------------------------- -# Set a special flag when using memory sanity checkers like Valgrind. -# This disables the free lists, as the memory reuse scheme they implement -# can hide memory problems. -#----------------------------------------------------------------------------- if (HDF5_ENABLE_USING_MEMCHECKER) set (${HDF_PREFIX}_USING_MEMCHECKER 1) endif () @@ -707,6 +703,7 @@ endif () # Option for --enable-strict-format-checks #----------------------------------------------------------------------------- option (HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF) +mark_as_advanced (HDF5_STRICT_FORMAT_CHECKS) if (HDF5_STRICT_FORMAT_CHECKS) set (${HDF_PREFIX}_STRICT_FORMAT_CHECKS 1) endif () @@ -719,6 +716,7 @@ MARK_AS_ADVANCED (HDF5_STRICT_FORMAT_CHECKS) # support denormalized floating values) to maximize speed. #----------------------------------------------------------------------------- option (HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON) +mark_as_advanced (HDF5_WANT_DATA_ACCURACY) if (HDF5_WANT_DATA_ACCURACY) set (${HDF_PREFIX}_WANT_DATA_ACCURACY 1) endif () @@ -731,6 +729,7 @@ MARK_AS_ADVANCED (HDF5_WANT_DATA_ACCURACY) # actually benefit little. #----------------------------------------------------------------------------- option (HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON) +mark_as_advanced (HDF5_WANT_DCONV_EXCEPTION) if (HDF5_WANT_DCONV_EXCEPTION) set (${HDF_PREFIX}_WANT_DCONV_EXCEPTION 1) endif () @@ -740,6 +739,7 @@ MARK_AS_ADVANCED (HDF5_WANT_DCONV_EXCEPTION) # Check if they would like the function stack support compiled in #----------------------------------------------------------------------------- option (HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF) +mark_as_advanced (HDF5_ENABLE_CODESTACK) if (HDF5_ENABLE_CODESTACK) set (${HDF_PREFIX}_HAVE_CODESTACK 1) endif () diff --git a/config/cmake/FindSZIP.cmake b/config/cmake/FindSZIP.cmake deleted file mode 100644 index 846a3d1..0000000 --- a/config/cmake/FindSZIP.cmake +++ /dev/null @@ -1,129 +0,0 @@ -# -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# -######################################################################### - -# - Derived from the FindTiff.cmake and FindJPEG.cmake that is included with cmake -# FindSZIP - -# Find the native SZIP includes and library - -# Imported targets -################## - -# This module defines the following :prop_tgt:`IMPORTED` targets: -# -# SZIP::SZIP -# The SZIP library, if found. -# -# Result variables -################### - -# This module will set the following variables in your project: - -# SZIP_FOUND, true if the SZIP headers and libraries were found. -# SZIP_INCLUDE_DIR, the directory containing the SZIP headers. -# SZIP_INCLUDE_DIRS, the directory containing the SZIP headers. -# SZIP_LIBRARIES, libraries to link against to use SZIP. - -# Cache variables -################# - -# The following variables may also be set: - -# SZIP_LIBRARY, where to find the SZIP library. -# SZIP_LIBRARY_DEBUG - Debug version of SZIP library -# SZIP_LIBRARY_RELEASE - Release Version of SZIP library - -# message (STATUS "Finding SZIP library and headers..." ) -######################################################################### - - -find_path(SZIP_INCLUDE_DIR szlib.h) - -set(szip_names ${SZIP_NAMES} sz szip szip-static libsz libszip libszip-static) -foreach(name ${szip_names}) - list (APPEND szip_names_debug "${name}d") -endforeach() - -if(NOT SZIP_LIBRARY) - find_library(SZIP_LIBRARY_RELEASE NAMES ${szip_names}) - find_library(SZIP_LIBRARY_DEBUG NAMES ${szip_names_debug}) - include(SelectLibraryConfigurations) - select_library_configurations(SZIP) - mark_as_advanced(SZIP_LIBRARY_RELEASE SZIP_LIBRARY_DEBUG) -endif() -unset(szip_names) -unset(szip_names_debug) - -if(SZIP_INCLUDE_DIR AND EXISTS "${SZIP_INCLUDE_DIR}/SZconfig.h") - file(STRINGS "${SZIP_INCLUDE_DIR}/SZconfig.h" szip_version_str - REGEX "^#define[\t ]+SZIP_PACKAGE_VERSION[\t ]+.*") - - string(REGEX REPLACE "^#define[\t ]+SZIP_PACKAGE_VERSION[\t ]+([0-9]+).*" - "\\1" SZIP_VERSION "${szip_version_str}") - unset(szip_version_str) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(SZIP - REQUIRED_VARS SZIP_LIBRARY SZIP_INCLUDE_DIR - VERSION_VAR SZIP_VERSION) - -if(SZIP_FOUND) - set(SZIP_LIBRARIES ${SZIP_LIBRARY}) - set(SZIP_INCLUDE_DIRS "${SZIP_INCLUDE_DIR}") - - if(NOT TARGET SZIP::SZIP) - add_library(SZIP::SZIP UNKNOWN IMPORTED) - if(SZIP_INCLUDE_DIRS) - set_target_properties(SZIP::SZIP PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${SZIP_INCLUDE_DIRS}") - endif() - if(EXISTS "${SZIP_LIBRARY}") - set_target_properties(SZIP::SZIP PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION "${SZIP_LIBRARY}") - endif() - if(EXISTS "${SZIP_LIBRARY_RELEASE}") - set_property(TARGET SZIP::SZIP APPEND PROPERTY - IMPORTED_CONFIGURATIONS RELEASE) - set_target_properties(SZIP::SZIP PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C" - IMPORTED_LOCATION_RELEASE "${SZIP_LIBRARY_RELEASE}") - endif() - if(EXISTS "${SZIP_LIBRARY_DEBUG}") - set_property(TARGET SZIP::SZIP APPEND PROPERTY - IMPORTED_CONFIGURATIONS DEBUG) - set_target_properties(SZIP::SZIP PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C" - IMPORTED_LOCATION_DEBUG "${SZIP_LIBRARY_DEBUG}") - endif() - endif() -endif() - -mark_as_advanced(SZIP_LIBRARY SZIP_INCLUDE_DIR) - -# Report the results. -if (NOT SZIP_FOUND) - set (SZIP_DIR_MESSAGE - "SZip was not found. Make sure SZIP_LIBRARY and SZIP_INCLUDE_DIR are set or set the SZIP_INSTALL environment variable." - ) - if (NOT SZIP_FIND_QUIETLY) - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE "${SZIP_DIR_MESSAGE}") - endif () - else () - if (SZIP_FIND_REQUIRED) - message (FATAL_ERROR "SZip was NOT found and is Required by this project") - endif () - endif () -endif () diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index 43e006c..fd09c51 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -17,6 +17,12 @@ enable_language (Fortran) set (HDF_PREFIX "H5") + +# Force lowercase Fortran module file names +if (CMAKE_Fortran_COMPILER_ID STREQUAL "Cray") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ef") +endif () + include (CheckFortranFunctionExists) if (NOT CMAKE_VERSION VERSION_LESS "3.14.0") @@ -43,11 +49,16 @@ macro (FORTRAN_RUN FUNCTION_NAME SOURCE_CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR1 ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler1.f90 "${SOURCE_CODE}" ) + if (CMAKE_VERSION VERSION_LESS 3.25) + set (_RUN_OUTPUT_VARIABLE "RUN_OUTPUT_VARIABLE") + else () + set (_RUN_OUTPUT_VARIABLE "RUN_OUTPUT_STDOUT_VARIABLE") + endif() TRY_RUN (RUN_RESULT_VAR COMPILE_RESULT_VAR ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler1.f90 LINK_LIBRARIES "${HDF5_REQUIRED_LIBRARIES}" - RUN_OUTPUT_VARIABLE OUTPUT_VAR + ${_RUN_OUTPUT_VARIABLE} OUTPUT_VAR ) set (${RETURN_OUTPUT_VAR} ${OUTPUT_VAR}) @@ -187,10 +198,10 @@ foreach (KIND ${VAR}) " PROGRAM main USE ISO_C_BINDING - USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stderr=>ERROR_UNIT + USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stdout=>OUTPUT_UNIT IMPLICIT NONE INTEGER (KIND=${KIND}) a - WRITE(stderr,'(I0)') ${FC_SIZEOF_A} + WRITE(stdout,'(I0)') ${FC_SIZEOF_A} END " ) @@ -230,10 +241,10 @@ foreach (KIND ${VAR} ) " PROGRAM main USE ISO_C_BINDING - USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stderr=>ERROR_UNIT + USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stdout=>OUTPUT_UNIT IMPLICIT NONE REAL (KIND=${KIND}) a - WRITE(stderr,'(I0)') ${FC_SIZEOF_A} + WRITE(stdout,'(I0)') ${FC_SIZEOF_A} END " ) @@ -272,17 +283,17 @@ set (PROG_SRC3 " PROGRAM main USE ISO_C_BINDING - USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stderr=>ERROR_UNIT + USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stdout=>OUTPUT_UNIT IMPLICIT NONE INTEGER a REAL b DOUBLE PRECISION c - WRITE(stderr,*) ${FC_SIZEOF_A} - WRITE(stderr,*) kind(a) - WRITE(stderr,*) ${FC_SIZEOF_B} - WRITE(stderr,*) kind(b) - WRITE(stderr,*) ${FC_SIZEOF_C} - WRITE(stderr,*) kind(c) + WRITE(stdout,*) ${FC_SIZEOF_A} + WRITE(stdout,*) kind(a) + WRITE(stdout,*) ${FC_SIZEOF_B} + WRITE(stdout,*) kind(b) + WRITE(stdout,*) ${FC_SIZEOF_C} + WRITE(stdout,*) kind(c) END " ) diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 88670d7..b5c50b3 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -56,7 +56,9 @@ if (CMAKE_COMPILER_IS_GNUCC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Og -ftrapv -fno-common") endif () else () - if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND + NOT CMAKE_C_CLANG_TIDY) + # `clang-tidy` does not understand -fstdarg-opt set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt") endif () if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0) diff --git a/config/cmake/HDFLibMacros.cmake b/config/cmake/HDFLibMacros.cmake index 6d77ab5..752d817 100644 --- a/config/cmake/HDFLibMacros.cmake +++ b/config/cmake/HDFLibMacros.cmake @@ -17,13 +17,14 @@ macro (ORIGINAL_ZLIB_LIBRARY compress_type) GIT_TAG ${ZLIB_BRANCH} ) elseif (${compress_type} MATCHES "TGZ") + message (VERBOSE "Filter ZLIB file ${ZLIB_URL}") FetchContent_Declare (HDF5_ZLIB URL ${ZLIB_URL} URL_HASH "" ) endif () FetchContent_GetProperties(HDF5_ZLIB) - if(NOT zlib_POPULATED) + if(NOT hdf5_zlib_POPULATED) FetchContent_Populate(HDF5_ZLIB) # Copy an additional/replacement files into the populated source @@ -51,6 +52,7 @@ macro (ORIGINAL_SZIP_LIBRARY compress_type encoding) GIT_TAG ${SZIP_BRANCH} ) elseif (${compress_type} MATCHES "TGZ") + message (VERBOSE "Filter SZIP file ${SZIP_URL}") FetchContent_Declare (SZIP URL ${SZIP_URL} URL_HASH "" diff --git a/config/cmake/HDFTests.c b/config/cmake/HDFTests.c index 2d7e1b4..133540b 100644 --- a/config/cmake/HDFTests.c +++ b/config/cmake/HDFTests.c @@ -188,8 +188,8 @@ int main(void) for (currentArg = llwidthArgs; *currentArg != NULL; currentArg++) { char formatString[64]; - sprintf(formatString, "%%%sd", *currentArg); - sprintf(s, formatString, x); + snprintf(formatString, sizeof(formatString), "%%%sd", *currentArg); + snprintf(s, 128, formatString, x); if (strcmp(s, "1099511627776") == 0) { printf("PRINTF_LL_WIDTH=[%s]\n", *currentArg); diff --git a/config/cmake/UserMacros/Windows_MT.cmake b/config/cmake/UserMacros/Windows_MT.cmake index 15cffba..c8edbe4 100644 --- a/config/cmake/UserMacros/Windows_MT.cmake +++ b/config/cmake/UserMacros/Windows_MT.cmake @@ -47,6 +47,7 @@ endmacro () #----------------------------------------------------------------------------- option (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" OFF) +mark_as_advanced (BUILD_STATIC_CRT_LIBS) if (BUILD_STATIC_CRT_LIBS) TARGET_STATIC_CRT_FLAGS () endif () diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake index 92bfd37..ba5fc24 100644 --- a/config/cmake/scripts/HDF5options.cmake +++ b/config/cmake/scripts/HDF5options.cmake @@ -70,7 +70,7 @@ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRIN ### disable using ext zlib #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF") ### disable using ext szip -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF") +#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON") #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") #### package examples #### |