diff options
-rw-r--r-- | CMakeLists.txt | 25 | ||||
-rw-r--r-- | MANIFEST | 2 | ||||
-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 | ||||
-rwxr-xr-x | configure | 22 | ||||
-rw-r--r-- | configure.in | 16 | ||||
-rw-r--r-- | perform/CMakeLists.txt | 48 | ||||
-rw-r--r-- | src/H5config.h.in | 4 |
12 files changed, 633 insertions, 250 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index fbb8e98..9ac6f37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -301,6 +301,15 @@ IF (HDF5_ENABLE_COVERAGE) ENDIF (HDF5_ENABLE_COVERAGE) #----------------------------------------------------------------------------- +# Option to indicate using dmalloc +#----------------------------------------------------------------------------- +# OPTION (HDF5_ENABLE_USING_DMALLOC "Indicate that dmalloc is used" OFF) +# IF (HDF5_ENABLE_USING_DMALLOC) +# FIND_PACKAGE (DMALLOC) +# SET (H5_HAVE_DMALLOC DMALLOC_FOUND) +# ENDIF (HDF5_ENABLE_USING_DMALLOC) + +#----------------------------------------------------------------------------- # Option to indicate using a memory checker #----------------------------------------------------------------------------- OPTION (HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF) @@ -359,10 +368,17 @@ IF (CMAKE_BUILD_TYPE MATCHES Debug) -DH5I_DEBUG -DH5HL_DEBUG -DH5HG_DEBUG -DH5G_DEBUG -DH5F_DEBUG -DH5E_DEBUG -DH5D_DEBUG -DH5B_DEBUG -DH5AC_DEBUG -UNDEBUG ) + # Enable tracing of the API OPTION (HDF5_ENABLE_TRACE "Enable API tracing capability" ON) IF (HDF5_ENABLE_TRACE) ADD_DEFINITIONS (-DH5_DEBUG_API ) ENDIF (HDF5_ENABLE_TRACE) + # Enable instrumenting of the library's internal operations + OPTION (HDF5_ENABLE_INSTRUMENT "Instrument The library" OFF) + IF (HDF5_ENABLE_INSTRUMENT) + SET (H5_HAVE_INSTRUMENTED_LIBRARY 1) + ENDIF (HDF5_ENABLE_INSTRUMENT) + MARK_AS_ADVANCED (HDF5_Enable_Instrument) #-- NMake Makefiles will overwhelm the console with warnings if -Wall is used. IF (NOT WIN32) ADD_DEFINITIONS (-Wall) @@ -407,7 +423,7 @@ ENDIF (HDF5_ENABLE_EMBEDDED_LIBINFO) OPTION (HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF) IF (HDF5_DISABLE_COMPILER_WARNINGS) # MSVC uses /w to suppress warnings. It also complains if another - # warning level is given, so remove it. + # warning level is given, so remove it.CMAKE_NO_STD_NAMESPACE IF (MSVC) SET (HDF5_WARNINGS_BLOCKED 1) STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") @@ -461,6 +477,7 @@ IF (HDF5_ENABLE_PARALLEL) # and once set, they are cached as false and not regenerated SET (CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}" ) CHECK_FUNCTION_EXISTS (MPI_File_get_size H5_HAVE_MPI_GET_SIZE) + SET (H5_MPI_FILE_SET_SIZE_BIG 1) # Used by Fortran + MPI CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) @@ -475,6 +492,7 @@ IF (H5_HAVE_PARALLEL) ENDIF (MPI_C_LINK_FLAGS) ENDIF (H5_HAVE_PARALLEL) +SET (DEFAULT_API_VERSION "v110") #----------------------------------------------------------------------------- # Option to use 1.6.x API #----------------------------------------------------------------------------- @@ -482,6 +500,7 @@ OPTION (HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF) SET (H5_USE_16_API_DEFAULT 0) IF (HDF5_USE_16_API_DEFAULT) SET (H5_USE_16_API_DEFAULT 1) + SET (DEFAULT_API_VERSION "v16") ENDIF (HDF5_USE_16_API_DEFAULT) #----------------------------------------------------------------------------- @@ -491,6 +510,7 @@ OPTION (HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF) SET (H5_USE_18_API_DEFAULT 0) IF (HDF5_USE_18_API_DEFAULT) SET (H5_USE_18_API_DEFAULT 1) + SET (DEFAULT_API_VERSION "v18") ENDIF (HDF5_USE_18_API_DEFAULT) #----------------------------------------------------------------------------- @@ -749,6 +769,9 @@ IF (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") IF (HDF5_ENABLE_PARALLEL) MESSAGE (FATAL " **** Parallel and C++ options are mutually exclusive **** ") ENDIF (HDF5_ENABLE_PARALLEL) + IF (CMAKE_NO_STD_NAMESPACE) + SET (H5_NO_STD 1) + ENDIF (CMAKE_NO_STD_NAMESPACE) ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/c++ ${PROJECT_BINARY_DIR}/c++) ENDIF (HDF5_BUILD_CPP_LIB) ENDIF (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") @@ -2219,6 +2219,7 @@ ./config/cmake/FindSZIP.cmake ./config/cmake/ConversionTests.c ./config/cmake/GetTimeOfDayTest.cpp +./config/cmake/HDF5CXXTests.c ./config/cmake/HDF5Tests.c ./config/cmake/xlatefile.c ./config/cmake/CheckTypeSize.cmake @@ -2246,6 +2247,7 @@ ./config/cmake/CPack.cmake ./config/cmake/NSIS.template.in ./config/cmake/NSIS.InstallOptions.ini.in + ./CMakeLists.txt ./CTestConfig.cmake ./c++/CMakeLists.txt 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)
@@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in 22413 2012-05-27 14:34:59Z hdftest . +# From configure.in Id: configure.in 22427 2012-06-03 14:29:20Z hdftest . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for HDF5 1.9.121. # @@ -3900,6 +3900,7 @@ elif test $hdf5_cv_host != $host; then as_fn_error $? "config.cache file is invalid" "$LINENO" 5 fi + case $host_os in aix*) host_os_novers=aix @@ -7257,6 +7258,7 @@ done fi + if test -z "$AR"; then for ac_prog in ar xar do @@ -7449,6 +7451,7 @@ $as_echo "none" >&6; } ;; esac + if test "X$HDF_FORTRAN" = "Xyes" ; then ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' @@ -7503,6 +7506,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi + if test "X${enable_shared}" = "X" -a "X${enable_parallel}" = "Xyes"; then echo ' shared libraries disabled in parallel' enable_shared="no" @@ -7522,14 +7526,16 @@ if test "X${HDF_FORTRAN}" = "Xyes" && test "X${enable_shared}" != "Xno"; then $as_echo_n "checking if shared Fortran libraries are supported... " >&6; } H5_FORTRAN_SHARED="yes" - case "`uname`" in + + case "`uname`" in Darwin*) H5_FORTRAN_SHARED="no" CHECK_WARN="Shared Fortran libraries not currently supported on Mac." ;; esac - if test "X${H5_FORTRAN_SHARED}" = "Xno"; then + + if test "X${H5_FORTRAN_SHARED}" = "Xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $CHECK_WARN" >&5 @@ -7569,12 +7575,14 @@ if test "X${HDF_CXX}" = "Xyes" && test "X${enable_shared}" != "Xno"; then $as_echo_n "checking if shared C++ libraries are supported... " >&6; } H5_CXX_SHARED="yes" - if (echo dummy ${CXX} ${CXXLD} ${CFLAGS} ${CXXFLAGS} ${LDFLAGS} | grep 'DD64') > /dev/null; then + + if (echo dummy ${CXX} ${CXXLD} ${CFLAGS} ${CXXFLAGS} ${LDFLAGS} | grep 'DD64') > /dev/null; then H5_CXX_SHARED="no" CHECK_WARN="Shared C++ libraries not currently supported with +DD64 flag." fi - if test "X${H5_CXX_SHARED}" = "Xno"; then + + if test "X${H5_CXX_SHARED}" = "Xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $CHECK_WARN" >&5 @@ -7606,11 +7614,13 @@ else fi + if (${CC-cc} -V 2>&1 | grep '^pgcc 6.0') > /dev/null && test "X$enable_production" = "Xyes"; then echo 'adding compiler flag to avoid optimization problem in pgcc' CC="${CC-cc} -Mx,28,0x8" fi + if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then case "`uname`" in CYGWIN*) @@ -22262,7 +22272,7 @@ done ;; *) - for ac_header in io.h winsock.h sys/timeb.h + for ac_header in io.h winsock2.h sys/timeb.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" diff --git a/configure.in b/configure.in index 834757b..3283cc8 100644 --- a/configure.in +++ b/configure.in @@ -251,6 +251,7 @@ dnl CPU dnl dnl If the `OS' ends with a version number then remove it. For instance, dnl `freebsd3.1' would become `freebsd' + case $host_os in aix*) host_os_novers=aix @@ -710,6 +711,7 @@ dnl ---------------------------------------------------------------------- dnl Check which archiving tool to use. This needs to be done before dnl the AM_PROG_LIBTOOL macro. dnl + if test -z "$AR"; then AC_CHECK_PROGS([AR], [ar xar], [:], [$PATH]) fi @@ -850,6 +852,7 @@ dnl Furthermore, the name of the compiler might tell us how to run the dnl resulting executable. For `mpif90' the executable should be run with dnl `mpiexec' from the same directory as mpif90 if it exists. dnl + if test "X$HDF_FORTRAN" = "Xyes" ; then dnl Change to the Fortran 90 language AC_LANG_PUSH(Fortran) @@ -904,6 +907,7 @@ fi dnl ----------------------------------------------------------------------------- dnl If shared libraries are being used with parallel, disable them, unless the dnl user explicity enables them via the '--enable-shared' option. + if test "X${enable_shared}" = "X" -a "X${enable_parallel}" = "Xyes"; then echo ' shared libraries disabled in parallel' enable_shared="no" @@ -918,7 +922,7 @@ fi dnl ---------------------------------------------------------------------- dnl Fortran libraries are not currently supported on Mac. Disable them. -dnl (this is overridable with --enable-unsupported). +dnl this is overridable with '--enable-unsupported'. dnl AC_SUBST([H5_FORTRAN_SHARED]) H5_FORTRAN_SHARED="no" @@ -927,6 +931,7 @@ if test "X${HDF_FORTRAN}" = "Xyes" && test "X${enable_shared}" != "Xno"; then H5_FORTRAN_SHARED="yes" dnl Disable fortran shared libraries on Mac. (MAM - 03/30/11) + case "`uname`" in Darwin*) H5_FORTRAN_SHARED="no" @@ -935,6 +940,7 @@ if test "X${HDF_FORTRAN}" = "Xyes" && test "X${enable_shared}" != "Xno"; then esac dnl Report results of check(s) + if test "X${H5_FORTRAN_SHARED}" = "Xno"; then AC_MSG_RESULT([no]) AC_MSG_WARN([$CHECK_WARN]) @@ -965,12 +971,14 @@ if test "X${HDF_CXX}" = "Xyes" && test "X${enable_shared}" != "Xno"; then H5_CXX_SHARED="yes" dnl Disable C++ shared libraries if DD64 flag is being used. + if (echo dummy ${CXX} ${CXXLD} ${CFLAGS} ${CXXFLAGS} ${LDFLAGS} | grep 'DD64') > /dev/null; then H5_CXX_SHARED="no" CHECK_WARN="Shared C++ libraries not currently supported with +DD64 flag." fi dnl Report results of check(s) + if test "X${H5_CXX_SHARED}" = "Xno"; then AC_MSG_RESULT([no]) AC_MSG_WARN([$CHECK_WARN]) @@ -995,6 +1003,7 @@ dnl pgcc version 6.0x have optimization (-O, -O2 or -O3) problem. Detect dnl these versions and add option "-Mx,28,0x8" to the compiler to avoid dnl the problem if optimization is enabled. dnl + if (${CC-cc} -V 2>&1 | grep '^pgcc 6.0') > /dev/null && test "X$enable_production" = "Xyes"; then echo 'adding compiler flag to avoid optimization problem in pgcc' CC="${CC-cc} -Mx,28,0x8" @@ -1003,6 +1012,7 @@ fi dnl ---------------------------------------------------------------------- dnl Shared libraries are not currently supported under Cygwin, so configure dnl disables them unless --enable-unsupported has been supplied by the user. + if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then case "`uname`" in CYGWIN*) @@ -1063,7 +1073,7 @@ esac dnl ---------------------------------------------------------------------- dnl Some users have reported problems with libtool's use of '-Wl,-rpath' to -dnl link shared libraries in nondefulat directories. Allow users to +dnl link shared libraries in nondefault directories. Allow users to dnl disable embedding the rpath information in the executables and to dnl instead solely rely on the information in LD_LIBRARY_PATH. AC_MSG_CHECKING([if -Wl,-rpath should be used to link shared libs in nondefault directories]) @@ -1277,7 +1287,7 @@ case "`uname`" in AC_CHECK_HEADERS([io.h sys/timeb.h]) ;; *) - AC_CHECK_HEADERS([io.h winsock.h sys/timeb.h]) + AC_CHECK_HEADERS([io.h winsock2.h sys/timeb.h]) ;; esac diff --git a/perform/CMakeLists.txt b/perform/CMakeLists.txt index 1bcf628..421caba 100644 --- a/perform/CMakeLists.txt +++ b/perform/CMakeLists.txt @@ -110,25 +110,27 @@ IF (H5_HAVE_PARALLEL) SET_TARGET_PROPERTIES (h5perf_alone PROPERTIES FOLDER perform) ENDIF (HDF5_BUILD_PERFORM_STANDALONE) - #-- Adding test for benchpar - SET (benchpar_SRCS - ${HDF5_PERFORM_SOURCE_DIR}/benchpar.c - ) - ADD_EXECUTABLE (benchpar ${benchpar_SRCS}) - TARGET_NAMING (benchpar ${LIB_TYPE}) - TARGET_LINK_LIBRARIES (benchpar ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (benchpar PROPERTIES FOLDER perform) - - #-- Adding test for mpi-perf - IF (NOT WIN32) - SET (mpi-perf_SRCS - ${HDF5_PERFORM_SOURCE_DIR}/mpi-perf.c + IF (HDF5_BUILD_PARALLEL_ALL) + #-- Adding test for benchpar + SET (benchpar_SRCS + ${HDF5_PERFORM_SOURCE_DIR}/benchpar.c ) - ADD_EXECUTABLE (mpi-perf ${mpi-perf_SRCS}) - TARGET_NAMING (mpi-perf ${LIB_TYPE}) - TARGET_LINK_LIBRARIES (mpi-perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (mpi-perf PROPERTIES FOLDER perform) - ENDIF (NOT WIN32) + ADD_EXECUTABLE (benchpar ${benchpar_SRCS}) + TARGET_NAMING (benchpar ${LIB_TYPE}) + TARGET_LINK_LIBRARIES (benchpar ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + SET_TARGET_PROPERTIES (benchpar PROPERTIES FOLDER perform) + + #-- Adding test for mpi-perf + IF (NOT WIN32) + SET (mpi-perf_SRCS + ${HDF5_PERFORM_SOURCE_DIR}/mpi-perf.c + ) + ADD_EXECUTABLE (mpi-perf ${mpi-perf_SRCS}) + TARGET_NAMING (mpi-perf ${LIB_TYPE}) + TARGET_LINK_LIBRARIES (mpi-perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + SET_TARGET_PROPERTIES (mpi-perf PROPERTIES FOLDER perform) + ENDIF (NOT WIN32) + ENDIF (HDF5_BUILD_PARALLEL_ALL) ENDIF (H5_HAVE_PARALLEL) @@ -188,9 +190,11 @@ IF (H5_HAVE_PARALLEL) ADD_TEST (NAME PERFORM_h5perf_alone COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:h5perf_alone>) ENDIF (HDF5_BUILD_PERFORM_STANDALONE) -# ADD_TEST (NAME PERFORM_benchpar COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:benchpar>) + IF (HDF5_BUILD_PARALLEL_ALL) + ADD_TEST (NAME PERFORM_benchpar COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:benchpar>) - IF (NOT WIN32) - ADD_TEST (NAME PERFORM_mpi-perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:mpi-perf>) - ENDIF (NOT WIN32) + IF (NOT WIN32) + ADD_TEST (NAME PERFORM_mpi-perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:mpi-perf>) + ENDIF (NOT WIN32) + ENDIF (HDF5_BUILD_PARALLEL_ALL) ENDIF (H5_HAVE_PARALLEL) diff --git a/src/H5config.h.in b/src/H5config.h.in index a2059f5..6176b33 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -405,8 +405,8 @@ /* Define if your system has window style path name. */ #undef HAVE_WINDOW_PATH -/* Define to 1 if you have the <winsock.h> header file. */ -#undef HAVE_WINSOCK_H +/* Define to 1 if you have the <winsock2.h> header file. */ +#undef HAVE_WINSOCK2_H /* Define to 1 if you have the <zlib.h> header file. */ #undef HAVE_ZLIB_H |