diff options
Diffstat (limited to 'config/cmake')
-rwxr-xr-x | config/cmake/CTestCustom.ctest | 1 | ||||
-rw-r--r-- | config/cmake/ConfigureChecks.cmake | 65 | ||||
-rw-r--r-- | config/cmake/HDF5Macros.cmake | 36 | ||||
-rw-r--r-- | config/cmake/HDF5Tests.c | 11 | ||||
-rw-r--r-- | config/cmake/grepTest.cmake | 61 |
5 files changed, 157 insertions, 17 deletions
diff --git a/config/cmake/CTestCustom.ctest b/config/cmake/CTestCustom.ctest index c1538c0..acb1918 100755 --- a/config/cmake/CTestCustom.ctest +++ b/config/cmake/CTestCustom.ctest @@ -4,6 +4,7 @@ SET (CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} "H5detect.c.[0-9]+.[ ]*: warning C4090:" "testhdf5.h.[0-9]+.[ ]*: warning C4005:" + "POSIX name for this item is deprecated" "disabling jobserver mode" ) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 1318e90..b5b1170 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -35,6 +35,7 @@ OPTION (HDF5_Enable_Clear_File_Buffers "Securely clear file buffers before writi IF (HDF5_Enable_Clear_File_Buffers) SET (H5_CLEAR_MEMORY 1) ENDIF (HDF5_Enable_Clear_File_Buffers) +MARK_AS_ADVANCED (HDF5_Enable_Clear_File_Buffers) #----------------------------------------------------------------------------- # Option for --enable-instrument @@ -46,6 +47,7 @@ OPTION (HDF5_Enable_Instrument "Instrument The library" HDF5_Enable_Instrument) IF (HDF5_Enable_Instrument) SET (H5_HAVE_INSTRUMENTED_LIBRARY 1) ENDIF (HDF5_Enable_Instrument) +MARK_AS_ADVANCED (HDF5_Enable_Instrument) #----------------------------------------------------------------------------- # Option for --enable-strict-format-checks @@ -54,6 +56,7 @@ OPTION (HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" IF (HDF5_STRICT_FORMAT_CHECKS) SET (H5_STRICT_FORMAT_CHECKS 1) ENDIF (HDF5_STRICT_FORMAT_CHECKS) +MARK_AS_ADVANCED (HDF5_STRICT_FORMAT_CHECKS) #----------------------------------------------------------------------------- # Option for --enable-metadata-trace-file @@ -62,6 +65,7 @@ OPTION (HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF) IF (HDF5_METADATA_TRACE_FILE) SET (H5_METADATA_TRACE_FILE 1) ENDIF (HDF5_METADATA_TRACE_FILE) +MARK_AS_ADVANCED (HDF5_METADATA_TRACE_FILE) # ---------------------------------------------------------------------- # Decide whether the data accuracy has higher priority during data @@ -73,6 +77,7 @@ OPTION (HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conv IF (HDF5_WANT_DATA_ACCURACY) SET (H5_WANT_DATA_ACCURACY 1) ENDIF(HDF5_WANT_DATA_ACCURACY) +MARK_AS_ADVANCED (HDF5_WANT_DATA_ACCURACY) # ---------------------------------------------------------------------- # Decide whether the presence of user's exception handling functions is @@ -84,24 +89,16 @@ OPTION (HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked durin IF (HDF5_WANT_DCONV_EXCEPTION) SET (H5_WANT_DCONV_EXCEPTION 1) ENDIF (HDF5_WANT_DCONV_EXCEPTION) +MARK_AS_ADVANCED (HDF5_WANT_DCONV_EXCEPTION) -SET (LINUX_LFS 0) -SET (HDF5_EXTRA_FLAGS) -IF (CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.") - # Linux Specific flags - ADD_DEFINITIONS (-D_POSIX_SOURCE -D_BSD_SOURCE) - OPTION (HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) - IF (HDF5_ENABLE_LARGE_FILE) - SET (LARGEFILE 1) - SET (HDF5_EXTRA_FLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) - SET (CMAKE_REQUIRED_DEFINITIONS ${HDF5_EXTRA_FLAGS}) - ENDIF (HDF5_ENABLE_LARGE_FILE) -ENDIF (CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.") -IF (LINUX_LFS) - SET (HDF5_EXTRA_FLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) - SET (CMAKE_REQUIRED_DEFINITIONS ${HDF5_EXTRA_FLAGS}) -ENDIF (LINUX_LFS) -ADD_DEFINITIONS (${HDF5_EXTRA_FLAGS}) +# ---------------------------------------------------------------------- +# Check if they would like the function stack support compiled in +# +OPTION (HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF) +IF (HDF5_ENABLE_CODESTACK) + SET (H5_HAVE_CODESTACK 1) +ENDIF (HDF5_ENABLE_CODESTACK) +MARK_AS_ADVANCED (HDF5_ENABLE_CODESTACK) #IF (WIN32) # SET (DEFAULT_STREAM_VFD OFF) @@ -253,6 +250,28 @@ IF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) ENDIF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) #----------------------------------------------------------------------------- +# Check for large file support +#----------------------------------------------------------------------------- + +SET (LINUX_LFS 0) +SET (HDF5_EXTRA_FLAGS) +IF (CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.") + # Linux Specific flags + ADD_DEFINITIONS (-D_POSIX_SOURCE -D_BSD_SOURCE) + OPTION (HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) + IF (HDF5_ENABLE_LARGE_FILE) + SET (LARGEFILE 1) + SET (HDF5_EXTRA_FLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) + SET (CMAKE_REQUIRED_DEFINITIONS ${HDF5_EXTRA_FLAGS}) + ENDIF (HDF5_ENABLE_LARGE_FILE) +ENDIF (CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.") +IF (LINUX_LFS) + SET (HDF5_EXTRA_FLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) + SET (CMAKE_REQUIRED_DEFINITIONS ${HDF5_EXTRA_FLAGS}) +ENDIF (LINUX_LFS) +ADD_DEFINITIONS (${HDF5_EXTRA_FLAGS}) + +#----------------------------------------------------------------------------- # Check the size in bytes of all the int and float types #----------------------------------------------------------------------------- MACRO (H5_CHECK_TYPE_SIZE type var) @@ -531,6 +550,18 @@ ELSE (WINDOWS) ENDIF (WINDOWS) #----------------------------------------------------------------------------- +# Option to see if GPFS is available on this filesystem --enable-gpfs +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_GPFS "Enable GPFS hints for the MPI/POSIX file driver" OFF) +IF (HDF5_ENABLE_GPFS) + CHECK_INCLUDE_FILE_CONCAT ("gpfs.h" HAVE_GPFS) + IF (HAVE_GPFS) + HDF5_FUNCTION_TEST (HAVE_GPFS) + ENDIF (HAVE_GPFS) +ENDIF (HDF5_ENABLE_GPFS) +MARK_AS_ADVANCED (HDF5_ENABLE_GPFS) + +#----------------------------------------------------------------------------- # Look for 64 bit file stream capability #----------------------------------------------------------------------------- IF (HAVE_OFF64_T) diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index 8b30fbf..99fbea1 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -120,3 +120,39 @@ MACRO (H5_SET_LIB_OPTIONS libtarget libname libtype) ENDMACRO (H5_SET_LIB_OPTIONS) +#------------------------------------------------------------------------------- +MACRO (TARGET_WIN_PROPERTIES target) + IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (${target} + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) + ENDIF (WIN32) +ENDMACRO (TARGET_WIN_PROPERTIES) + +#------------------------------------------------------------------------------- +MACRO (TARGET_FORTRAN_WIN_PROPERTIES target) + IF (WIN32) + IF (BUILD_SHARED_LIBS) + IF (MSVC) + SET_TARGET_PROPERTIES (${target} + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ENDIF (MSVC) + ELSE (BUILD_SHARED_LIBS) + IF (MSVC) + SET_TARGET_PROPERTIES (${target} + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (MSVC) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (WIN32) +ENDMACRO (TARGET_FORTRAN_WIN_PROPERTIES) + diff --git a/config/cmake/HDF5Tests.c b/config/cmake/HDF5Tests.c index f909ed9..7fb5756 100644 --- a/config/cmake/HDF5Tests.c +++ b/config/cmake/HDF5Tests.c @@ -371,4 +371,15 @@ int main(int argc, char * argv) } #endif +#ifdef HAVE_GPFS + +#include <gpfs.h> +int main () +{ + int fd = 0; + gpfs_fcntl(fd, (void *)0); +} + +#endif /* HAVE_GPFS */ + diff --git a/config/cmake/grepTest.cmake b/config/cmake/grepTest.cmake new file mode 100644 index 0000000..cc3a9b4 --- /dev/null +++ b/config/cmake/grepTest.cmake @@ -0,0 +1,61 @@ +# runTest.cmake executes a command and captures the output in a file. File is then compared +# against a reference file. Exit status of command can also be compared. + +# arguments checking +IF (NOT TEST_PROGRAM) + MESSAGE (FATAL_ERROR "Require TEST_PROGRAM to be defined") +ENDIF (NOT TEST_PROGRAM) +#IF (NOT TEST_ARGS) +# MESSAGE (STATUS "Require TEST_ARGS to be defined") +#ENDIF (NOT TEST_ARGS) +IF (NOT TEST_FOLDER) + MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") +ENDIF (NOT TEST_FOLDER) +IF (NOT TEST_OUTPUT) + MESSAGE (FATAL_ERROR "Require TEST_OUTPUT to be defined") +ENDIF (NOT TEST_OUTPUT) +#IF (NOT TEST_EXPECT) +# MESSAGE (STATUS "Require TEST_EXPECT to be defined") +#ENDIF (NOT TEST_EXPECT) +IF (NOT TEST_FILTER) + MESSAGE (STATUS "Require TEST_FILTER to be defined") +ENDIF (NOT TEST_FILTER) +IF (NOT TEST_REFERENCE) + MESSAGE (FATAL_ERROR "Require TEST_REFERENCE to be defined") +ENDIF (NOT TEST_REFERENCE) + +MESSAGE (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") + +# 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} + ERROR_FILE ${TEST_OUTPUT}.err + OUTPUT_VARIABLE TEST_ERROR + ERROR_VARIABLE TEST_ERROR +) + +MESSAGE (STATUS "COMMAND Result: ${TEST_RESULT}") +MESSAGE (STATUS "COMMAND Error: ${TEST_ERROR}") + +# now grep the output with the reference +FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + +STRING(REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) +IF (${TEST_EXPECT}) + STRING(LENGTH "${TEST_MATCH}" TEST_RESULT) + IF (NOT ${TEST_RESULT} STREQUAL "0") + MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_REFERENCE}") + ENDIF (NOT ${TEST_RESULT} STREQUAL "0") +ELSE (${TEST_EXPECT}) + STRING(COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) + IF (${TEST_RESULT} STREQUAL "0") + MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") + ENDIF (${TEST_RESULT} STREQUAL "0") +ENDIF (${TEST_EXPECT}) + +# everything went fine... +MESSAGE ("Passed: The output of ${TEST_PROGRAM} matched") + |