diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2021-04-08 02:07:31 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2021-04-08 02:07:31 (GMT) |
commit | 94ecd14100c226ae16ba8e6122e8a025b408f360 (patch) | |
tree | ead9be12c20e05113ec060ddfc81bac74c8162e9 /config | |
parent | ce39d7501c58427add05aba62956acb84a6f56da (diff) | |
download | hdf5-94ecd14100c226ae16ba8e6122e8a025b408f360.zip hdf5-94ecd14100c226ae16ba8e6122e8a025b408f360.tar.gz hdf5-94ecd14100c226ae16ba8e6122e8a025b408f360.tar.bz2 |
Brings many CMake changes from develop
Diffstat (limited to 'config')
31 files changed, 660 insertions, 179 deletions
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 4e31b38..0d82668 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -165,14 +165,18 @@ if (NOT WINDOWS) add_definitions ("-D_GNU_SOURCE") else () set (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_DIRECT_VFD_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" ) endif () else () set (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_DIRECT_VFD_WORKS Compile failed with the following output:\n ${OUTPUT}\n" ) @@ -192,7 +196,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 () - message (STATUS "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.") + 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 () @@ -209,7 +213,7 @@ if (H5FD_ENABLE_MIRROR_VFD) ${HDF_PREFIX}_HAVE_FORK) set (${HDF_PREFIX}_HAVE_MIRROR_VFD 1) else() - message(STATUS "The socket-based Mirror VFD was requested but cannot be built. System prerequisites are not met.") + message(WARNING "The socket-based Mirror VFD was requested but cannot be built. System prerequisites are not met.") endif() endif() @@ -235,7 +239,6 @@ endif () #----------------------------------------------------------------------------- macro (H5ConversionTests TEST msg) if (NOT DEFINED ${TEST}) - # message (STATUS "===> ${TEST}") TRY_RUN (${TEST}_RUN ${TEST}_COMPILE ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_DIR}/ConversionTests.c @@ -245,17 +248,23 @@ macro (H5ConversionTests TEST msg) if (${TEST}_COMPILE) if (${TEST}_RUN MATCHES 0) set (${TEST} 1 CACHE INTERNAL ${msg}) - message (STATUS "${msg}... yes") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... yes") + endif () else () set (${TEST} "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Run failed with the following output and exit code:\n ${OUTPUT}\n" ) endif () else () set (${TEST} "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Compile failed with the following output:\n ${OUTPUT}\n" ) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 62cfcab..bf24776 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -26,9 +26,6 @@ /* Define if using a Windows compiler (i.e. Visual Studio) */ #cmakedefine H5_HAVE_VISUAL_STUDIO @H5_HAVE_VISUAL_STUDIO@ -/* Define if building universal (internal helper macro) */ -#cmakedefine H5_AC_APPLE_UNIVERSAL_BUILD @H5_AC_APPLE_UNIVERSAL_BUILD@ - /* Define if C++ compiler recognizes offsetof */ #cmakedefine H5_CXX_HAVE_OFFSETOF @CXX_HAVE_OFFSETOF@ @@ -524,7 +521,7 @@ #cmakedefine H5_LT_OBJDIR @H5_LT_OBJDIR@ /* Define to enable internal memory allocation sanity checking. */ -/* #cmakedefine H5_MEMORY_ALLOC_SANITY_CHECK @H5_MEMORY_ALLOC_SANITY_CHECK@ ** Define in CMakeLists.txt */ +#cmakedefine H5_MEMORY_ALLOC_SANITY_CHECK @H5_MEMORY_ALLOC_SANITY_CHECK@ /* Define if we can violate pointer alignment restrictions */ #cmakedefine H5_NO_ALIGNMENT_RESTRICTIONS @H5_NO_ALIGNMENT_RESTRICTIONS@ @@ -614,6 +611,7 @@ #cmakedefine H5_SIZEOF_INT_LEAST8_T @H5_SIZEOF_INT_LEAST8_T@ #if !defined(__APPLE__) + /* The size of `size_t', as computed by sizeof. */ #cmakedefine H5_SIZEOF_SIZE_T @H5_SIZEOF_SIZE_T@ @@ -623,8 +621,17 @@ /* The size of `long', as computed by sizeof. */ #cmakedefine H5_SIZEOF_LONG @H5_SIZEOF_LONG@ +/* The size of `long double', as computed by sizeof. */ +#cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@ + #else - # if defined(__LP64__) && __LP64__ + + /* On Apple, to support Universal Binaries (where multiple CPU + architectures exist in one library/executable), we can't assume + the machine doing the compiling has the same endianness or type + sizes as all the various architectures (PowerPC, Intel, ARM). */ + + # if defined(__LP64__) && __LP64__ #define H5_SIZEOF_LONG 8 #define H5_SIZEOF_SIZE_T 8 #define H5_SIZEOF_SSIZE_T 8 @@ -634,10 +641,15 @@ #define H5_SIZEOF_SSIZE_T 4 # endif -#endif + # if defined(__i386__) || defined(__x86_64__) + #define H5_SIZEOF_LONG_DOUBLE 16 + # elif defined(__aarch64__) + #define H5_SIZEOF_LONG_DOUBLE 8 + # else + #cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@ + # endif -/* The size of `long double', as computed by sizeof. */ -#cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@ +#endif /* Define size of long long and/or __int64 bit integer type only if the type exists. */ diff --git a/config/cmake/HDF5PluginCache.cmake b/config/cmake/HDF5PluginCache.cmake new file mode 100644 index 0000000..3b085dd --- /dev/null +++ b/config/cmake/HDF5PluginCache.cmake @@ -0,0 +1,29 @@ +# This is the CMakeCache file. + +######################## +# EXTERNAL cache entries +######################## + +# examples are the tests for plugins +set (H5PL_BUILD_TESTING ON CACHE BOOL "Enable h5pl testing" FORCE) +set (BUILD_EXAMPLES ON CACHE BOOL "Build h5pl Examples" FORCE) + +set (HDF5_HDF5_HEADER "h5pubconf.h" CACHE STRING "Name of HDF5 header" FORCE) +set (HDF5_LINK_LIBS ${HDF5_LIBSH_TARGET} CACHE STRING "hdf5 target" FORCE) +#set (HDF5_INCLUDE_DIR $<TARGET_PROPERTY:${HDF5_LIBSH_TARGET},INCLUDE_DIRECTORIES> CACHE PATH "hdf5 include dirs" FORCE) +set (HDF5_INCLUDE_DIR "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}" CACHE PATH "hdf5 include dirs" FORCE) +set (HDF5_INCLUDE_DIRS "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}" CACHE PATH "hdf5 include dirs" FORCE) +set (HDF5_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE STRING "hdf5 build folder" FORCE) + +set (HDF5_DUMP_EXECUTABLE $<TARGET_FILE:h5dump-shared> CACHE STRING "hdf5 h5dump target" FORCE) +set (HDF5_REPACK_EXECUTABLE $<TARGET_FILE:h5repack-shared> CACHE STRING "hdf5 h5repack target" FORCE) + +set (H5PL_ALLOW_EXTERNAL_SUPPORT "${HDF5_ALLOW_EXTERNAL_SUPPORT}" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE) + +set (H5PL_GIT_URL "https://github.com/HDFGroup/hdf5_plugins.git" CACHE STRING "Use plugins from HDF repository" FORCE) +set (H5PL_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (H5PL_TGZ_NAME "${PLUGIN_TGZ_NAME}" CACHE STRING "Use plugins from compressed file" FORCE) + +set (PL_PACKAGE_NAME "${PLUGIN_PACKAGE_NAME}" CACHE STRING "Name of plugins package" FORCE) +set (H5PL_CPACK_ENABLE OFF CACHE BOOL "Enable the CPACK include and components" FORCE) diff --git a/config/cmake/HDF5PluginMacros.cmake b/config/cmake/HDF5PluginMacros.cmake new file mode 100644 index 0000000..4e05399 --- /dev/null +++ b/config/cmake/HDF5PluginMacros.cmake @@ -0,0 +1,108 @@ +#------------------------------------------------------------------------------- +# Plugins must be built SHARED +#------------------------------------------------------------------------------- +macro (EXTERNAL_PLUGIN_LIBRARY compress_type) + if (${compress_type} MATCHES "GIT") + FetchContent_Declare (PLUGIN + GIT_REPOSITORY ${PLUGIN_URL} + GIT_TAG ${PLUGIN_BRANCH} + ) + elseif (${compress_type} MATCHES "TGZ") + FetchContent_Declare (PLUGIN + URL ${PLUGIN_URL} + URL_HASH "" + ) + endif () + FetchContent_GetProperties(PLUGIN) + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "HDF5_INCLUDE_DIR=${HDF5_INCLUDE_DIR}") + endif () + if(NOT PLUGIN_POPULATED) + FetchContent_Populate(PLUGIN) + include (${HDF_RESOURCES_DIR}/HDF5PluginCache.cmake) + set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) + add_subdirectory(${plugin_SOURCE_DIR} ${plugin_BINARY_DIR}) + if (ENABLE_BLOSC) + add_dependencies (h5blosc ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_blosc ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_blosc PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_BSHUF) + add_dependencies (h5bshuf ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_bshuf ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_bshuf PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_BZIP2) + add_dependencies (h5bz2 ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_bzip2 ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_bzip2 PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_JPEG) + add_dependencies (h5jpeg ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_jpeg ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_jpeg PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_LZ4) + add_dependencies (h5lz4 ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_lz4 ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_lz4 PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_LZF) + add_dependencies (h5lzf ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_lzf ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_lzf PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_MAFISC) + add_dependencies (h5mafisc ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_mafisc ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_mafisc PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_SZF) + add_dependencies (h5szf ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_sz ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_sz PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + if (ENABLE_ZFP) + add_dependencies (h5zfp ${HDF5_LIBSH_TARGET}) + add_dependencies (h5ex_d_zfp ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_zfp PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + endif () + endif () + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "HDF5_INCLUDE_DIR=${HDF5_INCLUDE_DIR}") + endif () + set (PLUGIN_BINARY_DIR "${plugin_BINARY_DIR}") + set (PLUGIN_SOURCE_DIR "${plugin_SOURCE_DIR}") + set (PLUGIN_LIBRARY "PLUGIN") + set (PLUGIN_FOUND 1) +endmacro () + +#------------------------------------------------------------------------------- +macro (FILTER_OPTION plname) + string(TOLOWER ${plname} PLUGIN_NAME) + option (ENABLE_${plname} "Enable Library Building for ${plname} plugin" ON) + if (ENABLE_${plname}) + option (HDF_${plname}_USE_EXTERNAL "Use External Library Building for ${PLUGIN_NAME} plugin" 0) + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + set (HDF_${plname}_USE_EXTERNAL 1 CACHE BOOL "Use External Library Building for ${PLUGIN_NAME} plugin" FORCE) + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") + set (HDF_${plname}_URL ${HDF_${plname}_GIT_URL}) + set (HDF_${plname}_BRANCH ${HDF_${plname}_GIT_BRANCH}) + elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + if (NOT TGZPATH) + set (TGZPATH ${H5PL_SOURCE_DIR}) + endif () + set (HDF_${plname}_URL ${TGZPATH}/${HDF_${plname}_TGZ_NAME}) + endif () + endif () + add_subdirectory (${plname}) + set_global_variable (H5PL_LIBRARIES_TO_EXPORT "${H5PL_LIBRARIES_TO_EXPORT};${H5${plname}_LIBRARIES_TO_EXPORT}") + endif () +endmacro () + +#------------------------------------------------------------------------------- +macro (PACKAGE_PLUGIN_LIBRARY compress_type) + if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ") + message (STATUS "Filter PLUGIN is to be packaged") + endif () +endmacro () diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index 1dd8203..003f24f 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -41,7 +41,9 @@ else () # so this one is used. #----------------------------------------------------------------------------- macro (FORTRAN_RUN FUNCTION_NAME SOURCE_CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR1 RETURN_VAR) - message (STATUS "Detecting Fortran ${FUNCTION_NAME}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Detecting Fortran ${FUNCTION_NAME}") + endif () file (WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler1.f90 "${SOURCE_CODE}" @@ -55,18 +57,24 @@ macro (FORTRAN_RUN FUNCTION_NAME SOURCE_CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR1 if (${COMPILE_RESULT_VAR}) set(${RETURN_VAR} ${RUN_RESULT_VAR}) if (${RUN_RESULT_VAR} MATCHES 0) - message (STATUS "Testing Fortran ${FUNCTION_NAME} - OK") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing Fortran ${FUNCTION_NAME} - OK") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Fortran ${FUNCTION_NAME} exists passed\n" ) else () - message (STATUS "Testing Fortran ${FUNCTION_NAME} - Fail") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing Fortran ${FUNCTION_NAME} - Fail") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Fortran ${FUNCTION_NAME} exists failed: ${RUN_RESULT_VAR}\n" ) endif () else () - message (STATUS "Compiling Fortran ${FUNCTION_NAME} - Fail") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Compiling Fortran ${FUNCTION_NAME} - Fail") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Fortran ${FUNCTION_NAME} compiles failed: ${COMPILE_RESULT_VAR}\n" ) @@ -281,7 +289,9 @@ string (REGEX REPLACE " " "" pack_int_sizeof "${pack_int_sizeof}") set (PAC_FC_ALL_INTEGER_KINDS_SIZEOF "\{${pack_int_sizeof}\}") -message (STATUS "....FOUND SIZEOF for INTEGER KINDs ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF}") +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "....FOUND SIZEOF for INTEGER KINDs ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF}") +endif () # ********** # REALS # ********** @@ -442,7 +452,9 @@ else () # so this one is used. #----------------------------------------------------------------------------- macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR) - message (STATUS "Detecting C ${FUNCTION_NAME}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Detecting C ${FUNCTION_NAME}") + endif () if (HDF5_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${HDF5_REQUIRED_LIBRARIES}") @@ -462,22 +474,28 @@ macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR) set (${RETURN_VAR} ${OUTPUT_VAR}) - #message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - #message (STATUS "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ") - #message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - #message (STATUS "Test RUN_RESULT_VAR ${RUN_RESULT_VAR} ") - #message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + #if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + # message (TRACE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + # message (TRACE "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ") + # message (TRACE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + # message (TRACE "Test RUN_RESULT_VAR ${RUN_RESULT_VAR} ") + # message (TRACE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + #endif () if (${COMPILE_RESULT_VAR}) if (${RUN_RESULT_VAR} MATCHES 1) set (${RUN_RESULT_VAR} 1 CACHE INTERNAL "Have C function ${FUNCTION_NAME}") - message (STATUS "Testing C ${FUNCTION_NAME} - OK") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing C ${FUNCTION_NAME} - OK") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the C ${FUNCTION_NAME} exists passed with the following output:\n" "${OUTPUT_VAR}\n\n" ) else () - message (STATUS "Testing C ${FUNCTION_NAME} - Fail") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing C ${FUNCTION_NAME} - Fail") + endif () set (${RUN_RESULT_VAR} 0 CACHE INTERNAL "Have C function ${FUNCTION_NAME}") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the C ${FUNCTION_NAME} exists failed with the following output:\n" diff --git a/config/cmake/HDF5_Examples_options.cmake b/config/cmake/HDF5_Examples_options.cmake index 9fd367a..b639b19 100644 --- a/config/cmake/HDF5_Examples_options.cmake +++ b/config/cmake/HDF5_Examples_options.cmake @@ -18,6 +18,7 @@ #### HDF_BUILD_CXX:BOOL=OFF ### #### HDF_BUILD_FORTRAN:BOOL=OFF ### #### HDF_BUILD_JAVA:BOOL=OFF ### +#### HDF_BUILD_FILTERS:BOOL=OFF ### #### BUILD_TESTING:BOOL=OFF ### #### HDF_ENABLE_PARALLEL:BOOL=OFF ### #### HDF_ENABLE_THREADSAFE:BOOL=OFF ### @@ -41,6 +42,9 @@ ### enable JAVA builds #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON") +### enable FILTERS builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FILTERS:BOOL=ON") + ############################################################################################# ### enable parallel program builds #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_PARALLEL:BOOL=ON") diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake index ef06090..757692c 100644 --- a/config/cmake/HDFCXXCompilerFlags.cmake +++ b/config/cmake/HDFCXXCompilerFlags.cmake @@ -30,6 +30,14 @@ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstdarg-opt") endif () + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0) + if (HDF5_ENABLE_BUILD_DIAGS) + message (STATUS "... default color and URL extended diagnostic messages enabled") + else () + message (STATUS "... disable color and URL extended diagnostic messages") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color") + endif () + endif () endif () endif () diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 18f8d01..add40bb 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -32,6 +32,20 @@ if (CMAKE_COMPILER_IS_GNUCC) if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) 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) + #----------------------------------------------------------------------------- + # Option to allow the user to enable build extended diagnostics + # + # This should NOT be on by default as it can cause process issues. + #----------------------------------------------------------------------------- + option (HDF5_ENABLE_BUILD_DIAGS "Enable color and URL extended diagnostic messages" OFF) + if (HDF5_ENABLE_BUILD_DIAGS) + message (STATUS "... default color and URL extended diagnostic messages enabled") + else () + message (STATUS "... disable color and URL extended diagnostic messages") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color") + endif () + endif () endif () endif () diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake index d133069..8b631ad 100644 --- a/config/cmake/HDFFortranCompilerFlags.cmake +++ b/config/cmake/HDFFortranCompilerFlags.cmake @@ -10,7 +10,9 @@ # help@hdfgroup.org. # -message (STATUS "Warnings Configuration: default Fortran: ${CMAKE_Fortran_FLAGS}") +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Warnings Configuration: default Fortran: ${CMAKE_Fortran_FLAGS}") +endif () #----------------------------------------------------------------------------- # Option to allow the user to disable compiler warnings @@ -43,6 +45,14 @@ endif () #----------------------------------------------------------------------------- # HDF5 library compile options #----------------------------------------------------------------------------- +if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 10.0) + if (HDF5_ENABLE_BUILD_DIAGS) + message (STATUS "... default color and URL extended diagnostic messages enabled") + else () + message (STATUS "... disable color and URL extended diagnostic messages") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color") + endif () +endif () #----------------------------------------------------------------------------- # CDash is configured to only allow 3000 warnings, so @@ -64,7 +74,9 @@ if (NOT MSVC AND NOT MINGW) elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "PGI") list (APPEND HDF5_CMAKE_Fortran_FLAGS "-Mfreeform" "-Mdclchk" "-Mstandard" "-Mallocatable=03") endif () - message (STATUS "HDF5_CMAKE_Fortran_FLAGS=${HDF5_CMAKE_Fortran_FLAGS}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "HDF5_CMAKE_Fortran_FLAGS=${HDF5_CMAKE_Fortran_FLAGS}") + endif () if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") diff --git a/config/cmake/README.txt.cmake.in b/config/cmake/README.txt.cmake.in index 3afebc2..f621515 100644 --- a/config/cmake/README.txt.cmake.in +++ b/config/cmake/README.txt.cmake.in @@ -17,6 +17,18 @@ The contents of this directory are: README.txt - This file @HDF5_PACKAGE_NAME@-@HDF5_PACKAGE_VERSION@-@BINARY_SYSTEM_NAME@.@BINARY_INSTALL_ENDING@ - HDF5 Install Package +This binary was built with the ZLIB and SZIP/Libaec external libraries and are +included for convenience. Libaec is an unrestricted open-source replacement for SZIP +(version 1.0.4, Encoder ENABLED). + +The official ZLIB and SZIP/Libaec pages are at: + + ZLIB: https://git.savannah.gnu.org/cgit/gzip.git/ + https://git.savannah.gnu.org/cgit/gzip.git/tree/COPYING + SZIP/Libaec: https://gitlab.dkrz.de/k202009/libaec + https://gitlab.dkrz.de/k202009/libaec/-/blob/master/Copyright.txt + + Installation =========================================================================== 1. Execute @HDF5_PACKAGE_NAME@-@HDF5_PACKAGE_VERSION@-@BINARY_SYSTEM_NAME@.@BINARY_INSTALL_ENDING@ diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 8abd01e..fc85277 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -40,11 +40,12 @@ set (HDF5_ENABLE_ALL_WARNINGS ON CACHE BOOL "Enable all warnings" FORCE) set (HDF_TEST_EXPRESS "2" CACHE STRING "Control testing framework (0-3)" FORCE) +set (HDF5_MINGW_STATIC_GCC_LIBS ON CACHE BOOL "Statically link libgcc/libstdc++" FORCE) + set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE) set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) - set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) set (SZAEC_TGZ_NAME "LIBAEC.tar.gz" CACHE STRING "Use SZip AEC from compressed file" FORCE) set (USE_LIBAEC ON CACHE BOOL "Use libaec szip replacement" FORCE) @@ -52,3 +53,128 @@ set (USE_LIBAEC ON CACHE BOOL "Use libaec szip replacement" FORCE) set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) set (LIBAEC_PACKAGE_NAME "libaec" CACHE STRING "Name of AEC SZIP package" FORCE) set (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) + +####################### +# filter plugin options +####################### +set (PLUGIN_TGZ_NAME "hdf5_plugins.tar.gz" CACHE STRING "Use PLUGINS from compressed file" FORCE) + +set (PLUGIN_PACKAGE_NAME "pl" CACHE STRING "Name of PLUGIN package" FORCE) + +############ +# bitshuffle +########### + +set (BSHUF_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/bitshuffle.git" CACHE STRING "Use BSHUF from HDF repository" FORCE) +set (BSHUF_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (BSHUF_TGZ_NAME "bitshuffle.tar.gz" CACHE STRING "Use BSHUF from compressed file" FORCE) + +set (BSHUF_PACKAGE_NAME "bshuf" CACHE STRING "Name of BSHUF package" FORCE) + +####### +# blosc +####### + +set (BLOSC_GIT_URL "https://github.com/Blosc/c-blosc.git" CACHE STRING "Use BLOSC from Github" FORCE) +set (BLOSC_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (BLOSC_TGZ_NAME "c-blosc.tar.gz" CACHE STRING "Use BLOSC from compressed file" FORCE) + +set (BLOSC_PACKAGE_NAME "blosc" CACHE STRING "Name of BLOSC package" FORCE) + +set (ZLIB_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/zlib.git" CACHE STRING "Use ZLIB from HDF repo" FORCE) +set (ZLIB_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) + +set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) + +####### +# bzip2 +###### +# +set (BZ2_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/bzip2.git" CACHE STRING "Use BZ2 from HDF repository" FORCE) +set (BZ2_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (BZ2_TGZ_NAME "BZ2.tar.gz" CACHE STRING "Use BZ2 from compressed file" FORCE) + +set (BZ2_PACKAGE_NAME "bz2" CACHE STRING "Name of BZ2 package" FORCE) + +####### +# fpzip +####### + +set (FPZIP_GIT_URL "https://https://github.com/LLNL/fpzip" CACHE STRING "Use FPZIP from github repository" FORCE) +set (FPZIP_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (FPZIP_TGZ_NAME "fpzip.tar.gz" CACHE STRING "Use FPZIP from compressed file" FORCE) + +set (FPZIP_PACKAGE_NAME "fpzip" CACHE STRING "Name of FPZIP package" FORCE) + +###### +# jpeg +###### + +set (JPEG_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/jpeg.git" CACHE STRING "Use JPEG from HDF repository" FORCE) +set (JPEG_GIT_BRANCH "jpeg9c" CACHE STRING "" FORCE) + +#set (JPEG_TGZ_NAME "JPEG9c.tar.gz" CACHE STRING "Use JPEG from compressed file" FORCE) +set (JPEG_TGZ_NAME "JPEG.tar.gz" CACHE STRING "Use JPEG from compressed file" FORCE) + +set (JPEG_PACKAGE_NAME "jpeg" CACHE STRING "Name of JPEG package" FORCE) + +###### +# lz4 +###### + +set (BUILD_LZ4_LIBRARY_SOURCE ON CACHE BOOL "build the lz4 library within the plugin" FORCE) + +set (LZ4_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/lz4.git" CACHE STRING "Use LZ4 from HDF repository" FORCE) +set (LZ4_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (LZ4_TGZ_NAME "lz4.tar.gz" CACHE STRING "Use LZ4 from compressed file" FORCE) + +set (LZ4_PACKAGE_NAME "lz4" CACHE STRING "Name of LZ4 package" FORCE) + +###### +# lzf +###### + +set (LZF_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/lzf.git" CACHE STRING "Use LZF from HDF repository" FORCE) +set (LZF_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (LZF_TGZ_NAME "lzf.tar.gz" CACHE STRING "Use LZF from compressed file" FORCE) + +set (LZF_PACKAGE_NAME "lzf" CACHE STRING "Name of LZF package" FORCE) + +######## +# mafisc +######## + +#set (BUILD_MAFISC_LIBRARY_SOURCE OFF CACHE BOOL "build the mafisc library within the plugin" FORCE) + +#set (MAFISC_PACKAGE_NAME "mafisc" CACHE STRING "Name of MAFISC package" FORCE) + +###### +# szf +###### + +set (SZF_GIT_URL "https://github.com/disheng222/SZ" CACHE STRING "Use SZ from github repository" FORCE) +set (SZF_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (SZF_TGZ_NAME "szf.tar.gz" CACHE STRING "Use SZ from compressed file" FORCE) + +set (SZF_PACKAGE_NAME "szf" CACHE STRING "Name of SZ package" FORCE) + +###### +# zfp +###### + +set (ZFP_GIT_URL "https://github.com/LLNL/zfp.git" CACHE STRING "Use ZFP from Github" FORCE) +set (ZFP_GIT_BRANCH "master" CACHE STRING "" FORCE) + +set (ZFP_TGZ_NAME "zfp.tar.gz" CACHE STRING "Use ZFP from compressed file" FORCE) + +set (ZFP_PACKAGE_NAME "zfp" CACHE STRING "Name of ZFP package" FORCE) + diff --git a/config/cmake/fileCompareTest.cmake b/config/cmake/fileCompareTest.cmake index 2bbeecc..4a8dc09 100644 --- a/config/cmake/fileCompareTest.cmake +++ b/config/cmake/fileCompareTest.cmake @@ -24,9 +24,6 @@ endif () if (NOT TEST_FUNCTION) message (FATAL_ERROR "Require TEST_FUNCTION (LT,LTEQ,EQ,GTEQ,GT) to be defined") endif () -#if (NOT TEST_EXPECT) -# message (STATUS "Require TEST_EXPECT to be defined") -#endif () set (TEST_ONE_SIZE 0) set (TEST_TWO_SIZE 0) @@ -53,7 +50,9 @@ if (TEST_STRINGS STREQUAL "YES") RESULT_VARIABLE TEST_RESULT ) - message (STATUS "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}-${TEST_O_STRING_LEN}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}-${TEST_O_STRING_LEN}") + endif () # if the return value is !=${TEST_EXPECT} bail out if (NOT TEST_RESULT EQUAL TEST_EXPECT) message (FATAL_ERROR "Failed: The output of ${TEST_FOLDER}/${TEST_ONEFILE} did not match ${TEST_FOLDER}/${TEST_TWOFILE}.\n${TEST_ERROR}") @@ -66,31 +65,41 @@ else () file (SIZE ${TEST_FOLDER}/${TEST_TWOFILE} TEST_TWO_SIZE) if (TEST_FUNCTION MATCHES "LT") if (TEST_ONE_SIZE LESS TEST_TWO_SIZE) - message (STATUS "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was less ${TEST_FOLDER}/${TEST_TWOFILE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was less ${TEST_FOLDER}/${TEST_TWOFILE}") + endif () else () message (FATAL_ERROR "The size of ${TEST_FOLDER}/${TEST_ONEFILE} was NOT less ${TEST_FOLDER}/${TEST_TWOFILE}") endif () elseif (TEST_FUNCTION MATCHES "LTEQ") if (TEST_ONE_SIZE LESS_EQUAL TEST_TWO_SIZE) - message (STATUS "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was less or equal ${TEST_FOLDER}/${TEST_TWOFILE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSES "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was less or equal ${TEST_FOLDER}/${TEST_TWOFILE}") + endif () else () message (FATAL_ERROR "The size of ${TEST_FOLDER}/${TEST_ONEFILE} was NOT less or equal ${TEST_FOLDER}/${TEST_TWOFILE}") endif () elseif (TEST_FUNCTION MATCHES "EQ") if (TEST_ONE_SIZE LESS_EQUAL TEST_TWO_SIZE) - message (STATUS "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was equal ${TEST_FOLDER}/${TEST_TWOFILE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was equal ${TEST_FOLDER}/${TEST_TWOFILE}") + endif () else () message (FATAL_ERROR "The size of ${TEST_FOLDER}/${TEST_ONEFILE} was NOT equal ${TEST_FOLDER}/${TEST_TWOFILE}") endif () elseif (TEST_FUNCTION MATCHES "GTEQ") if (TEST_ONE_SIZE LESS_EQUAL TEST_TWO_SIZE) - message (STATUS "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was greater or equal ${TEST_FOLDER}/${TEST_TWOFILE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was greater or equal ${TEST_FOLDER}/${TEST_TWOFILE}") + endif () else () message (FATAL_ERROR "The size of ${TEST_FOLDER}/${TEST_ONEFILE} was NOT greater or equal ${TEST_FOLDER}/${TEST_TWOFILE}") endif () elseif (TEST_FUNCTION MATCHES "GT") if (TEST_ONE_SIZE LESS_EQUAL TEST_TWO_SIZE) - message (STATUS "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was greater ${TEST_FOLDER}/${TEST_TWOFILE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was greater ${TEST_FOLDER}/${TEST_TWOFILE}") + endif () else () message (FATAL_ERROR "The size of ${TEST_FOLDER}/${TEST_ONEFILE} was NOT greater ${TEST_FOLDER}/${TEST_TWOFILE}") endif () diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in index 8e93dc6..20ce630 100644 --- a/config/cmake/hdf5-config-version.cmake.in +++ b/config/cmake/hdf5-config-version.cmake.in @@ -33,7 +33,7 @@ else() endif() if((PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) AND - (PACKAGE_FIND_VERSION_MINOR STREQUAL CVF_VERSION_MINOR)) + (PACKAGE_FIND_VERSION_MINOR STRLESS_EQUAL CVF_VERSION_MINOR)) set(PACKAGE_VERSION_COMPATIBLE TRUE) else() set(PACKAGE_VERSION_COMPATIBLE FALSE) diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index b262aeb..4d02c9c 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -39,6 +39,7 @@ set (${HDF5_PACKAGE_NAME}_BUILD_JAVA @HDF5_BUILD_JAVA@) set (${HDF5_PACKAGE_NAME}_BUILD_TOOLS @HDF5_BUILD_TOOLS@) set (${HDF5_PACKAGE_NAME}_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@) set (${HDF5_PACKAGE_NAME}_ENABLE_THREADSAFE @HDF5_ENABLE_THREADSAFE@) +set (${HDF5_PACKAGE_NAME}_ENABLE_PLUGIN_SUPPORT @HDF5_ENABLE_PLUGIN_SUPPORT@) set (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@) set (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@) set (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@) diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake index 722cd19..2ca1b75 100644 --- a/config/cmake/jrunTest.cmake +++ b/config/cmake/jrunTest.cmake @@ -49,7 +49,7 @@ endif () message (STATUS "COMMAND: ${TEST_TESTER} -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=${LOG_LEVEL} -Djava.library.path=\"${TEST_LIBRARY_DIRECTORY}\" -cp \"${TEST_CLASSPATH}\" ${TEST_ARGS} ${TEST_PROGRAM} ${ARGN}") -if (WIN32 OR MINGW) +if (WIN32) set (ENV{PATH} "$ENV{PATH}\\;${TEST_LIBRARY_DIRECTORY}") else () set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") @@ -131,7 +131,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) @@ -202,7 +202,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF}) diff --git a/config/cmake/jvolTest.cmake b/config/cmake/jvolTest.cmake index aafb8a0..b12c358 100644 --- a/config/cmake/jvolTest.cmake +++ b/config/cmake/jvolTest.cmake @@ -54,7 +54,7 @@ message (STATUS "USING ${TEST_VOL} ON COMMAND: ${TEST_TESTER} -Xmx1024M -Dorg.sl set (ENV{HDF5_VOL_CONNECTOR} "${TEST_VOL}") -if (WIN32 OR MINGW) +if (WIN32) set (ENV{PATH} "$ENV{PATH}\\;${TEST_LIBRARY_DIRECTORY}") else () set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") @@ -136,7 +136,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) list(LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) @@ -207,7 +207,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) list(LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF}) diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 7005d3a..08e38e8 100644 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -21,6 +21,7 @@ cmake_minimum_required (VERSION 3.12) # ctest -S HDF5config.cmake,OPTION=VALUE -C Release -VV -O test.log # where valid options for OPTION are: # BUILD_GENERATOR - The cmake build generator: +# MinGW * MinGW Makefiles # Unix * Unix Makefiles # VS2019 * Visual Studio 16 2019 # VS201964 * Visual Studio 16 2019 @@ -167,7 +168,11 @@ if (NOT DEFINED HPC) ## Set the following to unique id your computer ## set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") else () - set (CTEST_CMAKE_GENERATOR "Unix Makefiles") + if (MINGW) + set (CTEST_CMAKE_GENERATOR "MinGW Makefiles") + else () + set (CTEST_CMAKE_GENERATOR "Unix Makefiles") + endif () ## Set the following to unique id your computer ## if (APPLE) set (CTEST_SITE "MAC.XXXX") diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake index d880988..7133e6c 100644 --- a/config/cmake/scripts/HDF5options.cmake +++ b/config/cmake/scripts/HDF5options.cmake @@ -57,7 +57,9 @@ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRIN #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=GIT") ### ext libs on system #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=NO") +#set(ENV{ZLIB_ROOT} "some_location") #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib -DZLIB_INCLUDE_DIR:PATH=some_location/include") +#set(ENV{SZIP_ROOT} "some_location") #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include") ### disable using ext zlib diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index c401cf6..4b11f51 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -22,21 +22,6 @@ include (CheckVariableExists) include (TestBigEndian) include (CheckStructHasMember) -#----------------------------------------------------------------------------- -# APPLE/Darwin setup -#----------------------------------------------------------------------------- -if (APPLE) - list (LENGTH CMAKE_OSX_ARCHITECTURES ARCH_LENGTH) - if (ARCH_LENGTH GREATER 1) - set (CMAKE_OSX_ARCHITECTURES "" CACHE STRING "" FORCE) - message (FATAL_ERROR "Building Universal Binaries on OS X is NOT supported by the HDF5 project. This is" - "due to technical reasons. The best approach would be build each architecture in separate directories" - "and use the 'lipo' tool to combine them into a single executable or library. The 'CMAKE_OSX_ARCHITECTURES'" - "variable has been set to a blank value which will build the default architecture for this system.") - endif () - set (${HDF_PREFIX}_AC_APPLE_UNIVERSAL_BUILD 0) -endif () - # Check for Darwin (not just Apple - we also want to catch OpenDarwin) if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set (${HDF_PREFIX}_HAVE_DARWIN 1) @@ -69,6 +54,7 @@ if (MINGW) set (WINDOWS 1) # MinGW tries to imitate Windows set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1") set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1) + set (__USE_MINGW_ANSI_STDIO 1) endif () if (WIN32 AND NOT MINGW) @@ -223,7 +209,9 @@ macro (HDF_FUNCTION_TEST OTHER_TEST) ) endif () - #message (STATUS "Performing ${OTHER_TEST}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "Performing ${OTHER_TEST}") + endif () try_compile (${OTHER_TEST} ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFTests.c @@ -233,9 +221,13 @@ macro (HDF_FUNCTION_TEST OTHER_TEST) ) if (${OTHER_TEST}) set (${HDF_PREFIX}_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}") - message (STATUS "Performing Other Test ${OTHER_TEST} - Success") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing Other Test ${OTHER_TEST} - Success") + endif () else () - message (STATUS "Performing Other Test ${OTHER_TEST} - Failed") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing Other Test ${OTHER_TEST} - Failed") + endif () set (${HDF_PREFIX}_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing Other Test ${OTHER_TEST} failed with the following output:\n" @@ -296,17 +288,23 @@ if (MINGW OR NOT WINDOWS) set (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg}) set (LARGEFILE 1) set (HDF_EXTRA_FLAGS ${HDF_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) - message (STATUS "${msg}... yes") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... yes") + endif () else () set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Test TEST_LFS_WORKS Run failed with the following exit code:\n ${TEST_LFS_WORKS_RUN}\n" ) endif () else () set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Test TEST_LFS_WORKS Compile failed\n" ) @@ -339,11 +337,15 @@ endif () macro (HDF_CHECK_TYPE_SIZE type var) set (aType ${type}) set (aVar ${var}) -# message (STATUS "Checking size of ${aType} and storing into ${aVar}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "Checking size of ${aType} and storing into ${aVar}") + endif () CHECK_TYPE_SIZE (${aType} ${aVar}) if (NOT ${aVar}) set (${aVar} 0 CACHE INTERNAL "SizeOf for ${aType}") -# message (STATUS "Size of ${aType} was NOT Found") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "Size of ${aType} was NOT Found") + endif () endif () endmacro () @@ -575,7 +577,9 @@ endif () #----------------------------------------------------------------------------- if (WINDOWS) if (NOT HDF_NO_IOEO_TEST) - message (STATUS "Checking for InitOnceExecuteOnce:") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Checking for InitOnceExecuteOnce:") + endif () if (NOT DEFINED ${HDF_PREFIX}_HAVE_IOEO) if (LARGEFILE) set (CMAKE_REQUIRED_DEFINITIONS @@ -604,7 +608,9 @@ if (WINDOWS) # if the return value was 0 then it worked if ("${HAVE_IOEO_EXITCODE}" EQUAL 0) set (${HDF_PREFIX}_HAVE_IOEO 1 CACHE INTERNAL "Test InitOnceExecuteOnce") - message (STATUS "Performing Test InitOnceExecuteOnce - Success") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing Test InitOnceExecuteOnce - Success") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing C SOURCE FILE Test InitOnceExecuteOnce succeded with the following output:\n" "${OUTPUT}\n" @@ -616,7 +622,9 @@ if (WINDOWS) set (${HDF_PREFIX}_HAVE_IOEO "" CACHE INTERNAL "Test InitOnceExecuteOnce") endif () - message (STATUS "Performing Test InitOnceExecuteOnce - Failed") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing Test InitOnceExecuteOnce - Failed") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing InitOnceExecuteOnce Test failed with the following output:\n" "${OUTPUT}\n" @@ -639,7 +647,9 @@ endforeach () #----------------------------------------------------------------------------- if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES "unknown") set (PRINT_LL_FOUND 0) - message (STATUS "Checking for appropriate format for 64 bit long:") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Checking for appropriate format for 64 bit long:") + endif () set (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH") if (${HDF_PREFIX}_SIZEOF_LONG_LONG) set (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG") @@ -656,7 +666,9 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES " set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"${${HDF_PREFIX}_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll") set (PRINT_LL_FOUND 1) else () - message (STATUS "Width test failed with result: ${${HDF_PREFIX}_PRINTF_LL_TEST_RUN}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Width test failed with result: ${${HDF_PREFIX}_PRINTF_LL_TEST_RUN}") + endif () endif () else () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log @@ -665,9 +677,13 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES " endif () if (PRINT_LL_FOUND) - message (STATUS "Checking for appropriate format for 64 bit long: found ${${HDF_PREFIX}_PRINTF_LL_WIDTH}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Checking for appropriate format for 64 bit long: found ${${HDF_PREFIX}_PRINTF_LL_WIDTH}") + endif () else () - message (STATUS "Checking for appropriate format for 64 bit long: not found") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Checking for appropriate format for 64 bit long: not found") + endif () set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll" ) diff --git a/config/cmake_ext_mod/FindSZIP.cmake b/config/cmake_ext_mod/FindSZIP.cmake index c3dc04a..846a3d1 100644 --- a/config/cmake_ext_mod/FindSZIP.cmake +++ b/config/cmake_ext_mod/FindSZIP.cmake @@ -118,7 +118,9 @@ if (NOT SZIP_FOUND) "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) - message (STATUS "${SZIP_DIR_MESSAGE}") + 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") diff --git a/config/cmake_ext_mod/HDFCXXTests.cpp b/config/cmake_ext_mod/HDFCXXTests.cpp index f05151b..08ccb34 100644 --- a/config/cmake_ext_mod/HDFCXXTests.cpp +++ b/config/cmake_ext_mod/HDFCXXTests.cpp @@ -10,62 +10,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef OLD_HEADER_FILENAME - -#include <iostream> - -int main(void) { return 0; } - -#endif - - -#ifdef HDF_NO_NAMESPACE - -namespace HDF { -int fnord; -} - -int main(void) { - using namespace HDF; - fnord = 37; - return 0; -} - -#endif - -#ifdef HDF_NO_STD - -#include <string> - -using namespace std; - -int main(void) { - string myString("testing namespace std"); - return 0; -} - -#endif - -#ifdef BOOL_NOTDEFINED -int main(void) { - bool flag; - return 0; -} - -#endif - -#ifdef NO_STATIC_CAST - -int main(void) { - float test_float; - int test_int; - test_float = 37.0; - test_int = static_cast <int> (test_float); - return 0; -} - -#endif - #ifdef CXX_HAVE_OFFSETOF #include <stdio.h> diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake index 821ac2d..a60d09f 100644 --- a/config/cmake_ext_mod/HDFLibMacros.cmake +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -84,6 +84,10 @@ endmacro () #------------------------------------------------------------------------------- macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) if (${compress_type} MATCHES "GIT") +# FetchContent_Declare (SZIP +# GIT_REPOSITORY ${SZIP_URL} +# GIT_TAG ${SZIP_BRANCH} +# ) EXTERNALPROJECT_ADD (SZIP GIT_REPOSITORY ${SZIP_URL} GIT_TAG ${SZIP_BRANCH} @@ -104,6 +108,10 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) elseif (${compress_type} MATCHES "TGZ") +# FetchContent_Declare (SZIP +# URL ${SZIP_URL} +# URL_HASH "" +# ) EXTERNALPROJECT_ADD (SZIP URL ${SZIP_URL} URL_MD5 "" @@ -125,7 +133,12 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) ) endif () externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR) - +# FetchContent_GetProperties(SZIP) +# if(NOT SZIP_POPULATED) +# FetchContent_Populate(SZIP) +# add_subdirectory(${szip_SOURCE_DIR} ${szip_BINARY_DIR}) +# endif() +# ##include (${BINARY_DIR}/${SZ_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target szip-static if (USE_LIBAEC) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index c6bd9e6..ae0ebca 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -28,7 +28,9 @@ macro (SET_HDF_BUILD_TYPE) endif() endif() if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - message (STATUS "Setting build type to 'RelWithDebInfo' as none was specified.") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Setting build type to 'RelWithDebInfo' as none was specified.") + endif() set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE) # Set the possible values of build type for cmake-gui set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" @@ -126,10 +128,6 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) OUTPUT_NAME_MINSIZEREL ${LIB_RELEASE_NAME} OUTPUT_NAME_RELWITHDEBINFO ${LIB_RELEASE_NAME} ) - #get_property (target_name TARGET ${libtarget} PROPERTY OUTPUT_NAME) - #get_property (target_name_debug TARGET ${libtarget} PROPERTY OUTPUT_NAME_DEBUG) - #get_property (target_name_rwdi TARGET ${libtarget} PROPERTY OUTPUT_NAME_RELWITHDEBINFO) - #message (STATUS "${target_name} : ${target_name_debug} : ${target_name_rwdi}") if (${libtype} MATCHES "STATIC") if (WIN32) @@ -143,8 +141,8 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) endif () endif () - #----- Use MSVC Naming conventions for Shared Libraries - if (MINGW AND ${libtype} MATCHES "SHARED") + option (HDF5_MSVC_NAMING_CONVENTION "Use MSVC Naming conventions for Shared Libraries" OFF) + if (HDF5_MSVC_NAMING_CONVENTION AND MINGW AND ${libtype} MATCHES "SHARED") set_target_properties (${libtarget} PROPERTIES IMPORT_SUFFIX ".lib" IMPORT_PREFIX "" @@ -343,7 +341,7 @@ macro (HDF_DIR_PATHS package_prefix) set (${package_prefix}_INSTALL_INCLUDE_DIR include) endif () if (NOT ${package_prefix}_INSTALL_DATA_DIR) - if (NOT WIN32) + if (NOT MSVC) if (APPLE) if (${package_prefix}_BUILD_FRAMEWORKS) set (${package_prefix}_INSTALL_EXTRA_DIR ../SharedSupport) @@ -353,12 +351,13 @@ macro (HDF_DIR_PATHS package_prefix) set (${package_prefix}_INSTALL_FWRK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) endif () set (${package_prefix}_INSTALL_DATA_DIR share) - set (${package_prefix}_INSTALL_CMAKE_DIR share/cmake) else () set (${package_prefix}_INSTALL_DATA_DIR ".") - set (${package_prefix}_INSTALL_CMAKE_DIR cmake) endif () endif () + if (NOT ${package_prefix}_INSTALL_CMAKE_DIR) + set (${package_prefix}_INSTALL_CMAKE_DIR share/cmake) + endif () # Always use full RPATH, i.e. don't skip the full RPATH for the build tree set (CMAKE_SKIP_BUILD_RPATH FALSE) @@ -427,23 +426,49 @@ macro (HDF_DIR_PATHS package_prefix) set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) endif () endif () + + if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + if (CMAKE_HOST_UNIX) + set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" + CACHE PATH "Install path prefix, prepended onto install directories." FORCE) + else () + GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES) + set (CMAKE_INSTALL_PREFIX + "${CMAKE_GENERIC_PROGRAM_FILES}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" + CACHE PATH "Install path prefix, prepended onto install directories." FORCE) + set (CMAKE_GENERIC_PROGRAM_FILES) + endif () + endif () + +#----------------------------------------------------------------------------- +# Setup pre-3.14 FetchContent +#----------------------------------------------------------------------------- + if(${CMAKE_VERSION} VERSION_LESS 3.14) + macro(FetchContent_MakeAvailable NAME) + FetchContent_GetProperties(${NAME}) + if(NOT ${NAME}_POPULATED) + FetchContent_Populate(${NAME}) + add_subdirectory(${${NAME}_SOURCE_DIR} ${${NAME}_BINARY_DIR}) + endif() + endmacro() + endif() endmacro () macro (ADD_H5_FLAGS h5_flag_var infile) file (STRINGS ${infile} TEST_FLAG_STREAM) - #message (STATUS "TEST_FLAG_STREAM=${TEST_FLAG_STREAM}") + #message (TRACE "TEST_FLAG_STREAM=${TEST_FLAG_STREAM}") list (LENGTH TEST_FLAG_STREAM len_flag) if (len_flag GREATER 0) math (EXPR _FP_LEN "${len_flag} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET TEST_FLAG_STREAM ${line} str_flag) string (REGEX REPLACE "^#.*" "" str_flag "${str_flag}") - #message (STATUS "str_flag=${str_flag}") + #message (TRACE "str_flag=${str_flag}") if (str_flag) list (APPEND ${h5_flag_var} "${str_flag}") endif () endforeach () endif () - #message (STATUS "h5_flag_var=${${h5_flag_var}}") + #message (TRACE "h5_flag_var=${${h5_flag_var}}") endmacro () diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c index 86e57d5..2d7e1b4 100644 --- a/config/cmake_ext_mod/HDFTests.c +++ b/config/cmake_ext_mod/HDFTests.c @@ -178,7 +178,7 @@ int DebugReport(int reportType, char* message, int* returnValue) int main(void) { - char *llwidthArgs[] = { "I64", "l64", "l", "L", "q", "ll", NULL }; + char *llwidthArgs[] = { "I64", "l64", "ll", "l", "L", "q", NULL }; char *s = malloc(128); char **currentArg = NULL; LL_TYPE x = (LL_TYPE)1048576 * (LL_TYPE)1048576; diff --git a/config/cmake_ext_mod/HDFUseCXX.cmake b/config/cmake_ext_mod/HDFUseCXX.cmake index 9b4b138..580c409 100644 --- a/config/cmake_ext_mod/HDFUseCXX.cmake +++ b/config/cmake_ext_mod/HDFUseCXX.cmake @@ -70,7 +70,9 @@ macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) ) endif () - #message (STATUS "Performing ${OTHER_TEST}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "Performing ${OTHER_TEST}") + endif () TRY_COMPILE (${OTHER_TEST} ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFCXXTests.cpp @@ -80,9 +82,13 @@ macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) ) if (${OTHER_TEST} EQUAL 0) set (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}") - message (STATUS "Performing CXX Test ${OTHER_TEST} - Success") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing CXX Test ${OTHER_TEST} - Success") + endif () else () - message (STATUS "Performing CXX Test ${OTHER_TEST} - Failed") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing CXX Test ${OTHER_TEST} - Failed") + endif () set (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}") file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Performing CXX Test ${OTHER_TEST} failed with the following output:\n" @@ -97,11 +103,6 @@ endmacro () #----------------------------------------------------------------------------- if (CMAKE_CXX_COMPILER_LOADED) foreach (cxx_test - OLD_HEADER_FILENAME - HDF_NO_NAMESPACE - HDF_NO_STD - BOOL_NOTDEFINED - NO_STATIC_CAST CXX_HAVE_OFFSETOF ) HDF_CXX_FUNCTION_TEST (${cxx_test}) diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake index 17fdefb..9cbcd76 100644 --- a/config/cmake_ext_mod/HDFUseFortran.cmake +++ b/config/cmake_ext_mod/HDFUseFortran.cmake @@ -135,7 +135,9 @@ else () # so this one is used for a sizeof test. #----------------------------------------------------------------------------- macro (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) - message (STATUS "Testing Fortran ${FUNCTION}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing Fortran ${FUNCTION}") + endif () if (HDF5_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${HDF5_REQUIRED_LIBRARIES}") @@ -153,13 +155,17 @@ else () OUTPUT_VARIABLE OUTPUT ) - # message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - # message (STATUS "Test result ${OUTPUT}") - # message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + # if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + # message (TRACE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + # message (TRACE "Test result ${OUTPUT}") + # message (TRACE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + # endif () if (${RESULT_VAR}) set (${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}") - message (STATUS "Testing Fortran ${FUNCTION} - OK") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing Fortran ${FUNCTION} - OK") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n" "${OUTPUT}\n\n" diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake index ad3fe79..631fca6 100644 --- a/config/cmake_ext_mod/grepTest.cmake +++ b/config/cmake_ext_mod/grepTest.cmake @@ -16,18 +16,12 @@ if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM to be defined") endif () -#if (NOT TEST_ARGS) -# message (STATUS "Require TEST_ARGS to be defined") -#endif () if (NOT TEST_FOLDER) message (FATAL_ERROR "Require TEST_FOLDER to be defined") endif () if (NOT TEST_OUTPUT) message (FATAL_ERROR "Require TEST_OUTPUT to be defined") endif () -#if (NOT TEST_EXPECT) -# message (STATUS "Require TEST_EXPECT to be defined") -#endif () if (NOT TEST_FILTER) message (STATUS "Optional TEST_FILTER to be defined") endif () @@ -46,7 +40,7 @@ endif () message (STATUS "COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}") if (TEST_LIBRARY_DIRECTORY) - if (WIN32 OR MINGW) + if (WIN32) set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}") else () set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") @@ -55,7 +49,9 @@ endif () if (TEST_ENV_VAR) set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") - #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}") + endif () endif () # run the test program, capture the stdout/stderr and the result var @@ -105,7 +101,7 @@ if (TEST_ERRREF) file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 21d34d8..f552dcd 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -38,7 +38,7 @@ endif () message (STATUS "COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}") if (TEST_LIBRARY_DIRECTORY) - if (WIN32 OR MINGW) + if (WIN32) set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}") else () set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") @@ -212,7 +212,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) @@ -283,7 +283,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF}) diff --git a/config/libhdf5.pc.in b/config/libhdf5.pc.in new file mode 100644 index 0000000..4a2ebaa --- /dev/null +++ b/config/libhdf5.pc.in @@ -0,0 +1,14 @@ +prefix=@_PKG_CONFIG_PREFIX@ +exec_prefix=@_PKG_CONFIG_EXEC_PREFIX@ +libdir=@_PKG_CONFIG_LIBDIR@ +includedir=@_PKG_CONFIG_INCLUDEDIR@ + +Name: @_PKG_CONFIG_LIBNAME@ +Description: HDF5 (Hierarchical Data Format 5) Software Library +Version: @_PKG_CONFIG_VERSION@ + +Cflags: -I${includedir} +Libs: -L${libdir} @_PKG_CONFIG_SH_LIBS@ +Requires: @_PKG_CONFIG_REQUIRES@ +Libs.private: @_PKG_CONFIG_LIBS_PRIVATE@ @_PKG_CONFIG_LIBS@ +Requires.private: @_PKG_CONFIG_REQUIRES_PRIVATE@ diff --git a/config/sanitizer/formatting.cmake b/config/sanitizer/formatting.cmake new file mode 100644 index 0000000..5aaa2a6 --- /dev/null +++ b/config/sanitizer/formatting.cmake @@ -0,0 +1,92 @@ +# +# Copyright (C) 2019 by George Cave - gcave@stablecoder.ca +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +# +# clang-format +# +find_program(CLANG_FORMAT_EXE "clang-format") +mark_as_advanced(FORCE CLANG_FORMAT_EXE) +if(CLANG_FORMAT_EXE) + message(STATUS "clang-format found: ${CLANG_FORMAT_EXE}") +else() + message(STATUS "clang-format not found!") +endif() + +# Generates a 'format' target using a custom name, files, and include +# directories all being parameters. +# +# Do note that in order for sources to be inherited properly, the source paths +# must be reachable from where the macro is called, or otherwise require a full +# path for proper inheritance. +# +# ~~~ +# Required: +# TARGET_NAME - The name of the target to create. +# +# Optional: ARGN - The list of targets OR files to format. Relative and absolute +# paths are accepted. +# ~~~ +function(clang_format TARGET_NAME) + if(CLANG_FORMAT_EXE) + set(FORMAT_FILES) + # Check through the ARGN's, determine existent files + foreach(item IN LISTS ARGN) + if(TARGET ${item}) + # If the item is a target, then we'll attempt to grab the associated + # source files from it. + get_target_property(_TARGET_TYPE ${item} TYPE) + if(NOT + _TARGET_TYPE + STREQUAL + "INTERFACE_LIBRARY") + get_property( + _TEMP + TARGET ${item} + PROPERTY SOURCES) + foreach(iter IN LISTS _TEMP) + if(EXISTS ${iter}) + set(FORMAT_FILES ${FORMAT_FILES} ${iter}) + endif() + endforeach() + endif() + elseif(EXISTS ${item}) + # Check if it's a full file path + set(FORMAT_FILES ${FORMAT_FILES} ${item}) + elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${item}) + # Check if it's based on the current source dir + set(FORMAT_FILES ${FORMAT_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/${item}) + endif() + endforeach() + + # Make the target + if(FORMAT_FILES) + if(TARGET ${TARGET_NAME}) + message( + ERROR + "Cannot create clang-format target '${TARGET_NAME}', already exists.") + else() + add_custom_target(${TARGET_NAME} COMMAND ${CLANG_FORMAT_EXE} -i -style=file ${FORMAT_FILES}) + + if(NOT TARGET format) + add_custom_target(format) + endif() + + add_dependencies(format ${TARGET_NAME}) + endif() + endif() + + endif() +endfunction() + diff --git a/config/sanitizer/tools.cmake b/config/sanitizer/tools.cmake index a44022f..242e33f 100644 --- a/config/sanitizer/tools.cmake +++ b/config/sanitizer/tools.cmake @@ -1,5 +1,5 @@ # -# Copyright (C) 2018 by George Cave - gcave@stablecoder.ca +# Copyright (C) 2018-2020 by George Cave - gcave@stablecoder.ca # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of @@ -29,7 +29,7 @@ endmacro() # used as the options set. macro(include_what_you_use) if(IWYU AND IWYU_EXE) - set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "${IWYU_EXE};${IWYU_STRING}") + set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${IWYU_EXE} ${ARGN}) endif() endmacro() @@ -37,11 +37,12 @@ endmacro() # options set. macro(cppcheck) if(CPPCHECK AND CPPCHECK_EXE) - set(CMAKE_CXX_CPPCHECK "${CPPCHECK_EXE};${CPPCHECK_STRING}") + set(CMAKE_CXX_CPPCHECK ${CPPCHECK_EXE} ${ARGN}) endif() endmacro() find_program(CLANG_TIDY_EXE NAMES "clang-tidy") +mark_as_advanced(FORCE CLANG_TIDY_EXE) if(CLANG_TIDY_EXE) message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}") if(NOT CLANG_TIDY) @@ -63,6 +64,7 @@ else() endif() find_program(IWYU_EXE NAMES "include-what-you-use") +mark_as_advanced(FORCE IWYU_EXE) if(IWYU_EXE) message(STATUS "include-what-you-use found: ${IWYU_EXE}") if(NOT IWYU) @@ -85,6 +87,7 @@ else() endif() find_program(CPPCHECK_EXE NAMES "cppcheck") +mark_as_advanced(FORCE CPPCHECK_EXE) if(CPPCHECK_EXE) message(STATUS "cppcheck found: ${CPPCHECK_EXE}") if(CPPECHECK) |