diff options
36 files changed, 741 insertions, 273 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index edd7b62..7a6289b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -308,6 +308,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) @@ -366,10 +375,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) @@ -468,6 +484,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) @@ -749,6 +766,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++") @@ -171,7 +171,6 @@ ./fortran/examples/nested_derived_type.f90 ./fortran/examples/rwdset_fortran2003.f90 - ./fortran/src/H5_f.c ./fortran/src/H5_ff.f90 ./fortran/src/H5_ff_F90.f90 @@ -1854,8 +1853,6 @@ ./tools/h5repack/testfiles/h5repack_named_dtypes.h5 ./tools/h5repack/testfiles/h5repack_refs.h5 - - # jam utility and tests ./tools/h5jam/h5jam.c ./tools/h5jam/h5unjam.c @@ -2106,6 +2103,7 @@ ./config/cmake/FindSZIP.cmake ./config/cmake/ConversionTests.c ./config/cmake/GetTimeOfDayTest.cpp +./config/cmake/HDF5CXXTests.cpp ./config/cmake/HDF5Tests.c ./config/cmake/xlatefile.c ./config/cmake/CheckTypeSize.cmake @@ -2133,6 +2131,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/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index d2bc71a..375bd4a 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -103,6 +103,9 @@ INSTALL ( # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- IF (HDF5_EXPORTED_TARGETS) + + INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} cpplibraries) + INSTALL ( TARGETS ${HDF5_CPP_LIB_TARGET} diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 930f3a9..1604a4f 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) @@ -134,6 +123,8 @@ IF (WIN32) SET (WINDOWS 1) # MinGW tries to imitate Windows ENDIF (MINGW) SET (H5_HAVE_WIN32_API 1) + SET (CMAKE_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib") + SET (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1") IF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) SET (WINDOWS 1) IF (MSVC) @@ -153,6 +144,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) # ---------------------------------------------------------------------- @@ -160,24 +153,16 @@ IF (WINDOWS) # that is, "drive-letter:\" (e.g. "C:") or "drive-letter:/" (e.g. "C:/"). # (This flag should be _unset_ for all machines, except for 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) - SET (H5_HAVE_SETJMP_H 1) SET (H5_HAVE_STDDEF_H 1) SET (H5_HAVE_SYS_STAT_H 1) - SET (H5_HAVE_SYS_TIMEB_H 1) SET (H5_HAVE_SYS_TYPES_H 1) - SET (H5_HAVE_WINSOCK_H 1) SET (H5_HAVE_LIBM 1) SET (H5_HAVE_STRDUP 1) SET (H5_HAVE_SYSTEM 1) - SET (H5_HAVE_DIFFTIME 1) SET (H5_HAVE_LONGJMP 1) - SET (H5_STDC_HEADERS 1) IF (NOT MINGW) SET (H5_HAVE_GETHOSTNAME 1) ENDIF (NOT MINGW) @@ -187,6 +172,9 @@ IF (WINDOWS) SET (H5_HAVE_TIMEZONE 1) SET (H5_HAVE_GETTIMEOFDAY 1) SET (H5_LONE_COLON 0) + + SET (H5_HAVE_LIBWS2_32 1) + SET (H5_HAVE_LIBWSOCK32 1) ENDIF (WINDOWS) #----------------------------------------------------------------------------- @@ -194,9 +182,7 @@ ENDIF (WINDOWS) # something not quite correct with the actual test implementation. This affects # the 'dt_arith' test and most likely lots of other code # ---------------------------------------------------------------------------- -IF (WINDOWS) - SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") -ENDIF (WINDOWS) +SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") # ---------------------------------------------------------------------- # END of WINDOWS Hard code Values @@ -210,11 +196,11 @@ 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) + CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup H5_HAVE_LIBWS2_32) + CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" gethostbyname H5_HAVE_LIBWSOCK32) ENDIF (NOT WINDOWS) -CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup H5_HAVE_LIBWS2_32) -CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" gethostbyname H5_HAVE_LIBWSOCK32) CHECK_LIBRARY_EXISTS_CONCAT ("ucb" gethostname H5_HAVE_LIBUCB) CHECK_LIBRARY_EXISTS_CONCAT ("socket" connect H5_HAVE_LIBSOCKET) CHECK_LIBRARY_EXISTS ("c" gethostbyname "" NOT_NEED_LIBNSL) @@ -223,6 +209,8 @@ IF (NOT NOT_NEED_LIBNSL) CHECK_LIBRARY_EXISTS_CONCAT ("nsl" gethostbyname H5_HAVE_LIBNSL) ENDIF (NOT NOT_NEED_LIBNSL) +# For other tests to use the same libraries +SET (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LINK_LIBS}) SET (USE_INCLUDES "") IF (WINDOWS) @@ -231,6 +219,121 @@ 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 +#----------------------------------------------------------------------------- +HDF5_FUNCTION_TEST (STDC_HEADERS) + +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 +347,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 +370,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_WINSOCK2_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 +411,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 +448,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 +483,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,51 +499,106 @@ 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) +IF (NOT WINDOWS) + #----------------------------------------------------------------------------- + # Check if the dev_t type is a scalar type + #----------------------------------------------------------------------------- + HDF5_FUNCTION_TEST (DEV_T_IS_SCALAR) -# 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 + #----------------------------------------------------------------------------- + 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) + + # ---------------------------------------------------------------------- + # Does the struct stat have the st_blocks field? This field is not Posix. + # + HDF5_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) + + # ---------------------------------------------------------------------- + # How do we figure out the width of a tty in characters? + # + CHECK_FUNCTION_EXISTS (ioctl H5_HAVE_IOCTL) + HDF5_FUNCTION_TEST (HAVE_STRUCT_VIDEOCONFIG) + HDF5_FUNCTION_TEST (HAVE_STRUCT_TEXT_INFO) + CHECK_FUNCTION_EXISTS (_getvideoconfig H5_HAVE__GETVIDEOCONFIG) + CHECK_FUNCTION_EXISTS (gettextinfo H5_HAVE_GETTEXTINFO) + CHECK_FUNCTION_EXISTS (_scrsize H5_HAVE__SCRSIZE) + 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) @@ -447,18 +631,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) @@ -469,71 +648,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) @@ -564,61 +702,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) @@ -682,7 +846,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 @@ -697,13 +860,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) @@ -934,6 +1090,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 @@ -951,10 +1132,23 @@ 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 # problem converting from unsigned long long to long double */ IF (CYGWIN) SET (H5_CYGWIN_ULLONG_TO_LDOUBLE_ROUND_PROBLEM 1) -ENDIF (CYGWIN)
\ No newline at end of file +ENDIF (CYGWIN) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index a87efd1..208ad18 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -105,6 +105,9 @@ /* Define if the compiler understands the __func__ keyword */ #cmakedefine H5_HAVE_C99_FUNC @H5_HAVE_C99_FUNC@ +/* Define to 1 if you have the `clock_gettime' function. */ +#cmakedefine H5_HAVE_CLOCK_GETTIME @H5_HAVE_CLOCK_GETTIME@ + /* Define if the function stack tracing code is to be compiled in */ #cmakedefine H5_HAVE_CODESTACK @H5_HAVE_CODESTACK@ @@ -458,7 +461,7 @@ #cmakedefine H5_HAVE_WINDOW_PATH @H5_HAVE_WINDOW_PATH@ /* Define to 1 if you have the <winsock.h> header file. */ -#cmakedefine H5_HAVE_WINSOCK_H @H5_HAVE_WINSOCK_H@ +#cmakedefine H5_HAVE_WINSOCK2_H @H5_HAVE_WINSOCK2_H@ /* Define to 1 if you have the <zlib.h> header file. */ #cmakedefine H5_HAVE_ZLIB_H @H5_HAVE_ZLIB_H@ 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/HDFLibMacros.cmake b/config/cmake/HDFLibMacros.cmake index b9c1fbb..7b54c95 100644 --- a/config/cmake/HDFLibMacros.cmake +++ b/config/cmake/HDFLibMacros.cmake @@ -59,8 +59,8 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type libtype jpeg_pic) ) ELSE (MINGW) SET_TARGET_PROPERTIES(jpeg PROPERTIES - IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) ENDIF (MINGW) ELSE (WIN32) @@ -80,7 +80,7 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type libtype jpeg_pic) ELSE (${libtype} MATCHES "SHARED") IF (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(jpeg PROPERTIES - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/lib${JPEG_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/lib${JPEG_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) ELSE (WIN32 AND NOT MINGW) @@ -173,8 +173,8 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) ) ELSE (MINGW) SET_TARGET_PROPERTIES(szip PROPERTIES - IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) ENDIF (MINGW) ELSE (WIN32) @@ -194,7 +194,7 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) ELSE (${libtype} MATCHES "SHARED") IF (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(szip PROPERTIES - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/lib${SZIP_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/lib${SZIP_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) ELSE (WIN32 AND NOT MINGW) @@ -289,8 +289,8 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) ) ELSE (MINGW) SET_TARGET_PROPERTIES(zlib PROPERTIES - IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) ENDIF (MINGW) ELSE (WIN32) @@ -310,7 +310,7 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) ELSE (${libtype} MATCHES "SHARED") IF (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(zlib PROPERTIES - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/lib${ZLIB_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/lib${ZLIB_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) ELSE (WIN32 AND NOT MINGW) diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake index b90d718..5e0fcdc 100644 --- a/config/cmake/HDFMacros.cmake +++ b/config/cmake/HDFMacros.cmake @@ -48,6 +48,37 @@ MACRO (TARGET_NAMING target libtype) ENDMACRO (TARGET_NAMING) #------------------------------------------------------------------------------- +MACRO (INSTALL_TARGET_PDB target targetdestination targetcomponent) + IF (WIN32 AND MSVC) + GET_TARGET_PROPERTY (target_name ${target} RELWITHDEBINFO_OUTPUT_NAME) + INSTALL ( + FILES + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${target_name}.pdb + DESTINATION + ${targetdestination} + CONFIGURATIONS RelWithDebInfo + COMPONENT ${targetcomponent} + ) + ENDIF (WIN32 AND MSVC) +ENDMACRO (INSTALL_TARGET_PDB) + +#------------------------------------------------------------------------------- +MACRO (INSTALL_PROGRAM_PDB target targetdestination targetcomponent) + IF (WIN32 AND MSVC) + GET_TARGET_PROPERTY (target_name ${target} RELWITHDEBINFO_OUTPUT_NAME) + GET_TARGET_PROPERTY (target_prefix h5dump PREFIX) + INSTALL ( + FILES + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${target_prefix}${target_name}.pdb + DESTINATION + ${targetdestination} + CONFIGURATIONS RelWithDebInfo + COMPONENT ${targetcomponent} + ) + ENDIF (WIN32 AND MSVC) +ENDMACRO (INSTALL_PROGRAM_PDB) + +#------------------------------------------------------------------------------- MACRO (HDF_SET_LIB_OPTIONS libtarget libname libtype) # message (STATUS "${libname} libtype: ${libtype}") IF (${libtype} MATCHES "SHARED") diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index b49df17..6a3baa1 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..418e178 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,34 @@ 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_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 22428 2012-06-04 00:24:55Z hdftest . +# From configure.in Id: configure.in 22449 2012-06-10 23:40:40Z hdftest . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for HDF5 1.8.10-snap4. # @@ -3201,6 +3201,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + am__api_version='1.11' # Find a good install program. We prefer a C program (faster), @@ -3903,6 +3904,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 @@ -7260,6 +7262,7 @@ done fi + if test -z "$AR"; then for ac_prog in ar xar do @@ -7452,6 +7455,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' @@ -7506,6 +7510,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" @@ -7525,14 +7530,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 @@ -7572,12 +7579,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 @@ -7609,11 +7618,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*) @@ -22271,7 +22282,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" @@ -25840,7 +25851,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for global timezone variable" >&5 $as_echo_n "checking for global timezone variable... " >&6; } - case "`uname`" in CYGWIN*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled in CYGWIN" >&5 @@ -26620,6 +26630,7 @@ else $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __func__ extension" >&5 $as_echo_n "checking for __func__ extension... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext diff --git a/configure.in b/configure.in index d27f431..7363eee 100644 --- a/configure.in +++ b/configure.in @@ -32,6 +32,7 @@ AM_CONFIG_HEADER([src/H5config.h]) AC_CONFIG_AUX_DIR([bin]) AC_CONFIG_MACRO_DIR([m4]) + dnl AM_INIT_AUTOMAKE takes a list of options that should be applied to dnl every Makefile.am when automake is run. AM_INIT_AUTOMAKE([foreign]) @@ -250,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 @@ -709,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 @@ -849,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) @@ -903,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" @@ -926,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" @@ -934,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]) @@ -964,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]) @@ -994,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" @@ -1002,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*) @@ -1074,7 +1085,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]) @@ -1288,7 +1299,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 @@ -1860,7 +1871,7 @@ esac if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then dnl SZLIB library is available. Check if it can encode AC_MSG_CHECKING([for szlib encoder]) - + dnl Set LD_LIBRARY_PATH so encoder test can find the library and run. dnl Also add LL_PATH substitution to Makefiles so they can use the dnl path as well, for testing examples. @@ -1870,7 +1881,7 @@ if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then export LD_LIBRARY_PATH="$szlib_lib:$LD_LIBRARY_PATH" fi - AC_SUBST([LL_PATH]) LL_PATH="$LD_LIBRARY_PATH" + AC_SUBST([LL_PATH]) LL_PATH="$LD_LIBRARY_PATH" AC_CACHE_VAL([hdf5_cv_szlib_can_encode], [AC_TRY_RUN([ @@ -2068,7 +2079,6 @@ AC_MSG_RESULT([no])) dnl Check whether the global variable `timezone' is defined. AC_MSG_CHECKING([for global timezone variable]) - case "`uname`" in CYGWIN*) AC_MSG_RESULT([disabled in CYGWIN]) @@ -2273,6 +2283,7 @@ AC_TRY_COMPILE(,[int __attribute__((unused)) x], [Define if the __attribute__(()) extension is present]) AC_MSG_RESULT([yes]), AC_MSG_RESULT([no])) + AC_MSG_CHECKING([for __func__ extension]) AC_TRY_COMPILE(,[ const char *fname = __func__; ], AC_DEFINE([HAVE_C99_FUNC], [1], diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index cecbfb6..c0fea8c 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -270,6 +270,10 @@ ENDIF (WIN32 AND NOT CYGWIN) # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- IF (HDF5_EXPORTED_TARGETS) + + INSTALL_TARGET_PDB (${HDF5_F90_C_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} fortlibraries) + INSTALL_TARGET_PDB (${HDF5_F90_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} fortlibraries) + INSTALL ( TARGETS ${HDF5_F90_C_LIB_TARGET} diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index ad5454d..e0ca0e9 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -36,6 +36,9 @@ INSTALL ( # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- IF (HDF5_EXPORTED_TARGETS) + + INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlcpplibraries) + INSTALL ( TARGETS ${HDF5_HL_CPP_LIB_TARGET} diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index f01c7f8..b6f6d08 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -95,6 +95,10 @@ ENDIF (WIN32 AND NOT CYGWIN) # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- IF (HDF5_EXPORTED_TARGETS) + + INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlfortlibraries) + INSTALL_TARGET_PDB (${HDF5_HL_F90_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlfortlibraries) + INSTALL ( TARGETS ${HDF5_HL_F90_C_LIB_TARGET} diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index f144b94..2df2c23 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -55,6 +55,9 @@ INSTALL ( # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- IF (HDF5_EXPORTED_TARGETS) + + INSTALL_TARGET_PDB (${HDF5_HL_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hllibraries) + INSTALL ( TARGETS ${HDF5_HL_LIB_TARGET} 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/perform/sio_timer.h b/perform/sio_timer.h index 04432af..46702c3 100644 --- a/perform/sio_timer.h +++ b/perform/sio_timer.h @@ -26,9 +26,9 @@ # include <time.h> #endif -#ifdef H5_HAVE_WINSOCK_H +#ifdef H5_HAVE_WINSOCK2_H # include <winsock2.h> -#endif /* H5_HAVE_WINSOCK_H */ +#endif /* H5_HAVE_WINSOCK2_H */ /* The different types of timers we can have */ typedef enum timer_type_ { diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 263f6b8..ae99dc4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -652,6 +652,9 @@ ENDIF (NOT HDF5_INSTALL_NO_DEVELOPMENT) # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- IF (HDF5_EXPORTED_TARGETS) + + INSTALL_TARGET_PDB (${HDF5_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} libraries) + INSTALL ( TARGETS ${HDF5_LIB_TARGET} diff --git a/src/H5config.h.in b/src/H5config.h.in index 5603476..1dbb545 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -409,8 +409,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 diff --git a/src/H5private.h b/src/H5private.h index c32d4f5..ef6c9d8 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -155,7 +155,7 @@ #define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */ #define NOGDI /* Exclude Graphic Display Interface macros */ -#ifdef H5_HAVE_WINSOCK_H +#ifdef H5_HAVE_WINSOCK2_H #include <winsock2.h> #endif diff --git a/src/H5system.c b/src/H5system.c index bb1d2f1..c0baee1 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -639,7 +639,7 @@ Wgettimeofday(struct timeval *tv, struct timezone *tz) return 0; } -#ifdef H5_HAVE_WINSOCK_H +#ifdef H5_HAVE_WINSOCK2_H #pragma comment(lib, "advapi32.lib") #endif @@ -650,12 +650,12 @@ char* Wgetlogin() { -#ifdef H5_HAVE_WINSOCK_H +#ifdef H5_HAVE_WINSOCK2_H long bufferCount = WloginBuffer_count; if (GetUserName(Wlogin_buffer, &bufferCount) == 0) return (Wlogin_buffer); else -#endif /* H5_HAVE_WINSOCK_H */ +#endif /* H5_HAVE_WINSOCK2_H */ return NULL; } diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index f9e7c12..b56f8c7 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -374,6 +374,9 @@ ENDIF (BUILD_TESTING) #-----------------------------------------------------------------------------
# Rules for Installation of tools using make Install target
#-----------------------------------------------------------------------------
+ +INSTALL_PROGRAM_PDB (h5copy ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL ( TARGETS h5copy diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index e46f3e1..a962ceb 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -1428,6 +1428,9 @@ ENDIF (BUILD_TESTING) #-----------------------------------------------------------------------------
# Rules for Installation of tools using make Install target
#-----------------------------------------------------------------------------
+ +INSTALL_PROGRAM_PDB (h5diff ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL ( TARGETS h5diff @@ -1438,6 +1441,9 @@ INSTALL ( ) IF (H5_HAVE_PARALLEL) + + INSTALL_PROGRAM_PDB (ph5diff ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL ( TARGETS ph5diff diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index daad33f..3ed9d1b 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -1752,6 +1752,9 @@ ENDIF (BUILD_TESTING) #-----------------------------------------------------------------------------
# Rules for Installation of tools using make Install target
#-----------------------------------------------------------------------------
+ +INSTALL_PROGRAM_PDB (h5dump ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL ( TARGETS h5dump diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index 76dcf26..f5dabef 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -261,6 +261,9 @@ ENDIF (BUILD_TESTING) #-----------------------------------------------------------------------------
# Rules for Installation of tools using make Install target
#-----------------------------------------------------------------------------
+ +INSTALL_PROGRAM_PDB (h5import ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL ( TARGETS h5import diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index a03d139..4d81d72 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -534,6 +534,9 @@ ENDIF (BUILD_TESTING) #-----------------------------------------------------------------------------
# Rules for Installation of tools using make Install target
#-----------------------------------------------------------------------------
+ +INSTALL_PROGRAM_PDB (h5jam ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL ( TARGETS h5jam h5unjam diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index 0dec21c..4c21eee 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -433,6 +433,9 @@ ENDIF (BUILD_TESTING) #-----------------------------------------------------------------------------
# Rules for Installation of tools using make Install target
#-----------------------------------------------------------------------------
+ +INSTALL_PROGRAM_PDB (h5ls ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL ( TARGETS h5ls diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 98d5c5a..b182332 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -898,6 +898,9 @@ ENDIF (BUILD_TESTING) #-----------------------------------------------------------------------------
# Rules for Installation of tools using make Install target
#-----------------------------------------------------------------------------
+ +INSTALL_PROGRAM_PDB (h5repack ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL ( TARGETS h5repack diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 64e17e2..091da9a 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -202,6 +202,9 @@ ENDIF (BUILD_TESTING) #-----------------------------------------------------------------------------
# Rules for Installation of tools using make Install target
#-----------------------------------------------------------------------------
+ +INSTALL_PROGRAM_PDB (h5stat ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL ( TARGETS h5stat diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index 837a14e..6d48d5f 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -79,6 +79,9 @@ ENDIF (APPLE) # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- IF (HDF5_EXPORTED_TARGETS) + + INSTALL_TARGET_PDB (${HDF5_TOOLS_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} toolslibraries) + INSTALL ( TARGETS ${HDF5_TOOLS_LIB_TARGET} diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index 72930c9..b634b47 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -311,6 +311,11 @@ ENDIF (BUILD_TESTING) #-----------------------------------------------------------------------------
# Rules for Installation of tools using make Install target
#-----------------------------------------------------------------------------
+ +INSTALL_PROGRAM_PDB (h5debug ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) +INSTALL_PROGRAM_PDB (h5repart ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) +INSTALL_PROGRAM_PDB (h5mkgrp ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL ( TARGETS h5debug h5repart h5mkgrp diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 83a932e..93104ee 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -418,7 +418,7 @@ /* #undef H5_HAVE_WINDOW_PATH */ /* Define to 1 if you have the <winsock.h> header file. */ -/* #undef H5_HAVE_WINSOCK_H */ +/* #undef H5_HAVE_WINSOCK2_H */ /* Define to 1 if you have the <zlib.h> header file. */ #define H5_HAVE_ZLIB_H 1 diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index 3b813c0..cc9f30b 100644 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -468,7 +468,7 @@ #define H5_HAVE_WINDOW_PATH 1 /* Define to 1 if you have the <winsock.h> header file. */ -#define H5_HAVE_WINSOCK_H 1 +#define H5_HAVE_WINSOCK2_H 1 /* Define to 1 if you have the <zlib.h> header file. */ #define H5_HAVE_ZLIB_H 1 |