diff options
Diffstat (limited to 'config')
38 files changed, 1103 insertions, 759 deletions
diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 33e6d4c..2333f67 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -41,16 +41,20 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5TEST-err_compat #uses runTest.cmake H5TEST-links_env #uses runTest.cmake H5TEST-testlibinfo #uses grepTest.cmake - H5TEST-clear-testhdf5-objects + ######### H5TEST-clear-objects H5TEST-clear-cache-objects H5TEST-clear-cache_api-objects H5TEST-clear-cache_image-objects H5TEST-clear-cache_tagging-objects + H5TEST-clear-del_many_dense_attrs-objects H5TEST-clear-err_compat-objects H5TEST-clear-error_test-objects H5TEST-clear-filenotclosed-objects + H5TEST-clear-flush-objects H5TEST-clear-links_env-objects + H5TEST-clear-testflushrefresh-objects + H5TEST-clear-testhdf5-objects H5TEST-clear-ttsafe-objects PERFORM_h5perform-clear-objects HL_TOOLS-clear-objects @@ -60,11 +64,19 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE CPP_testhdf5-clear-objects ######### tools/h5clear ######### H5CLEAR-clearall-objects + H5CLEAR-copy_h5clear_fsm_persist_equal.h5 + H5CLEAR-copy_h5clear_fsm_persist_greater.h5 + H5CLEAR-copy_h5clear_fsm_persist_less.h5 + H5CLEAR-copy_h5clear_fsm_persist_noclose.h5 + H5CLEAR-copy_h5clear_fsm_persist_user_equal.h5 + H5CLEAR-copy_h5clear_fsm_persist_user_greater.h5 + H5CLEAR-copy_h5clear_fsm_persist_user_less.h5 H5CLEAR-copy_h5clear_log_v3.h5 H5CLEAR-copy_h5clear_mdc_image.h5 H5CLEAR-copy_h5clear_sec2_v0.h5 H5CLEAR-copy_h5clear_sec2_v2.h5 H5CLEAR-copy_h5clear_sec2_v3.h5 + H5CLEAR-copy_h5clear_status_noclear.h5 H5CLEAR-copy_latest_h5clear_log_v3.h5 H5CLEAR-copy_latest_h5clear_sec2_v3.h5 H5CLEAR-copy_mod_h5clear_mdc_image.h5 @@ -307,6 +319,11 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5REPACK_VERIFY_LAYOUT_ALL-layout_short_switches #uses grepTest.cmake H5REPACK-plugin H5REPACK_CMP-plugin_zero + ######### + ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-latest_latest_invalid-clear-objects + H5REPACK_VERIFY_SUPERBLOCK-SB_IS_0-clear-objects + H5REPACK_VERIFY_SUPERBLOCK-SB_IS_2-clear-objects + H5REPACK_VERIFY_SUPERBLOCK-SB_IS_3-clear-objects ######### tools/h5stat ######### H5STAT-clearall-objects ######### tools/misc ######### diff --git a/config/cmake/CTestScript.cmake b/config/cmake/CTestScript.cmake index 0269ba8..0269ba8 100755..100644 --- a/config/cmake/CTestScript.cmake +++ b/config/cmake/CTestScript.cmake diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 6d1e3ce..c1abeed 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -28,15 +28,6 @@ if (HDF5_STRICT_FORMAT_CHECKS) endif () MARK_AS_ADVANCED (HDF5_STRICT_FORMAT_CHECKS) -#----------------------------------------------------------------------------- -# Option for --enable-metadata-trace-file -#----------------------------------------------------------------------------- -option (HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF) -if (HDF5_METADATA_TRACE_FILE) - set (${HDF_PREFIX}_METADATA_TRACE_FILE 1) -endif () -MARK_AS_ADVANCED (HDF5_METADATA_TRACE_FILE) - # ---------------------------------------------------------------------- # Decide whether the data accuracy has higher priority during data # conversions. If not, some hard conversions will still be prefered even @@ -256,6 +247,11 @@ H5ConversionTests (${HDF_PREFIX}_LDOUBLE_TO_LLONG_ACCURATE "Checking IF correctl # H5ConversionTests (${HDF_PREFIX}_LLONG_TO_LDOUBLE_CORRECT "Checking IF correctly converting (unsigned) long long to long double values") # ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can accurately convert +# some long double values +# +H5ConversionTests (${HDF_PREFIX}_DISABLE_SOME_LDOUBLE_CONV "Checking IF the cpu is power9 and cannot correctly converting long double values") +# ---------------------------------------------------------------------- # Check if pointer alignments are enforced # H5ConversionTests (${HDF_PREFIX}_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restrictions are strictly enforced") diff --git a/config/cmake/ConversionTests.c b/config/cmake/ConversionTests.c index c2748b2..6d597a0 100644 --- a/config/cmake/ConversionTests.c +++ b/config/cmake/ConversionTests.c @@ -287,3 +287,27 @@ main () #endif +#ifdef H5_DISABLE_SOME_LDOUBLE_CONV_TEST + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +int HDF_NO_UBSAN main(void) +{ + FILE *fp; + char cpu[64]; + + fp = popen("uname -m", "r"); + + fgets(cpu, sizeof(cpu)-1, fp); + + pclose(fp); + + if(strncmp(cpu, "ppc64le", 7) == 0) + return 0; + + return 1; +} + +#endif diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 2ddb740..9e7b8b7 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -267,6 +267,9 @@ /* Define if we have parallel support */ #cmakedefine H5_HAVE_PARALLEL @H5_HAVE_PARALLEL@ +/* Define if both pread and pwrite exist. */ +#cmakedefine H5_HAVE_PREADWRITE @H5_HAVE_PREADWRITE@ + /* Define to 1 if you have the <pthread.h> header file. */ #cmakedefine H5_HAVE_PTHREAD_H @H5_HAVE_PTHREAD_H@ @@ -387,8 +390,13 @@ /* Define to 1 if you have the <szlib.h> header file. */ #cmakedefine H5_HAVE_SZLIB_H @H5_HAVE_SZLIB_H@ +#if defined(_WIN32) && !defined(H5_BUILT_AS_DYNAMIC_LIB) +/* Not supported on WIN32 platforms with static linking */ +/* #undef H5_HAVE_THREADSAFE */ +#else /* Define if we have thread safe support */ -#cmakedefine H5_HAVE_THREADSAFE @H5_HAVE_THREADSAFE@ +# cmakedefine H5_HAVE_THREADSAFE @H5_HAVE_THREADSAFE@ +#endif /* Define if timezone is a global variable */ #cmakedefine H5_HAVE_TIMEZONE @H5_HAVE_TIMEZONE@ @@ -460,15 +468,15 @@ with special algorithm. */ #cmakedefine H5_LONG_TO_LDOUBLE_SPECIAL @H5_LONG_TO_LDOUBLE_SPECIAL@ +/* Define if your system is power6 and cannot convert some long double values. */ +#cmakedefine H5_DISABLE_SOME_LDOUBLE_CONV @H5_DISABLE_SOME_LDOUBLE_CONV@ + /* Define to the sub-directory where libtool stores uninstalled libraries. */ #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 */ -/* Define if the metadata trace file code is to be compiled in */ -#cmakedefine H5_METADATA_TRACE_FILE @H5_METADATA_TRACE_FILE@ - /* Define if we can violate pointer alignment restrictions */ #cmakedefine H5_NO_ALIGNMENT_RESTRICTIONS @H5_NO_ALIGNMENT_RESTRICTIONS@ @@ -602,6 +610,9 @@ /* The size of `short', as computed by sizeof. */ #cmakedefine H5_SIZEOF_SHORT @H5_SIZEOF_SHORT@ +/* The size of `time_t', as computed by sizeof. */ +#cmakedefine H5_SIZEOF_TIME_T @H5_SIZEOF_TIME_T@ + /* The size of `uint16_t', as computed by sizeof. */ #cmakedefine H5_SIZEOF_UINT16_T @H5_SIZEOF_UINT16_T@ diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in deleted file mode 100644 index ba79ef2..0000000 --- a/config/cmake/HDF518_Examples.cmake.in +++ /dev/null @@ -1,106 +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://support.hdfgroup.org/ftp/HDF5/releases. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# -cmake_minimum_required (VERSION 3.10) -############################################################################################################### -# This script will build and run the examples from a folder -# Execute from a command line: -# ctest -S HDF518_Examples.cmake,OPTION=VALUE -C Release -VV -O test.log -############################################################################################################### - -set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -if("@CMAKE_GENERATOR_TOOLSET@") - set(CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") -endif() -set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) - -# handle input parameters to script. -#INSTALLDIR - HDF5-1.8 root folder -#CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo -#CTEST_SOURCE_NAME - name of source folder; HDF5Examples -if(DEFINED CTEST_SCRIPT_ARG) - # transform ctest script arguments of the form - # script.ctest,var1=value1,var2=value2 - # to variables with the respective names set to the respective values - string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") - foreach(current_var ${script_args}) - if("${current_var}" MATCHES "^([^=]+)=(.+)$") - set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif() - endforeach() -endif() - -################################################################### -### Following Line is one of [Release, RelWithDebInfo, Debug] ##### -set(CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") -if(NOT DEFINED CTEST_CONFIGURATION_TYPE) - set(CTEST_CONFIGURATION_TYPE "Release") -endif() -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=${CTEST_CONFIGURATION_TYPE}") -################################################################## - -if(NOT DEFINED INSTALLDIR) - set(INSTALLDIR "C:/Program Files/HDF_Group/@HDF5_PACKAGE_NAME@/@HDF5_PACKAGE_VERSION@") -endif() - -if(NOT DEFINED CTEST_SOURCE_NAME) - set(CTEST_SOURCE_NAME "HDF5Examples") -endif() - -if(NOT DEFINED HDF_LOCAL) - set(CDASH_LOCAL "NO") -else() - set(CDASH_LOCAL "YES") -endif() -if(NOT DEFINED CTEST_SITE) - set(CTEST_SITE "local") -endif() -if(NOT DEFINED CTEST_BUILD_NAME) - set(CTEST_BUILD_NAME "examples") -endif() -set(BUILD_OPTIONS "${BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") - -#TAR_SOURCE - name of tarfile -#if(NOT DEFINED TAR_SOURCE) -# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.2.1-Source") -#endif() - -############################################################################################################### -if(WIN32) - set(SITE_OS_NAME "Windows") - set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake") - set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) - set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") - set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") -else() - set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") - set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") - set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) - set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") - set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") -endif() -if(${CDASH_LOCAL}) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON") -endif() -set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") - -############################################################################################################### -# For any comments please contact cdashhelp@hdfgroup.org -# -############################################################################################################### - -if(WIN32) - include(${CTEST_SCRIPT_DIRECTORY}\\HDF5_Examples_options.cmake) - include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) -else() - include(${CTEST_SCRIPT_DIRECTORY}/HDF5_Examples_options.cmake) - include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) -endif() diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index 6c203e2..007bc29 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -15,6 +15,8 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage) # SOVERSION passed in ARGN when shared if (${libtype} MATCHES "SHARED") set (PACKAGE_SOVERSION ${HDF5_${libpackage}_PACKAGE_SOVERSION}) + set (PACKAGE_COMPATIBILITY ${H5_${libpackage}_SOVERS_INTERFACE}.0.0) + set (PACKAGE_CURRENT ${H5_${libpackage}_SOVERS_INTERFACE}.${H5_${libpackage}_SOVERS_MINOR}.0) if (WIN32) set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) else () @@ -26,6 +28,11 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage) else () set_target_properties (${libtarget} PROPERTIES SOVERSION ${LIBHDF_VERSION}) endif () + if (CMAKE_C_OSX_CURRENT_VERSION_FLAG) + set_property(TARGET ${libtarget} APPEND PROPERTY + LINK_FLAGS "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}${PACKAGE_CURRENT} ${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}${PACKAGE_COMPATIBILITY}" + ) + endif () endif () HDF_SET_LIB_OPTIONS (${libtarget} ${LIB_OUT_NAME} ${libtype}) @@ -33,9 +40,6 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage) if (APPLE) option (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF) if (HDF5_BUILD_WITH_INSTALL_NAME) - set_property(TARGET ${libtarget} APPEND PROPERTY - LINK_FLAGS "-current_version ${HDF5_PACKAGE_VERSION} -compatibility_version ${HDF5_PACKAGE_VERSION}" - ) set_target_properties (${libtarget} PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME} diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index 157befd..03597f2 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -18,16 +18,6 @@ ENABLE_LANGUAGE (Fortran) set (HDF_PREFIX "H5") include (CheckFortranFunctionExists) -## Check for non-standard extenstion quadmath.h - -CHECK_INCLUDE_FILES(quadmath.h C_HAVE_QUADMATH) - -if (${C_HAVE_QUADMATH}) - set(${HDF_PREFIX}_HAVE_QUADMATH_H 1) -else () - set(${HDF_PREFIX}_HAVE_QUADMATH_H 0) -endif () - # The provided CMake Fortran macros don't provide a general compile/run function # so this one is used. #----------------------------------------------------------------------------- @@ -40,7 +30,7 @@ macro (FORTRAN_RUN FUNCTION_NAME SOURCE_CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR1 TRY_RUN (RUN_RESULT_VAR COMPILE_RESULT_VAR ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler1.f90 - LINK_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}" + LINK_LIBRARIES "${HDF5_REQUIRED_LIBRARIES}" ) if (${COMPILE_RESULT_VAR}) @@ -67,8 +57,8 @@ endmacro () # Read source line beginning at the line matching Input:"START" and ending at the line matching Input:"END" macro (READ_SOURCE SOURCE_START SOURCE_END RETURN_VAR) - file (READ "${HDF5_SOURCE_DIR}/m4/aclocal_fc.f90" SOURCE_CODE) - string (REGEX MATCH "${SOURCE_START}[\\\t\\\n\\\r[].+]*${SOURCE_END}" SOURCE_CODE ${SOURCE_CODE}) + file (READ "${HDF5_SOURCE_DIR}/m4/aclocal_fc.f90" SOURCE_MASTER) + string (REGEX MATCH "${SOURCE_START}[\\\t\\\n\\\r[].+]*${SOURCE_END}" SOURCE_CODE ${SOURCE_MASTER}) set (RETURN_VAR "${SOURCE_CODE}") endmacro () @@ -244,7 +234,7 @@ foreach (KIND ${VAR} ) set (pack_real_sizeof "${pack_real_sizeof} ${PROG_OUTPUT1},") endforeach () -if (pack_int_sizeof STREQUAL "") +if (pack_real_sizeof STREQUAL "") message (FATAL_ERROR "Failed to find available REAL KINDs for Fortran") endif () @@ -367,9 +357,9 @@ ENABLE_LANGUAGE (C) #----------------------------------------------------------------------------- macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR) message (STATUS "Detecting C ${FUNCTION_NAME}") - if (CMAKE_REQUIRED_LIBRARIES) + if (HDF5_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES - "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + "-DLINK_LIBRARIES:STRING=${HDF5_REQUIRED_LIBRARIES}") else () set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) endif () diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index d30f2ab..c4d9cd8 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -48,7 +48,11 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=${ ################################################################## if(NOT DEFINED INSTALLDIR) - set(INSTALLDIR "C:/Program Files/HDF_Group/@HDF5_PACKAGE_NAME@/@HDF5_PACKAGE_VERSION@") + if(WIN32) + set(INSTALLDIR "C:/Program Files/HDF_Group/@HDF5_PACKAGE_NAME@/@HDF5_PACKAGE_VERSION@") + else() + set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@") + endif() endif() if(NOT DEFINED CTEST_SOURCE_NAME) @@ -70,7 +74,7 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDN #TAR_SOURCE - name of tarfile #if(NOT DEFINED TAR_SOURCE) -# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.10-Source") +# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.12.4-Source") #endif() ############################################################################################################### @@ -99,8 +103,6 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PAC if(WIN32) include(${CTEST_SCRIPT_DIRECTORY}\\HDF5_Examples_options.cmake) - include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) else() include(${CTEST_SCRIPT_DIRECTORY}/HDF5_Examples_options.cmake) - include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) endif() diff --git a/config/cmake/HDF5_Examples_options.cmake b/config/cmake/HDF5_Examples_options.cmake index 386e99c..6e4b510 100755..100644 --- a/config/cmake/HDF5_Examples_options.cmake +++ b/config/cmake/HDF5_Examples_options.cmake @@ -57,3 +57,106 @@ #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCOMPARE_TESTING:BOOL=ON") ############################################################################################# +# Do not edit below this line +############################################################################################# +#----------------------------------------------------------------------------- +# MAC machines need special option +#----------------------------------------------------------------------------- +if (APPLE) + # Compiler choice + execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set (ENV{CC} "${XCODE_CC}") + set (ENV{CXX} "${XCODE_CXX}") + if (NOT NO_MAC_FORTRAN) + # Shared fortran is not supported, build static + set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + else () + set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") + endif () + set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") +else () + set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS}") +endif () + +#----------------------------------------------------------------------------- +set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") +## -------------------------- +if (CTEST_USE_TAR_SOURCE) + ## Uncompress source if tar or zip file provided + ## -------------------------- + if (WIN32) + message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]") + execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) + else () + message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") + execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) + endif () + + if (NOT rv EQUAL 0) + message (STATUS "extracting... [error-(${rv}) clean up]") + file (REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") + message (FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") + endif () +endif() + +#----------------------------------------------------------------------------- +## Clear the build directory +## -------------------------- +set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) +if (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") + ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY}) +else () + file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") +endif () + +# Use multiple CPU cores to build +include (ProcessorCount) +ProcessorCount (N) +if (NOT N EQUAL 0) + if (NOT WIN32) + set (CTEST_BUILD_FLAGS -j${N}) + endif () + set (ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) +endif () +set (CTEST_CONFIGURE_COMMAND + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" +) + +#----------------------------------------------------------------------------- +## -- set output to english +set ($ENV{LC_MESSAGES} "en_EN") + +#----------------------------------------------------------------------------- +configure_file (${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) +ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") +## NORMAL process +## -------------------------- +ctest_start (Experimental) +ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +if (${res} LESS 0 OR ${res} GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") +endif () +if (LOCAL_SUBMIT) + ctest_submit (PARTS Configure Notes) +endif () +ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND APPEND RETURN_VALUE res NUMBER_ERRORS errval) +if (${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) + file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") +endif () +if (LOCAL_SUBMIT) + ctest_submit (PARTS Build) +endif () +ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) +if (${res} LESS 0 OR ${res} GREATER 0) + file(APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") +endif () +if (LOCAL_SUBMIT) + ctest_submit (PARTS Test) +endif () +if (${res} LESS 0 OR ${res} GREATER 0) + message (FATAL_ERROR "tests FAILED") +endif () +#----------------------------------------------------------------------------- +############################################################################################################## +message (STATUS "DONE") diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 93ebc3c..0a39568 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -9,16 +9,16 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # +set(CMAKE_C_STANDARD 99) +set(CMAKE_C_STANDARD_REQUIRED TRUE) message (STATUS "Warnings Configuration:") +set (CMAKE_C_FLAGS "${CMAKE_C99_STANDARD_COMPILE_OPTION} ${CMAKE_C_FLAGS}") #----------------------------------------------------------------------------- # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- if (CMAKE_COMPILER_IS_GNUCC) set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}") - if (NOT CYGWIN) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") - endif () if (${HDF_CFG_NAME} MATCHES "Debug") if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Og -ftrapv -fno-common") diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in index 8e16725..575c1ab 100644 --- a/config/cmake/hdf5-config-version.cmake.in +++ b/config/cmake/hdf5-config-version.cmake.in @@ -21,38 +21,38 @@ set (PACKAGE_VERSION "@HDF5_VERSION_STRING@") -if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) +if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) -else () - if ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@") +else() + if("@H5_VERS_MAJOR@.@H5_VERS_MINOR@" MATCHES "^([0-9]+)\\.([0-9]+)") + set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") + set(CVF_VERSION_MINOR "${CMAKE_MATCH_2}") + else() + set(CVF_VERSION_MAJOR "@HDF5_VERSION_STRING@") + set(CVF_VERSION_MINOR "") + endif() + + if((PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) AND + (PACKAGE_FIND_VERSION_MINOR STREQUAL CVF_VERSION_MINOR)) + set(PACKAGE_VERSION_COMPATIBLE TRUE) + else() + set(PACKAGE_VERSION_COMPATIBLE FALSE) + endif() + + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() - # exact match for version @H5_VERS_MAJOR@.@H5_VERS_MINOR@ - if ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") - - # compatible with any version @H5_VERS_MAJOR@.@H5_VERS_MINOR@.x - set (PACKAGE_VERSION_COMPATIBLE TRUE) - - if ("${PACKAGE_FIND_VERSION_PATCH}" STREQUAL "@H5_VERS_RELEASE@") - set (PACKAGE_VERSION_EXACT TRUE) - - if ("${PACKAGE_FIND_VERSION_TWEAK}" STREQUAL "@H5_VERS_SUBRELEASE@") - # not using this yet - endif () - endif () - else () - set (PACKAGE_VERSION_COMPATIBLE FALSE) - endif () - endif () -endif () # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: -if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") return() -endif () +endif() # check that the installed version has the same 32/64bit-ness as the one which is currently searching: -if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@") +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@") math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") set(PACKAGE_VERSION_UNSUITABLE TRUE) -endif () +endif() diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index e687a58..b1ef0ac 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -38,6 +38,7 @@ set (${HDF5_PACKAGE_NAME}_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@) 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_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@) @@ -45,6 +46,8 @@ set (${HDF5_PACKAGE_NAME}_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) set (${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS @HDF5_PACKAGE_EXTLIBS@) set (${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES @HDF5_LIBRARIES_TO_EXPORT@) set (${HDF5_PACKAGE_NAME}_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") +set (${HDF5_PACKAGE_NAME}_DEFAULT_API_VERSION "@DEFAULT_API_VERSION@") +set (${HDF5_PACKAGE_NAME}_PARALLEL_FILTERED_WRITES "@PARALLEL_FILTERED_WRITES@") #----------------------------------------------------------------------------- # Dependencies @@ -124,14 +127,14 @@ endif () # Handle requested components: list (REMOVE_DUPLICATES ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS) foreach (comp IN LISTS ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS) - if (${comp} STREQUAL "shared") + if (comp STREQUAL "shared") list (REMOVE_ITEM ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS ${comp}) set (${HDF5_PACKAGE_NAME}_LIB_TYPE ${${HDF5_PACKAGE_NAME}_LIB_TYPE} ${comp}) if (${HDF5_PACKAGE_NAME}_BUILD_FORTRAN) set (${HDF5_PACKAGE_NAME}_INCLUDE_DIR_FORTRAN "@PACKAGE_INCLUDE_INSTALL_DIR@/shared") endif () - elseif (${comp} STREQUAL "static") + elseif (comp STREQUAL "static") list (REMOVE_ITEM ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS ${comp}) set (${HDF5_PACKAGE_NAME}_LIB_TYPE ${${HDF5_PACKAGE_NAME}_LIB_TYPE} ${comp}) @@ -143,32 +146,32 @@ endforeach () foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE) foreach (comp IN LISTS ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS) set (hdf5_comp2) - if (${comp} STREQUAL "C") + if (comp STREQUAL "C") set (hdf5_comp "hdf5") - elseif (${comp} STREQUAL "CXX") + elseif (comp STREQUAL "CXX") set (hdf5_comp "hdf5_cpp") - elseif (${comp} STREQUAL "HL") + elseif (comp STREQUAL "HL") set (hdf5_comp "hdf5_hl") - elseif (${comp} STREQUAL "CXX_HL") + elseif (comp STREQUAL "CXX_HL") set (hdf5_comp "hdf5_hl_cpp") - elseif (${comp} STREQUAL "Java") + elseif (comp STREQUAL "Java") set (hdf5_comp "hdf5_java") - elseif (${comp} STREQUAL "Tools") + elseif (comp STREQUAL "Tools") set (hdf5_comp "hdf5_tools") - elseif (${comp} STREQUAL "Fortran") + elseif (comp STREQUAL "Fortran") set (hdf5_comp2 "hdf5_f90cstub") set (hdf5_comp "hdf5_fortran") - elseif (${comp} STREQUAL "Fortran_HL") + elseif (comp STREQUAL "Fortran_HL") set (hdf5_comp2 "hdf5_hl_f90cstub") set (hdf5_comp "hdf5_hl_fortran") endif () - if (${comp} STREQUAL "Java") + if (comp STREQUAL "Java") list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}" HAVE_COMP) else () list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}-${libtype}" HAVE_COMP) endif () if (${HAVE_COMP} LESS 0) - if (${comp} STREQUAL "Java") + if (comp STREQUAL "Java") set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 0) else () set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 0) @@ -183,7 +186,7 @@ foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE) string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_${libtype}_LIBRARY COMP_LIBRARY) set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF5_PACKAGE@::${hdf5_comp2}-${libtype} @HDF5_PACKAGE@::${hdf5_comp}-${libtype}) endif () - elseif (${comp} STREQUAL "Java") + elseif (comp STREQUAL "Java") set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 1) string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_LIBRARY COMP_LIBRARY) set (${COMP_LIBRARY} ${${COMP_LIBRARY}} hdf5::${hdf5_comp}) diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake index b66f3a8..d5cd903 100644 --- a/config/cmake/jrunTest.cmake +++ b/config/cmake/jrunTest.cmake @@ -32,9 +32,6 @@ endif () if (NOT TEST_CLASSPATH) message (STATUS "Require TEST_CLASSPATH to be defined") endif () -if (NOT TEST_REFERENCE) - message (FATAL_ERROR "Require TEST_REFERENCE to be defined") -endif () if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) @@ -44,14 +41,6 @@ if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) endif () -# if there is not an error reference file add the error output to the stdout file -if (NOT TEST_ERRREF) - if (NOT SKIP_APPEND) - # append error file since skip was not defined - set (ERROR_APPEND 1) - endif () -endif () - if (NOT TEST_LOG_LEVEL) set (LOG_LEVEL "info") else () @@ -88,10 +77,10 @@ if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) endif () if (NOT ERROR_APPEND) - # append error output to the stdout output file + # write back to original .err file file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") else () - # write back to original .err file + # append error output to the stdout output file file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") endif () endif () @@ -121,8 +110,8 @@ if (TEST_MASK_ERROR) endif () endif () -# if the return value is !=0 bail out -if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}") +# if the return value is !=expected bail out +if (NOT TEST_RESULT EQUAL TEST_EXPECT) message (STATUS "ERROR OUTPUT: ${TEST_STREAM}") message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != 0.\n${TEST_ERROR}") endif () @@ -131,52 +120,54 @@ message (STATUS "COMMAND Error: ${TEST_ERROR}") # compare output files to references unless this must be skipped if (NOT TEST_SKIP_COMPARE) - if (WIN32 AND NOT MINGW) - file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) - file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") - endif () + if (EXISTS ${TEST_FOLDER}/${TEST_REFERENCE}) + if (WIN32 AND NOT MINGW) + file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) + file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") + endif () - # now compare the output with the reference - execute_process ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} - RESULT_VARIABLE TEST_RESULT - ) - if (NOT "${TEST_RESULT}" STREQUAL "0") - set (TEST_RESULT 0) - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) - list (LENGTH test_act len_act) - file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) - list (LENGTH test_ref len_ref) - if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0") - math (EXPR _FP_LEN "${len_ref} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - list (GET test_act ${line} str_act) - list (GET test_ref ${line} str_ref) - if (NOT "${str_act}" STREQUAL "${str_ref}") - if (NOT "${str_act}" STREQUAL "") - set (TEST_RESULT 1) - message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + # now compare the output with the reference + execute_process ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} + RESULT_VARIABLE TEST_RESULT + ) + if (TEST_RESULT) + set (TEST_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) + list (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) + list (LENGTH test_ref len_ref) + if (len_act GREATER 0 AND len_ref GREATER 0) + math (EXPR _FP_LEN "${len_ref} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET test_act ${line} str_act) + list (GET test_ref ${line} str_ref) + if (NOT str_act STREQUAL str_ref) + if (str_act) + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif () endif () + endforeach () + else () + if (len_act EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") + endif () + if (len_ref EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") endif () - endforeach () - else () - if ("${len_act}" STREQUAL "0") - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") endif () - if ("${len_ref}" STREQUAL "0") - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") + if (NOT len_act EQUAL len_ref) + set (TEST_RESULT 1) endif () endif () - if (NOT "${len_act}" STREQUAL "${len_ref}") - set (TEST_RESULT 1) - endif () - endif () - message (STATUS "COMPARE Result: ${TEST_RESULT}") + message (STATUS "COMPARE Result: ${TEST_RESULT}") - # again, if return value is !=0 scream and shout - if (NOT "${TEST_RESULT}" STREQUAL "0") - message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") + # again, if return value is !=0 scream and shout + if (TEST_RESULT) + message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") + endif () endif () # now compare the .err file with the error reference, if supplied @@ -191,34 +182,34 @@ if (NOT TEST_SKIP_COMPARE) COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} RESULT_VARIABLE TEST_RESULT ) - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) list (LENGTH test_ref len_ref) math (EXPR _FP_LEN "${len_ref} - 1") - if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0") + if (len_act GREATER 0 AND len_ref GREATER 0) math (EXPR _FP_LEN "${len_ref} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) list (GET test_ref ${line} str_ref) - if (NOT "${str_act}" STREQUAL "${str_ref}") - if (NOT "${str_act}" STREQUAL "") + if (NOT str_act STREQUAL str_ref) + if (str_act) set (TEST_RESULT 1) message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () endforeach () else () - if ("${len_act}" STREQUAL "0") + if (len_act EQUAL 0) message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") endif () - if ("${len_ref}" STREQUAL "0") + if (len_ref EQUAL 0) message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") endif () - endif() - if (NOT "${len_act}" STREQUAL "${len_ref}") + endif () + if (NOT len_act EQUAL len_ref) set (TEST_RESULT 1) endif () endif () @@ -226,7 +217,7 @@ if (NOT TEST_SKIP_COMPARE) message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - if (NOT ${TEST_RESULT} STREQUAL 0) + if (TEST_RESULT) message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") endif () endif () @@ -239,15 +230,15 @@ if (TEST_GREP_COMPARE) # TEST_REFERENCE should always be matched string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) - if ("${TEST_RESULT}" STREQUAL "0") + if (NOT TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") endif () string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) - if ("${TEST_EXPECT}" STREQUAL "1") + if (TEST_EXPECT) # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match string (LENGTH "${TEST_MATCH}" TEST_RESULT) - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") endif () endif () diff --git a/config/cmake/libh5cc.in b/config/cmake/libh5cc.in index f462d56..f462d56 100755..100644 --- a/config/cmake/libh5cc.in +++ b/config/cmake/libh5cc.in diff --git a/config/cmake/libhdf5.pc.in b/config/cmake/libhdf5.pc.in index 4a2ebaa..4a2ebaa 100755..100644 --- a/config/cmake/libhdf5.pc.in +++ b/config/cmake/libhdf5.pc.in diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index 6a489e7..9a534df 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -79,7 +79,6 @@ Parallel Filtered Dataset Writes: @PARALLEL_FILTERED_WRITES@ API Tracing: @HDF5_ENABLE_TRACE@ Using memory checker: @HDF5_ENABLE_USING_MEMCHECKER@ Memory allocation sanity checks: @HDF5_MEMORY_ALLOC_SANITY_CHECK@ - Metadata trace file: @METADATATRACEFILE@ Function Stack Tracing: @HDF5_ENABLE_CODESTACK@ Strict File Format Checks: @HDF5_STRICT_FORMAT_CHECKS@ Optimization Instrumentation: @HDF5_Enable_Instrument@ diff --git a/config/cmake/patch.xml b/config/cmake/patch.xml index 70571c5..1bdff3e 100644 --- a/config/cmake/patch.xml +++ b/config/cmake/patch.xml @@ -1,5 +1,5 @@ <CPackWiXPatch> - <CPackWiXFragment Id="CM_CP_libraries.bin.hdf5.dll"> + <CPackWiXFragment Id="CM_CP_libraries.bin.hdf5.dll"> <Environment Id="PATH" Name="PATH" Value="[CM_DP_libraries.bin]" @@ -7,5 +7,5 @@ Part="last" Action="set" System="yes"/> - </CPackWiXFragment> + </CPackWiXFragment> </CPackWiXPatch> diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index 9534b1e..e234057 100755..100644 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -9,266 +9,279 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -cmake_minimum_required (VERSION 3.10)
-########################################################
-# This dashboard is maintained by The HDF Group
-# For any comments please contact cdashhelp@hdfgroup.org
-#
-########################################################
-# -----------------------------------------------------------
-# -- Get environment
-# -----------------------------------------------------------
-if (NOT SITE_OS_NAME)
- ## machine name not provided - attempt to discover with uname
- ## -- set hostname
- ## --------------------------
- find_program (HOSTNAME_CMD NAMES hostname)
- exec_program (${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME)
- set (CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}")
- find_program (UNAME NAMES uname)
- macro (getuname name flag)
- exec_program ("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}")
- endmacro ()
-
- getuname (osname -s)
- getuname (osrel -r)
- getuname (cpu -m)
- message (STATUS "Dashboard script uname output: ${osname}-${osrel}-${cpu}\n")
-
- set (CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}")
-else ()
- ## machine name provided
- ## --------------------------
- if (CMAKE_HOST_UNIX)
- set (CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_OS_BITS}-${SITE_COMPILER_NAME}-${SITE_COMPILER_VERSION}")
- else ()
- set (CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}")
- endif ()
-endif ()
+cmake_minimum_required (VERSION 3.10) +######################################################## +# This dashboard is maintained by The HDF Group +# For any comments please contact cdashhelp@hdfgroup.org +# +######################################################## +# ----------------------------------------------------------- +# -- Get environment +# ----------------------------------------------------------- +if (NOT SITE_OS_NAME) + ## machine name not provided - attempt to discover with uname + ## -- set hostname + ## -------------------------- + find_program (HOSTNAME_CMD NAMES hostname) + exec_program (${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME) + set (CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}") + find_program (UNAME NAMES uname) + macro (getuname name flag) + exec_program ("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}") + endmacro () + + getuname (osname -s) + getuname (osrel -r) + getuname (cpu -m) + message (STATUS "Dashboard script uname output: ${osname}-${osrel}-${cpu}\n") + + set (CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}") +else () + ## machine name provided + ## -------------------------- + if (CMAKE_HOST_UNIX) + set (CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_OS_BITS}-${SITE_COMPILER_NAME}-${SITE_COMPILER_VERSION}") + else () + set (CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}") + endif () +endif () if (SITE_BUILDNAME_SUFFIX) set (CTEST_BUILD_NAME "${SITE_BUILDNAME_SUFFIX}-${CTEST_BUILD_NAME}") endif () set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") -
-#-----------------------------------------------------------------------------
-# MAC machines need special option
-#-----------------------------------------------------------------------------
-if (APPLE)
- # Compiler choice
- execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE)
- set (ENV{CC} "${XCODE_CC}")
- set (ENV{CXX} "${XCODE_CXX}")
-
- set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
-endif ()
-
-#-----------------------------------------------------------------------------
-set (NEED_REPOSITORY_CHECKOUT 0)
-set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"")
-if (CTEST_USE_TAR_SOURCE)
- ## Uncompress source if tar file provided
- ## --------------------------
- if (WIN32)
- message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]")
- execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv)
- else ()
- message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar]")
- execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv)
- endif ()
-
- if (NOT rv EQUAL 0)
- message (STATUS "extracting... [error-(${rv}) clean up]")
- file (REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}")
- message (FATAL_ERROR "error: extract of ${CTEST_USE_TAR_SOURCE} failed")
- endif ()
-
- file (RENAME ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY})
- set (LOCAL_SKIP_UPDATE "TRUE")
-else ()
- if (LOCAL_UPDATE)
- if (CTEST_USE_GIT_SOURCE)
- find_program (CTEST_GIT_COMMAND NAMES git git.cmd)
- set (CTEST_GIT_UPDATE_OPTIONS)
-
- if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}")
- set (NEED_REPOSITORY_CHECKOUT 1)
- endif ()
-
- if (${NEED_REPOSITORY_CHECKOUT})
- if (REPOSITORY_BRANCH)
- set (CTEST_GIT_options "clone \"${REPOSITORY_URL}\" --branch \"${REPOSITORY_BRANCH}\" --single-branch \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules")
- else ()
- set (CTEST_GIT_options "clone \"${REPOSITORY_URL}\" \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules")
- endif ()
- set (CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} ${CTEST_GIT_options}")
- else ()
- set (CTEST_GIT_options "pull")
- endif ()
- set (CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}")
- else ()
- ## --------------------------
- ## use subversion to get source
- #-----------------------------------------------------------------------------
- ## cygwin does not handle the find_package() call
- ## --------------------------
- set (CTEST_UPDATE_COMMAND "SVNCommand")
- if (NOT SITE_CYGWIN})
- find_package (Subversion)
- set (CTEST_SVN_COMMAND "${Subversion_SVN_EXECUTABLE}")
- set (CTEST_UPDATE_COMMAND "${Subversion_SVN_EXECUTABLE}")
- else ()
- set (CTEST_SVN_COMMAND "/usr/bin/svn")
- set (CTEST_UPDATE_COMMAND "/usr/bin/svn")
- endif ()
-
- if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}")
- set (NEED_REPOSITORY_CHECKOUT 1)
- endif ()
-
- if (NOT CTEST_REPO_VERSION)
- set (CTEST_REPO_VERSION "HEAD")
- endif ()
- if (${NEED_REPOSITORY_CHECKOUT})
- set (CTEST_CHECKOUT_COMMAND
- "\"${CTEST_SVN_COMMAND}\" co ${REPOSITORY_URL} \"${CTEST_SOURCE_DIRECTORY}\" -r ${CTEST_REPO_VERSION}")
- else ()
- if (CTEST_REPO_VERSION)
- set (CTEST_SVN_UPDATE_OPTIONS "-r ${CTEST_REPO_VERSION}")
- endif ()
- endif ()
- endif ()
- endif ()
-endif ()
-
-#-----------------------------------------------------------------------------
-## Clear the build directory
-## --------------------------
-set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE)
-if (NOT EXISTS "${CTEST_BINARY_DIRECTORY}")
- file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
-else ()
- ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY})
-endif ()
-
-# Use multiple CPU cores to build
-include (ProcessorCount)
-ProcessorCount (N)
+ +#----------------------------------------------------------------------------- +# MAC machines need special option +#----------------------------------------------------------------------------- +if (APPLE) + # Compiler choice + execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set (ENV{CC} "${XCODE_CC}") + set (ENV{CXX} "${XCODE_CXX}") + + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") +endif () + +#----------------------------------------------------------------------------- +set (NEED_REPOSITORY_CHECKOUT 0) +set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") +if (CTEST_USE_TAR_SOURCE) + ## Uncompress source if tar file provided + ## -------------------------- + if (WIN32) + message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]") + execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) + else () + message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar]") + execute_process (COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) + endif () + + if (NOT rv EQUAL 0) + message (STATUS "extracting... [error-(${rv}) clean up]") + file (REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") + message (FATAL_ERROR "error: extract of ${CTEST_USE_TAR_SOURCE} failed") + endif () + + file (RENAME ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY}) + set (LOCAL_SKIP_UPDATE "TRUE") +else () + if (LOCAL_UPDATE) + if (CTEST_USE_GIT_SOURCE) + find_program (CTEST_GIT_COMMAND NAMES git git.cmd) + set (CTEST_GIT_UPDATE_OPTIONS) + + if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") + set (NEED_REPOSITORY_CHECKOUT 1) + endif () + + if (${NEED_REPOSITORY_CHECKOUT}) + if (REPOSITORY_BRANCH) + set (CTEST_GIT_options "clone \"${REPOSITORY_URL}\" --branch \"${REPOSITORY_BRANCH}\" --single-branch \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") + else () + set (CTEST_GIT_options "clone \"${REPOSITORY_URL}\" \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules") + endif () + set (CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} ${CTEST_GIT_options}") + else () + set (CTEST_GIT_options "pull") + endif () + set (CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}") + else () + ## -------------------------- + ## use subversion to get source + #----------------------------------------------------------------------------- + ## cygwin does not handle the find_package() call + ## -------------------------- + set (CTEST_UPDATE_COMMAND "SVNCommand") + if (NOT SITE_CYGWIN}) + find_package (Subversion) + set (CTEST_SVN_COMMAND "${Subversion_SVN_EXECUTABLE}") + set (CTEST_UPDATE_COMMAND "${Subversion_SVN_EXECUTABLE}") + else () + set (CTEST_SVN_COMMAND "/usr/bin/svn") + set (CTEST_UPDATE_COMMAND "/usr/bin/svn") + endif () + + if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") + set (NEED_REPOSITORY_CHECKOUT 1) + endif () + + if (NOT CTEST_REPO_VERSION) + set (CTEST_REPO_VERSION "HEAD") + endif () + if (${NEED_REPOSITORY_CHECKOUT}) + set (CTEST_CHECKOUT_COMMAND + "\"${CTEST_SVN_COMMAND}\" co ${REPOSITORY_URL} \"${CTEST_SOURCE_DIRECTORY}\" -r ${CTEST_REPO_VERSION}") + else () + if (CTEST_REPO_VERSION) + set (CTEST_SVN_UPDATE_OPTIONS "-r ${CTEST_REPO_VERSION}") + endif () + endif () + endif () + endif () +endif () + +#----------------------------------------------------------------------------- +## Clear the build directory +## -------------------------- +set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) +if (NOT EXISTS "${CTEST_BINARY_DIRECTORY}") + file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") +else () + ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY}) +endif () + +# Use multiple CPU cores to build +include (ProcessorCount) +ProcessorCount (N) if (NOT N EQUAL 0) if (MAX_PROC_COUNT) if (N GREATER MAX_PROC_COUNT) set (N ${MAX_PROC_COUNT}) endif () endif () - if (NOT WIN32)
- set (CTEST_BUILD_FLAGS -j${N})
- endif ()
- set (ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
-endif ()
-
-#-----------------------------------------------------------------------------
-# Send the main script as a note.
-list (APPEND CTEST_NOTES_FILES
- "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}"
- "${CMAKE_CURRENT_LIST_FILE}"
- "${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake"
-)
-
-#-----------------------------------------------------------------------------
-# Check for required variables.
-# --------------------------
-foreach (req
- CTEST_CMAKE_GENERATOR
- CTEST_SITE
- CTEST_BUILD_NAME
- )
- if (NOT DEFINED ${req})
- message (FATAL_ERROR "The containing script must set ${req}")
- endif ()
-endforeach ()
-
-#-----------------------------------------------------------------------------
-# Initialize the CTEST commands
-#------------------------------
-if (CMAKE_GENERATOR_TOOLSET)
- set (CTEST_CONFIGURE_TOOLSET "-T${CMAKE_GENERATOR_TOOLSET}")
-else ()
- set (CTEST_CONFIGURE_TOOLSET "")
-endif()
-if (LOCAL_MEMCHECK_TEST)
- find_program (CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
- set (CTEST_CONFIGURE_COMMAND
- "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\""
- )
-else ()
- if (LOCAL_COVERAGE_TEST)
- find_program (CTEST_COVERAGE_COMMAND NAMES gcov)
- endif ()
- set (CTEST_CONFIGURE_COMMAND
- "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\""
- )
-endif ()
-
-#-----------------------------------------------------------------------------
-## -- set output to english
-set ($ENV{LC_MESSAGES} "en_EN")
-
-# Print summary information.
-foreach (v
- CTEST_SITE
- CTEST_BUILD_NAME
- CTEST_SOURCE_DIRECTORY
- CTEST_BINARY_DIRECTORY
- CTEST_CMAKE_GENERATOR
- CTEST_CONFIGURATION_TYPE
- CTEST_GIT_COMMAND
- CTEST_CHECKOUT_COMMAND
- CTEST_CONFIGURE_COMMAND
- CTEST_SCRIPT_DIRECTORY
- CTEST_USE_LAUNCHERS
- )
- set (vars "${vars} ${v}=[${${v}}]\n")
-endforeach ()
-message (STATUS "Dashboard script configuration:\n${vars}\n")
-
-#-----------------------------------------------------------------------------
-#-----------------------------------------------------------------------------
- ## NORMAL process
- ## -- LOCAL_UPDATE updates the source folder from svn
- ## -- LOCAL_SUBMIT reports to CDash server
- ## -- LOCAL_SKIP_TEST skips the test process (only builds)
- ## -- LOCAL_MEMCHECK_TEST executes the Valgrind testing
- ## -- LOCAL_COVERAGE_TEST executes code coverage process
- ## --------------------------
- ctest_start (${MODEL} TRACK ${MODEL})
- if (LOCAL_UPDATE)
- ctest_update (SOURCE "${CTEST_SOURCE_DIRECTORY}")
- endif ()
- configure_file (${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake)
- ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}")
- ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
- if (LOCAL_SUBMIT)
- ctest_submit (PARTS Update Configure Notes)
- endif ()
- if (${res} LESS 0 OR ${res} GREATER 0)
- file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n")
- endif ()
-
- ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND RETURN_VALUE res NUMBER_ERRORS errval)
- if (LOCAL_SUBMIT)
- ctest_submit (PARTS Build)
- endif ()
- if (${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0)
- file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n")
- endif ()
-
- if (NOT LOCAL_SKIP_TEST)
- if (NOT LOCAL_MEMCHECK_TEST)
+ if (NOT WIN32) + set (CTEST_BUILD_FLAGS -j${N}) + endif () + set (ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) +endif () + +#----------------------------------------------------------------------------- +# Send the main script as a note. +list (APPEND CTEST_NOTES_FILES + "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" + "${CMAKE_CURRENT_LIST_FILE}" + "${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake" +) + +#----------------------------------------------------------------------------- +# Check for required variables. +# -------------------------- +foreach (req + CTEST_CMAKE_GENERATOR + CTEST_SITE + CTEST_BUILD_NAME + ) + if (NOT DEFINED ${req}) + message (FATAL_ERROR "The containing script must set ${req}") + endif () +endforeach () + +#----------------------------------------------------------------------------- +# Initialize the CTEST commands +#------------------------------ +if (CMAKE_GENERATOR_TOOLSET) + set (CTEST_CONFIGURE_TOOLSET "-T${CMAKE_GENERATOR_TOOLSET}") +else () + set (CTEST_CONFIGURE_TOOLSET "") +endif() +if (LOCAL_MEMCHECK_TEST) + find_program (CTEST_MEMORYCHECK_COMMAND NAMES valgrind) + set (CTEST_CONFIGURE_COMMAND + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\"" + ) +else () + if (LOCAL_COVERAGE_TEST) + find_program (CTEST_COVERAGE_COMMAND NAMES gcov) + endif () + set (CTEST_CONFIGURE_COMMAND + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\"" + ) +endif () + +#----------------------------------------------------------------------------- +## -- set output to english +set ($ENV{LC_MESSAGES} "en_EN") + +# Print summary information. +foreach (v + CTEST_SITE + CTEST_BUILD_NAME + CTEST_SOURCE_DIRECTORY + CTEST_BINARY_DIRECTORY + CTEST_CMAKE_GENERATOR + CTEST_CONFIGURATION_TYPE + CTEST_GIT_COMMAND + CTEST_CHECKOUT_COMMAND + CTEST_CONFIGURE_COMMAND + CTEST_SCRIPT_DIRECTORY + CTEST_USE_LAUNCHERS + ) + set (vars "${vars} ${v}=[${${v}}]\n") +endforeach () +message (STATUS "Dashboard script configuration:\n${vars}\n") + +#----------------------------------------------------------------------------- +#----------------------------------------------------------------------------- + ## NORMAL process + ## -- LOCAL_UPDATE updates the source folder from svn + ## -- LOCAL_SUBMIT reports to CDash server + ## -- LOCAL_SKIP_TEST skips the test process (only builds) + ## -- LOCAL_MEMCHECK_TEST executes the Valgrind testing + ## -- LOCAL_COVERAGE_TEST executes code coverage process + ## -------------------------- + ctest_start (${MODEL} TRACK ${MODEL}) + if (LOCAL_UPDATE) + ctest_update (SOURCE "${CTEST_SOURCE_DIRECTORY}") + endif () + configure_file (${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) + ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") + ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) + if (LOCAL_SUBMIT) + ctest_submit (PARTS Update Configure Notes) + endif () + if (${res} LESS 0 OR ${res} GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Configure: ${res}\n") + endif () + + # On Cray XC40, configuring fails in the Fortran section when using the craype-mic-knl module. + # When the configure phase is done with the craype-haswell module and the build phase is done + # with the craype-mic-knl module, configure succeeds and tests pass on the knl compute nodes + # for Intel, Cray, GCC and Clang compilers. If the variables aren't set or if not + # cross compiling, the module switch will not occur. + if (CMAKE_CROSSCOMPILING AND COMPILENODE_HWCOMPILE_MODULE AND COMPUTENODE_HWCOMPILE_MODULE) + execute_process (COMMAND module switch ${COMPILENODE_HWCOMPILE_MODULE} ${COMPUTENODE_HWCOMPILE_MODULE}) + endif () + + ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND RETURN_VALUE res NUMBER_ERRORS errval) + if (LOCAL_SUBMIT) + ctest_submit (PARTS Build) + endif () + if (${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed ${errval} Build: ${res}\n") + endif () + + if (NOT LOCAL_SKIP_TEST) + if (NOT LOCAL_MEMCHECK_TEST) if (NOT LOCAL_BATCH_TEST) ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) else () file(STRINGS ${CTEST_BINARY_DIRECTORY}/Testing/TAG TAG_CONTENTS REGEX "^2([0-9]+)[-]([0-9]+)$") - execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${CTEST_SOURCE_DIRECTORY}/bin/batch/${LOCAL_BATCH_SCRIPT_NAME}) + if (LOCAL_BATCH_SCRIPT_COMMAND STREQUAL "raybsub") + execute_process (COMMAND ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_NAME}) + else () + execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_NAME}) + endif () message(STATUS "Check for existence of ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml") execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) while(result) @@ -281,8 +294,13 @@ message (STATUS "Dashboard script configuration:\n${vars}\n") endif () message(STATUS "Found ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml for serial tests. Renaming to SerialTest.xml") file (RENAME ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/SerialTest.xml) + file (RENAME ${CTEST_BINARY_DIRECTORY}/Testing/Temporary/LastTest_${TAG_CONTENTS}.log ${CTEST_BINARY_DIRECTORY}/Testing/Temporary/LastTest_${TAG_CONTENTS}_Serial.log) unset(result CACHE) - execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${CTEST_SOURCE_DIRECTORY}/bin/batch/${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}) + if (LOCAL_BATCH_SCRIPT_COMMAND STREQUAL "raybsub") + execute_process (COMMAND ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}) + else () + execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}) + endif () message(STATUS "Check for existence of ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml") execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) while(result) diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index dd3b17c..83909b2 100755..100644 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -43,6 +43,9 @@ set (CTEST_SOURCE_VERSEXT "") #INSTALLDIR - HDF5-1.10.0 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF5-1.10.0 +#MODEL - CDash group name +#HPC - run alternate configurations for HPC machines; sbatch, bsub, raybsub +#MPI - enable MPI; if (DEFINED CTEST_SCRIPT_ARG) # transform ctest script arguments of the form # script.ctest,var1=value1,var2=value2 @@ -55,6 +58,11 @@ if (DEFINED CTEST_SCRIPT_ARG) endforeach () endif () +#HPC - run alternate configurations for HPC machines +if (DEFINED HPC) + set (BUILD_GENERATOR "Unix") +endif () + # build generator must be defined if (NOT DEFINED BUILD_GENERATOR) message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") @@ -92,84 +100,95 @@ endif () ################################################################### ######### Following describes compiler ############ -if (WIN32) - set (SITE_OS_NAME "Windows") - set (SITE_OS_VERSION "WIN7") - if (${BUILD_GENERATOR} STREQUAL "VS201764") - set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017 Win64") - set (SITE_OS_BITS "64") - set (SITE_COMPILER_NAME "vs2017") - set (SITE_COMPILER_VERSION "15") - elseif (${BUILD_GENERATOR} STREQUAL "VS2017") - set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017") - set (SITE_OS_BITS "32") - set (SITE_COMPILER_NAME "vs2017") - set (SITE_COMPILER_VERSION "15") - elseif (${BUILD_GENERATOR} STREQUAL "VS201564") - set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") - set (SITE_OS_BITS "64") - set (SITE_COMPILER_NAME "vs2015") - set (SITE_COMPILER_VERSION "14") - elseif (${BUILD_GENERATOR} STREQUAL "VS2015") - set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") - set (SITE_OS_BITS "32") - set (SITE_COMPILER_NAME "vs2015") - set (SITE_COMPILER_VERSION "14") - elseif (${BUILD_GENERATOR} STREQUAL "VS201364") - set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") - set (SITE_OS_BITS "64") - set (SITE_COMPILER_NAME "vs2013") - set (SITE_COMPILER_VERSION "12") - elseif (${BUILD_GENERATOR} STREQUAL "VS2013") - set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") - set (SITE_OS_BITS "32") - set (SITE_COMPILER_NAME "vs2013") - set (SITE_COMPILER_VERSION "12") - elseif (${BUILD_GENERATOR} STREQUAL "VS201264") - set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") - set (SITE_OS_BITS "64") - set (SITE_COMPILER_NAME "vs2012") - set (SITE_COMPILER_VERSION "11") - elseif (${BUILD_GENERATOR} STREQUAL "VS2012") - set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") - set (SITE_OS_BITS "32") - set (SITE_COMPILER_NAME "vs2012") - set (SITE_COMPILER_VERSION "11") +if (NOT DEFINED HPC) + if (NOT DEFINED BUILD_GENERATOR) + message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") + endif () + if (WIN32) + set (SITE_OS_NAME "Windows") + set (SITE_OS_VERSION "WIN7") + if (BUILD_GENERATOR STREQUAL "VS201764") + set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2017") + set (SITE_COMPILER_VERSION "15") + elseif (BUILD_GENERATOR STREQUAL "VS2017") + set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2017") + set (SITE_COMPILER_VERSION "15") + elseif (BUILD_GENERATOR STREQUAL "VS201564") + set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2015") + set (SITE_COMPILER_VERSION "14") + elseif (BUILD_GENERATOR STREQUAL "VS2015") + set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2015") + set (SITE_COMPILER_VERSION "14") + elseif (BUILD_GENERATOR STREQUAL "VS201364") + set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2013") + set (SITE_COMPILER_VERSION "12") + elseif (BUILD_GENERATOR STREQUAL "VS2013") + set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2013") + set (SITE_COMPILER_VERSION "12") + elseif (BUILD_GENERATOR STREQUAL "VS201264") + set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2012") + set (SITE_COMPILER_VERSION "11") + elseif (BUILD_GENERATOR STREQUAL "VS2012") + set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2012") + set (SITE_COMPILER_VERSION "11") + else () + message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") + endif () + ## Set the following to unique id your computer ## + set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") else () - message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") + set (CTEST_CMAKE_GENERATOR "Unix Makefiles") + ## Set the following to unique id your computer ## + if (APPLE) + set (CTEST_SITE "MAC.XXXX") + else () + set (CTEST_SITE "LINUX.XXXX") + endif () + if (APPLE) + execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set (ENV{CC} "${XCODE_CC}") + set (ENV{CXX} "${XCODE_CXX}") + set (CTEST_USE_LAUNCHERS 1) + set (RR_WARNINGS_COMMON "-Wno-format-nonliteral -Wno-cast-align -Wno-unused -Wno-unused-variable -Wno-unused-function -Wno-self-assign -Wno-unused-parameter -Wno-sign-compare") + set (RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations -Wno-uninitialized") + set (RR_WARNINGS_CXX "${RR_WARNINGS_COMMON} -Woverloaded-virtual -Wshadow -Wwrite-strings -Wc++11-compat") + set (RR_FLAGS_COMMON "-g -O0 -fstack-protector-all -D_FORTIFY_SOURCE=2") + set (RR_FLAGS_C "${RR_FLAGS_COMMON}") + set (RR_FLAGS_CXX "${RR_FLAGS_COMMON}") + set (ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}") + set (ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}") + endif () endif () -## Set the following to unique id your computer ## - set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") else () set (CTEST_CMAKE_GENERATOR "Unix Makefiles") -## Set the following to unique id your computer ## - if (APPLE) - set (CTEST_SITE "MAC.XXXX") - else () - set (CTEST_SITE "LINUX.XXXX") - endif () - if (APPLE) - execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set (ENV{CC} "${XCODE_CC}") - set (ENV{CXX} "${XCODE_CXX}") - set (CTEST_USE_LAUNCHERS 1) - set (RR_WARNINGS_COMMON "-Wno-format-nonliteral -Wno-cast-align -Wno-unused -Wno-unused-variable -Wno-unused-function -Wno-self-assign -Wno-unused-parameter -Wno-sign-compare") - set (RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations -Wno-uninitialized") - set (RR_WARNINGS_CXX "${RR_WARNINGS_COMMON} -Woverloaded-virtual -Wshadow -Wwrite-strings -Wc++11-compat") - set (RR_FLAGS_COMMON "-g -O0 -fstack-protector-all -D_FORTIFY_SOURCE=2") - set (RR_FLAGS_C "${RR_FLAGS_COMMON}") - set (RR_FLAGS_CXX "${RR_FLAGS_COMMON}") - set (ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}") - set (ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}") - endif () + include (${CTEST_SOURCE_DIRECTORY}/config/cmake/scripts/HPC/${HPC}-HDF5options.cmake) endif () ################################################################### ################################################################### ######### Following is for submission to CDash ############ ################################################################### -set (MODEL "Experimental") +if (NOT DEFINED MODEL) + set (MODEL "Experimental") +endif () + ################################################################### ################################################################### diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake index 6d1a57a..45877d7 100755..100644 --- a/config/cmake/scripts/HDF5options.cmake +++ b/config/cmake/scripts/HDF5options.cmake @@ -33,12 +33,8 @@ ############################################################################################# #### fortran enabled #### #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") - ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON") #### fortran disabled #### set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") - ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF") ############################################################################################# #### java enabled #### @@ -58,17 +54,18 @@ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRIN ### ext libs from git #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 (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib -DZLIB_INCLUDE_DIR:PATH=some_location/include") #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include") -### disable ext zlib building +### disable using ext zlib #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF") -### disable ext szip building +### 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_ENCODING:BOOL=OFF") #### package examples #### -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACK_EXAMPLES:BOOL=ON -DHDF5_EXAMPLES_COMPRESSED:STRING=HDF5Examples-1.10.9-Source.tar.gz -DHDF5_EXAMPLES_COMPRESSED_DIR:PATH=${CTEST_SCRIPT_DIRECTORY}") +#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACK_EXAMPLES:BOOL=ON -DHDF5_EXAMPLES_COMPRESSED:STRING=HDF5Examples-1.12.4-Source.tar.gz -DHDF5_EXAMPLES_COMPRESSED_DIR:PATH=${CTEST_SCRIPT_DIRECTORY}") ############################################################################################# ### enable parallel builds diff --git a/config/cmake/scripts/HPC/bsub-HDF5options.cmake b/config/cmake/scripts/HPC/bsub-HDF5options.cmake new file mode 100644 index 0000000..83c17aa --- /dev/null +++ b/config/cmake/scripts/HPC/bsub-HDF5options.cmake @@ -0,0 +1,40 @@ +# +# 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://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# +############################################################################################# +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### +############################################################################################# + +### uncomment/comment and change the following lines for other configuration options + +############################################################################################# +### enable parallel builds +if (DEFINED MPI) + # maximum parallel processor count for build and test #### + set (MAX_PROC_COUNT 8) + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PARALLEL:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_THREADSAFE:BOOL=OFF") +endif () +############################################################################################# +### options to run test scripts in batch commands +set (LOCAL_BATCH_SCRIPT_COMMAND "bsub") +set (LOCAL_BATCH_TEST "TRUE") +set (LOCAL_BATCH_SCRIPT_NAME "ctestS.lsf") +set (LOCAL_BATCH_SCRIPT_PARALLEL_NAME "ctestP.lsf") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_TEST:BOOL=ON") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_NAME:STRING=${LOCAL_BATCH_SCRIPT_NAME}") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_PARALLEL_NAME:STRING=${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_EXECUTABLE:STRING=srun") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_NUMPROC_FLAG:STRING=-n") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_MAX_NUMPROCS:STRING=6") diff --git a/config/cmake/scripts/HPC/raybsub-HDF5options.cmake b/config/cmake/scripts/HPC/raybsub-HDF5options.cmake new file mode 100644 index 0000000..4aad887 --- /dev/null +++ b/config/cmake/scripts/HPC/raybsub-HDF5options.cmake @@ -0,0 +1,41 @@ +# +# 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://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# +############################################################################################# +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### +############################################################################################# + +### uncomment/comment and change the following lines for other configuration options + +############################################################################################# +### enable parallel builds +if (DEFINED MPI) + # maximum parallel processor count for build and test #### + set (MAX_PROC_COUNT 8) + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PARALLEL:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_THREADSAFE:BOOL=OFF") +endif () +############################################################################################# +### options to run test scripts in batch commands +set (LOCAL_BATCH_SCRIPT_COMMAND "raybsub") +set (LOCAL_BATCH_TEST "TRUE") +set (LOCAL_BATCH_SCRIPT_NAME "ray_ctestS.lsf") +set (LOCAL_BATCH_SCRIPT_PARALLEL_NAME "ray_ctestP.lsf") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_TEST:BOOL=ON") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_COMMAND:STRING=${LOCAL_BATCH_SCRIPT_COMMAND}") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_NAME:STRING=${LOCAL_BATCH_SCRIPT_NAME}") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_PARALLEL_NAME:STRING=${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_EXECUTABLE:STRING=mpirun") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_NUMPROC_FLAG:STRING=-np") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_MAX_NUMPROCS:STRING=6") diff --git a/config/cmake/scripts/HPC/sbatch-HDF5options.cmake b/config/cmake/scripts/HPC/sbatch-HDF5options.cmake new file mode 100644 index 0000000..f70526e --- /dev/null +++ b/config/cmake/scripts/HPC/sbatch-HDF5options.cmake @@ -0,0 +1,52 @@ +# +# 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://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# +############################################################################################# +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### +############################################################################################# + +### uncomment/comment and change the following lines for other configuration options + +############################################################################################# +### enable parallel builds +if (DEFINED MPI) + # maximum parallel processor count for build and test #### + set (MAX_PROC_COUNT 8) + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PARALLEL:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_THREADSAFE:BOOL=OFF") +endif () +############################################################################################# +### options to run test scripts in batch commands +if (DEFINED KNL) + ### some additions and alternatives to cross compile on haswell for knl + set (COMPILENODE_HWCOMPILE_MODULE "craype-haswell") + set (COMPUTENODE_HWCOMPILE_MODULE "craype-mic-knl") + set (LOCAL_BATCH_SCRIPT_NAME "knl_ctestS.sl") + set (LOCAL_BATCH_SCRIPT_PARALLEL_NAME "knl_ctestP.sl") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/crayle.cmake") +else () + set (LOCAL_BATCH_SCRIPT_NAME "ctestS.sl") + set (LOCAL_BATCH_SCRIPT_PARALLEL_NAME "ctestP.sl") +endif () +set (LOCAL_BATCH_SCRIPT_COMMAND "sbatch") +set (LOCAL_BATCH_TEST "TRUE") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_TEST:BOOL=ON") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_NAME:STRING=${LOCAL_BATCH_SCRIPT_NAME}") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_PARALLEL_NAME:STRING=${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_EXECUTABLE:STRING=srun") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_NUMPROC_FLAG:STRING=-n") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_MAX_NUMPROCS:STRING=6") + +############################################################################################# +############################################################################################# diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake index 9af7e5b..4a580d0 100644 --- a/config/cmake/userblockTest.cmake +++ b/config/cmake/userblockTest.cmake @@ -62,7 +62,7 @@ if (TEST_CHECKUB STREQUAL "YES") OUTPUT_VARIABLE TEST_OUT ERROR_VARIABLE TEST_ERROR ) - if (NOT ${TEST_RESULT} STREQUAL "0") + if (TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} ${TEST_OFILE} is: ${TEST_ERROR}") endif () file (READ ${TEST_HFILE}.len.txt TEST_O_STRING_LEN) @@ -70,7 +70,7 @@ if (TEST_CHECKUB STREQUAL "YES") math( EXPR TEST_STRING_SIZE "${TEST_U_STRING_LEN} + ${TEST_O_STRING_LEN}" ) - if (NOT TEST_O_STRING_LEN STREQUAL "0") + if (TEST_O_STRING_LEN) #$JAM_BIN/getub -c $s2 $origfile > $cmpfile EXECUTE_PROCESS ( COMMAND ${TEST_GET_PROGRAM} -c ${TEST_O_STRING_LEN} ${TEST_OFILE} @@ -108,7 +108,7 @@ if (TEST_CHECKUB STREQUAL "YES") message (STATUS "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}+${TEST_O_STRING_LEN}") # if the return value is !=${TEST_EXPECT} bail out - if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + if (NOT TEST_RESULT EQUAL TEST_EXPECT) message (FATAL_ERROR "Failed: The output of ${TEST_HFILE}-ub did not match ${TEST_HFILE}.\n${TEST_ERROR}") endif () else () @@ -121,7 +121,7 @@ else () OUTPUT_VARIABLE TEST_OUT ERROR_VARIABLE TEST_ERROR ) - if (NOT TEST_H_STRING_LEN STREQUAL "0") + if (TEST_H_STRING_LEN) message (FATAL_ERROR "Failed: The output of ${TEST_HFILE} was NOT empty") endif () endif () diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake index 66a97c0..b616958 100644 --- a/config/cmake/vfdTest.cmake +++ b/config/cmake/vfdTest.cmake @@ -32,9 +32,9 @@ if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) endif () # if there is not an error reference file add the error output to the stdout file -if (NOT TEST_ERRREF) - set (ERROR_APPEND 1) -endif () +#if (NOT TEST_ERRREF) +# set (ERROR_APPEND 1) +#endif () message (STATUS "USING ${TEST_VFD} ON COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") @@ -60,7 +60,7 @@ if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err) endif () # if the return value is !=${TEST_EXPECT} bail out -if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}") +if (NOT TEST_RESULT EQUAL TEST_EXPECT) if (NOT TEST_NOERRDISPLAY) if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out) file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out TEST_STREAM) diff --git a/config/cmake/volTest.cmake b/config/cmake/volTest.cmake new file mode 100644 index 0000000..d8c82a4 --- /dev/null +++ b/config/cmake/volTest.cmake @@ -0,0 +1,76 @@ +# +# 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://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# +# volTest.cmake executes a command and captures the output in a file. Command uses specified VOL. +# Exit status of command can also be compared. + +# arguments checking +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM to be defined") +endif () +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif () +if (NOT TEST_VOL) + message (FATAL_ERROR "Require TEST_VOL to be defined") +endif () + +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) +endif () + +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) +endif () + +# if there is not an error reference file add the error output to the stdout file +#if (NOT TEST_ERRREF) +# set (ERROR_APPEND 1) +#endif () + +message (STATUS "USING ${TEST_VOL} ON COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") + +set (ENV{HDF5_VOL_CONNECTOR} "${TEST_VOL}") + +# run the test program, capture the stdout/stderr and the result var +execute_process ( + COMMAND ${TEST_PROGRAM} ${TEST_ARGS} + WORKING_DIRECTORY ${TEST_FOLDER} + RESULT_VARIABLE TEST_RESULT + OUTPUT_FILE ${TEST_OUTPUT}.out + ERROR_FILE ${TEST_OUTPUT}.err + OUTPUT_VARIABLE TEST_OUT + ERROR_VARIABLE TEST_ERROR +) + +message (STATUS "COMMAND Result: ${TEST_RESULT}") + +# if the .err file exists and ERRROR_APPEND is enabled +if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) + file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT}.out "${TEST_STREAM}") +endif () + +# if the return value is !=${TEST_EXPECT} bail out +if (NOT TEST_RESULT EQUAL TEST_EXPECT) + if (NOT TEST_NOERRDISPLAY) + if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.out) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.out TEST_STREAM) + message (STATUS "Output USING ${TEST_VOL}:\n${TEST_STREAM}") + endif () + endif () + message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") +endif () + +message (STATUS "COMMAND Error: ${TEST_ERROR}") + +# everything went fine... +message ("Passed: The ${TEST_PROGRAM} program used vol ${TEST_VOL}") diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 40f1440..cc9de79 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -70,7 +70,7 @@ if (WIN32) set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1") endif () set (${HDF_PREFIX}_HAVE_WIN32_API 1) - set (CMAKE_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib") + set (HDF5_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib") if (NOT UNIX AND NOT MINGW) set (WINDOWS 1) set (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1") @@ -109,6 +109,78 @@ endif () # END of WINDOWS Hard code Values # ---------------------------------------------------------------------- +if (NOT WINDOWS) + TEST_BIG_ENDIAN (${HDF_PREFIX}_WORDS_BIGENDIAN) +endif () + +#----------------------------------------------------------------------------- +# Check IF header file exists and add it to the list. +#----------------------------------------------------------------------------- +macro (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE) + CHECK_INCLUDE_FILES ("${USE_INCLUDES};${FILE}" ${VARIABLE}) + if (${VARIABLE}) + set (USE_INCLUDES ${USE_INCLUDES} ${FILE}) + endif () +endmacro () + +#----------------------------------------------------------------------------- +# Check for the existence of certain header files +#----------------------------------------------------------------------------- +CHECK_INCLUDE_FILE_CONCAT ("sys/file.h" ${HDF_PREFIX}_HAVE_SYS_FILE_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/ioctl.h" ${HDF_PREFIX}_HAVE_SYS_IOCTL_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/resource.h" ${HDF_PREFIX}_HAVE_SYS_RESOURCE_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/socket.h" ${HDF_PREFIX}_HAVE_SYS_SOCKET_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/stat.h" ${HDF_PREFIX}_HAVE_SYS_STAT_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/time.h" ${HDF_PREFIX}_HAVE_SYS_TIME_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" ${HDF_PREFIX}_HAVE_SYS_TYPES_H) +CHECK_INCLUDE_FILE_CONCAT ("features.h" ${HDF_PREFIX}_HAVE_FEATURES_H) +CHECK_INCLUDE_FILE_CONCAT ("dirent.h" ${HDF_PREFIX}_HAVE_DIRENT_H) +CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" ${HDF_PREFIX}_HAVE_SETJMP_H) +CHECK_INCLUDE_FILE_CONCAT ("stddef.h" ${HDF_PREFIX}_HAVE_STDDEF_H) +CHECK_INCLUDE_FILE_CONCAT ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H) +CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H) + +# Darwin +CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" ${HDF_PREFIX}_HAVE_MACH_MACH_TIME_H) + +# Windows +CHECK_INCLUDE_FILE_CONCAT ("io.h" ${HDF_PREFIX}_HAVE_IO_H) +if (NOT CYGWIN) + CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" ${HDF_PREFIX}_HAVE_WINSOCK2_H) +endif () +CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" ${HDF_PREFIX}_HAVE_SYS_TIMEB_H) + +if (CMAKE_SYSTEM_NAME MATCHES "OSF") + CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" ${HDF_PREFIX}_HAVE_SYS_SYSINFO_H) + CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" ${HDF_PREFIX}_HAVE_SYS_PROC_H) +else () + set (${HDF_PREFIX}_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE) + set (${HDF_PREFIX}_HAVE_SYS_PROC_H "" CACHE INTERNAL "" FORCE) +endif () + +CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" ${HDF_PREFIX}_HAVE_GLOBUS_COMMON_H) +CHECK_INCLUDE_FILE_CONCAT ("pdb.h" ${HDF_PREFIX}_HAVE_PDB_H) +CHECK_INCLUDE_FILE_CONCAT ("pthread.h" ${HDF_PREFIX}_HAVE_PTHREAD_H) +CHECK_INCLUDE_FILE_CONCAT ("srbclient.h" ${HDF_PREFIX}_HAVE_SRBCLIENT_H) +CHECK_INCLUDE_FILE_CONCAT ("string.h" ${HDF_PREFIX}_HAVE_STRING_H) +CHECK_INCLUDE_FILE_CONCAT ("strings.h" ${HDF_PREFIX}_HAVE_STRINGS_H) +CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" ${HDF_PREFIX}_HAVE_STDLIB_H) +CHECK_INCLUDE_FILE_CONCAT ("memory.h" ${HDF_PREFIX}_HAVE_MEMORY_H) +CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" ${HDF_PREFIX}_HAVE_DLFCN_H) +CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" ${HDF_PREFIX}_HAVE_INTTYPES_H) +CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" ${HDF_PREFIX}_HAVE_NETINET_IN_H) +# _Bool type support +CHECK_INCLUDE_FILE_CONCAT (stdbool.h ${HDF_PREFIX}_HAVE_STDBOOL_H) + +## Check for non-standard extenstion quadmath.h + +CHECK_INCLUDE_FILES(quadmath.h C_HAVE_QUADMATH) +if (${C_HAVE_QUADMATH}) + set(${HDF_PREFIX}_HAVE_QUADMATH_H 1) +else () + set(${HDF_PREFIX}_HAVE_QUADMATH_H 0) +endif () + if (CYGWIN) set (${HDF_PREFIX}_HAVE_LSEEK64 0) endif () @@ -127,17 +199,13 @@ endif () CHECK_LIBRARY_EXISTS_CONCAT ("ucb" gethostname ${HDF_PREFIX}_HAVE_LIBUCB) # For other tests to use the same libraries -set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LINK_LIBS}) +set (HDF5_REQUIRED_LIBRARIES ${HDF5_REQUIRED_LIBRARIES} ${LINK_LIBS}) set (USE_INCLUDES "") if (WINDOWS) set (USE_INCLUDES ${USE_INCLUDES} "windows.h") endif () -if (NOT WINDOWS) - TEST_BIG_ENDIAN (${HDF_PREFIX}_WORDS_BIGENDIAN) -endif () - # For other specific tests, use this MACRO. macro (HDF_FUNCTION_TEST OTHER_TEST) if (NOT DEFINED ${HDF_PREFIX}_${OTHER_TEST}) @@ -161,11 +229,11 @@ macro (HDF_FUNCTION_TEST OTHER_TEST) endif () #message (STATUS "Performing ${OTHER_TEST}") - TRY_COMPILE (${OTHER_TEST} + try_compile (${OTHER_TEST} ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFTests.c COMPILE_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS}" - LINK_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}" + LINK_LIBRARIES "${HDF5_REQUIRED_LIBRARIES}" OUTPUT_VARIABLE OUTPUT ) if (${OTHER_TEST}) @@ -188,63 +256,6 @@ endmacro () HDF_FUNCTION_TEST (STDC_HEADERS) #----------------------------------------------------------------------------- -# Check IF header file exists and add it to the list. -#----------------------------------------------------------------------------- -macro (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE) - CHECK_INCLUDE_FILES ("${USE_INCLUDES};${FILE}" ${VARIABLE}) - if (${VARIABLE}) - set (USE_INCLUDES ${USE_INCLUDES} ${FILE}) - endif () -endmacro () - -#----------------------------------------------------------------------------- -# Check for the existence of certain header files -#----------------------------------------------------------------------------- -CHECK_INCLUDE_FILE_CONCAT ("sys/file.h" ${HDF_PREFIX}_HAVE_SYS_FILE_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/ioctl.h" ${HDF_PREFIX}_HAVE_SYS_IOCTL_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/resource.h" ${HDF_PREFIX}_HAVE_SYS_RESOURCE_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/socket.h" ${HDF_PREFIX}_HAVE_SYS_SOCKET_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/stat.h" ${HDF_PREFIX}_HAVE_SYS_STAT_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/time.h" ${HDF_PREFIX}_HAVE_SYS_TIME_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" ${HDF_PREFIX}_HAVE_SYS_TYPES_H) -CHECK_INCLUDE_FILE_CONCAT ("features.h" ${HDF_PREFIX}_HAVE_FEATURES_H) -CHECK_INCLUDE_FILE_CONCAT ("dirent.h" ${HDF_PREFIX}_HAVE_DIRENT_H) -CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" ${HDF_PREFIX}_HAVE_SETJMP_H) -CHECK_INCLUDE_FILE_CONCAT ("stddef.h" ${HDF_PREFIX}_HAVE_STDDEF_H) -CHECK_INCLUDE_FILE_CONCAT ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H) -CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H) - -# Darwin -CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" ${HDF_PREFIX}_HAVE_MACH_MACH_TIME_H) - -# Windows -CHECK_INCLUDE_FILE_CONCAT ("io.h" ${HDF_PREFIX}_HAVE_IO_H) -if (NOT CYGWIN) - CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" ${HDF_PREFIX}_HAVE_WINSOCK2_H) -endif () -CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" ${HDF_PREFIX}_HAVE_SYS_TIMEB_H) - -if (CMAKE_SYSTEM_NAME MATCHES "OSF") - CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" ${HDF_PREFIX}_HAVE_SYS_SYSINFO_H) - CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" ${HDF_PREFIX}_HAVE_SYS_PROC_H) -else () - set (${HDF_PREFIX}_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE) - set (${HDF_PREFIX}_HAVE_SYS_PROC_H "" CACHE INTERNAL "" FORCE) -endif () - -CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" ${HDF_PREFIX}_HAVE_GLOBUS_COMMON_H) -CHECK_INCLUDE_FILE_CONCAT ("pdb.h" ${HDF_PREFIX}_HAVE_PDB_H) -CHECK_INCLUDE_FILE_CONCAT ("pthread.h" ${HDF_PREFIX}_HAVE_PTHREAD_H) -CHECK_INCLUDE_FILE_CONCAT ("srbclient.h" ${HDF_PREFIX}_HAVE_SRBCLIENT_H) -CHECK_INCLUDE_FILE_CONCAT ("string.h" ${HDF_PREFIX}_HAVE_STRING_H) -CHECK_INCLUDE_FILE_CONCAT ("strings.h" ${HDF_PREFIX}_HAVE_STRINGS_H) -CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" ${HDF_PREFIX}_HAVE_STDLIB_H) -CHECK_INCLUDE_FILE_CONCAT ("memory.h" ${HDF_PREFIX}_HAVE_MEMORY_H) -CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" ${HDF_PREFIX}_HAVE_DLFCN_H) -CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" ${HDF_PREFIX}_HAVE_INTTYPES_H) -CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" ${HDF_PREFIX}_HAVE_NETINET_IN_H) - -#----------------------------------------------------------------------------- # Check for large file support #----------------------------------------------------------------------------- @@ -275,7 +286,7 @@ if (NOT WINDOWS) option (HDF_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) 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 + try_run (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFTests.c COMPILE_DEFINITIONS "-DTEST_LFS_WORKS" @@ -402,13 +413,13 @@ HDF_CHECK_TYPE_SIZE (off64_t ${HDF_PREFIX}_SIZEOF_OFF64_T) if (NOT ${HDF_PREFIX}_SIZEOF_OFF64_T) set (${HDF_PREFIX}_SIZEOF_OFF64_T 0) endif () +HDF_CHECK_TYPE_SIZE (time_t ${HDF_PREFIX}_SIZEOF_TIME_T) #----------------------------------------------------------------------------- # Extra C99 types #----------------------------------------------------------------------------- # _Bool type support -CHECK_INCLUDE_FILE_CONCAT (stdbool.h ${HDF_PREFIX}_HAVE_STDBOOL_H) if (HAVE_STDBOOL_H) set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h) HDF_CHECK_TYPE_SIZE (bool ${HDF_PREFIX}_SIZEOF_BOOL) @@ -432,7 +443,7 @@ if (NOT WINDOWS) # Check a bunch of time functions #----------------------------------------------------------------------------- CHECK_FUNCTION_EXISTS (gettimeofday ${HDF_PREFIX}_HAVE_GETTIMEOFDAY) - foreach (test + foreach (time_test HAVE_TM_GMTOFF HAVE___TM_GMTOFF # HAVE_TIMEZONE @@ -442,7 +453,7 @@ if (NOT WINDOWS) HAVE_TM_ZONE HAVE_STRUCT_TM_TM_ZONE ) - HDF_FUNCTION_TEST (${test}) + HDF_FUNCTION_TEST (${time_test}) endforeach () if (NOT CYGWIN AND NOT MINGW) HDF_FUNCTION_TEST (HAVE_TIMEZONE) @@ -495,6 +506,8 @@ CHECK_FUNCTION_EXISTS (lround ${HDF_PREFIX}_HAVE_LROUND) CHECK_FUNCTION_EXISTS (lroundf ${HDF_PREFIX}_HAVE_LROUNDF) CHECK_FUNCTION_EXISTS (lstat ${HDF_PREFIX}_HAVE_LSTAT) +CHECK_FUNCTION_EXISTS (pread ${HDF_PREFIX}_HAVE_PREAD) +CHECK_FUNCTION_EXISTS (pwrite ${HDF_PREFIX}_HAVE_PWRITE) CHECK_FUNCTION_EXISTS (rand_r ${HDF_PREFIX}_HAVE_RAND_R) CHECK_FUNCTION_EXISTS (random ${HDF_PREFIX}_HAVE_RANDOM) CHECK_FUNCTION_EXISTS (round ${HDF_PREFIX}_HAVE_ROUND) @@ -544,7 +557,7 @@ endif () # Check a bunch of other functions #----------------------------------------------------------------------------- if (NOT WINDOWS) - foreach (test + foreach (other_test HAVE_ATTRIBUTE HAVE_C99_FUNC # STDC_HEADERS @@ -553,7 +566,7 @@ if (NOT WINDOWS) SYSTEM_SCOPE_THREADS HAVE_SOCKLEN_T ) - HDF_FUNCTION_TEST (${test}) + HDF_FUNCTION_TEST (${other_test}) endforeach () endif () @@ -580,7 +593,7 @@ if (WINDOWS) ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFTests.c COMPILE_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} ${MACRO_CHECK_FUNCTION_DEFINITIONS}" - LINK_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}" + LINK_LIBRARIES "${HDF5_REQUIRED_LIBRARIES}" CMAKE_FLAGS "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES} -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}" COMPILE_OUTPUT_VARIABLE OUTPUT ) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 147ae2f..2f4ce52 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -14,7 +14,7 @@ macro (SET_HDF_BUILD_TYPE) get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(_isMultiConfig) - set(HDF_CFG_NAME ${CTEST_CONFIGURATION_TYPE}) + set(HDF_CFG_NAME ${CMAKE_BUILD_TYPE}) set(HDF_BUILD_TYPE ${CMAKE_CFG_INTDIR}) set(HDF_CFG_BUILD_TYPE \${CMAKE_INSTALL_CONFIG_NAME}) else() @@ -170,7 +170,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) if (${importtype} MATCHES "IMPORT") set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}") endif () - if (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (${HDF_CFG_NAME} MATCHES "Debug") set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME}) else () set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME}) @@ -273,7 +273,7 @@ macro (HDF_README_PROPERTIES target_fortran) set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2015") else () set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2017") - endif () + endif () else () set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}") endif () diff --git a/config/cmake_ext_mod/HDFUseCXX.cmake b/config/cmake_ext_mod/HDFUseCXX.cmake index f293ec5..8d98147 100644 --- a/config/cmake_ext_mod/HDFUseCXX.cmake +++ b/config/cmake_ext_mod/HDFUseCXX.cmake @@ -48,8 +48,8 @@ macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) if (NOT DEFINED ${OTHER_TEST}) set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") set (OTHER_TEST_ADD_LIBRARIES) - if (CMAKE_REQUIRED_LIBRARIES) - set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + if (HDF5_REQUIRED_LIBRARIES) + set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${HDF5_REQUIRED_LIBRARIES}") endif () foreach (def @@ -96,7 +96,7 @@ endmacro () # Check a bunch of cxx functions #----------------------------------------------------------------------------- if (CMAKE_CXX_COMPILER_LOADED) - foreach (test + foreach (cxx_test OLD_HEADER_FILENAME HDF_NO_NAMESPACE HDF_NO_STD @@ -104,6 +104,6 @@ if (CMAKE_CXX_COMPILER_LOADED) NO_STATIC_CAST CXX_HAVE_OFFSETOF ) - HDF_CXX_FUNCTION_TEST (${test}) + HDF_CXX_FUNCTION_TEST (${cxx_test}) endforeach () endif () diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake index f8f3cea..c68c921 100644 --- a/config/cmake_ext_mod/HDFUseFortran.cmake +++ b/config/cmake_ext_mod/HDFUseFortran.cmake @@ -48,9 +48,9 @@ set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) ${CMAKE_MATCH_1}") #----------------------------------------------------------------------------- macro (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) message (STATUS "Testing Fortran ${FUNCTION}") - if (CMAKE_REQUIRED_LIBRARIES) + if (HDF5_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES - "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + "-DLINK_LIBRARIES:STRING=${HDF5_REQUIRED_LIBRARIES}") else () set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) endif () diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake index b812d73..1417204 100644 --- a/config/cmake_ext_mod/grepTest.cmake +++ b/config/cmake_ext_mod/grepTest.cmake @@ -57,15 +57,15 @@ file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) # TEST_REFERENCE should always be matched string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) -if ("${TEST_RESULT}" STREQUAL "0") +if (NOT TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") endif () string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) -if ("${TEST_EXPECT}" STREQUAL "1") - # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match +if (TEST_EXPECT) + # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match string (LENGTH "${TEST_MATCH}" TEST_RESULT) - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") endif () endif () diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 5569a73..13e8a4d 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -26,9 +26,6 @@ endif () if (NOT TEST_EXPECT) message (STATUS "Require TEST_EXPECT to be defined") endif () -if (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) - message (FATAL_ERROR "Require TEST_REFERENCE to be defined") -endif () if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) @@ -38,11 +35,6 @@ if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) endif () -# if there is not an error reference file add the error output to the stdout file -if (NOT TEST_ERRREF) - set (ERROR_APPEND 1) -endif () - message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") if (TEST_LIBRARY_DIRECTORY) @@ -88,7 +80,7 @@ if (TEST_REGEX) file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) string (REGEX MATCH "${TEST_REGEX}" REGEX_MATCH ${TEST_STREAM}) string (COMPARE EQUAL "${REGEX_MATCH}" "${TEST_MATCH}" REGEX_RESULT) - if ("${REGEX_RESULT}" STREQUAL "0") + if (NOT REGEX_RESULT) message (STATUS "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_MATCH}") endif () endif () @@ -96,9 +88,21 @@ endif () message (STATUS "COMMAND Result: ${TEST_RESULT}") # if the .err file exists and ERRROR_APPEND is enabled -if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) - file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + if (TEST_MASK_FILE) + STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}") + endif () + # remove special output + string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}") + + if (NOT ERROR_APPEND) + # write back to original .err file + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") + else () + # append error output to the stdout output file + file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + endif () endif () # append the test result status with a predefined text @@ -107,7 +111,7 @@ if (TEST_APPEND) endif () # if the return value is !=${TEST_EXPECT} bail out -if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}") +if (NOT TEST_RESULT EQUAL TEST_EXPECT) if (NOT TEST_NOERRDISPLAY) if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) @@ -119,6 +123,14 @@ endif () message (STATUS "COMMAND Error: ${TEST_ERROR}") +# remove special output +file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) +string (FIND TEST_STREAM "_pmi_alps" "${TEST_FIND_RESULT}") +if (TEST_FIND_RESULT GREATER 0) + string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM}) +endif () + # if the output file needs Storage text removed if (TEST_MASK) file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) @@ -173,63 +185,65 @@ endif () # compare output files to references unless this must be skipped if (NOT TEST_SKIP_COMPARE) - if (WIN32 AND NOT MINGW) - file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) - file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") - endif () + if (EXISTS ${TEST_FOLDER}/${TEST_REFERENCE}) + if (WIN32 AND NOT MINGW) + file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) + file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") + endif () - if (NOT TEST_SORT_COMPARE) - # now compare the output with the reference - execute_process ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} - RESULT_VARIABLE TEST_RESULT - ) - else () - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1) - file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2) - list (SORT v1) - list (SORT v2) - if (NOT v1 STREQUAL v2) - set(TEST_RESULT 1) + if (NOT TEST_SORT_COMPARE) + # now compare the output with the reference + execute_process ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} + RESULT_VARIABLE TEST_RESULT + ) + else () + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2) + list (SORT v1) + list (SORT v2) + if (NOT v1 STREQUAL v2) + set(TEST_RESULT 1) + endif () endif () - endif () - if (NOT "${TEST_RESULT}" STREQUAL "0") - set (TEST_RESULT 0) - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) - list (LENGTH test_act len_act) - file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) - list (LENGTH test_ref len_ref) - if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0") - math (EXPR _FP_LEN "${len_ref} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - list (GET test_act ${line} str_act) - list (GET test_ref ${line} str_ref) - if (NOT "${str_act}" STREQUAL "${str_ref}") - if (NOT "${str_act}" STREQUAL "") - set (TEST_RESULT 1) - message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + if (TEST_RESULT) + set (TEST_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) + list (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) + list (LENGTH test_ref len_ref) + if (len_act GREATER 0 AND len_ref GREATER 0) + math (EXPR _FP_LEN "${len_ref} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET test_act ${line} str_act) + list (GET test_ref ${line} str_ref) + if (NOT str_act STREQUAL str_ref) + if (str_act) + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif () endif () + endforeach () + else () + if (len_act EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") + endif () + if (len_ref EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") endif () - endforeach () - else () - if ("${len_act}" STREQUAL "0") - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") endif () - if ("${len_ref}" STREQUAL "0") - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") + if (NOT len_act EQUAL len_ref) + set (TEST_RESULT 1) endif () endif () - if (NOT "${len_act}" STREQUAL "${len_ref}") - set (TEST_RESULT 1) - endif () - endif () - message (STATUS "COMPARE Result: ${TEST_RESULT}") + message (STATUS "COMPARE Result: ${TEST_RESULT}") - # again, if return value is !=0 scream and shout - if (NOT "${TEST_RESULT}" STREQUAL "0") - message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") + # again, if return value is !=0 scream and shout + if (TEST_RESULT) + message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") + endif () endif () # now compare the .err file with the error reference, if supplied @@ -244,34 +258,34 @@ if (NOT TEST_SKIP_COMPARE) COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} RESULT_VARIABLE TEST_RESULT ) - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) list (LENGTH test_ref len_ref) math (EXPR _FP_LEN "${len_ref} - 1") - if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0") + if (len_act GREATER 0 AND len_ref GREATER 0) math (EXPR _FP_LEN "${len_ref} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) list (GET test_ref ${line} str_ref) - if (NOT "${str_act}" STREQUAL "${str_ref}") - if (NOT "${str_act}" STREQUAL "") + if (NOT str_act STREQUAL str_ref) + if (str_act) set (TEST_RESULT 1) message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - endif () + endif () endif () endforeach () else () - if ("${len_act}" STREQUAL "0") + if (len_act EQUAL 0) message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") endif () - if ("${len_ref}" STREQUAL "0") + if (len_ref EQUAL 0) message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") endif () endif () - if (NOT "${len_act}" STREQUAL "${len_ref}") + if (NOT len_act EQUAL len_ref) set (TEST_RESULT 1) endif () endif () @@ -279,11 +293,33 @@ if (NOT TEST_SKIP_COMPARE) message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - if (NOT "${TEST_RESULT}" STREQUAL "0") + if (TEST_RESULT) message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") endif () endif () endif () +if (TEST_GREP_COMPARE) + # now grep the output with the reference + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + + # TEST_REFERENCE should always be matched + string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) + string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) + if (NOT TEST_RESULT) + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") + endif () + + string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) + if (TEST_EXPECT) + # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match + string (LENGTH "${TEST_MATCH}" TEST_RESULT) + if (TEST_RESULT) + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") + endif () + endif () +endif () + # everything went fine... -message ("Passed: The output of ${TEST_PROGRAM} matches ${TEST_REFERENCE}") +message ("${TEST_PROGRAM} Passed") + diff --git a/config/conclude.am b/config/conclude.am index 4655565..9da1da5 100644 --- a/config/conclude.am +++ b/config/conclude.am @@ -131,28 +131,43 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: echo "============================" > $${log}; \ fi; \ if test "X$(FORTRAN_API)" = "Xyes"; then \ - echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \ + echo "Fortran API: Testing $${tname} $(TEST_FLAGS)"; \ if test -n "$(REALTIMEOUTPUT)"; then \ - echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \ + echo "Fortran API: Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log}; \ else \ - echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \ + echo "Fortran API: Test log for $${tname} $(TEST_FLAGS)" >> $${log}; \ fi; \ elif test "X$(CXX_API)" = "Xyes"; then \ - echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \ + echo "C++ API: Testing $${tname} $(TEST_FLAGS)"; \ if test -n "$(REALTIMEOUTPUT)"; then \ - echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log};\ + echo "C++ API: Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log};\ else \ - echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\ + echo "C++ API: Test log for $${tname} $(TEST_FLAGS)" >> $${log};\ fi; \ else \ - echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \ + echo "Testing: $${tname} $(TEST_FLAGS)"; \ if test -n "$(REALTIMEOUTPUT)"; then \ - echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \ + echo "Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log}; \ else \ - echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \ + echo "Test log for $${tname} $(TEST_FLAGS)" >> $${log}; \ fi; \ fi; \ if test -n "$(REALTIMEOUTPUT)"; then \ + if test -n "$(HDF5_VOL_CONNECTOR)"; then \ + echo "VOL connector: $(HDF5_VOL_CONNECTOR)" | tee -a $${log}; \ + fi; \ + if test -n "$(HDF5_DRIVER)"; then \ + echo "Virtual file driver (VFD): $(HDF5_DRIVER)" | tee -a $${log}; \ + fi; \ + else \ + if test -n "$(HDF5_VOL_CONNECTOR)"; then \ + echo "VOL connector: $(HDF5_VOL_CONNECTOR)" >> $${log}; \ + fi; \ + if test -n "$(HDF5_DRIVER)"; then \ + echo "Virtual file driver (VFD): $(HDF5_DRIVER)" >> $${log}; \ + fi; \ + fi; \ + if test -n "$(REALTIMEOUTPUT)"; then \ echo "============================" | tee -a $${log}; \ else \ echo "============================" >> $${log}; \ @@ -234,7 +249,7 @@ build-check-p: $(LIB) $(PROGS) $(chk_TESTS) echo "**** Hint ****"; \ echo "Parallel test files reside in the current directory" \ "by default."; \ - echo "Set HDF5_PARAPREFIX to use another directory. E.g.,"; \ + echo "Set HDF5_PARAPREFIX to use another directory. e.g.,"; \ echo " HDF5_PARAPREFIX=/PFS/user/me"; \ echo " export HDF5_PARAPREFIX"; \ echo " make check"; \ diff --git a/config/toolchain/GCC.cmake b/config/toolchain/GCC.cmake index ddb1641..c41d0ca 100644 --- a/config/toolchain/GCC.cmake +++ b/config/toolchain/GCC.cmake @@ -1,5 +1,6 @@ -# Uncomment the following to use cross-compiling +# Uncomment the following line and the correct system name to use cross-compiling #set(CMAKE_SYSTEM_NAME Linux) + set(CMAKE_COMPILER_VENDOR "GCC") set(CMAKE_C_COMPILER cc) diff --git a/config/toolchain/PGI.cmake b/config/toolchain/PGI.cmake new file mode 100644 index 0000000..ec58cbb --- /dev/null +++ b/config/toolchain/PGI.cmake @@ -0,0 +1,11 @@ +# Uncomment the following to use cross-compiling +#set(CMAKE_SYSTEM_NAME Linux) + +set(CMAKE_COMPILER_VENDOR "PGI") + +set(CMAKE_C_COMPILER pgcc) +set(CMAKE_CXX_COMPILER pgc++) +set(CMAKE_Fortran_COMPILER pgf90) + +# the following is used if cross-compiling +set(CMAKE_CROSSCOMPILING_EMULATOR "") diff --git a/config/toolchain/crayle.cmake b/config/toolchain/crayle.cmake index a83147b..bf7cf69 100644 --- a/config/toolchain/crayle.cmake +++ b/config/toolchain/crayle.cmake @@ -1,5 +1,6 @@ -# Uncomment the following to use cross-compiling +# The following line will use cross-compiling set(CMAKE_SYSTEM_NAME Linux) + set(CMAKE_COMPILER_VENDOR "CrayLinuxEnvironment") set(CMAKE_C_COMPILER cc) @@ -7,14 +8,3 @@ set(CMAKE_Fortran_COMPILER ftn) # the following is used if cross-compiling set(CMAKE_CROSSCOMPILING_EMULATOR "") - -# option to use pre-generated H5Tinit.c file -set(HDF5_USE_PREGEN OFF) -# directory where H5Tinit.c file will be found -#set(HDF5_USE_PREGEN_DIR "/lscratch1/lknox/HDF5_1_10_4/CMake-hdf5-1.10.4") - -# option to generate H5Tinit.c by running H5detect on knl compute node during build -set(HDF5_BATCH_H5DETECT ON) -set(HDF5_BATCH_CMD "sbatch") -set(HDF5_BATCH_H5DETECT_SCRIPT "knl_H5detect.sl") -set(MPIEXEC_EXECUTABLE "srun") diff --git a/config/toolchain/intel.cmake b/config/toolchain/intel.cmake index f1a5734..97f6a64 100644 --- a/config/toolchain/intel.cmake +++ b/config/toolchain/intel.cmake @@ -1,5 +1,6 @@ # Uncomment the following to use cross-compiling #set(CMAKE_SYSTEM_NAME Linux) + set(CMAKE_COMPILER_VENDOR "intel") set(CMAKE_C_COMPILER icc) |