diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2012-06-04 17:05:02 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2012-06-04 17:05:02 (GMT) |
commit | 7b1ea8aa2a75ef8e28c60e79fcba42b44c4e584a (patch) | |
tree | 96446a5912f352d549c2324e4b5735d3ddee663d /config | |
parent | 64fc9df55b7ae09b18ac159590cb2325d003be34 (diff) | |
download | hdf5-7b1ea8aa2a75ef8e28c60e79fcba42b44c4e584a.zip hdf5-7b1ea8aa2a75ef8e28c60e79fcba42b44c4e584a.tar.gz hdf5-7b1ea8aa2a75ef8e28c60e79fcba42b44c4e584a.tar.bz2 |
[svn-r22430] CMake and configure synchronization effort. CMake added most tests and options: DEBUGPKG not addressed.
Still needed: compiler wrapper scripts
Tested: local linux(cmake) and h5committest
Diffstat (limited to 'config')
-rw-r--r-- | config/cmake/ConfigureChecks.cmake | 546 | ||||
-rw-r--r-- | config/cmake/HDF5CXXTests.cpp | 56 | ||||
-rw-r--r-- | config/cmake/HDF5Tests.c | 133 | ||||
-rw-r--r-- | config/cmake/HDF5UseFortran.cmake | 5 | ||||
-rwxr-xr-x | config/cmake/cacheinit.cmake | 8 | ||||
-rwxr-xr-x | config/cmake/mccacheinit.cmake | 18 |
6 files changed, 550 insertions, 216 deletions
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 0a078b6..274434b 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -11,6 +11,7 @@ INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) INCLUDE (${CMAKE_ROOT}/Modules/CheckVariableExists.cmake) INCLUDE (${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) INCLUDE (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) +INCLUDE (${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake) #----------------------------------------------------------------------------- # Always SET this for now IF we are on an OS X box @@ -37,18 +38,6 @@ ENDIF (HDF5_Enable_Clear_File_Buffers) MARK_AS_ADVANCED (HDF5_Enable_Clear_File_Buffers) #----------------------------------------------------------------------------- -# Option for --enable-instrument -#----------------------------------------------------------------------------- -IF (CMAKE_BUILD_TYPE MATCHES Debug) - SET (HDF5_Enable_Instrument ON) -ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) -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 #----------------------------------------------------------------------------- OPTION (HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF) @@ -153,6 +142,8 @@ ENDIF (WIN32) # Should the Default Virtual File Driver be compiled? # This is hard-coded now but option should added to match configure # +SET (H5_DEFAULT_VFD H5FD_SEC2) + IF (WINDOWS) SET (H5_HAVE_WINDOWS 1) # ---------------------------------------------------------------------- @@ -162,7 +153,6 @@ IF (WINDOWS) SET (H5_HAVE_WINDOW_PATH 1) SET (LINK_LIBS ${LINK_LIBS} "kernel32") ENDIF (WINDOWS) -SET (H5_DEFAULT_VFD H5FD_SEC2) IF (WINDOWS) SET (H5_HAVE_IO_H 1) @@ -210,7 +200,7 @@ ENDIF (CYGWIN) # Check for the math library "m" #----------------------------------------------------------------------------- IF (NOT WINDOWS) - CHECK_LIBRARY_EXISTS_CONCAT ("m" random H5_HAVE_LIBM) + CHECK_LIBRARY_EXISTS_CONCAT ("m" ceil H5_HAVE_LIBM) ENDIF (NOT WINDOWS) CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup H5_HAVE_LIBWS2_32) @@ -231,6 +221,123 @@ ENDIF (WINDOWS) TEST_BIG_ENDIAN(H5_WORDS_BIGENDIAN) +# For other specific tests, use this MACRO. +MACRO (HDF5_FUNCTION_TEST OTHER_TEST) + IF ("H5_${OTHER_TEST}" MATCHES "^H5_${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}") + ENDIF (CMAKE_REQUIRED_LIBRARIES) + + FOREACH (def ${HDF5_EXTRA_TEST_DEFINITIONS}) + SET (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}=${${def}}") + ENDFOREACH (def) + + FOREACH (def + HAVE_SYS_TIME_H + HAVE_UNISTD_H + HAVE_SYS_TYPES_H + HAVE_SYS_SOCKET_H + ) + IF ("${H5_${def}}") + SET (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") + ENDIF ("${H5_${def}}") + ENDFOREACH (def) + + IF (LARGEFILE) + SET (MACRO_CHECK_FUNCTION_DEFINITIONS + "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" + ) + ENDIF (LARGEFILE) + + #MESSAGE (STATUS "Performing ${OTHER_TEST}") + TRY_COMPILE (${OTHER_TEST} + ${CMAKE_BINARY_DIR} + ${HDF5_RESOURCES_DIR}/HDF5Tests.c + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} + "${OTHER_TEST_ADD_LIBRARIES}" + OUTPUT_VARIABLE OUTPUT + ) + IF (${OTHER_TEST}) + SET (H5_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}") + MESSAGE (STATUS "Performing Other Test ${OTHER_TEST} - Success") + ELSE (${OTHER_TEST}) + MESSAGE (STATUS "Performing Other Test ${OTHER_TEST} - Failed") + SET (H5_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}") + FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Performing Other Test ${OTHER_TEST} failed with the following output:\n" + "${OUTPUT}\n" + ) + ENDIF (${OTHER_TEST}) + ENDIF ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") +ENDMACRO (HDF5_FUNCTION_TEST) + +#----------------------------------------------------------------------------- +# Check for these functions before the time headers are checked +#----------------------------------------------------------------------------- +IF (NOT WINDOWS) + HDF5_FUNCTION_TEST (STDC_HEADERS) +ENDIF (NOT WINDOWS) + +CHECK_FUNCTION_EXISTS (difftime H5_HAVE_DIFFTIME) +#CHECK_FUNCTION_EXISTS (gettimeofday H5_HAVE_GETTIMEOFDAY) +# Since gettimeofday is not defined any where standard, lets look in all the +# usual places. On MSVC we are just going to use ::clock() +IF (NOT MSVC) + IF ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") + TRY_COMPILE (HAVE_TIME_GETTIMEOFDAY + ${CMAKE_BINARY_DIR} + ${HDF5_RESOURCES_DIR}/GetTimeOfDayTest.cpp + COMPILE_DEFINITIONS -DTRY_TIME_H + OUTPUT_VARIABLE OUTPUT + ) + IF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") + SET (H5_HAVE_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_TIME_GETTIMEOFDAY") + SET (H5_HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_GETTIMEOFDAY") + ENDIF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") + ENDIF ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") + + IF ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") + TRY_COMPILE (HAVE_SYS_TIME_GETTIMEOFDAY + ${CMAKE_BINARY_DIR} + ${HDF5_RESOURCES_DIR}/GetTimeOfDayTest.cpp + COMPILE_DEFINITIONS -DTRY_SYS_TIME_H + OUTPUT_VARIABLE OUTPUT + ) + IF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") + SET (H5_HAVE_SYS_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_SYS_TIME_GETTIMEOFDAY") + SET (H5_HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_GETTIMEOFDAY") + ENDIF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") + ENDIF ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") + + IF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY) + MESSAGE (STATUS "---------------------------------------------------------------") + MESSAGE (STATUS "Function 'gettimeofday()' was not found. HDF5 will use its") + MESSAGE (STATUS " own implementation.. This can happen on older versions of") + MESSAGE (STATUS " MinGW on Windows. Consider upgrading your MinGW installation") + MESSAGE (STATUS " to a newer version such as MinGW 3.12") + MESSAGE (STATUS "---------------------------------------------------------------") + ENDIF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY) +ENDIF (NOT MSVC) + +# Find the library containing clock_gettime() +IF (NOT WINDOWS) + CHECK_FUNCTION_EXISTS(clock_gettime CLOCK_GETTIME_IN_LIBC) + CHECK_LIBRARY_EXISTS(rt clock_gettime "" CLOCK_GETTIME_IN_LIBRT) + CHECK_LIBRARY_EXISTS(posix4 clock_gettime "" CLOCK_GETTIME_IN_LIBPOSIX4) + IF(CLOCK_GETTIME_IN_LIBC) + SET(H5_HAVE_CLOCK_GETTIME 1) + ELSEIF(CLOCK_GETTIME_IN_LIBRT) + SET(H5_HAVE_CLOCK_GETTIME 1) + LIST(APPEND LINK_LIBS rt) + ELSEIF(CLOCK_GETTIME_IN_LIBPOSIX4) + SET(H5_HAVE_CLOCK_GETTIME 1) + LIST(APPEND LINK_LIBS posix4) + ENDIF(CLOCK_GETTIME_IN_LIBC) +ENDIF (NOT WINDOWS) +#----------------------------------------------------------------------------- + #----------------------------------------------------------------------------- # Check IF header file exists and add it to the list. #----------------------------------------------------------------------------- @@ -244,43 +351,17 @@ ENDMACRO (CHECK_INCLUDE_FILE_CONCAT) #----------------------------------------------------------------------------- # Check for the existence of certain header files #----------------------------------------------------------------------------- -CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" H5_HAVE_GLOBUS_COMMON_H) -CHECK_INCLUDE_FILE_CONCAT ("io.h" H5_HAVE_IO_H) -CHECK_INCLUDE_FILE_CONCAT ("mfhdf.h" H5_HAVE_MFHDF_H) -CHECK_INCLUDE_FILE_CONCAT ("pdb.h" H5_HAVE_PDB_H) -CHECK_INCLUDE_FILE_CONCAT ("pthread.h" H5_HAVE_PTHREAD_H) -CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" H5_HAVE_SETJMP_H) -CHECK_INCLUDE_FILE_CONCAT ("srbclient.h" H5_HAVE_SRBCLIENT_H) -CHECK_INCLUDE_FILE_CONCAT ("stddef.h" H5_HAVE_STDDEF_H) -CHECK_INCLUDE_FILE_CONCAT ("stdint.h" H5_HAVE_STDINT_H) -CHECK_INCLUDE_FILE_CONCAT ("string.h" H5_HAVE_STRING_H) -CHECK_INCLUDE_FILE_CONCAT ("strings.h" H5_HAVE_STRINGS_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/ioctl.h" H5_HAVE_SYS_IOCTL_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" H5_HAVE_SYS_PROC_H) CHECK_INCLUDE_FILE_CONCAT ("sys/resource.h" H5_HAVE_SYS_RESOURCE_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/socket.h" H5_HAVE_SYS_SOCKET_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/stat.h" H5_HAVE_SYS_STAT_H) -IF (CMAKE_SYSTEM_NAME MATCHES "OSF") - CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" H5_HAVE_SYS_SYSINFO_H) -ELSE (CMAKE_SYSTEM_NAME MATCHES "OSF") - SET (H5_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE) -ENDIF (CMAKE_SYSTEM_NAME MATCHES "OSF") CHECK_INCLUDE_FILE_CONCAT ("sys/time.h" H5_HAVE_SYS_TIME_H) -CHECK_INCLUDE_FILE_CONCAT ("time.h" H5_HAVE_TIME_H) -CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" H5_HAVE_MACH_MACH_TIME_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" H5_HAVE_SYS_TIMEB_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" H5_HAVE_SYS_TYPES_H) CHECK_INCLUDE_FILE_CONCAT ("unistd.h" H5_HAVE_UNISTD_H) -CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" H5_HAVE_STDLIB_H) -CHECK_INCLUDE_FILE_CONCAT ("memory.h" H5_HAVE_MEMORY_H) -CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" H5_HAVE_DLFCN_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/ioctl.h" H5_HAVE_SYS_IOCTL_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/stat.h" H5_HAVE_SYS_STAT_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/socket.h" H5_HAVE_SYS_SOCKET_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" H5_HAVE_SYS_TYPES_H) +CHECK_INCLUDE_FILE_CONCAT ("stddef.h" H5_HAVE_STDDEF_H) +CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" H5_HAVE_SETJMP_H) CHECK_INCLUDE_FILE_CONCAT ("features.h" H5_HAVE_FEATURES_H) -CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" H5_HAVE_INTTYPES_H) -CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" H5_HAVE_NETINET_IN_H) - -IF (NOT CYGWIN) - CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" H5_HAVE_WINSOCK_H) -ENDIF (NOT CYGWIN) +CHECK_INCLUDE_FILE_CONCAT ("stdint.h" H5_HAVE_STDINT_H) # IF the c compiler found stdint, check the C++ as well. On some systems this # file will be found by C but not C++, only do this test IF the C++ compiler @@ -293,6 +374,37 @@ IF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) ENDIF (NOT H5_HAVE_STDINT_H_CXX) ENDIF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) +# Darwin +CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" H5_HAVE_MACH_MACH_TIME_H) + +# Windows +CHECK_INCLUDE_FILE_CONCAT ("io.h" H5_HAVE_IO_H) +IF (NOT CYGWIN) + CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" H5_HAVE_WINSOCK_H) +ENDIF (NOT CYGWIN) +CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" H5_HAVE_SYS_TIMEB_H) + +IF (CMAKE_SYSTEM_NAME MATCHES "OSF") + CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" H5_HAVE_SYS_SYSINFO_H) + CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" H5_HAVE_SYS_PROC_H) +ELSE (CMAKE_SYSTEM_NAME MATCHES "OSF") + SET (H5_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE) + SET (H5_HAVE_SYS_PROC_H "" CACHE INTERNAL "" FORCE) +ENDIF (CMAKE_SYSTEM_NAME MATCHES "OSF") + +CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" H5_HAVE_GLOBUS_COMMON_H) +CHECK_INCLUDE_FILE_CONCAT ("pdb.h" H5_HAVE_PDB_H) +CHECK_INCLUDE_FILE_CONCAT ("pthread.h" H5_HAVE_PTHREAD_H) +CHECK_INCLUDE_FILE_CONCAT ("srbclient.h" H5_HAVE_SRBCLIENT_H) +CHECK_INCLUDE_FILE_CONCAT ("string.h" H5_HAVE_STRING_H) +CHECK_INCLUDE_FILE_CONCAT ("strings.h" H5_HAVE_STRINGS_H) +CHECK_INCLUDE_FILE_CONCAT ("time.h" H5_HAVE_TIME_H) +CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" H5_HAVE_STDLIB_H) +CHECK_INCLUDE_FILE_CONCAT ("memory.h" H5_HAVE_MEMORY_H) +CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" H5_HAVE_DLFCN_H) +CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" H5_HAVE_INTTYPES_H) +CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" H5_HAVE_NETINET_IN_H) + #----------------------------------------------------------------------------- # Check for large file support #----------------------------------------------------------------------------- @@ -303,7 +415,7 @@ SET (LINUX_LFS 0) SET (HDF5_EXTRA_FLAGS) IF (NOT WINDOWS) # Linux Specific flags - SET (HDF5_EXTRA_FLAGS -D_POSIX_SOURCE -D_BSD_SOURCE) + SET (HDF5_EXTRA_FLAGS -D_POSIX_SOURCE=199506L -D_BSD_SOURCE) OPTION (HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) IF (HDF5_ENABLE_LARGE_FILE) SET (msg "Performing TEST_LFS_WORKS") @@ -340,6 +452,28 @@ ENDIF (NOT WINDOWS) ADD_DEFINITIONS (${HDF5_EXTRA_FLAGS}) #----------------------------------------------------------------------------- +# Check for HAVE_OFF64_T functionality +#----------------------------------------------------------------------------- +IF (NOT WINDOWS) + HDF5_FUNCTION_TEST (HAVE_OFF64_T) + IF (H5_HAVE_OFF64_T) + CHECK_FUNCTION_EXISTS (lseek64 H5_HAVE_LSEEK64) + CHECK_FUNCTION_EXISTS (fseeko64 H5_HAVE_FSEEKO64) + CHECK_FUNCTION_EXISTS (ftello64 H5_HAVE_FTELLO64) + CHECK_FUNCTION_EXISTS (ftruncate64 H5_HAVE_FTRUNCATE64) + ENDIF (H5_HAVE_OFF64_T) + + CHECK_FUNCTION_EXISTS (fseeko H5_HAVE_FSEEKO) + CHECK_FUNCTION_EXISTS (ftello H5_HAVE_FTELLO) + + HDF5_FUNCTION_TEST (HAVE_STAT64_STRUCT) + IF (HAVE_STAT64_STRUCT) + CHECK_FUNCTION_EXISTS (fstat64 H5_HAVE_FSTAT64) + CHECK_FUNCTION_EXISTS (stat64 H5_HAVE_STAT64) + ENDIF (HAVE_STAT64_STRUCT) +ENDIF (NOT WINDOWS) + +#----------------------------------------------------------------------------- # Check the size in bytes of all the int and float types #----------------------------------------------------------------------------- MACRO (H5_CHECK_TYPE_SIZE type var) @@ -353,7 +487,6 @@ MACRO (H5_CHECK_TYPE_SIZE type var) ENDIF (NOT ${aVar}) ENDMACRO (H5_CHECK_TYPE_SIZE) - H5_CHECK_TYPE_SIZE (char H5_SIZEOF_CHAR) H5_CHECK_TYPE_SIZE (short H5_SIZEOF_SHORT) H5_CHECK_TYPE_SIZE (int H5_SIZEOF_INT) @@ -370,66 +503,115 @@ ENDIF (NOT H5_SIZEOF___INT64) H5_CHECK_TYPE_SIZE (float H5_SIZEOF_FLOAT) H5_CHECK_TYPE_SIZE (double H5_SIZEOF_DOUBLE) H5_CHECK_TYPE_SIZE ("long double" H5_SIZEOF_LONG_DOUBLE) + H5_CHECK_TYPE_SIZE (int8_t H5_SIZEOF_INT8_T) H5_CHECK_TYPE_SIZE (uint8_t H5_SIZEOF_UINT8_T) H5_CHECK_TYPE_SIZE (int_least8_t H5_SIZEOF_INT_LEAST8_T) H5_CHECK_TYPE_SIZE (uint_least8_t H5_SIZEOF_UINT_LEAST8_T) H5_CHECK_TYPE_SIZE (int_fast8_t H5_SIZEOF_INT_FAST8_T) H5_CHECK_TYPE_SIZE (uint_fast8_t H5_SIZEOF_UINT_FAST8_T) + H5_CHECK_TYPE_SIZE (int16_t H5_SIZEOF_INT16_T) H5_CHECK_TYPE_SIZE (uint16_t H5_SIZEOF_UINT16_T) H5_CHECK_TYPE_SIZE (int_least16_t H5_SIZEOF_INT_LEAST16_T) H5_CHECK_TYPE_SIZE (uint_least16_t H5_SIZEOF_UINT_LEAST16_T) H5_CHECK_TYPE_SIZE (int_fast16_t H5_SIZEOF_INT_FAST16_T) H5_CHECK_TYPE_SIZE (uint_fast16_t H5_SIZEOF_UINT_FAST16_T) + H5_CHECK_TYPE_SIZE (int32_t H5_SIZEOF_INT32_T) H5_CHECK_TYPE_SIZE (uint32_t H5_SIZEOF_UINT32_T) H5_CHECK_TYPE_SIZE (int_least32_t H5_SIZEOF_INT_LEAST32_T) H5_CHECK_TYPE_SIZE (uint_least32_t H5_SIZEOF_UINT_LEAST32_T) H5_CHECK_TYPE_SIZE (int_fast32_t H5_SIZEOF_INT_FAST32_T) H5_CHECK_TYPE_SIZE (uint_fast32_t H5_SIZEOF_UINT_FAST32_T) + H5_CHECK_TYPE_SIZE (int64_t H5_SIZEOF_INT64_T) H5_CHECK_TYPE_SIZE (uint64_t H5_SIZEOF_UINT64_T) H5_CHECK_TYPE_SIZE (int_least64_t H5_SIZEOF_INT_LEAST64_T) H5_CHECK_TYPE_SIZE (uint_least64_t H5_SIZEOF_UINT_LEAST64_T) H5_CHECK_TYPE_SIZE (int_fast64_t H5_SIZEOF_INT_FAST64_T) H5_CHECK_TYPE_SIZE (uint_fast64_t H5_SIZEOF_UINT_FAST64_T) + IF (NOT APPLE) H5_CHECK_TYPE_SIZE (size_t H5_SIZEOF_SIZE_T) H5_CHECK_TYPE_SIZE (ssize_t H5_SIZEOF_SSIZE_T) IF (NOT H5_SIZEOF_SSIZE_T) SET (H5_SIZEOF_SSIZE_T 0) ENDIF (NOT H5_SIZEOF_SSIZE_T) + H5_CHECK_TYPE_SIZE (ptrdiff_t H5_SIZEOF_PTRDIFF_T) ENDIF (NOT APPLE) + H5_CHECK_TYPE_SIZE (off_t H5_SIZEOF_OFF_T) H5_CHECK_TYPE_SIZE (off64_t H5_SIZEOF_OFF64_T) IF (NOT H5_SIZEOF_OFF64_T) SET (H5_SIZEOF_OFF64_T 0) ENDIF (NOT H5_SIZEOF_OFF64_T) -# Find the library containing clock_gettime() +# For other tests to use the same libraries +SET (CMAKE_REQUIRED_LIBRARIES ${LINK_LIBS}) + +#----------------------------------------------------------------------------- +# Check if the dev_t type is a scalar type +#----------------------------------------------------------------------------- IF (NOT WINDOWS) - CHECK_FUNCTION_EXISTS(clock_gettime CLOCK_GETTIME_IN_LIBC) - CHECK_LIBRARY_EXISTS(rt clock_gettime "" CLOCK_GETTIME_IN_LIBRT) - CHECK_LIBRARY_EXISTS(posix4 clock_gettime "" CLOCK_GETTIME_IN_LIBPOSIX4) - IF(CLOCK_GETTIME_IN_LIBC) - SET(H5_HAVE_CLOCK_GETTIME 1) - ELSEIF(CLOCK_GETTIME_IN_LIBRT) - SET(H5_HAVE_CLOCK_GETTIME 1) - LIST(APPEND LINK_LIBS rt) - ELSEIF(CLOCK_GETTIME_IN_LIBPOSIX4) - SET(H5_HAVE_CLOCK_GETTIME 1) - LIST(APPEND LINK_LIBS posix4) - ENDIF(CLOCK_GETTIME_IN_LIBC) + HDF5_FUNCTION_TEST (DEV_T_IS_SCALAR) ENDIF (NOT WINDOWS) -# For other tests to use the same libraries -SET (CMAKE_REQUIRED_LIBRARIES ${LINK_LIBS}) +# ---------------------------------------------------------------------- +# Check for MONOTONIC_TIMER support (used in clock_gettime). This has +# to be done after any POSIX/BSD defines to ensure that the test gets +# the correct POSIX level on linux. +CHECK_VARIABLE_EXISTS (CLOCK_MONOTONIC HAVE_CLOCK_MONOTONIC) + +#----------------------------------------------------------------------------- +# Check a bunch of time functions +#----------------------------------------------------------------------------- +IF (NOT WINDOWS) + FOREACH (test + HAVE_TM_GMTOFF + HAVE___TM_GMTOFF +# HAVE_TIMEZONE + HAVE_STRUCT_TIMEZONE + GETTIMEOFDAY_GIVES_TZ + TIME_WITH_SYS_TIME + HAVE_TM_ZONE + HAVE_STRUCT_TM_TM_ZONE + ) + HDF5_FUNCTION_TEST (${test}) + ENDFOREACH (test) + IF (NOT CYGWIN AND NOT MINGW) + HDF5_FUNCTION_TEST (HAVE_TIMEZONE) +# HDF5_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) + ENDIF (NOT CYGWIN AND NOT MINGW) +ENDIF (NOT WINDOWS) + +# ---------------------------------------------------------------------- +# Does the struct stat have the st_blocks field? This field is not Posix. +# +IF (NOT WINDOWS) + HDF5_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) +ENDIF (NOT WINDOWS) + +# ---------------------------------------------------------------------- +# How do we figure out the width of a tty in characters? +# +CHECK_FUNCTION_EXISTS (_getvideoconfig H5_HAVE__GETVIDEOCONFIG) +CHECK_FUNCTION_EXISTS (gettextinfo H5_HAVE_GETTEXTINFO) +CHECK_FUNCTION_EXISTS (_scrsize H5_HAVE__SCRSIZE) +CHECK_FUNCTION_EXISTS (ioctl H5_HAVE_IOCTL) +HDF5_FUNCTION_TEST (HAVE_STRUCT_VIDEOCONFIG) +HDF5_FUNCTION_TEST (HAVE_STRUCT_TEXT_INFO) +IF (NOT WINDOWS) + CHECK_FUNCTION_EXISTS (GetConsoleScreenBufferInfo H5_HAVE_GETCONSOLESCREENBUFFERINFO) + CHECK_SYMBOL_EXISTS (TIOCGWINSZ "sys/ioctl.h" H5_HAVE_TIOCGWINSZ) + CHECK_SYMBOL_EXISTS (TIOCGETD "sys/ioctl.h" H5_HAVE_TIOCGETD) +ENDIF (NOT WINDOWS) #----------------------------------------------------------------------------- # Check for some functions that are used # CHECK_FUNCTION_EXISTS (alarm H5_HAVE_ALARM) +#CHECK_FUNCTION_EXISTS (BSDgettimeofday H5_HAVE_BSDGETTIMEOFDAY) CHECK_FUNCTION_EXISTS (fork H5_HAVE_FORK) CHECK_FUNCTION_EXISTS (frexpf H5_HAVE_FREXPF) CHECK_FUNCTION_EXISTS (frexpl H5_HAVE_FREXPL) @@ -462,18 +644,13 @@ CHECK_FUNCTION_EXISTS (vasprintf H5_HAVE_VASPRINTF) CHECK_FUNCTION_EXISTS (waitpid H5_HAVE_WAITPID) CHECK_FUNCTION_EXISTS (vsnprintf H5_HAVE_VSNPRINTF) -CHECK_FUNCTION_EXISTS (ioctl H5_HAVE_IOCTL) -#CHECK_FUNCTION_EXISTS (gettimeofday H5_HAVE_GETTIMEOFDAY) -CHECK_FUNCTION_EXISTS (difftime H5_HAVE_DIFFTIME) -CHECK_FUNCTION_EXISTS (fseeko H5_HAVE_FSEEKO) -CHECK_FUNCTION_EXISTS (ftello H5_HAVE_FTELLO) -CHECK_FUNCTION_EXISTS (fseeko64 H5_HAVE_FSEEKO64) -CHECK_FUNCTION_EXISTS (ftello64 H5_HAVE_FTELLO64) -CHECK_FUNCTION_EXISTS (fstat64 H5_HAVE_FSTAT64) -CHECK_FUNCTION_EXISTS (stat64 H5_HAVE_STAT64) +IF (H5_HAVE_VSNPRINTF) + HDF5_FUNCTION_TEST (VSNPRINTF_WORKS) +ENDIF (H5_HAVE_VSNPRINTF) #----------------------------------------------------------------------------- # sigsetjmp is special; may actually be a macro +#----------------------------------------------------------------------------- IF (NOT H5_HAVE_SIGSETJMP) IF (H5_HAVE_SETJMP_H) CHECK_SYMBOL_EXISTS (sigsetjmp "setjmp.h" H5_HAVE_MACRO_SIGSETJMP) @@ -484,71 +661,30 @@ IF (NOT H5_HAVE_SIGSETJMP) ENDIF (NOT H5_HAVE_SIGSETJMP) #----------------------------------------------------------------------------- -# Since gettimeofday is not defined any where standard, lets look in all the -# usual places. On MSVC we are just going to use ::clock() -#----------------------------------------------------------------------------- -IF (NOT MSVC) - IF ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") - TRY_COMPILE (HAVE_TIME_GETTIMEOFDAY - ${CMAKE_BINARY_DIR} - ${HDF5_RESOURCES_DIR}/GetTimeOfDayTest.cpp - COMPILE_DEFINITIONS -DTRY_TIME_H - OUTPUT_VARIABLE OUTPUT - ) - IF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") - SET (H5_HAVE_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_TIME_GETTIMEOFDAY") - SET (H5_HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_GETTIMEOFDAY") - ENDIF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") - ENDIF ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") - - IF ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") - TRY_COMPILE (HAVE_SYS_TIME_GETTIMEOFDAY - ${CMAKE_BINARY_DIR} - ${HDF5_RESOURCES_DIR}/GetTimeOfDayTest.cpp - COMPILE_DEFINITIONS -DTRY_SYS_TIME_H - OUTPUT_VARIABLE OUTPUT - ) - IF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") - SET (H5_HAVE_SYS_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_SYS_TIME_GETTIMEOFDAY") - SET (H5_HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_GETTIMEOFDAY") - ENDIF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") - ENDIF ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") - - IF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY) - MESSAGE (STATUS "---------------------------------------------------------------") - MESSAGE (STATUS "Function 'gettimeofday()' was not found. HDF5 will use its") - MESSAGE (STATUS " own implementation.. This can happen on older versions of") - MESSAGE (STATUS " MinGW on Windows. Consider upgrading your MinGW installation") - MESSAGE (STATUS " to a newer version such as MinGW 3.12") - MESSAGE (STATUS "---------------------------------------------------------------") - ENDIF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY) -ENDIF (NOT MSVC) - # Check for Symbols CHECK_SYMBOL_EXISTS (tzname "time.h" H5_HAVE_DECL_TZNAME) #----------------------------------------------------------------------------- -# +# Check a bunch of other functions #----------------------------------------------------------------------------- IF (NOT WINDOWS) - CHECK_SYMBOL_EXISTS (TIOCGWINSZ "sys/ioctl.h" H5_HAVE_TIOCGWINSZ) - CHECK_SYMBOL_EXISTS (TIOCGETD "sys/ioctl.h" H5_HAVE_TIOCGETD) + FOREACH (test + LONE_COLON + HAVE_ATTRIBUTE + HAVE_C99_FUNC + HAVE_FUNCTION + HAVE_C99_DESIGNATED_INITIALIZER + SYSTEM_SCOPE_THREADS + HAVE_SOCKLEN_T + CXX_HAVE_OFFSETOF + ) + HDF5_FUNCTION_TEST (${test}) + ENDFOREACH (test) ENDIF (NOT WINDOWS) -#----------------------------------------------------------------------------- -# Check for the Stream VFD driver -#----------------------------------------------------------------------------- -IF (HDF5_STREAM_VFD) - CHECK_INCLUDE_FILE_CONCAT ("netdb.h" H5_HAVE_NETDB_H) - CHECK_INCLUDE_FILE_CONCAT ("netinet/tcp.h" H5_HAVE_NETINET_TCP_H) - CHECK_INCLUDE_FILE_CONCAT ("sys/filio.h" H5_HAVE_SYS_FILIO_H) - SET (H5_HAVE_STREAM 1) -ENDIF (HDF5_STREAM_VFD) - - -# For other other specific tests, use this MACRO. -MACRO (HDF5_FUNCTION_TEST OTHER_TEST) - IF ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") +# For other CXX specific tests, use this MACRO. +MACRO (HDF5_CXX_FUNCTION_TEST OTHER_TEST) + IF ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") SET (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") SET (OTHER_TEST_ADD_LIBRARIES) IF (CMAKE_REQUIRED_LIBRARIES) @@ -579,61 +715,87 @@ MACRO (HDF5_FUNCTION_TEST OTHER_TEST) #MESSAGE (STATUS "Performing ${OTHER_TEST}") TRY_COMPILE (${OTHER_TEST} ${CMAKE_BINARY_DIR} - ${HDF5_RESOURCES_DIR}/HDF5Tests.c + ${HDF5_RESOURCES_DIR}/HDF5CXXTests.cpp CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} "${OTHER_TEST_ADD_LIBRARIES}" OUTPUT_VARIABLE OUTPUT ) - IF (${OTHER_TEST}) - SET (H5_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}") - MESSAGE (STATUS "Performing Other Test ${OTHER_TEST} - Success") - ELSE (${OTHER_TEST}) - MESSAGE (STATUS "Performing Other Test ${OTHER_TEST} - Failed") - SET (H5_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}") + IF ("${OTHER_TEST}" EQUAL 0) + SET (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}") + MESSAGE (STATUS "Performing CXX Test ${OTHER_TEST} - Success") + ELSE ("${OTHER_TEST}" EQUAL 0) + MESSAGE (STATUS "Performing CXX Test ${OTHER_TEST} - Failed") + SET (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log - "Performing Other Test ${OTHER_TEST} failed with the following output:\n" + "Performing CXX Test ${OTHER_TEST} failed with the following output:\n" "${OUTPUT}\n" ) - ENDIF (${OTHER_TEST}) - ENDIF ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") -ENDMACRO (HDF5_FUNCTION_TEST) + ENDIF ("${OTHER_TEST}" EQUAL 0) + ENDIF ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") +ENDMACRO (HDF5_CXX_FUNCTION_TEST) #----------------------------------------------------------------------------- -# Check a bunch of other functions +# Check a bunch of cxx functions #----------------------------------------------------------------------------- -IF (NOT WINDOWS) +IF (CMAKE_CXX_COMPILER_LOADED) FOREACH (test - TIME_WITH_SYS_TIME - STDC_HEADERS - HAVE_TM_ZONE - HAVE_STRUCT_TM_TM_ZONE - HAVE_ATTRIBUTE - HAVE_FUNCTION - HAVE_TM_GMTOFF -# HAVE_TIMEZONE - HAVE_STRUCT_TIMEZONE - HAVE_STAT_ST_BLOCKS - HAVE_FUNCTION - SYSTEM_SCOPE_THREADS - HAVE_SOCKLEN_T - DEV_T_IS_SCALAR - HAVE_OFF64_T - GETTIMEOFDAY_GIVES_TZ - VSNPRINTF_WORKS - HAVE_C99_FUNC - HAVE_C99_DESIGNATED_INITIALIZER - CXX_HAVE_OFFSETOF - LONE_COLON + OLD_HEADER_FILENAME + H5_NO_NAMESPACE + H5_NO_STD + BOOL_NOTDEFINED + NO_STATIC_CAST ) - HDF5_FUNCTION_TEST (${test}) + HDF5_CXX_FUNCTION_TEST (${test}) ENDFOREACH (test) - IF (NOT CYGWIN AND NOT MINGW) - HDF5_FUNCTION_TEST (HAVE_TIMEZONE) -# HDF5_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) - ENDIF (NOT CYGWIN AND NOT MINGW) +ENDIF (CMAKE_CXX_COMPILER_LOADED) + +#----------------------------------------------------------------------------- +# Check if Direct I/O driver works +#----------------------------------------------------------------------------- +IF (NOT WINDOWS) + OPTION (HDF5_ENABLE_DIRECT_VFD "Build the Direct I/O Virtual File Driver" ON) + IF (HDF5_ENABLE_DIRECT_VFD) + SET (msg "Performing TEST_DIRECT_VFD_WORKS") + SET (MACRO_CHECK_FUNCTION_DEFINITIONS "-DTEST_DIRECT_VFD_WORKS -D_GNU_SOURCE ${CMAKE_REQUIRED_FLAGS}") + TRY_RUN (TEST_DIRECT_VFD_WORKS_RUN TEST_DIRECT_VFD_WORKS_COMPILE + ${HDF5_BINARY_DIR}/CMake + ${HDF5_RESOURCES_DIR}/HDF5Tests.c + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} + OUTPUT_VARIABLE OUTPUT + ) + IF (TEST_DIRECT_VFD_WORKS_COMPILE) + IF (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) + HDF5_FUNCTION_TEST (HAVE_DIRECT) + SET (CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE") + ADD_DEFINITIONS ("-D_GNU_SOURCE") + ELSE (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) + SET (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) + MESSAGE (STATUS "${msg}... no") + FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Test TEST_DIRECT_VFD_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" + ) + ENDIF (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) + ELSE (TEST_DIRECT_VFD_WORKS_COMPILE ) + SET (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) + MESSAGE (STATUS "${msg}... no") + FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Test TEST_DIRECT_VFD_WORKS Compile failed with the following output:\n ${OUTPUT}\n" + ) + ENDIF (TEST_DIRECT_VFD_WORKS_COMPILE) + ENDIF (HDF5_ENABLE_DIRECT_VFD) ENDIF (NOT WINDOWS) #----------------------------------------------------------------------------- +# Check for the Stream VFD driver +#----------------------------------------------------------------------------- +IF (HDF5_STREAM_VFD) + CHECK_INCLUDE_FILE_CONCAT ("netdb.h" H5_HAVE_NETDB_H) + CHECK_INCLUDE_FILE_CONCAT ("netinet/tcp.h" H5_HAVE_NETINET_TCP_H) + CHECK_INCLUDE_FILE_CONCAT ("sys/filio.h" H5_HAVE_SYS_FILIO_H) + SET (H5_HAVE_STREAM 1) +ENDIF (HDF5_STREAM_VFD) + +#----------------------------------------------------------------------------- # Check if InitOnceExecuteOnce is available #----------------------------------------------------------------------------- IF (WINDOWS) @@ -697,7 +859,6 @@ IF (WINDOWS) ENDIF("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") ENDIF (NOT HDF5_NO_IOEO_TEST) ENDIF (WINDOWS) - #----------------------------------------------------------------------------- # Option to see if GPFS is available on this filesystem --enable-gpfs @@ -712,13 +873,6 @@ ENDIF (HDF5_ENABLE_GPFS) MARK_AS_ADVANCED (HDF5_ENABLE_GPFS) #----------------------------------------------------------------------------- -# Look for 64 bit file stream capability -#----------------------------------------------------------------------------- -IF (HAVE_OFF64_T) - CHECK_FUNCTION_EXISTS (lseek64 H5_HAVE_LSEEK64) -ENDIF (HAVE_OFF64_T) - -#----------------------------------------------------------------------------- # Determine how 'inline' is used #----------------------------------------------------------------------------- SET (HDF5_EXTRA_TEST_DEFINITIONS INLINE_TEST_INLINE) @@ -949,6 +1103,31 @@ H5ConversionTests (H5_ULLONG_TO_LDOUBLE_PRECISION "Checking IF converting unsign # H5ConversionTests (H5_FP_TO_INTEGER_OVERFLOW_WORKS "Checking IF overflows normally converting floating-point to integer values") # ---------------------------------------------------------------------- +# Set the flag to indicate that the machine is using a special algorithm to convert +# 'long double' to '(unsigned) long' values. (This flag should only be set for +# the IBM Power6 Linux. When the bit sequence of long double is +# 0x4351ccf385ebc8a0bfcc2a3c3d855620, the converted value of (unsigned)long +# is 0x004733ce17af227f, not the same as the library's conversion to 0x004733ce17af2282. +# The machine's conversion gets the correct value. We define the macro and disable +# this kind of test until we figure out what algorithm they use. +# +IF (H5_LDOUBLE_TO_LONG_SPECIAL MATCHES ^H5_LDOUBLE_TO_LONG_SPECIAL$) + SET (H5_LDOUBLE_TO_LONG_SPECIAL 0 CACHE INTERNAL "Define if your system converts long double to (unsigned) long values with special algorithm") + MESSAGE (STATUS "Checking IF your system converts long double to (unsigned) long values with special algorithm... no") +ENDIF (H5_LDOUBLE_TO_LONG_SPECIAL MATCHES ^H5_LDOUBLE_TO_LONG_SPECIAL$) +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine is using a special algorithm +# to convert some values of '(unsigned) long' to 'long double' values. +# (This flag should be off for all machines, except for IBM Power6 Linux, +# when the bit sequences are 003fff..., 007fff..., 00ffff..., 01ffff..., +# ..., 7fffff..., the compiler uses a unknown algorithm. We define a +# macro and skip the test for now until we know about the algorithm. +# +IF (H5_LONG_TO_LDOUBLE_SPECIAL MATCHES ^H5_LONG_TO_LDOUBLE_SPECIAL$) + SET (H5_LONG_TO_LDOUBLE_SPECIAL 0 CACHE INTERNAL "Define if your system can convert (unsigned) long to long double values with special algorithm") + MESSAGE (STATUS "Checking IF your system can convert (unsigned) long to long double values with special algorithm... no") +ENDIF (H5_LONG_TO_LDOUBLE_SPECIAL MATCHES ^H5_LONG_TO_LDOUBLE_SPECIAL$) +# ---------------------------------------------------------------------- # Set the flag to indicate that the machine can accurately convert # 'long double' to '(unsigned) long long' values. (This flag should be set for # all machines, except for Mac OS 10.4 and SGI IRIX64 6.5. When the bit sequence @@ -966,6 +1145,19 @@ H5ConversionTests (H5_LDOUBLE_TO_LLONG_ACCURATE "Checking IF correctly convertin # as big as they should be. # H5ConversionTests (H5_LLONG_TO_LDOUBLE_CORRECT "Checking IF correctly converting (unsigned) long long to long double values") +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine generates bad code +# for the H5V_log2_gen() routine in src/H5Vprivate.h +# (This flag should be set to no for all machines, except for SGI IRIX64, +# where the cache value is set to yes in it's config file) +# +IF (H5_BAD_LOG2_CODE_GENERATED MATCHES ^H5_BAD_LOG2_CODE_GENERATED$) + SET (H5_BAD_LOG2_CODE_GENERATED 0 CACHE INTERNAL "Define if your system generates wrong code for log2 routine") + MESSAGE (STATUS "Checking IF your system generates wrong code for log2 routine... no") +ENDIF (H5_BAD_LOG2_CODE_GENERATED MATCHES ^H5_BAD_LOG2_CODE_GENERATED$) +# ---------------------------------------------------------------------- +# Check if pointer alignments are enforced +# H5ConversionTests (H5_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restrictions are strictly enforced") # Define a macro for Cygwin (on XP only) where the compiler has rounding diff --git a/config/cmake/HDF5CXXTests.cpp b/config/cmake/HDF5CXXTests.cpp new file mode 100644 index 0000000..7003cc8 --- /dev/null +++ b/config/cmake/HDF5CXXTests.cpp @@ -0,0 +1,56 @@ + +#ifdef OLD_HEADER_FILENAME + +#include <iostream> + +int main(void) { return 0; } + +#endif + + +#ifdef H5_NO_NAMESPACE + +namespace H5 { +int fnord; +} + +int main(void) { + using namespace H5; + fnord = 37; + return 0; +} + +#endif + +#ifdef H5_NO_STD + +#include <string> + +using namespace std; + +int main(void) { + string myString("testing namespace std"); + return 0; +} + +#endif + +#ifdef BOOL_NOTDEFINED +int main(void) { + bool flag; + return 0; +} + +#endif + +#ifdef NO_STATIC_CAST + +int main(void) { + float test_float; + int test_int; + test_float = 37.0; + test_int = static_cast <int> (test_float); + return 0; +} + +#endif diff --git a/config/cmake/HDF5Tests.c b/config/cmake/HDF5Tests.c index 9c21415..2f69ec8 100644 --- a/config/cmake/HDF5Tests.c +++ b/config/cmake/HDF5Tests.c @@ -1,38 +1,5 @@ #define SIMPLE_TEST(x) int main(){ x; return 0; } -#ifdef CXX_HAVE_OFFSETOF - #include <stdio.h> -#include <stddef.h> - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus -extern "C" -# endif -int FC_DUMMY_MAIN() -{ return 1;} -#endif -#endif -int -main () -{ - - struct index_st - { - unsigned char type; - unsigned char num; - unsigned int len; - }; - typedef struct index_st index_t; - int x,y; - x = offsetof(struct index_st, len); - y = offsetof(index_t, num) - - ; - return 0; -} -#endif - #ifdef HAVE_C99_DESIGNATED_INITIALIZER #ifdef FC_DUMMY_MAIN @@ -106,7 +73,7 @@ int test_vsnprintf(const char *fmt,...) int main(void) { - exit(test_vsnprintf("%s","A string that is longer than 16 characters")); + return(test_vsnprintf("%s","A string that is longer than 16 characters")); } #endif @@ -215,6 +182,16 @@ SIMPLE_TEST(struct tm tm; tm.tm_gmtoff=0); #endif /* HAVE_TM_GMTOFF */ +#ifdef HAVE___TM_GMTOFF + +#ifdef HAVE_SYS_TIME_H +#include <sys/time.h> +#endif +#include <time.h> +SIMPLE_TEST(struct tm tm; tm.__tm_gmtoff=0); + +#endif /* HAVE_TM_GMTOFF */ + #ifdef HAVE_TIMEZONE #ifdef HAVE_SYS_TIME_H @@ -269,10 +246,10 @@ int main(void) if (strcmp(s, "1099511627776") == 0) { printf("PRINTF_LL_WIDTH=[%s]\n", *currentArg); - exit(0); + return 0; } } - exit(1); + return 1; } #endif /* PRINTF_LL_WIDTH */ @@ -288,7 +265,9 @@ int main(void) pthread_attr_init(&attribute); ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM); - exit(ret==0 ? 0 : 1); + if (ret==0) + return 0; + return 1; } #endif /* SYSTEM_SCOPE_THREADS */ @@ -336,6 +315,35 @@ int main() } #endif +#ifdef HAVE_STAT64_STRUCT +#include <sys/types.h> +#include <sys/stat.h>], +struct stat64 sb; +int main() +{ + return 0; +} +#endif + +#ifdef TEST_DIRECT_VFD_WORKS +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +int main(void) +{ + int fid; + if((fid=open("tst_file", O_CREAT | O_TRUNC | O_DIRECT, 0755))<0) + return 1; + close(fid); + remove("tst_file"); + return 0; +} +#endif + +#ifdef HAVE_DIRECT + SIMPLE_TEST(posix_memalign()); +#endif + #ifdef TEST_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE @@ -382,8 +390,8 @@ int main(void) gettimeofday(&tv, &tz); /* Check whether the function returned any value at all */ if(tz.tz_minuteswest == 7777 && tz.tz_dsttime == 7) - exit(1); - else exit (0); + return 1; + else return 0; } #endif @@ -394,6 +402,41 @@ int main(int argc, char * argv) } #endif +#ifdef CXX_HAVE_OFFSETOF + +#include <stdio.h> +#include <stddef.h> + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus +extern "C" +# endif +int FC_DUMMY_MAIN() +{ return 1;} +#endif +#endif +int +main () +{ + + struct index_st + { + unsigned char type; + unsigned char num; + unsigned int len; + }; + typedef struct index_st index_t; + int x,y; + x = offsetof(struct index_st, len); + y = offsetof(index_t, num) + + ; + return 0; +} + +#endif + #ifdef HAVE_GPFS #include <gpfs.h> @@ -423,6 +466,18 @@ int main () #endif /* HAVE_IOEO */ +#ifdef HAVE_STRUCT_VIDEOCONFIG + +SIMPLE_TEST(struct videoconfig w; w.numtextcols=0); + +#endif /* HAVE_TM_GMTOFF */ + +#ifdef HAVE_STRUCT_TEXT_INFO + +SIMPLE_TEST(struct text_info w; w.screenwidth=0); + +#endif /* HAVE_TM_GMTOFF */ + #if defined( INLINE_TEST_inline ) || defined( INLINE_TEST___inline__ ) || defined( INLINE_TEST___inline ) #ifndef __cplusplus diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index c1c5acb..323c9ef 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -114,6 +114,11 @@ CHECK_FORTRAN_FEATURE(iso_c_binding " PROGRAM main USE iso_c_binding + IMPLICIT NONE + TYPE(C_PTR) :: ptr + TYPE(C_FUNPTR) :: funptr + CHARACTER(LEN=80, KIND=c_char), TARGET :: ichr + ptr = C_LOC(ichr(1:1)) END PROGRAM " FORTRAN_HAVE_ISO_C_BINDING diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 1ab3432..e7dd19f 100755 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -20,6 +20,8 @@ SET (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE) SET (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE)
+SET (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE)
+
SET (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE)
SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE)
@@ -28,12 +30,18 @@ SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE)
+SET (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE)
+
SET (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE)
+SET (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE)
+
SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE)
SET (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE)
+SET (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE)
+
SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE)
SET (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE)
diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index 10b2824..b472acf 100755 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -14,10 +14,14 @@ SET (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) SET (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE)
+SET (HDF5_ENABLE_F2003 OFF CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE)
+
SET (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE)
SET (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE)
+SET (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE)
+
SET (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE)
SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE)
@@ -26,22 +30,36 @@ SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE)
+SET (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE)
+
SET (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE)
+SET (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE)
+
SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE)
+SET (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE)
+
+SET (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE)
+
SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE)
SET (HDF5_ENABLE_USING_MEMCHECKER ON CACHE BOOL "Indicate that a memory checker is used" FORCE)
SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE)
+SET (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE)
+
SET (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE)
+SET (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE)
+
SET (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE)
SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE)
+SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE)
+
SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building" FORCE)
SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE)
|