diff options
271 files changed, 7740 insertions, 7137 deletions
diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index bc78fa6..1a74460 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -3,12 +3,12 @@ # Options for HDF5 Filters #----------------------------------------------------------------------------- MACRO (HDF5_SETUP_FILTERS FILTER) - OPTION (HDF5_USE_FILTER_${FILTER} "Use the ${FILTER} Filter" ON) - IF (HDF5_USE_FILTER_${FILTER}) - SET (H5_HAVE_FILTER_${FILTER} 1) - SET (FILTERS "${FILTERS} ${FILTER}") - ENDIF (HDF5_USE_FILTER_${FILTER}) - # MESSAGE (STATUS "Filter ${FILTER} is ${HDF5_USE_FILTER_${FILTER}}") + option (HDF5_USE_FILTER_${FILTER} "Use the ${FILTER} Filter" ON) + if (HDF5_USE_FILTER_${FILTER}) + set (H5_HAVE_FILTER_${FILTER} 1) + set (FILTERS "${FILTERS} ${FILTER}") + endif (HDF5_USE_FILTER_${FILTER}) + # message (STATUS "Filter ${FILTER} is ${HDF5_USE_FILTER_${FILTER}}") ENDMACRO (HDF5_SETUP_FILTERS) HDF5_SETUP_FILTERS (SHUFFLE) @@ -16,107 +16,107 @@ HDF5_SETUP_FILTERS (FLETCHER32) HDF5_SETUP_FILTERS (NBIT) HDF5_SETUP_FILTERS (SCALEOFFSET) -INCLUDE (ExternalProject) -OPTION (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO SVN TGZ)" "NO") -IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - OPTION (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 1) - OPTION (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 1) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") - SET (ZLIB_URL ${ZLIB_SVN_URL}) - SET (SZIP_URL ${SZIP_SVN_URL}) - ELSEIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - IF (NOT TGZPATH) - SET (TGZPATH ${HDF5_SOURCE_DIR}) - ENDIF (NOT TGZPATH) - SET (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_NAME}) - SET (SZIP_URL ${TGZPATH}/${SZIP_TGZ_NAME}) - ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") - SET (ZLIB_USE_EXTERNAL 0) - SET (SZIP_USE_EXTERNAL 0) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") -ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") +include (ExternalProject) +option (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO SVN TGZ)" "NO") +if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + option (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 1) + option (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 1) + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + set (ZLIB_URL ${ZLIB_SVN_URL}) + set (SZIP_URL ${SZIP_SVN_URL}) + elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + if (NOT TGZPATH) + set (TGZPATH ${HDF5_SOURCE_DIR}) + endif (NOT TGZPATH) + set (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_NAME}) + set (SZIP_URL ${TGZPATH}/${SZIP_TGZ_NAME}) + else (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + set (ZLIB_USE_EXTERNAL 0) + set (SZIP_USE_EXTERNAL 0) + endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") +endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") #----------------------------------------------------------------------------- # Option for ZLib support #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" OFF) -IF (HDF5_ENABLE_Z_LIB_SUPPORT) - IF (NOT H5_ZLIB_HEADER) - IF (NOT ZLIB_USE_EXTERNAL) +option (HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" OFF) +if (HDF5_ENABLE_Z_LIB_SUPPORT) + if (NOT H5_ZLIB_HEADER) + if (NOT ZLIB_USE_EXTERNAL) FIND_PACKAGE (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}) - IF (NOT ZLIB_FOUND) + if (NOT ZLIB_FOUND) FIND_PACKAGE (ZLIB) # Legacy find - ENDIF (NOT ZLIB_FOUND) - ENDIF (NOT ZLIB_USE_EXTERNAL) - IF (ZLIB_FOUND) - SET (H5_HAVE_FILTER_DEFLATE 1) - SET (H5_HAVE_ZLIB_H 1) - SET (H5_HAVE_LIBZ 1) - SET (H5_ZLIB_HEADER "zlib.h") - SET (ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR}) - SET (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) - ELSE (ZLIB_FOUND) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif (NOT ZLIB_FOUND) + endif (NOT ZLIB_USE_EXTERNAL) + if (ZLIB_FOUND) + set (H5_HAVE_FILTER_DEFLATE 1) + set (H5_HAVE_ZLIB_H 1) + set (H5_HAVE_LIBZ 1) + set (H5_ZLIB_HEADER "zlib.h") + set (ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR}) + set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) + else (ZLIB_FOUND) + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") EXTERNAL_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${LIB_TYPE}) - SET (H5_HAVE_FILTER_DEFLATE 1) - SET (H5_HAVE_ZLIB_H 1) - SET (H5_HAVE_LIBZ 1) - MESSAGE (STATUS "Filter ZLIB is built") - ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - MESSAGE (FATAL_ERROR " ZLib is Required for ZLib support in HDF5") - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ENDIF (ZLIB_FOUND) - ELSE (NOT H5_ZLIB_HEADER) + set (H5_HAVE_FILTER_DEFLATE 1) + set (H5_HAVE_ZLIB_H 1) + set (H5_HAVE_LIBZ 1) + message (STATUS "Filter ZLIB is built") + else (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + message (FATAL_ERROR " ZLib is Required for ZLib support in HDF5") + endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif (ZLIB_FOUND) + else (NOT H5_ZLIB_HEADER) # This project is being called from within another and ZLib is already configured - SET (H5_HAVE_FILTER_DEFLATE 1) - SET (H5_HAVE_ZLIB_H 1) - SET (H5_HAVE_LIBZ 1) - ENDIF (NOT H5_ZLIB_HEADER) - IF (H5_HAVE_FILTER_DEFLATE) - SET (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE") - ENDIF (H5_HAVE_FILTER_DEFLATE) - SET (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES}) + set (H5_HAVE_FILTER_DEFLATE 1) + set (H5_HAVE_ZLIB_H 1) + set (H5_HAVE_LIBZ 1) + endif (NOT H5_ZLIB_HEADER) + if (H5_HAVE_FILTER_DEFLATE) + set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE") + endif (H5_HAVE_FILTER_DEFLATE) + set (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES}) INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS}) - MESSAGE (STATUS "Filter ZLIB is ON") -ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT) + message (STATUS "Filter ZLIB is ON") +endif (HDF5_ENABLE_Z_LIB_SUPPORT) #----------------------------------------------------------------------------- # Option for SzLib support #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF) -IF (HDF5_ENABLE_SZIP_SUPPORT) - OPTION (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF) - IF (NOT SZIP_USE_EXTERNAL) +option (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF) +if (HDF5_ENABLE_SZIP_SUPPORT) + option (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF) + if (NOT SZIP_USE_EXTERNAL) FIND_PACKAGE (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}) - IF (NOT SZIP_FOUND) + if (NOT SZIP_FOUND) FIND_PACKAGE (SZIP) # Legacy find - ENDIF (NOT SZIP_FOUND) - ENDIF (NOT SZIP_USE_EXTERNAL) - IF (SZIP_FOUND) - SET (H5_HAVE_FILTER_SZIP 1) - SET (H5_HAVE_SZLIB_H 1) - SET (H5_HAVE_LIBSZ 1) - SET (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR}) - SET (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR}) - ELSE (SZIP_FOUND) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif (NOT SZIP_FOUND) + endif (NOT SZIP_USE_EXTERNAL) + if (SZIP_FOUND) + set (H5_HAVE_FILTER_SZIP 1) + set (H5_HAVE_SZLIB_H 1) + set (H5_HAVE_LIBSZ 1) + set (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR}) + set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR}) + else (SZIP_FOUND) + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${LIB_TYPE} ${HDF5_ENABLE_SZIP_ENCODING}) - SET (H5_HAVE_FILTER_SZIP 1) - SET (H5_HAVE_SZLIB_H 1) - SET (H5_HAVE_LIBSZ 1) - MESSAGE (STATUS "Filter SZIP is built") - ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - MESSAGE (FATAL_ERROR "SZIP is Required for SZIP support in HDF5") - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ENDIF (SZIP_FOUND) - SET (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES}) + set (H5_HAVE_FILTER_SZIP 1) + set (H5_HAVE_SZLIB_H 1) + set (H5_HAVE_LIBSZ 1) + message (STATUS "Filter SZIP is built") + else (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + message (FATAL_ERROR "SZIP is Required for SZIP support in HDF5") + endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif (SZIP_FOUND) + set (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES}) INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIR}) - MESSAGE (STATUS "Filter SZIP is ON") - IF (H5_HAVE_FILTER_SZIP) - SET (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DECODE") - ENDIF (H5_HAVE_FILTER_SZIP) - IF (HDF5_ENABLE_SZIP_ENCODING) - SET (H5_HAVE_SZIP_ENCODER 1) - SET (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} ENCODE") - ENDIF (HDF5_ENABLE_SZIP_ENCODING) -ENDIF (HDF5_ENABLE_SZIP_SUPPORT) + message (STATUS "Filter SZIP is ON") + if (H5_HAVE_FILTER_SZIP) + set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DECODE") + endif (H5_HAVE_FILTER_SZIP) + if (HDF5_ENABLE_SZIP_ENCODING) + set (H5_HAVE_SZIP_ENCODER 1) + set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} ENCODE") + endif (HDF5_ENABLE_SZIP_ENCODING) +endif (HDF5_ENABLE_SZIP_SUPPORT) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 5929380..0631c61 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -2,48 +2,48 @@ #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -IF (NOT HDF5_INSTALL_NO_DEVELOPMENT) - INSTALL ( +if (NOT HDF5_INSTALL_NO_DEVELOPMENT) + install ( FILES ${PROJECT_BINARY_DIR}/H5pubconf.h DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT headers ) -ENDIF (NOT HDF5_INSTALL_NO_DEVELOPMENT) +endif (NOT HDF5_INSTALL_NO_DEVELOPMENT) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) - INSTALL ( +if (NOT HDF5_EXTERNALLY_CONFIGURED) + install ( EXPORT ${HDF5_EXPORTED_TARGETS} DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE} FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake COMPONENT configinstall ) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Export all exported targets to the build tree for use by parent project #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) +if (NOT HDF5_EXTERNALLY_CONFIGURED) EXPORT ( TARGETS ${HDF5_LIBRARIES_TO_EXPORT} ${HDF5_LIB_DEPENDENCIES} FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake ) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Configure the hdf5-config.cmake file for the build directory #----------------------------------------------------------------------------- -SET (HDF5_INCLUDES_BUILD_TIME +set (HDF5_INCLUDES_BUILD_TIME ${HDF5_SRC_DIR} ${HDF5_CPP_SRC_DIR} ${HDF5_HL_SRC_DIR} ${HDF5_TOOLS_SRC_DIR} ${HDF5_BINARY_DIR} ) -SET (HDF5_VERSION_STRING @HDF5_PACKAGE_VERSION@) -SET (HDF5_VERSION_MAJOR @HDF5_PACKAGE_VERSION_MAJOR@) -SET (HDF5_VERSION_MINOR @HDF5_PACKAGE_VERSION_MINOR@) +set (HDF5_VERSION_STRING @HDF5_PACKAGE_VERSION@) +set (HDF5_VERSION_MAJOR @HDF5_PACKAGE_VERSION_MAJOR@) +set (HDF5_VERSION_MINOR @HDF5_PACKAGE_VERSION_MINOR@) -CONFIGURE_FILE ( +configure_file ( ${HDF5_RESOURCES_DIR}/hdf5-config.cmake.build.in ${HDF5_BINARY_DIR}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake @ONLY ) @@ -51,61 +51,61 @@ CONFIGURE_FILE ( #----------------------------------------------------------------------------- # Configure the FindHDF5.cmake file for the install directory #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) - CONFIGURE_FILE ( +if (NOT HDF5_EXTERNALLY_CONFIGURED) + configure_file ( ${HDF5_RESOURCES_DIR}/FindHDF5.cmake.in ${HDF5_BINARY_DIR}/CMakeFiles/FindHDF5${HDF_PACKAGE_EXT}.cmake @ONLY ) - INSTALL ( + install ( FILES ${HDF5_BINARY_DIR}/CMakeFiles/FindHDF5${HDF_PACKAGE_EXT}.cmake DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE} COMPONENT configinstall ) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Configure the hdf5-config.cmake file for the install directory #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) - CONFIGURE_FILE ( +if (NOT HDF5_EXTERNALLY_CONFIGURED) + configure_file ( ${HDF5_RESOURCES_DIR}/hdf5-config.cmake.install.in ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake @ONLY ) - INSTALL ( + install ( FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE} COMPONENT configinstall ) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Configure the hdf5-config-version .cmake file for the install directory #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) - CONFIGURE_FILE ( +if (NOT HDF5_EXTERNALLY_CONFIGURED) + configure_file ( ${HDF5_RESOURCES_DIR}/hdf5-config-version.cmake.in ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake @ONLY ) - INSTALL ( + install ( FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE} COMPONENT configinstall ) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Configure the libhdf5.settings file for the lib info #----------------------------------------------------------------------------- -IF (H5_WORDS_BIGENDIAN) - SET (BYTESEX big-endian) -ELSE (H5_WORDS_BIGENDIAN) - SET (BYTESEX little-endian) -ENDIF (H5_WORDS_BIGENDIAN) -CONFIGURE_FILE ( +if (H5_WORDS_BIGENDIAN) + set (BYTESEX big-endian) +else (H5_WORDS_BIGENDIAN) + set (BYTESEX little-endian) +endif (H5_WORDS_BIGENDIAN) +configure_file ( ${HDF5_RESOURCES_DIR}/libhdf5.settings.cmake.in ${HDF5_BINARY_DIR}/libhdf5.settings @ONLY ) -INSTALL ( +install ( FILES ${HDF5_BINARY_DIR}/libhdf5.settings DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE} COMPONENT libraries @@ -114,157 +114,241 @@ INSTALL ( #----------------------------------------------------------------------------- # Configure the HDF518_Examples.cmake file and the examples #----------------------------------------------------------------------------- -OPTION (HDF5_PACK_EXAMPLES "Package the HDF5 Library Examples Compressed File" OFF) -IF (HDF5_PACK_EXAMPLES) - CONFIGURE_FILE ( +option (HDF5_PACK_EXAMPLES "Package the HDF5 Library Examples Compressed File" OFF) +if (HDF5_PACK_EXAMPLES) + configure_file ( ${HDF5_RESOURCES_DIR}/HDF518_Examples.cmake.in ${HDF5_BINARY_DIR}/HDF518_Examples.cmake @ONLY ) - INSTALL ( + install ( FILES ${HDF5_BINARY_DIR}/HDF518_Examples.cmake DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) - IF (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}") - INSTALL ( + if (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}") + install ( FILES ${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED} ${HDF5_SOURCE_DIR}/release_docs/USING_CMake_Examples.txt DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) - ENDIF (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}") -ENDIF (HDF5_PACK_EXAMPLES) + endif (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}") +endif (HDF5_PACK_EXAMPLES) + +#----------------------------------------------------------------------------- +# Configure the README.txt file for the binary package +#----------------------------------------------------------------------------- +set (BINARY_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}) +set (BINARY_PLATFORM "${CMAKE_SYSTEM_NAME}") +if (WIN32) + set (BINARY_EXAMPLE_ENDING "zip") + set (BINARY_INSTALL_ENDING "exe") + if (CMAKE_CL_64) + set (BINARY_SYSTEM_NAME "win64") + else (CMAKE_CL_64) + set (BINARY_SYSTEM_NAME "win32") + endif (CMAKE_CL_64) + if (${CMAKE_SYSTEM_VERSION} MATCHES "6.1") + set (BINARY_PLATFORM "${BINARY_PLATFORM} 7") + elseif (${CMAKE_SYSTEM_VERSION} MATCHES "6.2") + set (BINARY_PLATFORM "${BINARY_PLATFORM} 8") + endif (${CMAKE_SYSTEM_VERSION} MATCHES "6.1") + set (BINARY_PLATFORM "${BINARY_PLATFORM} ${MSVC_C_ARCHITECTURE_ID}") + if (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2010") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "15.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2008") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "17.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2012") + else (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}") + endif (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") +elseif (APPLE) + set (BINARY_EXAMPLE_ENDING "tar.gz") + set (BINARY_INSTALL_ENDING "dmg") + set (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}") +else (WIN32) + set (BINARY_EXAMPLE_ENDING "tar.gz") + set (BINARY_INSTALL_ENDING "sh") + set (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}") +endif (WIN32) +if (HDF4_BUILD_FORTRAN) + set (BINARY_PLATFORM "${BINARY_PLATFORM} / ${CMAKE_Fortran_COMPILER_ID} Fortran") +endif (HDF4_BUILD_FORTRAN) + +configure_file ( + ${HDF5_RESOURCES_DIR}/README.txt.cmake.in + ${HDF5_BINARY_DIR}/README.txt @ONLY +) #----------------------------------------------------------------------------- # Add Document File(s) to CMake Install #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) - INSTALL ( +if (NOT HDF5_EXTERNALLY_CONFIGURED) + install ( FILES - ${HDF5_SOURCE_DIR}/ACKNOWLEDGMENTS ${HDF5_SOURCE_DIR}/COPYING DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) - IF (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") - SET (release_files + if (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") + set (release_files ${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_CMake.txt ${HDF5_SOURCE_DIR}/release_docs/COPYING ${HDF5_SOURCE_DIR}/release_docs/RELEASE.txt ) - IF (WIN32 AND NOT CYGWIN) - SET (release_files + if (WIN32 AND NOT CYGWIN) + set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_VS.txt ) - ENDIF (WIN32 AND NOT CYGWIN) - IF (HDF5_PACK_INSTALL_DOCS) - SET (release_files + endif (WIN32 AND NOT CYGWIN) + if (HDF5_PACK_INSTALL_DOCS) + set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_CMake.txt ${HDF5_SOURCE_DIR}/release_docs/HISTORY-1_8.txt ${HDF5_SOURCE_DIR}/release_docs/INSTALL ) - IF (WIN32) - IF (NOT CYGWIN) - SET (release_files + if (WIN32) + if (NOT CYGWIN) + set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Windows.txt ) - ELSE (NOT CYGWIN) - SET (release_files + else (NOT CYGWIN) + set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Cygwin.txt ) - ENDIF (NOT CYGWIN) - ENDIF (WIN32) - IF (HDF5_ENABLE_PARALLEL) - SET (release_files + endif (NOT CYGWIN) + endif (WIN32) + if (HDF5_ENABLE_PARALLEL) + set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_parallel ) - ENDIF (HDF5_ENABLE_PARALLEL) - ENDIF (HDF5_PACK_INSTALL_DOCS) - INSTALL ( + endif (HDF5_ENABLE_PARALLEL) + endif (HDF5_PACK_INSTALL_DOCS) + install ( FILES ${release_files} DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) - ENDIF (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) + endif (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Set the cpack variables #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) - SET (CPACK_PACKAGE_VENDOR "HDF_Group") - SET (CPACK_PACKAGE_NAME "${HDF5_PACKAGE_NAME}") - SET (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}") - SET (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}") - SET (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}") - SET (CPACK_PACKAGE_VERSION_PATCH "") - SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${HDF5_PACKAGE_NAME}/${CPACK_PACKAGE_VERSION}") - IF (EXISTS "${HDF5_SOURCE_DIR}/release_docs") - SET (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") - SET (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/COPYING") - SET (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") - ENDIF (EXISTS "${HDF5_SOURCE_DIR}/release_docs") - SET (CPACK_PACKAGE_RELOCATABLE TRUE) +if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) + set (CPACK_PACKAGE_VENDOR "HDF_Group") + set (CPACK_PACKAGE_NAME "${HDF5_PACKAGE_NAME}") + if (CDASH_LOCAL) + set (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}") + else (CDASH_LOCAL) + set (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION_STRING}") + endif (CDASH_LOCAL) + set (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}") + set (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}") + set (CPACK_PACKAGE_VERSION_PATCH "") + if (EXISTS "${HDF5_SOURCE_DIR}/release_docs") + set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") + set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/COPYING") + set (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") + endif (EXISTS "${HDF5_SOURCE_DIR}/release_docs") + set (CPACK_PACKAGE_RELOCATABLE TRUE) + set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_NAME}/${CPACK_PACKAGE_VERSION}") + set (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}/hdf.bmp") - SET (CPACK_GENERATOR "TGZ") - IF (WIN32) + set (CPACK_GENERATOR "TGZ") + if (WIN32) LIST (APPEND CPACK_GENERATOR "NSIS") - SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${HDF5_PACKAGE_NAME}\\\\${CPACK_PACKAGE_VERSION}") - SET (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${LIB_TYPE}") - SET (CPACK_MONOLITHIC_INSTALL ON) - SET (CPACK_NSIS_CONTACT "${HDF5_PACKAGE_BUGREPORT}") - SET (CPACK_NSIS_MODIFY_PATH ON) - SET (CPACK_NSIS_PACKAGE_NAME "HDF5 ${CPACK_PACKAGE_VERSION}") - ELSEIF (APPLE) + # Installers for 32- vs. 64-bit CMake: + # - Root install directory (displayed to end user at installer-run time) + # - "NSIS package/display name" (text used in the installer GUI) + # - Registry key used to store info about the installation + set (CPACK_NSIS_PACKAGE_NAME "${HDF5_PACKAGE_STRING}") + if (CMAKE_CL_64) + set (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") + set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION} (Win64)") + else (CMAKE_CL_64) + set (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") + set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}") + endif (CMAKE_CL_64) + # set the install/unistall icon used for the installer itself + # There is a bug in NSI that does not handle full unix paths properly. + set (CPACK_NSIS_MUI_ICON "${HDF5_RESOURCES_DIR}\\\\hdf.ico") + set (CPACK_NSIS_MUI_UNIICON "${HDF5_RESOURCES_DIR}\\\\hdf.ico") + # set the package header icon for MUI + set (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}\\\\hdf.bmp") + set (CPACK_NSIS_DISPLAY_NAME "@CPACK_NSIS_PACKAGE_NAME@, is a data model, library, and file format for storing and managing data") + set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${CPACK_PACKAGE_NAME}\\\\${CPACK_PACKAGE_VERSION}") + set (CPACK_MONOLITHIC_INSTALL ON) + set (CPACK_NSIS_CONTACT "${HDF5_PACKAGE_BUGREPORT}") + set (CPACK_NSIS_MODIFY_PATH ON) + elseif (APPLE) LIST (APPEND CPACK_GENERATOR "DragNDrop") - SET (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) - SET (CPACK_PACKAGE_DEFAULT_LOCATION "/opt/${CPACK_PACKAGE_NAME}") - SET (CPACK_PACKAGING_INSTALL_PREFIX "/") - SET (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}") - SET (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}/hdf.gif") - SET (CPACK_SET_DESTDIR TRUE) # Required when packaging, and set CMAKE_INSTALL_PREFIX to "/". + set (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) + set (CPACK_PACKAGE_DEFAULT_LOCATION "/opt/${CPACK_PACKAGE_NAME}") + set (CPACK_PACKAGING_INSTALL_PREFIX "/") + set (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}/hdf.icns") + set (CPACK_SET_DESTDIR TRUE) # Required when packaging, and set CMAKE_INSTALL_PREFIX to "/". - IF (HDF5_PACK_MACOSX_BUNDLE) + if (HDF5_PACK_MACOSX_BUNDLE) LIST (APPEND CPACK_GENERATOR "Bundle") - SET (CPACK_BUNDLE_NAME "${HDF5_PACKAGE_STRING}") - SET (CPACK_BUNDLE_LOCATION "/") # make sure CMAKE_INSTALL_PREFIX ends in / - SET (CMAKE_INSTALL_PREFIX "/${CPACK_BUNDLE_NAME}.framework/Versions/${CPACK_PACKAGE_VERSION}/${CPACK_PACKAGE_NAME}/") - SET (CPACK_BUNDLE_ICON "${HDF5_RESOURCES_DIR}/hdf.gif") - SET (CPACK_BUNDLE_PLIST "${HDF5_BINARY_DIR}/CMakeFiles/Info.plist") - SET (CPACK_APPLE_GUI_INFO_STRING "HDF5 (Hierarchical Data Format 5) Software Library and Utilities") - SET (CPACK_APPLE_GUI_COPYRIGHT "Copyright © 2006-2013 by The HDF Group. All rights reserved.") - SET (CPACK_SHORT_VERSION_STRING "${CPACK_PACKAGE_VERSION}") + set (CPACK_BUNDLE_NAME "${HDF5_PACKAGE_STRING}") + set (CPACK_BUNDLE_LOCATION "/") # make sure CMAKE_INSTALL_PREFIX ends in / + set (CMAKE_INSTALL_PREFIX "/${CPACK_BUNDLE_NAME}.framework/Versions/${CPACK_PACKAGE_VERSION}/${CPACK_PACKAGE_NAME}/") + set (CPACK_BUNDLE_ICON "${HDF5_RESOURCES_DIR}/hdf.icns") + set (CPACK_BUNDLE_PLIST "${HDF5_BINARY_DIR}/CMakeFiles/Info.plist") + set (CPACK_APPLE_GUI_INFO_STRING "HDF5 (Hierarchical Data Format 5) Software Library and Utilities") + set (CPACK_APPLE_GUI_COPYRIGHT "Copyright © 2006-2014 by The HDF Group. All rights reserved.") + set (CPACK_SHORT_VERSION_STRING "${CPACK_PACKAGE_VERSION}") + set (CPACK_APPLE_GUI_BUNDLE_NAME "${HDF5_PACKAGE_STRING}") + set (CPACK_APPLE_GUI_VERSION_STRING "${CPACK_PACKAGE_VERSION_STRING}") + set (CPACK_APPLE_GUI_SHORT_VERSION_STRING "${CPACK_PACKAGE_VERSION}") #----------------------------------------------------------------------------- # Configure the Info.plist file for the install bundle #----------------------------------------------------------------------------- - CONFIGURE_FILE ( + configure_file ( ${HDF5_RESOURCES_DIR}/CPack.Info.plist.in ${HDF5_BINARY_DIR}/CMakeFiles/Info.plist @ONLY ) + configure_file ( + ${HDF5_RESOURCES_DIR}/PkgInfo.in + ${HDF5_BINARY_DIR}/CMakeFiles/PkgInfo @ONLY + ) + configure_file ( + ${HDF5_RESOURCES_DIR}/version.plist.in + ${HDF5_BINARY_DIR}/CMakeFiles/version.plist @ONLY + ) + install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/PkgInfo + ${HDF5_BINARY_DIR}/CMakeFiles/version.plist + DESTINATION .. + ) ENDIF(HDF5_PACK_MACOSX_BUNDLE) - ELSE (WIN32) + else (WIN32) LIST (APPEND CPACK_GENERATOR "STGZ") - SET (CPACK_PACKAGING_INSTALL_PREFIX "/usr") - SET (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) + set (CPACK_PACKAGING_INSTALL_PREFIX "/${CPACK_PACKAGE_INSTALL_DIRECTORY}") + set (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) - SET (CPACK_DEBIAN_PACKAGE_SECTION "Libraries") - SET (CPACK_DEBIAN_PACKAGE_MAINTAINER "${HDF5_PACKAGE_BUGREPORT}") + set (CPACK_DEBIAN_PACKAGE_SECTION "Libraries") + set (CPACK_DEBIAN_PACKAGE_MAINTAINER "${HDF5_PACKAGE_BUGREPORT}") # LIST (APPEND CPACK_GENERATOR "RPM") - SET (CPACK_RPM_PACKAGE_RELEASE "1") - SET (CPACK_RPM_COMPONENT_INSTALL ON) - SET (CPACK_RPM_PACKAGE_RELOCATABLE ON) - SET (CPACK_RPM_PACKAGE_LICENSE "BSD-style") - SET (CPACK_RPM_PACKAGE_GROUP "Development/Libraries") - SET (CPACK_RPM_PACKAGE_URL "${HDF5_PACKAGE_URL}") - SET (CPACK_RPM_PACKAGE_SUMMARY "HDF5 is a unique technology suite that makes possible the management of extremely large and complex data collections.") - SET (CPACK_RPM_PACKAGE_DESCRIPTION + set (CPACK_RPM_PACKAGE_RELEASE "1") + set (CPACK_RPM_COMPONENT_INSTALL ON) + set (CPACK_RPM_PACKAGE_RELOCATABLE ON) + set (CPACK_RPM_PACKAGE_LICENSE "BSD-style") + set (CPACK_RPM_PACKAGE_GROUP "Development/Libraries") + set (CPACK_RPM_PACKAGE_URL "${HDF5_PACKAGE_URL}") + set (CPACK_RPM_PACKAGE_SUMMARY "HDF5 is a unique technology suite that makes possible the management of extremely large and complex data collections.") + set (CPACK_RPM_PACKAGE_DESCRIPTION "The HDF5 technology suite includes: * A versatile data model that can represent very complex data objects and a wide variety of metadata. @@ -284,30 +368,34 @@ The HDF5 data model, file format, API, library, and tools are open and distribut #----------------------------------------------------------------------------- # Configure the spec file for the install RPM #----------------------------------------------------------------------------- -# CONFIGURE_FILE ("${HDF5_RESOURCES_DIR}/hdf5.spec.in" "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec" @ONLY IMMEDIATE) -# SET (CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec") - ENDIF (WIN32) +# configure_file ("${HDF5_RESOURCES_DIR}/hdf5.spec.in" "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec" @ONLY IMMEDIATE) +# set (CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec") + endif (WIN32) + # By default, do not warn when built on machines using only VS Express: + if (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) + set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) + ENDIF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) INCLUDE(InstallRequiredSystemLibraries) - SET (CPACK_INSTALL_CMAKE_PROJECTS "${HDF5_BINARY_DIR};HDF5;ALL;/") + set (CPACK_INSTALL_CMAKE_PROJECTS "${HDF5_BINARY_DIR};HDF5;ALL;/") - IF (HDF5_PACKAGE_EXTLIBS) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - IF (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) - SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;libraries;/") - SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;headers;/") - SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;configinstall;/") - ENDIF (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) - IF (SZIP_FOUND AND SZIP_USE_EXTERNAL) - SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;libraries;/") - SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;headers;/") - SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;configinstall;/") - ENDIF (SZIP_FOUND AND SZIP_USE_EXTERNAL) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ENDIF (HDF5_PACKAGE_EXTLIBS) + if (HDF5_PACKAGE_EXTLIBS) + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) + set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;libraries;/") + set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;headers;/") + set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;configinstall;/") + endif (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) + if (SZIP_FOUND AND SZIP_USE_EXTERNAL) + set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;libraries;/") + set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;headers;/") + set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;configinstall;/") + endif (SZIP_FOUND AND SZIP_USE_EXTERNAL) + endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif (HDF5_PACKAGE_EXTLIBS) - INCLUDE (CPack) + include (CPack) #--------------------------------------------------------------------------- # Now list the cpack commands @@ -336,7 +424,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut GROUP Development ) - IF (HDF5_BUILD_FORTRAN) + if (HDF5_BUILD_FORTRAN) CPACK_ADD_COMPONENT (fortlibraries DISPLAY_NAME "HDF5 Fortran Libraries" DEPENDS libraries @@ -347,9 +435,9 @@ The HDF5 data model, file format, API, library, and tools are open and distribut DEPENDS fortlibraries GROUP Development ) - ENDIF (HDF5_BUILD_FORTRAN) + endif (HDF5_BUILD_FORTRAN) - IF (HDF5_BUILD_CPP_LIB) + if (HDF5_BUILD_CPP_LIB) CPACK_ADD_COMPONENT (cpplibraries DISPLAY_NAME "HDF5 C++ Libraries" DEPENDS libraries @@ -360,9 +448,9 @@ The HDF5 data model, file format, API, library, and tools are open and distribut DEPENDS cpplibraries GROUP Development ) - ENDIF (HDF5_BUILD_CPP_LIB) + endif (HDF5_BUILD_CPP_LIB) - IF (HDF5_BUILD_TOOLS) + if (HDF5_BUILD_TOOLS) CPACK_ADD_COMPONENT (toolsapplications DISPLAY_NAME "HDF5 Tools Applications" DEPENDS toolslibraries @@ -378,9 +466,9 @@ The HDF5 data model, file format, API, library, and tools are open and distribut DEPENDS toolslibraries GROUP Development ) - ENDIF (HDF5_BUILD_TOOLS) + endif (HDF5_BUILD_TOOLS) - IF (HDF5_BUILD_HL_LIB) + if (HDF5_BUILD_HL_LIB) CPACK_ADD_COMPONENT (hllibraries DISPLAY_NAME "HDF5 HL Libraries" DEPENDS libraries @@ -411,6 +499,6 @@ The HDF5 data model, file format, API, library, and tools are open and distribut DEPENDS fortlibraries GROUP Runtime ) - ENDIF (HDF5_BUILD_HL_LIB) + endif (HDF5_BUILD_HL_LIB) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) +endif (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) diff --git a/CMakeLists.txt b/CMakeLists.txt index bd84c71..80aa594 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5 C CXX) #----------------------------------------------------------------------------- @@ -20,7 +20,7 @@ PROJECT (HDF5 C CXX) # HDF5_EXPORTED_TARGETS : # Set this to the name of the targets variable which controls exports # If unset (because parent project does not support/use the -# INSTALL (EXPORT target...) syntax), then targets are not configured +# install (EXPORT target...) syntax), then targets are not configured # for export during install. # # HDF5_LIB_DEPENDENCIES : @@ -44,25 +44,25 @@ PROJECT (HDF5 C CXX) # any project making use of this build of HDF5 will use the correct zlib # # # Tell hdf5 that we are manually overriding certain settings -# SET(HDF5_EXTERNALLY_CONFIGURED 1) +# set (HDF5_EXTERNALLY_CONFIGURED 1) # # Avoid duplicating names of installed libraries -# SET(HDF5_EXTERNAL_LIB_PREFIX "vtk") +# set (HDF5_EXTERNAL_LIB_PREFIX "vtk") # # Export configuration to this export variable -# SET(HDF5_EXPORTED_TARGETS "paraview-targets") +# set (HDF5_EXPORTED_TARGETS "paraview-targets") # # # Setup all necessary overrides for zlib so that HDF5 uses our # # internally compiled zlib rather than any other version # IF(HDF5_ENABLE_Z_LIB_SUPPORT) # # We must tell the main HDF5 library that it depends on our zlib -# SET(HDF5_LIB_DEPENDENCIES vtkzlib) +# set (HDF5_LIB_DEPENDENCIES vtkzlib) # # Override the zlib header file # IF(VTK_USE_SYSTEM_ZLIB) -# SET(H5_ZLIB_HEADER "zlib.h") +# set (H5_ZLIB_HEADER "zlib.h") # ELSE(VTK_USE_SYSTEM_ZLIB) -# SET(H5_ZLIB_HEADER "vtk_zlib.h") +# set (H5_ZLIB_HEADER "vtk_zlib.h") # # Set vars that FindZlib would have set if used in sub project -# SET(ZLIB_INCLUDE_DIRS "${VTK_ZLIB_INCLUDE_DIRS}") -# SET(ZLIB_LIBRARIES vtkzlib) +# set (ZLIB_INCLUDE_DIRS "${VTK_ZLIB_INCLUDE_DIRS}") +# set (ZLIB_LIBRARIES vtkzlib) # ENDIF(VTK_USE_SYSTEM_ZLIB) # ENDIF(HDF5_ENABLE_Z_LIB_SUPPORT) # @@ -77,265 +77,277 @@ PROJECT (HDF5 C CXX) # organization feature. Default to ON for non-Express users. Express users must # explicitly turn off this option to build HDF5 in the Express IDE... # -OPTION (HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON) +option (HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON) MARK_AS_ADVANCED (HDF5_USE_FOLDERS) -IF (HDF5_USE_FOLDERS) - SET_PROPERTY (GLOBAL PROPERTY USE_FOLDERS ON) -ENDIF (HDF5_USE_FOLDERS) -OPTION (HDF5_NO_PACKAGES "CPACK - Disable packaging" OFF) +if (HDF5_USE_FOLDERS) + set_property (GLOBAL PROPERTY USE_FOLDERS ON) +endif (HDF5_USE_FOLDERS) +option (HDF5_NO_PACKAGES "CPACK - Disable packaging" OFF) MARK_AS_ADVANCED (HDF5_NO_PACKAGES) #----------------------------------------------------------------------------- # Set the core names of all the libraries #----------------------------------------------------------------------------- -SET (HDF5_LIB_CORENAME "hdf5") -SET (HDF5_TEST_LIB_CORENAME "hdf5_test") -SET (HDF5_CPP_LIB_CORENAME "hdf5_cpp") -SET (HDF5_HL_LIB_CORENAME "hdf5_hl") -SET (HDF5_HL_CPP_LIB_CORENAME "hdf5_hl_cpp") -SET (HDF5_TOOLS_LIB_CORENAME "hdf5_tools") -SET (HDF5_F90_LIB_CORENAME "hdf5_fortran") -SET (HDF5_F90_C_LIB_CORENAME "hdf5_f90cstub") -SET (HDF5_F90_TEST_LIB_CORENAME "hdf5_test_fortran") -SET (HDF5_F90_C_TEST_LIB_CORENAME "hdf5_test_f90cstub") -SET (HDF5_HL_F90_LIB_CORENAME "hdf5_hl_fortran") -SET (HDF5_HL_F90_C_LIB_CORENAME "hdf5_hl_f90cstub") +set (HDF5_LIB_CORENAME "hdf5") +set (HDF5_TEST_LIB_CORENAME "hdf5_test") +set (HDF5_CPP_LIB_CORENAME "hdf5_cpp") +set (HDF5_HL_LIB_CORENAME "hdf5_hl") +set (HDF5_HL_CPP_LIB_CORENAME "hdf5_hl_cpp") +set (HDF5_TOOLS_LIB_CORENAME "hdf5_tools") +set (HDF5_F90_LIB_CORENAME "hdf5_fortran") +set (HDF5_F90_C_LIB_CORENAME "hdf5_f90cstub") +set (HDF5_F90_TEST_LIB_CORENAME "hdf5_test_fortran") +set (HDF5_F90_C_TEST_LIB_CORENAME "hdf5_test_f90cstub") +set (HDF5_HL_F90_LIB_CORENAME "hdf5_hl_fortran") +set (HDF5_HL_F90_C_LIB_CORENAME "hdf5_hl_f90cstub") #----------------------------------------------------------------------------- # Set the true names of all the libraries if customized by external project #----------------------------------------------------------------------------- -SET (HDF5_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_LIB_CORENAME}") -SET (HDF5_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_LIB_CORENAME}") -SET (HDF5_CPP_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_CPP_LIB_CORENAME}") -SET (HDF5_HL_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_LIB_CORENAME}") -SET (HDF5_HL_CPP_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_CPP_LIB_CORENAME}") -SET (HDF5_TOOLS_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOLS_LIB_CORENAME}") -SET (HDF5_F90_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_LIB_CORENAME}") -SET (HDF5_F90_C_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_C_LIB_CORENAME}") -SET (HDF5_F90_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_TEST_LIB_CORENAME}") -SET (HDF5_F90_C_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_C_TEST_LIB_CORENAME}") -SET (HDF5_HL_F90_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_F90_LIB_CORENAME}") -SET (HDF5_HL_F90_C_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_F90_C_LIB_CORENAME}") +set (HDF5_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_LIB_CORENAME}") +set (HDF5_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_LIB_CORENAME}") +set (HDF5_CPP_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_CPP_LIB_CORENAME}") +set (HDF5_HL_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_LIB_CORENAME}") +set (HDF5_HL_CPP_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_CPP_LIB_CORENAME}") +set (HDF5_TOOLS_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOLS_LIB_CORENAME}") +set (HDF5_F90_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_LIB_CORENAME}") +set (HDF5_F90_C_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_C_LIB_CORENAME}") +set (HDF5_F90_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_TEST_LIB_CORENAME}") +set (HDF5_F90_C_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_C_TEST_LIB_CORENAME}") +set (HDF5_HL_F90_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_F90_LIB_CORENAME}") +set (HDF5_HL_F90_C_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_F90_C_LIB_CORENAME}") #----------------------------------------------------------------------------- # Set the target names of all the libraries #----------------------------------------------------------------------------- -SET (HDF5_LIB_TARGET ${HDF5_LIB_CORENAME}) -SET (HDF5_TEST_LIB_TARGET ${HDF5_TEST_LIB_CORENAME}) -SET (HDF5_CPP_LIB_TARGET ${HDF5_CPP_LIB_CORENAME}) -SET (HDF5_HL_LIB_TARGET ${HDF5_HL_LIB_CORENAME}) -SET (HDF5_HL_CPP_LIB_TARGET ${HDF5_HL_CPP_LIB_CORENAME}) -SET (HDF5_TOOLS_LIB_TARGET ${HDF5_TOOLS_LIB_CORENAME}) -SET (HDF5_F90_LIB_TARGET ${HDF5_F90_LIB_CORENAME}) -SET (HDF5_F90_C_LIB_TARGET ${HDF5_F90_C_LIB_CORENAME}) -SET (HDF5_F90_TEST_LIB_TARGET ${HDF5_F90_TEST_LIB_CORENAME}) -SET (HDF5_F90_C_TEST_LIB_TARGET ${HDF5_F90_C_TEST_LIB_CORENAME}) -SET (HDF5_HL_F90_LIB_TARGET ${HDF5_HL_F90_LIB_CORENAME}) -SET (HDF5_HL_F90_C_LIB_TARGET ${HDF5_HL_F90_C_LIB_CORENAME}) +set (HDF5_LIB_TARGET ${HDF5_LIB_CORENAME}) +set (HDF5_TEST_LIB_TARGET ${HDF5_TEST_LIB_CORENAME}) +set (HDF5_CPP_LIB_TARGET ${HDF5_CPP_LIB_CORENAME}) +set (HDF5_HL_LIB_TARGET ${HDF5_HL_LIB_CORENAME}) +set (HDF5_HL_CPP_LIB_TARGET ${HDF5_HL_CPP_LIB_CORENAME}) +set (HDF5_TOOLS_LIB_TARGET ${HDF5_TOOLS_LIB_CORENAME}) +set (HDF5_F90_LIB_TARGET ${HDF5_F90_LIB_CORENAME}) +set (HDF5_F90_C_LIB_TARGET ${HDF5_F90_C_LIB_CORENAME}) +set (HDF5_F90_TEST_LIB_TARGET ${HDF5_F90_TEST_LIB_CORENAME}) +set (HDF5_F90_C_TEST_LIB_TARGET ${HDF5_F90_C_TEST_LIB_CORENAME}) +set (HDF5_HL_F90_LIB_TARGET ${HDF5_HL_F90_LIB_CORENAME}) +set (HDF5_HL_F90_C_LIB_TARGET ${HDF5_HL_F90_C_LIB_CORENAME}) #----------------------------------------------------------------------------- # Define some CMake variables for use later in the project #----------------------------------------------------------------------------- -SET (HDF5_RESOURCES_DIR ${HDF5_SOURCE_DIR}/config/cmake) -SET (HDF5_SRC_DIR ${HDF5_SOURCE_DIR}/src) -SET (HDF5_TEST_SRC_DIR ${HDF5_SOURCE_DIR}/test) -SET (HDF5_CPP_SRC_DIR ${HDF5_SOURCE_DIR}/c++) -SET (HDF5_CPP_TST_DIR ${HDF5_SOURCE_DIR}/c++/test) -SET (HDF5_HL_SRC_DIR ${HDF5_SOURCE_DIR}/hl) -SET (HDF5_HL_CPP_SRC_DIR ${HDF5_SOURCE_DIR}/hl/c++) -SET (HDF5_TOOLS_SRC_DIR ${HDF5_SOURCE_DIR}/tools) -SET (HDF5_PERFORM_SRC_DIR ${HDF5_SOURCE_DIR}/perform) -SET (HDF5_F90_SRC_DIR ${HDF5_SOURCE_DIR}/fortran) - -IF (NOT HDF5_INSTALL_BIN_DIR) - SET (HDF5_INSTALL_BIN_DIR bin) -ENDIF (NOT HDF5_INSTALL_BIN_DIR) -IF (NOT HDF5_INSTALL_LIB_DIR) - SET (HDF5_INSTALL_LIB_DIR lib) -ENDIF (NOT HDF5_INSTALL_LIB_DIR) -IF (NOT HDF5_INSTALL_INCLUDE_DIR) - SET (HDF5_INSTALL_INCLUDE_DIR include) -ENDIF (NOT HDF5_INSTALL_INCLUDE_DIR) -IF (NOT HDF5_INSTALL_DATA_DIR) - IF (NOT WIN32) - SET (HDF5_INSTALL_DATA_DIR share) - SET (HDF5_INSTALL_CMAKE_DIR share/cmake) - ELSE (NOT WIN32) - SET (HDF5_INSTALL_DATA_DIR ".") - SET (HDF5_INSTALL_CMAKE_DIR cmake) - ENDIF (NOT WIN32) -ENDIF (NOT HDF5_INSTALL_DATA_DIR) +set (HDF5_RESOURCES_DIR ${HDF5_SOURCE_DIR}/config/cmake) +set (HDF5_SRC_DIR ${HDF5_SOURCE_DIR}/src) +set (HDF5_TEST_SRC_DIR ${HDF5_SOURCE_DIR}/test) +set (HDF5_CPP_SRC_DIR ${HDF5_SOURCE_DIR}/c++) +set (HDF5_CPP_TST_DIR ${HDF5_SOURCE_DIR}/c++/test) +set (HDF5_HL_SRC_DIR ${HDF5_SOURCE_DIR}/hl) +set (HDF5_HL_CPP_SRC_DIR ${HDF5_SOURCE_DIR}/hl/c++) +set (HDF5_TOOLS_SRC_DIR ${HDF5_SOURCE_DIR}/tools) +set (HDF5_PERFORM_SRC_DIR ${HDF5_SOURCE_DIR}/perform) +set (HDF5_F90_SRC_DIR ${HDF5_SOURCE_DIR}/fortran) + +if (NOT HDF5_INSTALL_BIN_DIR) + set (HDF5_INSTALL_BIN_DIR bin) +endif (NOT HDF5_INSTALL_BIN_DIR) +if (NOT HDF5_INSTALL_LIB_DIR) + set (HDF5_INSTALL_LIB_DIR lib) +endif (NOT HDF5_INSTALL_LIB_DIR) +if (NOT HDF5_INSTALL_INCLUDE_DIR) + set (HDF5_INSTALL_INCLUDE_DIR include) +endif (NOT HDF5_INSTALL_INCLUDE_DIR) +if (NOT HDF5_INSTALL_DATA_DIR) + if (NOT WIN32) + set (HDF5_INSTALL_DATA_DIR share) + set (HDF5_INSTALL_CMAKE_DIR share/cmake) + else (NOT WIN32) + set (HDF5_INSTALL_DATA_DIR ".") + set (HDF5_INSTALL_CMAKE_DIR cmake) + endif (NOT WIN32) +endif (NOT HDF5_INSTALL_DATA_DIR) #----------------------------------------------------------------------------- # parse the full version number from H5public.h and include in H5_VERS_INFO #----------------------------------------------------------------------------- FILE (READ ${HDF5_SRC_DIR}/H5public.h _h5public_h_contents) -STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_MAJOR[ \t]+([0-9]*).*$" +string (REGEX REPLACE ".*#define[ \t]+H5_VERS_MAJOR[ \t]+([0-9]*).*$" "\\1" H5_VERS_MAJOR ${_h5public_h_contents}) -STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_MINOR[ \t]+([0-9]*).*$" +string (REGEX REPLACE ".*#define[ \t]+H5_VERS_MINOR[ \t]+([0-9]*).*$" "\\1" H5_VERS_MINOR ${_h5public_h_contents}) -STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_RELEASE[ \t]+([0-9]*).*$" +string (REGEX REPLACE ".*#define[ \t]+H5_VERS_RELEASE[ \t]+([0-9]*).*$" "\\1" H5_VERS_RELEASE ${_h5public_h_contents}) -STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._]*)\".*$" +string (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._]*)\".*$" "\\1" H5_VERS_SUBRELEASE ${_h5public_h_contents}) -#MESSAGE (STATUS "VERSION: ${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}") +#message (STATUS "VERSION: ${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}") #----------------------------------------------------------------------------- # parse the full soversion number from config/lt_vers.am and include in H5_SOVERS_INFO #----------------------------------------------------------------------------- FILE (READ ${HDF5_SOURCE_DIR}/config/lt_vers.am _lt_vers_am_contents) -STRING (REGEX REPLACE ".*LT_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" +string (REGEX REPLACE ".*LT_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_INTERFACE ${_lt_vers_am_contents}) -STRING (REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" +string (REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_MINOR ${_lt_vers_am_contents}) -STRING (REGEX REPLACE ".*LT_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" +string (REGEX REPLACE ".*LT_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_RELEASE ${_lt_vers_am_contents}) MATH(EXPR H5_SOVERS_MAJOR ${H5_SOVERS_INTERFACE}-${H5_SOVERS_RELEASE}) -MESSAGE (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") +message (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") #----------------------------------------------------------------------------- # Basic HDF5 stuff here #----------------------------------------------------------------------------- -SET (HDF5_PACKAGE "hdf5") -SET (HDF5_PACKAGE_NAME "HDF5") -SET (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}") -SET (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}") -SET (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}") -IF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") - SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") -ELSE (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") - SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") -ENDIF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") -SET (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") -SET (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION_STRING}") -SET (HDF5_PACKAGE_TARNAME "${HDF5_PACKAGE}${HDF_PACKAGE_EXT}") -SET (HDF5_PACKAGE_URL "http://www.hdfgroup.org") -SET (HDF5_PACKAGE_BUGREPORT "help@hdfgroup.org") +set (HDF5_PACKAGE "hdf5") +set (HDF5_PACKAGE_NAME "HDF5") +set (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}") +set (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}") +set (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}") +if (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") + set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") +else (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") + set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") +endif (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") +set (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") +set (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION_STRING}") +set (HDF5_PACKAGE_TARNAME "${HDF5_PACKAGE}${HDF_PACKAGE_EXT}") +set (HDF5_PACKAGE_URL "http://www.hdfgroup.org") +set (HDF5_PACKAGE_BUGREPORT "help@hdfgroup.org") + +#----------------------------------------------------------------------------- +# Set Install folder value +#----------------------------------------------------------------------------- +if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + IF(CMAKE_HOST_UNIX) + set (CMAKE_INSTALL_PREFIX "/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" + CACHE PATH "Install path prefix, prepended onto install directories." FORCE) + ELSE(CMAKE_HOST_UNIX) + GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES) + set (CMAKE_INSTALL_PREFIX + "${CMAKE_GENERIC_PROGRAM_FILES}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" + CACHE PATH "Install path prefix, prepended onto install directories." FORCE) + set (CMAKE_GENERIC_PROGRAM_FILES) + ENDIF(CMAKE_HOST_UNIX) +endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) #----------------------------------------------------------------------------- # Include some macros for reusable code #----------------------------------------------------------------------------- -INCLUDE (${HDF5_RESOURCES_DIR}/HDFMacros.cmake) -INCLUDE (${HDF5_RESOURCES_DIR}/HDFLibMacros.cmake) -INCLUDE (${HDF5_RESOURCES_DIR}/HDF5Macros.cmake) +include (${HDF5_RESOURCES_DIR}/HDFMacros.cmake) +include (${HDF5_RESOURCES_DIR}/HDFLibMacros.cmake) +include (${HDF5_RESOURCES_DIR}/HDF5Macros.cmake) #----------------------------------------------------------------------------- # Setup output Directories #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) - SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY +if (NOT HDF5_EXTERNALLY_CONFIGURED) + set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Executables." ) - SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY + set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Libraries" ) - SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY + set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all static libraries." ) - SET (CMAKE_Fortran_MODULE_DIRECTORY + set (CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/bin/fortran CACHE PATH "Single Directory for all fortran modules." ) -ELSE (NOT HDF5_EXTERNALLY_CONFIGURED) +else (NOT HDF5_EXTERNALLY_CONFIGURED) # if we are externally configured, but the project uses old cmake scripts # this may not be set and utilities like H5detect will fail - IF (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) - SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) - ENDIF (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) + if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) + endif (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Targets built within this project are exported at Install time for use # by other projects using FindHDF5. #----------------------------------------------------------------------------- -IF (NOT HDF5_EXPORTED_TARGETS) - SET (HDF5_EXPORTED_TARGETS "hdf5-targets") -ENDIF (NOT HDF5_EXPORTED_TARGETS) +if (NOT HDF5_EXPORTED_TARGETS) + set (HDF5_EXPORTED_TARGETS "hdf5-targets") +endif (NOT HDF5_EXPORTED_TARGETS) #----------------------------------------------------------------------------- # To include a library in the list exported by the project AT BUILD TIME, # add it to this variable. This is NOT used by Make Install, but for projects # which include hdf5 as a sub-project within their build tree #----------------------------------------------------------------------------- -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "") -SET (EXTERNAL_HEADER_LIST "") -SET (EXTERNAL_LIBRARY_LIST "") -SET (EXTERNAL_LIBRARYDLL_LIST "") +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "") +set (EXTERNAL_HEADER_LIST "") +set (EXTERNAL_LIBRARY_LIST "") +set (EXTERNAL_LIBRARYDLL_LIST "") #----------------------------------------------------------------------------- # Run all the CMake configuration tests for our build environment #----------------------------------------------------------------------------- -INCLUDE (${HDF5_RESOURCES_DIR}/ConfigureChecks.cmake) +include (${HDF5_RESOURCES_DIR}/ConfigureChecks.cmake) + +set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) #----------------------------------------------------------------------------- # Option to Build Shared/Static libs, default is static #----------------------------------------------------------------------------- -OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" OFF) -SET (LIB_TYPE STATIC) -SET (H5_ENABLE_SHARED_LIB NO) -SET (H5_ENABLE_STATIC_LIB NO) -IF (BUILD_SHARED_LIBS) - SET (LIB_TYPE SHARED) - SET (H5_BUILT_AS_DYNAMIC_LIB 1) - SET (H5_ENABLE_SHARED_LIB YES) -ELSE (BUILD_SHARED_LIBS) - SET (H5_BUILT_AS_STATIC_LIB 1) - SET (H5_ENABLE_STATIC_LIB YES) - IF (NOT WIN32) - # should this be a user setting : Everyone uses it anyway ? - ADD_DEFINITIONS (-DPIC) - IF (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - ADD_DEFINITIONS (-KPIC) - ENDIF (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - ENDIF (NOT WIN32) -ENDIF (BUILD_SHARED_LIBS) +option (BUILD_SHARED_LIBS "Build Shared Libraries" OFF) +set (LIB_TYPE STATIC) +set (H5_ENABLE_SHARED_LIB NO) +set (H5_ENABLE_STATIC_LIB NO) +if (BUILD_SHARED_LIBS) + set (LIB_TYPE SHARED) + set (H5_BUILT_AS_DYNAMIC_LIB 1) + set (H5_ENABLE_SHARED_LIB YES) +else (BUILD_SHARED_LIBS) + set (H5_BUILT_AS_STATIC_LIB 1) + set (H5_ENABLE_STATIC_LIB YES) + set (CMAKE_POSITION_INDEPENDENT_CODE ON) +endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # Option to Build Static executables #----------------------------------------------------------------------------- -OPTION (BUILD_STATIC_EXECS "Build Static Executabless" OFF) -IF (BUILD_STATIC_EXECS) - IF (NOT WIN32) - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") - ENDIF (NOT WIN32) -ENDIF (BUILD_STATIC_EXECS) +option (BUILD_STATIC_EXECS "Build Static Executabless" OFF) +if (BUILD_STATIC_EXECS) + if (NOT WIN32) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") + endif (NOT WIN32) +endif (BUILD_STATIC_EXECS) #----------------------------------------------------------------------------- # Option to use code coverage #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF) -IF (HDF5_ENABLE_COVERAGE) - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") - SET (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage") -ENDIF (HDF5_ENABLE_COVERAGE) +option (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF) +if (HDF5_ENABLE_COVERAGE) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") + set (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-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) +# 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) +# 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) -IF (HDF5_ENABLE_USING_MEMCHECKER) - SET (H5_USING_MEMCHECKER 1) -ENDIF (HDF5_ENABLE_USING_MEMCHECKER) +option (HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF) +if (HDF5_ENABLE_USING_MEMCHECKER) + set (H5_USING_MEMCHECKER 1) +endif (HDF5_ENABLE_USING_MEMCHECKER) #----------------------------------------------------------------------------- # Option to use deprecated public API symbols #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON) -IF (HDF5_ENABLE_DEPRECATED_SYMBOLS) - SET (H5_NO_DEPRECATED_SYMBOLS 0) -ELSE (HDF5_ENABLE_DEPRECATED_SYMBOLS) - SET (H5_NO_DEPRECATED_SYMBOLS 1) -ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS) +option (HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON) +if (HDF5_ENABLE_DEPRECATED_SYMBOLS) + set (H5_NO_DEPRECATED_SYMBOLS 0) +else (HDF5_ENABLE_DEPRECATED_SYMBOLS) + set (H5_NO_DEPRECATED_SYMBOLS 1) +endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) #----------------------------------------------------------------------------- # When building utility executables that generate other (source) files : @@ -343,296 +355,290 @@ ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS) # Certain systems may add /Debug or /Release to output paths # and we need to call the executable from inside the CMake configuration #----------------------------------------------------------------------------- -SET (EXE_EXT "") -IF (WIN32) - SET (EXE_EXT ".exe") - IF (NOT CYGWIN) - ADD_DEFINITIONS (-D_BIND_TO_CURRENT_VCLIBS_VERSION=1) - ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS) - ADD_DEFINITIONS (-D_CONSOLE) - ENDIF (NOT CYGWIN) -ENDIF (WIN32) - -IF (MSVC) - SET (CMAKE_MFC_FLAG 0) - SET (WIN_COMPILE_FLAGS "") - SET (WIN_LINK_FLAGS "") -ENDIF (MSVC) - -SET (MAKE_SYSTEM) -IF (CMAKE_BUILD_TOOL MATCHES "make") - SET (MAKE_SYSTEM 1) -ENDIF (CMAKE_BUILD_TOOL MATCHES "make") - -SET (CFG_INIT "/${CMAKE_CFG_INTDIR}") -IF (MAKE_SYSTEM) - SET (CFG_INIT "") -ENDIF (MAKE_SYSTEM) +set (EXE_EXT "") +if (WIN32) + set (EXE_EXT ".exe") + if (NOT CYGWIN) + add_definitions (-D_BIND_TO_CURRENT_VCLIBS_VERSION=1) + add_definitions (-D_CRT_SECURE_NO_WARNINGS) + add_definitions (-D_CONSOLE) + endif (NOT CYGWIN) +endif (WIN32) + +if (MSVC) + set (CMAKE_MFC_FLAG 0) + set (WIN_COMPILE_FLAGS "") + set (WIN_LINK_FLAGS "") +endif (MSVC) + +set (MAKE_SYSTEM) +if (CMAKE_BUILD_TOOL MATCHES "make") + set (MAKE_SYSTEM 1) +endif (CMAKE_BUILD_TOOL MATCHES "make") + +set (CFG_INIT "/${CMAKE_CFG_INTDIR}") +if (MAKE_SYSTEM) + set (CFG_INIT "") +endif (MAKE_SYSTEM) #----------------------------------------------------------------------------- # Add some definitions for Debug Builds #----------------------------------------------------------------------------- -IF (CMAKE_BUILD_TYPE MATCHES Debug) - ADD_DEFINITIONS (-DDEBUG) - ADD_DEFINITIONS ( - -DH5Z_DEBUG -DH5V_DEBUG -DH5T_DEBUG - -DH5S_DEBUG -DH5P_DEBUG -DH5O_DEBUG -DH5MM_DEBUG -DH5MF_DEBUG - -DH5I_DEBUG -DH5HL_DEBUG -DH5HG_DEBUG -DH5G_DEBUG -DH5F_DEBUG - -DH5E_DEBUG -DH5D_DEBUG -DH5B_DEBUG -DH5AC_DEBUG -UNDEBUG - ) +if (CMAKE_BUILD_TYPE MATCHES Debug) + add_definitions (-DDEBUG) # 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) + 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) + 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) - ENDIF (NOT WIN32) -ELSE (CMAKE_BUILD_TYPE MATCHES Debug) - ADD_DEFINITIONS (-DNDEBUG) - OPTION (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF) - IF (HDF5_ENABLE_TRACE) - ADD_DEFINITIONS (-DH5_DEBUG_API ) - ENDIF (HDF5_ENABLE_TRACE) -ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) + if (NOT WIN32) + add_definitions (-Wall) + endif (NOT WIN32) +else (CMAKE_BUILD_TYPE MATCHES Debug) + add_definitions (-DNDEBUG) + option (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF) + if (HDF5_ENABLE_TRACE) + add_definitions (-DH5_DEBUG_API ) + endif (HDF5_ENABLE_TRACE) +endif (CMAKE_BUILD_TYPE MATCHES Debug) #----------------------------------------------------------------------------- # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- -IF (CMAKE_COMPILER_IS_GNUCC) - IF (CMAKE_BUILD_TYPE MATCHES Debug) - SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -finline-functions -fno-common") - ELSE (CMAKE_BUILD_TYPE MATCHES Debug) - SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common") - ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) -ENDIF (CMAKE_COMPILER_IS_GNUCC) -IF (CMAKE_COMPILER_IS_GNUCXX) - IF (CMAKE_BUILD_TYPE MATCHES Debug) - SET (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -finline-functions -fno-common") - ELSE (CMAKE_BUILD_TYPE MATCHES Debug) - SET (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -fomit-frame-pointer -finline-functions -fno-common") - ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) -ENDIF (CMAKE_COMPILER_IS_GNUCXX) +if (CMAKE_COMPILER_IS_GNUCC) + if (CMAKE_BUILD_TYPE MATCHES Debug) + set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -finline-functions -fno-common") + else (CMAKE_BUILD_TYPE MATCHES Debug) + set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common") + endif (CMAKE_BUILD_TYPE MATCHES Debug) +endif (CMAKE_COMPILER_IS_GNUCC) +if (CMAKE_COMPILER_IS_GNUCXX) + if (CMAKE_BUILD_TYPE MATCHES Debug) + set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -finline-functions -fno-common") + else (CMAKE_BUILD_TYPE MATCHES Debug) + set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -fomit-frame-pointer -finline-functions -fno-common") + endif (CMAKE_BUILD_TYPE MATCHES Debug) +endif (CMAKE_COMPILER_IS_GNUCXX) #----------------------------------------------------------------------------- # Option to embed library info into executables #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON) -IF (HDF5_ENABLE_EMBEDDED_LIBINFO) - SET (H5_HAVE_EMBEDDED_LIBINFO 1) -ENDIF (HDF5_ENABLE_EMBEDDED_LIBINFO) +option (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON) +if (HDF5_ENABLE_EMBEDDED_LIBINFO) + set (H5_HAVE_EMBEDDED_LIBINFO 1) +endif (HDF5_ENABLE_EMBEDDED_LIBINFO) #----------------------------------------------------------------------------- # Option to allow the user to disable compiler warnings #----------------------------------------------------------------------------- -OPTION (HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF) -IF (HDF5_DISABLE_COMPILER_WARNINGS) +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. - IF (MSVC) - SET (HDF5_WARNINGS_BLOCKED 1) - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w") - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w") - ENDIF (MSVC) - IF (WIN32 AND NOT CYGWIN) - ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS) - ENDIF (WIN32 AND NOT CYGWIN) + if (MSVC) + set (HDF5_WARNINGS_BLOCKED 1) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w") + endif (MSVC) + if (WIN32 AND NOT CYGWIN) + add_definitions (-D_CRT_SECURE_NO_WARNINGS) + endif (WIN32 AND NOT CYGWIN) # Borland uses -w- to suppress warnings. - IF (BORLAND) - SET (HDF5_WARNINGS_BLOCKED 1) - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-") - ENDIF (BORLAND) + if (BORLAND) + set (HDF5_WARNINGS_BLOCKED 1) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-") + endif (BORLAND) # Most compilers use -w to suppress warnings. - IF (NOT HDF5_WARNINGS_BLOCKED) - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") - ENDIF (NOT HDF5_WARNINGS_BLOCKED) -ENDIF (HDF5_DISABLE_COMPILER_WARNINGS) + if (NOT HDF5_WARNINGS_BLOCKED) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") + endif (NOT HDF5_WARNINGS_BLOCKED) +endif (HDF5_DISABLE_COMPILER_WARNINGS) #----------------------------------------------------------------------------- # CDash is configured to only allow 3000 warnings, so # break into groups (from the config/gnu-flags file) #----------------------------------------------------------------------------- -IF (NOT MSVC) - IF (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline") - ELSE (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -erroff=%none -DBSD_COMP") - ENDIF (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") +if (NOT MSVC) + if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline") + else (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -erroff=%none -DBSD_COMP") + endif (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") # Append warning flags # Don't use the '-Wtraditional' flag, we're way past having K&R C code - # SET (H5_CFLAGS "${H5_CFLAGS} -Wtraditional") + # set (H5_CFLAGS "${H5_CFLAGS} -Wtraditional") # Don't use the '-Wtraditional-conversion' flag, there's too many warnings # from GCC's assert macro - # SET (H5_CFLAGS "${H5_CFLAGS} -Wtraditional-conversion") + # set (H5_CFLAGS "${H5_CFLAGS} -Wtraditional-conversion") # Append warning flags from gcc-3* case # (don't use -Wpadded flag for normal builds, many of the warnings its # issuing can't be fixed and they are making it hard to detect other, # more important warnings) - #SET (H5_CFLAGS "${H5_CFLAGS} -Wfloat-equal -Wmissing-format-attribute -Wpadded") - SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wfloat-equal -Wmissing-format-attribute") + #set (H5_CFLAGS "${H5_CFLAGS} -Wfloat-equal -Wmissing-format-attribute -Wpadded") + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wfloat-equal -Wmissing-format-attribute") # Append warning flags from gcc-3.2* case - SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn -Wpacked -Wdisabled-optimization") + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn -Wpacked -Wdisabled-optimization") # Enable more format checking flags, beyond the basic -Wformat included # in -Wall - SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wformat=2") + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wformat=2") # The "unreachable code" warning appears to be reliable now... # (this warning was removed in gcc 4.5+) - #SET (H5_CFLAGS "${H5_CFLAGS} -Wunreachable-code") + #set (H5_CFLAGS "${H5_CFLAGS} -Wunreachable-code") # Append warning flags from gcc-3.3* case - SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wendif-labels") + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wendif-labels") # Append warning flags from gcc-3.4* case - SET (H5_CFLAGS2 "${H5_CFLAGS2} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch") + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch") # Append more extra warning flags that only gcc4.0+ know about - SET (H5_CFLAGS2 "${H5_CFLAGS2} -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros") + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros") # Append more extra warning flags that only gcc 4.1+ know about - SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wunsafe-loop-optimizations -Wc++-compat") + set (H5_CFLAGS3 "${H5_CFLAGS3} -Wunsafe-loop-optimizations -Wc++-compat") # Append more extra warning flags that only gcc 4.2+ know about - SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wstrict-overflow") + set (H5_CFLAGS3 "${H5_CFLAGS3} -Wstrict-overflow") # Append more extra warning flags that only gcc 4.3+ know about # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK - SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wlogical-op -Wlarger-than=2048 -Wvla") + set (H5_CFLAGS3 "${H5_CFLAGS3} -Wlogical-op -Wlarger-than=2048 -Wvla") # Append more extra warning flags that only gcc 4.4+ know about - SET (H5_CFLAGS4 "${H5_CFLAGS4} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat") + set (H5_CFLAGS4 "${H5_CFLAGS4} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat") # Append more extra warning flags that only gcc 4.5+ know about - SET (H5_CFLAGS4 "${H5_CFLAGS4} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants") + set (H5_CFLAGS4 "${H5_CFLAGS4} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants") # Append more extra warning flags that only gcc 4.6+ know about - SET (H5_CFLAGS5 "${H5_CFLAGS5} -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines") + set (H5_CFLAGS5 "${H5_CFLAGS5} -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines") # Append more extra warning flags that only gcc 4.7+ know about - SET (H5_CFLAGS5 "${H5_CFLAGS5} -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") -ENDIF (NOT MSVC) + set (H5_CFLAGS5 "${H5_CFLAGS5} -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") +endif (NOT MSVC) #----------------------------------------------------------------------------- # Option to allow the user to enable all warnings #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF) -IF (HDF5_ENABLE_ALL_WARNINGS) - IF (MSVC) - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall") - ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}") - ENDIF (MSVC) -ENDIF (HDF5_ENABLE_ALL_WARNINGS) +option (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF) +if (HDF5_ENABLE_ALL_WARNINGS) + if (MSVC) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall") + else (MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}") + endif (MSVC) +endif (HDF5_ENABLE_ALL_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group zero warnings" OFF) -IF (HDF5_ENABLE_GROUPZERO_WARNINGS) - IF (MSVC) - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1") - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") - ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") - ENDIF (MSVC) -ENDIF (HDF5_ENABLE_GROUPZERO_WARNINGS) +option (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group zero warnings" OFF) +if (HDF5_ENABLE_GROUPZERO_WARNINGS) + if (MSVC) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") + else (MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") + endif (MSVC) +endif (HDF5_ENABLE_GROUPZERO_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GROUPONE_WARNINGS "Enable group one warnings" OFF) -IF (HDF5_ENABLE_GROUPONE_WARNINGS) - IF (MSVC) - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2") - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") - ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}") - ENDIF (MSVC) -ENDIF (HDF5_ENABLE_GROUPONE_WARNINGS) +option (HDF5_ENABLE_GROUPONE_WARNINGS "Enable group one warnings" OFF) +if (HDF5_ENABLE_GROUPONE_WARNINGS) + if (MSVC) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") + else (MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}") + endif (MSVC) +endif (HDF5_ENABLE_GROUPONE_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GROUPTWO_WARNINGS "Enable group two warnings" OFF) -IF (HDF5_ENABLE_GROUPTWO_WARNINGS) - IF (MSVC) - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") - ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}") - ENDIF (MSVC) -ENDIF (HDF5_ENABLE_GROUPTWO_WARNINGS) +option (HDF5_ENABLE_GROUPTWO_WARNINGS "Enable group two warnings" OFF) +if (HDF5_ENABLE_GROUPTWO_WARNINGS) + if (MSVC) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") + else (MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}") + endif (MSVC) +endif (HDF5_ENABLE_GROUPTWO_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GROUPTHREE_WARNINGS "Enable group three warnings" OFF) -IF (HDF5_ENABLE_GROUPTHREE_WARNINGS) - IF (MSVC) - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") - ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}") - ENDIF (MSVC) -ENDIF (HDF5_ENABLE_GROUPTHREE_WARNINGS) +option (HDF5_ENABLE_GROUPTHREE_WARNINGS "Enable group three warnings" OFF) +if (HDF5_ENABLE_GROUPTHREE_WARNINGS) + if (MSVC) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + else (MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}") + endif (MSVC) +endif (HDF5_ENABLE_GROUPTHREE_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF) -IF (HDF5_ENABLE_GROUPFOUR_WARNINGS) - IF (NOT MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS4}") - ENDIF (NOT MSVC) -ENDIF (HDF5_ENABLE_GROUPFOUR_WARNINGS) +option (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF) +if (HDF5_ENABLE_GROUPFOUR_WARNINGS) + if (NOT MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS4}") + endif (NOT MSVC) +endif (HDF5_ENABLE_GROUPFOUR_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GROUPFIVE_WARNINGS "Enable group five warnings" OFF) -IF (HDF5_ENABLE_GROUPFIVE_WARNINGS) - IF (NOT MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS5}") - ENDIF (NOT MSVC) -ENDIF (HDF5_ENABLE_GROUPFIVE_WARNINGS) +option (HDF5_ENABLE_GROUPFIVE_WARNINGS "Enable group five warnings" OFF) +if (HDF5_ENABLE_GROUPFIVE_WARNINGS) + if (NOT MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS5}") + endif (NOT MSVC) +endif (HDF5_ENABLE_GROUPFIVE_WARNINGS) #----------------------------------------------------------------------------- # This is in here to help some of the GCC based IDES like Eclipse # and code blocks parse the compiler errors and warnings better. #----------------------------------------------------------------------------- -IF (CMAKE_COMPILER_IS_GNUCC) - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0") -ENDIF (CMAKE_COMPILER_IS_GNUCC) -IF (CMAKE_COMPILER_IS_GNUCXX) - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") -ENDIF (CMAKE_COMPILER_IS_GNUCXX) +if (CMAKE_COMPILER_IS_GNUCC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0") +endif (CMAKE_COMPILER_IS_GNUCC) +if (CMAKE_COMPILER_IS_GNUCXX) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") +endif (CMAKE_COMPILER_IS_GNUCXX) #----------------------------------------------------------------------------- # All libs/tests/examples need the main include directories @@ -642,167 +648,159 @@ INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR} ${HDF5_SRC_DIR} ${CMAKE_RUNTIME_OUTPUT_D #----------------------------------------------------------------------------- # Option to Enable MPI Parallel #----------------------------------------------------------------------------- -SET (CMAKE_MODULE_PATH ${HDF5_RESOURCES_DIR} ${CMAKE_MODULE_PATH}) -OPTION (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF) -IF (HDF5_ENABLE_PARALLEL) - INCLUDE (FindMPI) +set (CMAKE_MODULE_PATH ${HDF5_RESOURCES_DIR} ${CMAKE_MODULE_PATH}) +option (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF) +if (HDF5_ENABLE_PARALLEL) + include (FindMPI) INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_PATH}) - IF (MPI_C_FOUND) - SET (H5_HAVE_PARALLEL 1) + if (MPI_C_FOUND) + set (H5_HAVE_PARALLEL 1) # MPI checks, only do these if MPI_C_FOUND is true, otherwise they always fail # and once set, they are cached as false and not regenerated - SET (CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}" ) + 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) + 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) - ELSE (MPI_C_FOUND) - MESSAGE (STATUS "Parallel libraries not found") - ENDIF (MPI_C_FOUND) -ENDIF (HDF5_ENABLE_PARALLEL) + else (MPI_C_FOUND) + message (STATUS "Parallel libraries not found") + endif (MPI_C_FOUND) +endif (HDF5_ENABLE_PARALLEL) # Parallel IO usage requires MPI to be Linked and Included -IF (H5_HAVE_PARALLEL) - SET (LINK_LIBS ${LINK_LIBS} ${MPI_C_LIBRARIES}) - IF (MPI_C_LINK_FLAGS) - SET (CMAKE_EXE_LINKER_FLAGS ${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}) - ENDIF (MPI_C_LINK_FLAGS) -ENDIF (H5_HAVE_PARALLEL) +if (H5_HAVE_PARALLEL) + set (LINK_LIBS ${LINK_LIBS} ${MPI_C_LIBRARIES}) + if (MPI_C_LINK_FLAGS) + set (CMAKE_EXE_LINKER_FLAGS "${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") + endif (MPI_C_LINK_FLAGS) +endif (H5_HAVE_PARALLEL) -SET (DEFAULT_API_VERSION "v110") +set (DEFAULT_API_VERSION "v110") #----------------------------------------------------------------------------- # Option to use 1.6.x API #----------------------------------------------------------------------------- -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) +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) #----------------------------------------------------------------------------- # Option to use 1.8.x API #----------------------------------------------------------------------------- -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) +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) #----------------------------------------------------------------------------- # Include user macros #----------------------------------------------------------------------------- -INCLUDE (UserMacros.cmake) +include (UserMacros.cmake) -INCLUDE (CMakeFilters.cmake) +include (CMakeFilters.cmake) #----------------------------------------------------------------------------- # Option for external libraries on windows #----------------------------------------------------------------------------- -OPTION (HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF) -IF (NOT HDF5_EXTERNALLY_CONFIGURED) - IF (HDF5_PACKAGE_EXTLIBS) - SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) - IF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) +option (HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF) +if (NOT HDF5_EXTERNALLY_CONFIGURED) + if (HDF5_PACKAGE_EXTLIBS) + set (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) + if (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) PACKAGE_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) - ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) + endif (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) - IF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) + if (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) PACKAGE_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) - ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) - ENDIF (HDF5_PACKAGE_EXTLIBS) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) + endif (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) + endif (HDF5_PACKAGE_EXTLIBS) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Option to use threadsafe # Note: Currently CMake only allows configuring of threadsafe on WINDOWS. #----------------------------------------------------------------------------- -IF (WIN32 AND NOT CYGWIN) - OPTION (HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF) - IF (HDF5_ENABLE_THREADSAFE) +if (WIN32 AND NOT CYGWIN) + option (HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF) + if (HDF5_ENABLE_THREADSAFE) # check for unsupported options - IF (HDF5_ENABLE_PARALLEL) - MESSAGE (FATAL_ERROR " **** Parallel and Threadsafe options are mutually exclusive **** ") - ENDIF (HDF5_ENABLE_PARALLEL) - SET (H5_HAVE_THREADSAFE 1) - IF (H5_HAVE_IOEO) - MESSAGE (STATUS " **** Windows Threads only available in WINVER>=0x600 (Vista or Windows 7) **** ") - SET (H5_HAVE_WIN_THREADS 1) - ELSE (H5_HAVE_IOEO) - IF (NOT H5_HAVE_PTHREAD_H) - SET (H5_HAVE_THREADSAFE 0) - MESSAGE (FATAL_ERROR " **** Threadsafe option requires thread library **** ") - ENDIF (NOT H5_HAVE_PTHREAD_H) - ENDIF (H5_HAVE_IOEO) - ENDIF (HDF5_ENABLE_THREADSAFE) -ENDIF (WIN32 AND NOT CYGWIN) + if (HDF5_ENABLE_PARALLEL) + message (FATAL_ERROR " **** Parallel and Threadsafe options are mutually exclusive **** ") + endif (HDF5_ENABLE_PARALLEL) + set (H5_HAVE_THREADSAFE 1) + if (H5_HAVE_IOEO) + message (STATUS " **** Windows Threads only available in WINVER>=0x600 (Vista or Windows 7) **** ") + set (H5_HAVE_WIN_THREADS 1) + else (H5_HAVE_IOEO) + if (NOT H5_HAVE_PTHREAD_H) + set (H5_HAVE_THREADSAFE 0) + message (FATAL_ERROR " **** Threadsafe option requires thread library **** ") + endif (NOT H5_HAVE_PTHREAD_H) + endif (H5_HAVE_IOEO) + endif (HDF5_ENABLE_THREADSAFE) +endif (WIN32 AND NOT CYGWIN) # ----------------------------------------------------------------------- # wrapper script variables # -#SET (CFLAGS "${C_DEFINES}") -#SET (CXXFLAGS "${CXX_DEFINES}") +#set (CFLAGS "${C_DEFINES}") +#set (CXXFLAGS "${CXX_DEFINES}") #----------------------------------------------------------------------------- # Add the HDF5 Library Target to the build #----------------------------------------------------------------------------- ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src) -IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - IF (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) +if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) ADD_DEPENDENCIES (${HDF5_LIB_TARGET} ZLIB) - ENDIF (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) - IF (SZIP_FOUND AND SZIP_USE_EXTERNAL) + endif (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) + if (SZIP_FOUND AND SZIP_USE_EXTERNAL) ADD_DEPENDENCIES (${HDF5_LIB_TARGET} SZIP) - ENDIF (SZIP_FOUND AND SZIP_USE_EXTERNAL) -ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - -#----------------------------------------------------------------------------- -# Build utility to copy and strip X lines of file -#----------------------------------------------------------------------------- -IF (HDF5_BUILD_TOOLS AND BUILD_TESTING) - SET (XLATE_UTILITY "xlatefile") - ADD_EXECUTABLE(${XLATE_UTILITY} ${HDF5_RESOURCES_DIR}/xlatefile.c) -ENDIF (HDF5_BUILD_TOOLS AND BUILD_TESTING) + endif (SZIP_FOUND AND SZIP_USE_EXTERNAL) +endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") #----------------------------------------------------------------------------- # Dashboard and Testing Settings #----------------------------------------------------------------------------- -OPTION (BUILD_TESTING "Build HDF5 Unit Testing" OFF) -IF (BUILD_TESTING) - SET (DART_TESTING_TIMEOUT 1200 +option (BUILD_TESTING "Build HDF5 Unit Testing" OFF) +if (BUILD_TESTING) + set (DART_TESTING_TIMEOUT 1200 CACHE INTEGER "Timeout in seconds for each test (default 1200=20minutes)" ) ENABLE_TESTING () - INCLUDE (CTest) - IF (NOT HDF5_EXTERNALLY_CONFIGURED) - IF (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") + include (CTest) + if (NOT HDF5_EXTERNALLY_CONFIGURED) + if (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/tools/lib ${PROJECT_BINARY_DIR}/tools/lib) ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/test ${PROJECT_BINARY_DIR}/test) - ENDIF (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") - IF (EXISTS "${HDF5_SOURCE_DIR}/perform" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/perform") + endif (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") + if (EXISTS "${HDF5_SOURCE_DIR}/perform" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/perform") ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/perform ${PROJECT_BINARY_DIR}/perform) ENDIF(EXISTS "${HDF5_SOURCE_DIR}/perform" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/perform") - IF (H5_HAVE_PARALLEL) - IF (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") + if (H5_HAVE_PARALLEL) + if (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/testpar ${PROJECT_BINARY_DIR}/testpar) - ENDIF (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") - ENDIF (H5_HAVE_PARALLEL) - ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) + endif (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") + endif (H5_HAVE_PARALLEL) + endif (NOT HDF5_EXTERNALLY_CONFIGURED) - OPTION (HDF5_TEST_VFD "Execute tests with different VFDs" OFF) + option (HDF5_TEST_VFD "Execute tests with different VFDs" OFF) MARK_AS_ADVANCED (HDF5_TEST_VFD) - IF (HDF5_TEST_VFD) - OPTION (HDF5_TEST_FHEAP_VFD "Execute tests with different VFDs" ON) + if (HDF5_TEST_VFD) + option (HDF5_TEST_FHEAP_VFD "Execute tests with different VFDs" ON) MARK_AS_ADVANCED (HDF5_TEST_FHEAP_VFD) - ENDIF (HDF5_TEST_VFD) + endif (HDF5_TEST_VFD) - INCLUDE (${HDF5_SOURCE_DIR}/CTestConfig.cmake) - CONFIGURE_FILE (${HDF5_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY) -ENDIF (BUILD_TESTING) + include (${HDF5_SOURCE_DIR}/CTestConfig.cmake) + configure_file (${HDF5_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY) +endif (BUILD_TESTING) #----------------------------------------------------------------------------- # Option to build Fortran bindings/tests/examples @@ -810,88 +808,88 @@ ENDIF (BUILD_TESTING) # so that fortran name mangling is detected before writing H5pubconf.h #----------------------------------------------------------------------------- # Set default name mangling : overridden by Fortran detection in fortran dir -SET (H5_FC_FUNC "H5_FC_FUNC(name,NAME) name ## _") -SET (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _") -IF (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") - OPTION (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF) - IF (HDF5_BUILD_FORTRAN) - IF (BUILD_SHARED_LIBS AND APPLE) - MESSAGE (FATAL_ERROR " **** Shared FORTRAN libraries are unsupported **** ") - ENDIF (BUILD_SHARED_LIBS AND APPLE) - OPTION (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" OFF) - INCLUDE (${HDF5_RESOURCES_DIR}/HDF5UseFortran.cmake) - IF (HDF5_ENABLE_F2003) - IF (NOT FORTRAN_HAVE_ISO_C_BINDING) - SET (HDF5_ENABLE_F2003 OFF) - ENDIF (NOT FORTRAN_HAVE_ISO_C_BINDING) - ENDIF (HDF5_ENABLE_F2003) +set (H5_FC_FUNC "H5_FC_FUNC(name,NAME) name ## _") +set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _") +if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") + option (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF) + if (HDF5_BUILD_FORTRAN) + if (BUILD_SHARED_LIBS AND APPLE) + message (FATAL_ERROR " **** Shared FORTRAN libraries are unsupported **** ") + endif (BUILD_SHARED_LIBS AND APPLE) + option (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" OFF) + include (${HDF5_RESOURCES_DIR}/HDF5UseFortran.cmake) + if (HDF5_ENABLE_F2003) + if (NOT FORTRAN_HAVE_ISO_C_BINDING) + set (HDF5_ENABLE_F2003 OFF) + endif (NOT FORTRAN_HAVE_ISO_C_BINDING) + endif (HDF5_ENABLE_F2003) # ----------------------------------------------------------------------- # wrapper script variables # -# SET (FCFLAGS "${Fortran_DEFINES}") +# set (FCFLAGS "${Fortran_DEFINES}") ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/fortran ${PROJECT_BINARY_DIR}/fortran) - IF (HDF5_BUILD_HL_LIB) - IF (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") + if (HDF5_BUILD_HL_LIB) + if (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") #-- Build the High Level Fortran source codes ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/hl/fortran ${PROJECT_BINARY_DIR}/hl/fortran) - ENDIF (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") - ENDIF (HDF5_BUILD_HL_LIB) - ENDIF (HDF5_BUILD_FORTRAN) -ENDIF (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") + endif (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") + endif (HDF5_BUILD_HL_LIB) + endif (HDF5_BUILD_FORTRAN) +endif (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") #----------------------------------------------------------------------------- # Option to build examples #----------------------------------------------------------------------------- -IF (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") - OPTION (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" OFF) - IF (HDF5_BUILD_EXAMPLES) +if (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") + option (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" OFF) + if (HDF5_BUILD_EXAMPLES) ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/examples ${PROJECT_BINARY_DIR}/examples) - ENDIF (HDF5_BUILD_EXAMPLES) -ENDIF (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") + endif (HDF5_BUILD_EXAMPLES) +endif (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") #----------------------------------------------------------------------------- # Option to build HDF5 C++ Library #----------------------------------------------------------------------------- -IF (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") - OPTION (HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF) - IF (HDF5_BUILD_CPP_LIB) +if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") + option (HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF) + if (HDF5_BUILD_CPP_LIB) # check for unsupported options - IF (HDF5_ENABLE_PARALLEL) - MESSAGE (FATAL_ERROR " **** 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) + if (HDF5_ENABLE_PARALLEL) + message (FATAL_ERROR " **** 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++") + endif (HDF5_BUILD_CPP_LIB) +endif (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") #----------------------------------------------------------------------------- # Option to build HDF5 Tools #----------------------------------------------------------------------------- -IF (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") - OPTION (HDF5_BUILD_TOOLS "Build HDF5 Tools" OFF) - IF (HDF5_BUILD_TOOLS) +if (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") + option (HDF5_BUILD_TOOLS "Build HDF5 Tools" OFF) + if (HDF5_BUILD_TOOLS) ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools) - ENDIF (HDF5_BUILD_TOOLS) -ENDIF (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") + endif (HDF5_BUILD_TOOLS) +endif (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") #----------------------------------------------------------------------------- # Option to build High Level API's #----------------------------------------------------------------------------- -IF (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") - OPTION (HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" OFF) - IF (HDF5_BUILD_HL_LIB) - SET (H5_INCLUDE_HL 1) +if (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") + option (HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" OFF) + if (HDF5_BUILD_HL_LIB) + set (H5_INCLUDE_HL 1) ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/hl ${PROJECT_BINARY_DIR}/hl) - ENDIF (HDF5_BUILD_HL_LIB) -ENDIF (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") + endif (HDF5_BUILD_HL_LIB) +endif (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") #----------------------------------------------------------------------------- # Generate the H5pubconf.h file containing user settings needed by compilation #----------------------------------------------------------------------------- -CONFIGURE_FILE (${HDF5_RESOURCES_DIR}/H5pubconf.h.in ${HDF5_BINARY_DIR}/H5pubconf.h @ONLY) +configure_file (${HDF5_RESOURCES_DIR}/H5pubconf.h.in ${HDF5_BINARY_DIR}/H5pubconf.h @ONLY) -INCLUDE (CMakeInstallation.cmake) +include (CMakeInstallation.cmake) diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 92bd300..0e00427 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -4,28 +4,28 @@ ## # The following are required to uses Dart and the Cdash dashboard ## ENABLE_TESTING() ## INCLUDE(CTest) -SET (CTEST_PROJECT_NAME "HDF5") -SET (CTEST_NIGHTLY_START_TIME "18:00:00 CST") +set (CTEST_PROJECT_NAME "HDF5") +set (CTEST_NIGHTLY_START_TIME "18:00:00 CST") -SET (CTEST_DROP_METHOD "http") -IF (CDASH_LOCAL) - SET (CTEST_DROP_SITE "72.36.68.252") - SET (CTEST_DROP_LOCATION "/submit.php?project=HDF5Trunk") -ELSE (CDASH_LOCAL) - SET (CTEST_DROP_SITE "cdash.hdfgroup.uiuc.edu") - SET (CTEST_DROP_LOCATION "/submit.php?project=HDF5+Trunk") -ENDIF (CDASH_LOCAL) -SET (CTEST_DROP_SITE_CDASH TRUE) +set (CTEST_DROP_METHOD "http") +if (CDASH_LOCAL) + set (CTEST_DROP_SITE "72.36.68.252") + set (CTEST_DROP_LOCATION "/submit.php?project=HDF5Trunk") +else (CDASH_LOCAL) + set (CTEST_DROP_SITE "cdash.hdfgroup.uiuc.edu") + set (CTEST_DROP_LOCATION "/submit.php?project=HDF5+Trunk") +endif (CDASH_LOCAL) +set (CTEST_DROP_SITE_CDASH TRUE) -SET (UPDATE_TYPE svn) -SET (VALGRIND_COMMAND "/usr/bin/valgrind") -SET (VALGRIND_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe") -SET (CTEST_MEMORYCHECK_COMMAND "/usr/bin/valgrind") -SET (CTEST_MEMORYCHECK_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe") +set (UPDATE_TYPE svn) +set (VALGRIND_COMMAND "/usr/bin/valgrind") +set (VALGRIND_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe") +set (CTEST_MEMORYCHECK_COMMAND "/usr/bin/valgrind") +set (CTEST_MEMORYCHECK_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe") -SET (CTEST_TEST_TIMEOUT 3600 CACHE STRING +set (CTEST_TEST_TIMEOUT 3600 CACHE STRING "Maximum time allowed before CTest will kill the test.") -SET (DART_TESTING_TIMEOUT 3600 CACHE STRING +set (DART_TESTING_TIMEOUT 3600 CACHE STRING "Maximum time allowed before CTest will kill the test." FORCE) SET(CTEST_SUBMIT_RETRY_DELAY 20 CACHE STRING @@ -921,8 +921,8 @@ ./src/H5Tvlen.c ./src/H5TS.c ./src/H5TSprivate.h -./src/H5V.c -./src/H5Vprivate.h +./src/H5VM.c +./src/H5VMprivate.h ./src/H5WB.c ./src/H5WBprivate.h ./src/H5Z.c @@ -2249,7 +2249,6 @@ ./hl/src/Makefile.am ./hl/src/Makefile.in ./hl/src/H5DO.c -./hl/src/H5DOprivate.h ./hl/src/H5DOpublic.h ./hl/src/H5DS.c ./hl/src/H5DSprivate.h @@ -2425,7 +2424,6 @@ ./config/cmake/GetTimeOfDayTest.cpp ./config/cmake/HDF5CXXTests.cpp ./config/cmake/HDF5Tests.c -./config/cmake/xlatefile.c ./config/cmake/CheckTypeSize.cmake ./config/cmake/H5cxx_config.h.in ./config/cmake/H5pubconf.h.in @@ -2448,11 +2446,15 @@ ./config/cmake/vfdTest.cmake ./config/cmake/CTestCustom.cmake ./config/cmake/ConfigureChecks.cmake -./config/cmake/CPack.cmake ./config/cmake/CPack.Info.plist.in -./config/cmake/hdf.gif +./config/cmake/hdf.bmp +./config/cmake/hdf.icns +./config/cmake/hdf.ico +./config/cmake/PkgInfo.in +./config/cmake/version.plist.in ./config/cmake/NSIS.template.in ./config/cmake/NSIS.InstallOptions.ini.in +./config/cmake/README.txt.cmake.in # CMake-specific User Files ./config/cmake/UserMacros/Windows_MT.cmake @@ -1,4 +1,4 @@ -HDF5 version 1.9.170 currently under development +HDF5 version 1.9.175 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/UserMacros.cmake b/UserMacros.cmake index 4c680ed..65ea5d4 100644 --- a/UserMacros.cmake +++ b/UserMacros.cmake @@ -8,14 +8,14 @@ # Option to Build with User Defined Values #----------------------------------------------------------------------------- MACRO (MACRO_USER_DEFINED_LIBS) - SET (USER_DEFINED_VALUE "FALSE") + set (USER_DEFINED_VALUE "FALSE") ENDMACRO (MACRO_USER_DEFINED_LIBS) #------------------------------------------------------------------------------- -OPTION (BUILD_USER_DEFINED_LIBS "Build With User Defined Values" OFF) -IF (BUILD_USER_DEFINED_LIBS) +option (BUILD_USER_DEFINED_LIBS "Build With User Defined Values" OFF) +if (BUILD_USER_DEFINED_LIBS) MACRO_USER_DEFINED_LIBS () -ENDIF (BUILD_USER_DEFINED_LIBS) +endif (BUILD_USER_DEFINED_LIBS) #----------------------------------------------------------------------------- #------------------- E X A M P L E E N D ----------------------------------- #----------------------------------------------------------------------------- diff --git a/bin/cmakehdf5 b/bin/cmakehdf5 index 97f45ed..1150994 100755 --- a/bin/cmakehdf5 +++ b/bin/cmakehdf5 @@ -3,13 +3,127 @@ # Author: Allen Byrne # Albert Cheng # Creation Date: Nov 2012 +# Modified: +# Changed to use the quick steps described in INSTALL_CMake.txt. (AKC 2014/1/1) -# Copyright: The HDF Group, 2012 +# Copyright: The HDF Group, 2012-14 -# Debug: remove the comment hash if you want DPRINT to do echo +# Debug Print: remove the comment hash if you want DPRINT to do echo DPRINT=: #DPRINT=echo +# use the ctest scripting method if --script is given +if [ "$1" != "--script" ]; then +# variable names +# The "extra" number is the step number and easier to see all logfiles in +# the sorted order of steps +progname=`basename $0` # program name +configlog="#${progname}_1config.log" +makelog="#${progname}_2build.log" +testlog="#${progname}_3test.log" +packlog="#${progname}_4pack.log" +installlog="#${progname}_5install.log" +srcdir="../hdf5" # expected source directory +exit_code=0 + +#============= +# Function definitions +#============= + +# Show user help page +HELP() +{ + echo "Usage: $progname [--script]" + echo " --script: Use the ctest scripting method of $progname" + echo "" +} + +# Display a time stamp +TIMESTAMP() +{ + echo "=====" "`date`" "=====" +} + + +# Do one step bracketed with time stamps +# The '< /dev/null' is needed to prevent some applications like MPI +# jobs blocked for reading when they read stdin unnecessary. +# $1 is banner message to be displayed. +# $2 is command to run +# $3 is logfile name for saving output from the command +STEP() +{ + banner="$1" + command="$2" + logfile="$3" + + echo "$banner" with output saved in $logfile + (TIMESTAMP; nerror=0 ; + echo "eval $command" + eval $command || nerror=1 ; + TIMESTAMP; exit $nerror) < /dev/null >> "$logfile" 2>&1 + if [ $? -ne 0 ]; then + echo "error in '$banner'. $progname aborted." + exit 1 + fi +} + + +#========== +# main +#========== + +# Show a start time stamp +TIMESTAMP + +# Always display the help page +HELP + +# Verify there is a valid hdf5 source directory present +if [ ! -d $srcdir ]; then + echo $srcdir not found. Aborted. + exit 1 +fi + +# figure out version information +vers=bin/h5vers +if [ ! -x $srcdir/$vers ]; then + echo $srcdir/$vers not found or not executable. Aborted. + exit 1 +fi +version=`cd $srcdir; $vers` +if [ $? != 0 ]; then + echo $vers failed. Aborted. + exit 1 +fi +echo Running Cmake for HDF5-${version} ... + +# 4. Configure the C library, tools and tests with this command: +STEP "Configure..." "cmake -G 'Unix Makefiles' -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ../hdf5" $configlog + +# 3. Build the C library, tools and tests with this command: +STEP "Build the library, tools and tests, ..." "cmake --build . --config Release" $makelog + +# 4. Test the C library and tools with this command: +STEP "Test the library and tools..." "ctest . -C Release" $testlog + +# 5. Create an install image with this command: +STEP "Create an install image..." "cpack -C Release CPackConfig.cmake" $packlog + +# 6. Install with this command: +STEP "Install..." "./HDF5-${version}-Linux.sh --skip-license" $installlog +# save the last exit code +exit_code=$? + +# Show a closing time stamp +TIMESTAMP +exit $exit_code + +else +# --------------- +# older version +# --------------- + # variable names progname=`basename $0` # program name cminfile="cmakemin.$$" # Cmake minimum file @@ -172,8 +286,8 @@ set($ENV{LC_MESSAGES} "en_EN") #----------------------------------------------------------------------------- # Initialize the CTEST commands #------------------------------ -SET (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") -SET (CTEST_CONFIGURE_COMMAND +set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") +set (CTEST_CONFIGURE_COMMAND "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"") # Print summary information. @@ -260,3 +374,6 @@ else fi TIMESTAMP exit $exit_code + +fi + diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index 50ea838..c1de616 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -1,24 +1,24 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_CPP) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Shared/Static Libs #----------------------------------------------------------------------------- -IF (BUILD_SHARED_LIBS) - SET (CPP_BUILT_AS_DYNAMIC_LIB 1) -ELSE (BUILD_SHARED_LIBS) - SET (CPP_BUILT_AS_STATIC_LIB 1) -ENDIF (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) + set (CPP_BUILT_AS_DYNAMIC_LIB 1) +else (BUILD_SHARED_LIBS) + set (CPP_BUILT_AS_STATIC_LIB 1) +endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # Generate configure file #----------------------------------------------------------------------------- -CONFIGURE_FILE (${HDF5_RESOURCES_DIR}/H5cxx_config.h.in +configure_file (${HDF5_RESOURCES_DIR}/H5cxx_config.h.in ${HDF5_BINARY_DIR}/H5cxx_pubconf.h ) @@ -31,23 +31,23 @@ INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR}) #----------------------------------------------------------------------------- # Parallel/MPI, prevent spurious cpp/cxx warnings #----------------------------------------------------------------------------- -IF (H5_HAVE_PARALLEL) - ADD_DEFINITIONS ("-DMPICH_SKIP_MPICXX") - ADD_DEFINITIONS ("-DMPICH_IGNORE_CXX_SEEK") -ENDIF (H5_HAVE_PARALLEL) +if (H5_HAVE_PARALLEL) + add_definitions ("-DMPICH_SKIP_MPICXX") + add_definitions ("-DMPICH_IGNORE_CXX_SEEK") +endif (H5_HAVE_PARALLEL) ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src) #----------------------------------------------------------------------------- # Build the CPP Examples #----------------------------------------------------------------------------- -IF (HDF5_BUILD_EXAMPLES) +if (HDF5_BUILD_EXAMPLES) ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/examples ${HDF5_CPP_BINARY_DIR}/examples) -ENDIF (HDF5_BUILD_EXAMPLES) +endif (HDF5_BUILD_EXAMPLES) #----------------------------------------------------------------------------- # Build the CPP unit tests #----------------------------------------------------------------------------- -IF (BUILD_TESTING) +if (BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/test ${HDF5_CPP_BINARY_DIR}/test) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index c79f6c2..e3e1077 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed # with "cpp_ex_". This allows for easier filtering of the examples. @@ -10,7 +10,7 @@ PROJECT (HDF5_CPP_EXAMPLES) # Define examples #----------------------------------------------------------------------------- -SET (examples +set (examples create readdata writedata @@ -20,7 +20,7 @@ SET (examples h5group ) -SET (tutr_examples +set (tutr_examples h5tutr_cmprss h5tutr_crtdat h5tutr_crtatt @@ -32,22 +32,22 @@ SET (tutr_examples h5tutr_subset ) -FOREACH (example ${examples}) - ADD_EXECUTABLE (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) +foreach (example ${examples}) + add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) TARGET_NAMING (cpp_ex_${example} ${LIB_TYPE}) TARGET_C_PROPERTIES (cpp_ex_${example} " " " ") - TARGET_LINK_LIBRARIES (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) -ENDFOREACH (example ${examples}) + target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) +endforeach (example ${examples}) -FOREACH (example ${tutr_examples}) - ADD_EXECUTABLE (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) +foreach (example ${tutr_examples}) + add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) TARGET_NAMING (cpp_ex_${example} ${LIB_TYPE}) TARGET_C_PROPERTIES (cpp_ex_${example} " " " ") - TARGET_LINK_LIBRARIES (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) -ENDFOREACH (example ${tutr_examples}) + target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) +endforeach (example ${tutr_examples}) -IF (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +if (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) diff --git a/c++/examples/CMakeTests.cmake b/c++/examples/CMakeTests.cmake index b39dcfe..352b799 100644 --- a/c++/examples/CMakeTests.cmake +++ b/c++/examples/CMakeTests.cmake @@ -5,7 +5,7 @@ ############################################################################## ############################################################################## # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME cpp_ex-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -15,23 +15,23 @@ SDSextendible.h5 Select.h5 ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (cpp_ex-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "cpp_ex-clear-objects") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (cpp_ex-clear-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "cpp_ex-clear-objects") - FOREACH (example ${examples}) - ADD_TEST (NAME cpp_ex_${example} COMMAND $<TARGET_FILE:cpp_ex_${example}>) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (cpp_ex_${example} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "cpp_ex_${example}") - ENDFOREACH (example ${examples}) + foreach (example ${examples}) + add_test (NAME cpp_ex_${example} COMMAND $<TARGET_FILE:cpp_ex_${example}>) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (cpp_ex_${example} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "cpp_ex_${example}") + endforeach (example ${examples}) #the following dependicies are handled by the order of the files # SET_TESTS_PROPERTIES(cpp_ex_readdata PROPERTIES DEPENDS cpp_ex_create) # SET_TESTS_PROPERTIES(cpp_ex_chunks PROPERTIES DEPENDS cpp_ex_extend_ds) - ADD_TEST ( + add_test ( NAME cpp_ex_tutr-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -42,18 +42,18 @@ h5tutr_groups.h5 h5tutr_subset.h5 ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (cpp_ex_tutr-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "cpp_ex_tutr-clear-objects") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (cpp_ex_tutr-clear-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "cpp_ex_tutr-clear-objects") - FOREACH (example ${tutr_examples}) - ADD_TEST (NAME cpp_ex_${example} COMMAND $<TARGET_FILE:cpp_ex_${example}>) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (cpp_ex_${example} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "cpp_ex_${example}") - ENDFOREACH (example ${tutr_examples}) + foreach (example ${tutr_examples}) + add_test (NAME cpp_ex_${example} COMMAND $<TARGET_FILE:cpp_ex_${example}>) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (cpp_ex_${example} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "cpp_ex_${example}") + endforeach (example ${tutr_examples}) #the following dependicies are handled by the order of the files # SET_TESTS_PROPERTIES(cpp_ex_h5tutr_crtatt PROPERTIES DEPENDS cpp_ex_h5tutr_crtdat) # SET_TESTS_PROPERTIES(cpp_ex_h5tutr_rdwt PROPERTIES DEPENDS cpp_ex_h5tutr_crtdat) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index e7ae371..7054b04 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -1,24 +1,24 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_CPP_SRC) #----------------------------------------------------------------------------- # Shared/Static Libs #----------------------------------------------------------------------------- -IF (BUILD_SHARED_LIBS) - SET (CPP_BUILT_AS_DYNAMIC_LIB 1) -ENDIF (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) + set (CPP_BUILT_AS_DYNAMIC_LIB 1) +endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # Generate configure file #----------------------------------------------------------------------------- -CONFIGURE_FILE (${HDF5_RESOURCES_DIR}/H5cxx_config.h.in +configure_file (${HDF5_RESOURCES_DIR}/H5cxx_config.h.in ${HDF5_BINARY_DIR}/H5cxx_pubconf.h ) #----------------------------------------------------------------------------- # Define cpp Library #----------------------------------------------------------------------------- -SET (CPP_SRCS +set (CPP_SRCS ${HDF5_CPP_SRC_SOURCE_DIR}/H5AbstractDs.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5ArrayType.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5AtomType.cpp @@ -48,7 +48,7 @@ SET (CPP_SRCS ${HDF5_CPP_SRC_SOURCE_DIR}/H5VarLenType.cpp ) -SET (CPP_HDRS +set (CPP_HDRS ${HDF5_CPP_SRC_SOURCE_DIR}/H5AbstractDs.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5Alltypes.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5ArrayType.h @@ -83,17 +83,17 @@ SET (CPP_HDRS ${HDF5_CPP_SRC_SOURCE_DIR}/H5VarLenType.h ) -ADD_LIBRARY (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} ${CPP_SRCS} ${CPP_HDRS}) +add_library (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} ${CPP_SRCS} ${CPP_HDRS}) TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}") +target_link_libraries (${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/cpp) +set_target_properties (${HDF5_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/cpp) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -INSTALL ( +install ( FILES ${CPP_HDRS} DESTINATION @@ -105,11 +105,12 @@ 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) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) + INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} cpplibraries) + endif (BUILD_SHARED_LIBS) - INSTALL ( + install ( TARGETS ${HDF5_CPP_LIB_TARGET} EXPORT @@ -118,4 +119,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT cpplibraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT cpplibraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index ef8094d..dfc3167 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -469,7 +469,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 160 +LT_VERS_REVISION = 165 LT_VERS_AGE = 0 # Include src directory diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index e498fc5..9966163 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_CPP_TEST) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed @@ -11,7 +11,7 @@ PROJECT (HDF5_CPP_TEST) #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -SET (CPP_TEST_SRCS +set (CPP_TEST_SRCS ${HDF5_CPP_TEST_SOURCE_DIR}/testhdf5.cpp ${HDF5_CPP_TEST_SOURCE_DIR}/tattr.cpp ${HDF5_CPP_TEST_SOURCE_DIR}/tcompound.cpp @@ -29,27 +29,27 @@ SET (CPP_TEST_SRCS #----------------------------------------------------------------------------- # Generate the H5srcdir_str.h file containing user settings needed by compilation #----------------------------------------------------------------------------- -SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) -CONFIGURE_FILE (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) -INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) +set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) +configure_file (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) -INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR} ) - -ADD_EXECUTABLE (cpp_testhdf5 ${CPP_TEST_SRCS} ) +add_executable (cpp_testhdf5 ${CPP_TEST_SRCS} ) TARGET_NAMING (cpp_testhdf5 ${LIB_TYPE}) TARGET_C_PROPERTIES (cpp_testhdf5 " " " ") -TARGET_LINK_LIBRARIES (cpp_testhdf5 +target_link_libraries (cpp_testhdf5 ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ) -SET_TARGET_PROPERTIES (cpp_testhdf5 PROPERTIES FOLDER test/cpp) +set_target_properties (cpp_testhdf5 PROPERTIES + FOLDER test/cpp + INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" +) -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET cpp_testhdf5 POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_CPP_TEST_SOURCE_DIR}/th5s.h5 ${PROJECT_BINARY_DIR}/th5s.h5 ) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/c++/test/CMakeTests.cmake b/c++/test/CMakeTests.cmake index 3e4f6d9..2b05fea 100644 --- a/c++/test/CMakeTests.cmake +++ b/c++/test/CMakeTests.cmake @@ -5,7 +5,7 @@ ############################################################################## ############################################################################## # Remove any output file left over from previous test run -ADD_TEST ( +add_test ( NAME cpp_testhdf5-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -17,12 +17,12 @@ ADD_TEST ( tfattrs.h5 ) -ADD_TEST (NAME cpp_testhdf5 COMMAND $<TARGET_FILE:cpp_testhdf5>) -SET_TESTS_PROPERTIES (cpp_testhdf5 PROPERTIES DEPENDS cpp_testhdf5-clear-objects) +add_test (NAME cpp_testhdf5 COMMAND $<TARGET_FILE:cpp_testhdf5>) +set_tests_properties (cpp_testhdf5 PROPERTIES DEPENDS cpp_testhdf5-clear-objects) -IF (HDF5_TEST_VFD) +if (HDF5_TEST_VFD) - SET (VFD_LIST + set (VFD_LIST sec2 stdio core @@ -31,13 +31,13 @@ IF (HDF5_TEST_VFD) family ) - IF (DIRECT_VFD) - SET (VFD_LIST ${VFD_LIST} direct) - ENDIF (DIRECT_VFD) + if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) + endif (DIRECT_VFD) MACRO (ADD_VFD_TEST vfdname resultcode) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME VFD-${vfdname}-cpp_testhdf5-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -48,7 +48,7 @@ IF (HDF5_TEST_VFD) tattr_scalar.h5 tfattrs.h5 ) - ADD_TEST ( + add_test ( NAME VFD-${vfdname}-cpp_testhdf5 COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:cpp_testhdf5>" @@ -59,13 +59,13 @@ IF (HDF5_TEST_VFD) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" ) - SET_TESTS_PROPERTIES (VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS VFD-${vfdname}-cpp_testhdf5-clear-objects) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS VFD-${vfdname}-cpp_testhdf5-clear-objects) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_VFD_TEST) # Run test with different Virtual File Driver - FOREACH (vfd ${VFD_LIST}) + foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - ENDFOREACH (vfd ${VFD_LIST}) + endforeach (vfd ${VFD_LIST}) -ENDIF (HDF5_TEST_VFD) +endif (HDF5_TEST_VFD) diff --git a/config/cmake/CPack.cmake b/config/cmake/CPack.cmake deleted file mode 100644 index bdfa5b8..0000000 --- a/config/cmake/CPack.cmake +++ /dev/null @@ -1,588 +0,0 @@ -##section Variables common to all CPack generators -##end -##module -# - Build binary and source package installers. -# The CPack module generates binary and source installers in a variety -# of formats using the cpack program. Inclusion of the CPack module -# adds two new targets to the resulting makefiles, package and -# package_source, which build the binary and source installers, -# respectively. The generated binary installers contain everything -# installed via CMake's INSTALL command (and the deprecated -# INSTALL_FILES, INSTALL_PROGRAMS, and INSTALL_TARGETS commands). -# -# For certain kinds of binary installers (including the graphical -# installers on Mac OS X and Windows), CPack generates installers that -# allow users to select individual application components to -# install. See CPackComponent module for that. -# -# The CPACK_GENERATOR variable has different meanings in different -# contexts. In your CMakeLists.txt file, CPACK_GENERATOR is a -# *list of generators*: when run with no other arguments, CPack -# will iterate over that list and produce one package for each -# generator. In a CPACK_PROJECT_CONFIG_FILE, though, CPACK_GENERATOR -# is a *string naming a single generator*. If you need per-cpack- -# generator logic to control *other* cpack settings, then you need -# a CPACK_PROJECT_CONFIG_FILE. -# -# The CMake source tree itself contains a CPACK_PROJECT_CONFIG_FILE. -# See the top level file CMakeCPackOptions.cmake.in for an example. -# -# If set, the CPACK_PROJECT_CONFIG_FILE is included automatically -# on a per-generator basis. It only need contain overrides. -# -# Here's how it works: -# - cpack runs -# - it includes CPackConfig.cmake -# - it iterates over the generators listed in that file's -# CPACK_GENERATOR list variable (unless told to use just a -# specific one via -G on the command line...) -# -# - foreach generator, it then -# - sets CPACK_GENERATOR to the one currently being iterated -# - includes the CPACK_PROJECT_CONFIG_FILE -# - produces the package for that generator -# -# This is the key: For each generator listed in CPACK_GENERATOR -# in CPackConfig.cmake, cpack will *reset* CPACK_GENERATOR -# internally to *the one currently being used* and then include -# the CPACK_PROJECT_CONFIG_FILE. -# -# Before including this CPack module in your CMakeLists.txt file, -# there are a variety of variables that can be set to customize -# the resulting installers. The most commonly-used variables are: -##end -# -##variable -# CPACK_PACKAGE_NAME - The name of the package (or application). If -# not specified, defaults to the project name. -##end -# -##variable -# CPACK_PACKAGE_VENDOR - The name of the package vendor. (e.g., -# "Kitware"). -##end -# -##variable -# CPACK_PACKAGE_DIRECTORY - The directory in which CPack is doing its -# packaging. If it is not set then this will default (internally) to the -# build dir. This variable may be defined in CPack config file or from -# the cpack command line option "-B". If set the command line option -# override the value found in the config file. -##end -# -##variable -# CPACK_PACKAGE_VERSION_MAJOR - Package major Version -##end -# -##variable -# CPACK_PACKAGE_VERSION_MINOR - Package minor Version -##end -# -##variable -# CPACK_PACKAGE_VERSION_PATCH - Package patch Version -##end -# -##variable -# CPACK_PACKAGE_DESCRIPTION_FILE - A text file used to describe the -# project. Used, for example, the introduction screen of a -# CPack-generated Windows installer to describe the project. -##end -# -##variable -# CPACK_PACKAGE_DESCRIPTION_SUMMARY - Short description of the -# project (only a few words). -##end -# -##variable -# CPACK_PACKAGE_FILE_NAME - The name of the package file to generate, -# not including the extension. For example, cmake-2.6.1-Linux-i686. -# The default value is -# -# ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}. -##end -# -##variable -# CPACK_PACKAGE_INSTALL_DIRECTORY - Installation directory on the -# target system. This may be used by some CPack generators -# like NSIS to create an installation directory e.g., "CMake 2.5" -# below the installation prefix. All installed element will be -# put inside this directory. -##end -# -##variable -# CPACK_PACKAGE_ICON - A branding image that will be displayed inside -# the installer (used by GUI installers). -##end -# -##variable -# CPACK_PROJECT_CONFIG_FILE - CPack-time project CPack configuration -# file. This file included at cpack time, once per -# generator after CPack has set CPACK_GENERATOR to the actual generator -# being used. It allows per-generator setting of CPACK_* variables at -# cpack time. -##end -# -##variable -# CPACK_RESOURCE_FILE_LICENSE - License to be embedded in the installer. It -# will typically be displayed to the user by the produced installer -# (often with an explicit "Accept" button, for graphical installers) -# prior to installation. This license file is NOT added to installed -# file but is used by some CPack generators like NSIS. If you want -# to install a license file (may be the same as this one) -# along with your project you must add an appropriate CMake INSTALL -# command in your CMakeLists.txt. -##end -# -##variable -# CPACK_RESOURCE_FILE_README - ReadMe file to be embedded in the installer. It -# typically describes in some detail the purpose of the project -# during the installation. Not all CPack generators uses -# this file. -##end -# -##variable -# CPACK_RESOURCE_FILE_WELCOME - Welcome file to be embedded in the -# installer. It welcomes users to this installer. -# Typically used in the graphical installers on Windows and Mac OS X. -##end -# -##variable -# CPACK_MONOLITHIC_INSTALL - Disables the component-based -# installation mechanism. When set the component specification is ignored -# and all installed items are put in a single "MONOLITHIC" package. -# Some CPack generators do monolithic packaging by default and -# may be asked to do component packaging by setting -# CPACK_<GENNAME>_COMPONENT_INSTALL to 1/TRUE. -##end -# -##variable -# CPACK_GENERATOR - List of CPack generators to use. If not -# specified, CPack will create a set of options CPACK_BINARY_<GENNAME> (e.g., -# CPACK_BINARY_NSIS) allowing the user to enable/disable individual -# generators. This variable may be used on the command line -# as well as in: -# -# cpack -D CPACK_GENERATOR="ZIP;TGZ" /path/to/build/tree -##end -# -##variable -# CPACK_OUTPUT_CONFIG_FILE - The name of the CPack binary configuration -# file. This file is the CPack configuration generated by the CPack module -# for binary installers. Defaults to CPackConfig.cmake. -##end -# -##variable -# CPACK_PACKAGE_EXECUTABLES - Lists each of the executables and associated -# text label to be used to create Start Menu shortcuts. For example, -# setting this to the list ccmake;CMake will -# create a shortcut named "CMake" that will execute the installed -# executable ccmake. Not all CPack generators use it (at least NSIS and -# OSXX11 do). -##end -# -##variable -# CPACK_STRIP_FILES - List of files to be stripped. Starting with -# CMake 2.6.0 CPACK_STRIP_FILES will be a boolean variable which -# enables stripping of all files (a list of files evaluates to TRUE -# in CMake, so this change is compatible). -##end -# -# The following CPack variables are specific to source packages, and -# will not affect binary packages: -# -##variable -# CPACK_SOURCE_PACKAGE_FILE_NAME - The name of the source package. For -# example cmake-2.6.1. -##end -# -##variable -# CPACK_SOURCE_STRIP_FILES - List of files in the source tree that -# will be stripped. Starting with CMake 2.6.0 -# CPACK_SOURCE_STRIP_FILES will be a boolean variable which enables -# stripping of all files (a list of files evaluates to TRUE in CMake, -# so this change is compatible). -##end -# -##variable -# CPACK_SOURCE_GENERATOR - List of generators used for the source -# packages. As with CPACK_GENERATOR, if this is not specified then -# CPack will create a set of options (e.g., CPACK_SOURCE_ZIP) -# allowing users to select which packages will be generated. -##end -# -##variable -# CPACK_SOURCE_OUTPUT_CONFIG_FILE - The name of the CPack source -# configuration file. This file is the CPack configuration generated by the -# CPack module for source installers. Defaults to CPackSourceConfig.cmake. -##end -# -##variable -# CPACK_SOURCE_IGNORE_FILES - Pattern of files in the source tree -# that won't be packaged when building a source package. This is a -# list of regular expression patterns (that must be properly escaped), -# e.g., /CVS/;/\\.svn/;\\.swp$;\\.#;/#;.*~;cscope.* -##end -# -# The following variables are for advanced uses of CPack: -# -##variable -# CPACK_CMAKE_GENERATOR - What CMake generator should be used if the -# project is CMake project. Defaults to the value of CMAKE_GENERATOR -# few users will want to change this setting. -##end -# -##variable -# CPACK_INSTALL_CMAKE_PROJECTS - List of four values that specify -# what project to install. The four values are: Build directory, -# Project Name, Project Component, Directory. If omitted, CPack will -# build an installer that installers everything. -##end -# -##variable -# CPACK_SYSTEM_NAME - System name, defaults to the value of -# ${CMAKE_SYSTEM_NAME}. -##end -# -##variable -# CPACK_PACKAGE_VERSION - Package full version, used internally. By -# default, this is built from CPACK_PACKAGE_VERSION_MAJOR, -# CPACK_PACKAGE_VERSION_MINOR, and CPACK_PACKAGE_VERSION_PATCH. -##end -# -##variable -# CPACK_TOPLEVEL_TAG - Directory for the installed files. -##end -# -##variable -# CPACK_INSTALL_COMMANDS - Extra commands to install components. -##end -# -##variable -# CPACK_INSTALLED_DIRECTORIES - Extra directories to install. -##end -# -##variable -# CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when -# installing this project. This is only used -# by installer for Windows. -##end -##variable -# CPACK_CREATE_DESKTOP_LINKS - List of desktop links to create. -##end -# - -#============================================================================= -# Copyright 2006-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -# Define this var in order to avoid (or warn) concerning multiple inclusion -if(CPack_CMake_INCLUDED) - message(WARNING "CPack.cmake has already been included!!") -else() - set(CPack_CMake_INCLUDED 1) -endif() - -# Pick a configuration file -set(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in") -if(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in") - set(cpack_input_file "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in") -endif() -set(cpack_source_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in") -if(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in") - set(cpack_source_input_file "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in") -endif() - -# Backward compatibility -# Include CPackComponent macros if it has not already been included before. -include(CPackComponent) - -# Macro for setting values if a user did not overwrite them -macro(cpack_set_if_not_set name value) - if(NOT DEFINED "${name}") - set(${name} "${value}") - endif() -endmacro() - -# cpack_encode_variables - Macro to encode variables for the configuration file -# find any variable that starts with CPACK and create a variable -# _CPACK_OTHER_VARIABLES_ that contains SET commands for -# each cpack variable. _CPACK_OTHER_VARIABLES_ is then -# used as an @ replacment in configure_file for the CPackConfig. -macro(cpack_encode_variables) - set(_CPACK_OTHER_VARIABLES_) - get_cmake_property(res VARIABLES) - foreach(var ${res}) - if("xxx${var}" MATCHES "xxxCPACK") - set(_CPACK_OTHER_VARIABLES_ - "${_CPACK_OTHER_VARIABLES_}\nSET(${var} \"${${var}}\")") - endif() - endforeach() -endmacro() - -# Set the package name -cpack_set_if_not_set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}") -cpack_set_if_not_set(CPACK_PACKAGE_VERSION_MAJOR "0") -cpack_set_if_not_set(CPACK_PACKAGE_VERSION_MINOR "1") -cpack_set_if_not_set(CPACK_PACKAGE_VERSION_PATCH "1") -cpack_set_if_not_set(CPACK_PACKAGE_VERSION - "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") -cpack_set_if_not_set(CPACK_PACKAGE_VENDOR "Humanity") -cpack_set_if_not_set(CPACK_PACKAGE_DESCRIPTION_SUMMARY - "${CMAKE_PROJECT_NAME} built using CMake") - -cpack_set_if_not_set(CPACK_PACKAGE_DESCRIPTION_FILE - "${CMAKE_ROOT}/Templates/CPack.GenericDescription.txt") -cpack_set_if_not_set(CPACK_RESOURCE_FILE_LICENSE - "${CMAKE_ROOT}/Templates/CPack.GenericLicense.txt") -cpack_set_if_not_set(CPACK_RESOURCE_FILE_README - "${CMAKE_ROOT}/Templates/CPack.GenericDescription.txt") -cpack_set_if_not_set(CPACK_RESOURCE_FILE_WELCOME - "${CMAKE_ROOT}/Templates/CPack.GenericWelcome.txt") - -cpack_set_if_not_set(CPACK_MODULE_PATH "${CMAKE_MODULE_PATH}") - -if(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL) - set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON) -endif() - -if(CPACK_NSIS_MODIFY_PATH) - set(CPACK_NSIS_MODIFY_PATH ON) -endif() - -set(__cpack_system_name ${CMAKE_SYSTEM_NAME}) -if(${__cpack_system_name} MATCHES Windows) - if(CMAKE_CL_64) - set(__cpack_system_name win64) - else() - set(__cpack_system_name win32) - endif() -endif() -cpack_set_if_not_set(CPACK_SYSTEM_NAME "${__cpack_system_name}") - -# Root dir: default value should be the string literal "$PROGRAMFILES" -# for backwards compatibility. Projects may set this value to anything. -if(CMAKE_CL_64) -set(__cpack_root_default "$PROGRAMFILES64") -else() -set(__cpack_root_default "$PROGRAMFILES") -endif() -cpack_set_if_not_set(CPACK_NSIS_INSTALL_ROOT "${__cpack_root_default}") - -# <project>-<major>.<minor>.<patch>-<release>-<platform>.<pkgtype> -cpack_set_if_not_set(CPACK_PACKAGE_FILE_NAME - "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}") -cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_DIRECTORY - "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}") -cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY - "${CPACK_PACKAGE_INSTALL_DIRECTORY}") -cpack_set_if_not_set(CPACK_PACKAGE_DEFAULT_LOCATION "/") -cpack_set_if_not_set(CPACK_PACKAGE_RELOCATABLE "true") - -# always force to exactly "true" or "false" for CPack.Info.plist.in: -if(CPACK_PACKAGE_RELOCATABLE) - set(CPACK_PACKAGE_RELOCATABLE "true") -else() - set(CPACK_PACKAGE_RELOCATABLE "false") -endif() - -macro(cpack_check_file_exists file description) - if(NOT EXISTS "${file}") - message(SEND_ERROR "CPack ${description} file: \"${file}\" could not be found.") - endif() -endmacro() - -cpack_check_file_exists("${CPACK_PACKAGE_DESCRIPTION_FILE}" "package description") -cpack_check_file_exists("${CPACK_RESOURCE_FILE_LICENSE}" "license resource") -cpack_check_file_exists("${CPACK_RESOURCE_FILE_README}" "readme resource") -cpack_check_file_exists("${CPACK_RESOURCE_FILE_WELCOME}" "welcome resource") - -macro(cpack_optional_append _list _cond _item) - if(${_cond}) - set(${_list} ${${_list}} ${_item}) - endif() -endmacro() - -##variable -# CPACK_BINARY_<GENNAME> - CPack generated options for binary generators. The -# CPack.cmake module generates (when CPACK_GENERATOR is not set) -# a set of CMake options (see CMake option command) which may then be used to -# select the CPack generator(s) to be used when launching the package target. -##end -# Provide options to choose generators -# we might check here if the required tools for the generates exist -# and set the defaults according to the results -if(NOT CPACK_GENERATOR) - if(UNIX) - if(CYGWIN) - option(CPACK_BINARY_CYGWIN "Enable to build Cygwin binary packages" ON) - else() - if(APPLE) - option(CPACK_BINARY_BUNDLE "Enable to build OSX bundles" OFF) - option(CPACK_BINARY_DRAGNDROP "Enable to build OSX Drag And Drop package" OFF) - option(CPACK_BINARY_PACKAGEMAKER "Enable to build PackageMaker packages" ON) - option(CPACK_BINARY_OSXX11 "Enable to build OSX X11 packages" OFF) - else() - option(CPACK_BINARY_TZ "Enable to build TZ packages" ON) - endif() - option(CPACK_BINARY_STGZ "Enable to build STGZ packages" ON) - option(CPACK_BINARY_TGZ "Enable to build TGZ packages" ON) - option(CPACK_BINARY_TBZ2 "Enable to build TBZ2 packages" OFF) - option(CPACK_BINARY_DEB "Enable to build Debian packages" OFF) - option(CPACK_BINARY_RPM "Enable to build RPM packages" OFF) - option(CPACK_BINARY_NSIS "Enable to build NSIS packages" OFF) - endif() - else() - option(CPACK_BINARY_NSIS "Enable to build NSIS packages" ON) - option(CPACK_BINARY_WIX "Enable to build WiX packages" OFF) - option(CPACK_BINARY_ZIP "Enable to build ZIP packages" OFF) - endif() - - cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_BUNDLE Bundle) - cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_DRAGNDROP DragNDrop) - cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_PACKAGEMAKER PackageMaker) - cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_OSXX11 OSXX11) - cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_CYGWIN CygwinBinary) - cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_DEB DEB) - cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_RPM RPM) - cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_NSIS NSIS) - cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_STGZ STGZ) - cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TGZ TGZ) - cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TBZ2 TBZ2) - cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TZ TZ) - cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_WIX WIX) - cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_ZIP ZIP) - -endif() - -# Provide options to choose source generators -if(NOT CPACK_SOURCE_GENERATOR) - if(UNIX) - if(CYGWIN) - option(CPACK_SOURCE_CYGWIN "Enable to build Cygwin source packages" ON) - else() - option(CPACK_SOURCE_TBZ2 "Enable to build TBZ2 source packages" ON) - option(CPACK_SOURCE_TGZ "Enable to build TGZ source packages" ON) - option(CPACK_SOURCE_TZ "Enable to build TZ source packages" ON) - option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" OFF) - endif() - else() - option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" ON) - endif() - - cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_CYGWIN CygwinSource) - cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TGZ TGZ) - cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TBZ2 TBZ2) - cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TZ TZ) - cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_ZIP ZIP) -endif() - -# mark the above options as advanced -mark_as_advanced(CPACK_BINARY_CYGWIN CPACK_BINARY_PACKAGEMAKER CPACK_BINARY_OSXX11 - CPACK_BINARY_STGZ CPACK_BINARY_TGZ CPACK_BINARY_TBZ2 - CPACK_BINARY_DEB CPACK_BINARY_RPM CPACK_BINARY_TZ - CPACK_BINARY_NSIS CPACK_BINARY_WIX CPACK_BINARY_ZIP CPACK_BINARY_BUNDLE - CPACK_SOURCE_CYGWIN CPACK_SOURCE_TBZ2 CPACK_SOURCE_TGZ - CPACK_SOURCE_TZ CPACK_SOURCE_ZIP CPACK_BINARY_DRAGNDROP) - -# Set some other variables -cpack_set_if_not_set(CPACK_INSTALL_CMAKE_PROJECTS - "${CMAKE_BINARY_DIR};${CMAKE_PROJECT_NAME};ALL;/") -cpack_set_if_not_set(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}") -cpack_set_if_not_set(CPACK_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}") -# if the user has set CPACK_NSIS_DISPLAY_NAME remember it -if(DEFINED CPACK_NSIS_DISPLAY_NAME) - set(CPACK_NSIS_DISPLAY_NAME_SET TRUE) -endif() -# if the user has set CPACK_NSIS_DISPLAY -# explicitly, then use that as the default -# value of CPACK_NSIS_PACKAGE_NAME instead -# of CPACK_PACKAGE_INSTALL_DIRECTORY -cpack_set_if_not_set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}") - -if(CPACK_NSIS_DISPLAY_NAME_SET) - string(REPLACE "\\" "\\\\" - _NSIS_DISPLAY_NAME_TMP "${CPACK_NSIS_DISPLAY_NAME}") - cpack_set_if_not_set(CPACK_NSIS_PACKAGE_NAME "${_NSIS_DISPLAY_NAME_TMP}") -else() - cpack_set_if_not_set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}") -endif() - -cpack_set_if_not_set(CPACK_OUTPUT_CONFIG_FILE - "${CMAKE_BINARY_DIR}/CPackConfig.cmake") - -cpack_set_if_not_set(CPACK_SOURCE_OUTPUT_CONFIG_FILE - "${CMAKE_BINARY_DIR}/CPackSourceConfig.cmake") - -cpack_set_if_not_set(CPACK_SET_DESTDIR OFF) -cpack_set_if_not_set(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") - -cpack_set_if_not_set(CPACK_NSIS_INSTALLER_ICON_CODE "") -cpack_set_if_not_set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "") - -# WiX specific variables -cpack_set_if_not_set(CPACK_WIX_SIZEOF_VOID_P "${CMAKE_SIZEOF_VOID_P}") - -if(DEFINED CPACK_COMPONENTS_ALL) - if(CPACK_MONOLITHIC_INSTALL) - message("CPack warning: both CPACK_COMPONENTS_ALL and CPACK_MONOLITHIC_INSTALL have been set.\nDefaulting to a monolithic installation.") - set(CPACK_COMPONENTS_ALL) - else() - # The user has provided the set of components to be installed as - # part of a component-based installation; trust her. - set(CPACK_COMPONENTS_ALL_SET_BY_USER TRUE) - endif() -else() - # If the user has not specifically requested a monolithic installer - # but has specified components in various "install" commands, tell - # CPack about those components. - if(NOT CPACK_MONOLITHIC_INSTALL) - get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS) - list(LENGTH CPACK_COMPONENTS_ALL CPACK_COMPONENTS_LEN) - if(CPACK_COMPONENTS_LEN EQUAL 1) - # Only one component: this is not a component-based installation - # (at least, it isn't a component-based installation, but may - # become one later if the user uses the cpack_add_* commands). - set(CPACK_COMPONENTS_ALL) - endif() - set(CPACK_COMPONENTS_LEN) - endif() -endif() - -# CMake always generates a component named "Unspecified", which is -# used to install everything that doesn't have an explicitly-provided -# component. Since these files should always be installed, we'll make -# them hidden and required. -set(CPACK_COMPONENT_UNSPECIFIED_HIDDEN TRUE) -set(CPACK_COMPONENT_UNSPECIFIED_REQUIRED TRUE) - -cpack_encode_variables() -configure_file("${cpack_input_file}" "${CPACK_OUTPUT_CONFIG_FILE}" @ONLY IMMEDIATE) - -# Generate source file -cpack_set_if_not_set(CPACK_SOURCE_INSTALLED_DIRECTORIES - "${CMAKE_SOURCE_DIR};/") -cpack_set_if_not_set(CPACK_SOURCE_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}-Source") -cpack_set_if_not_set(CPACK_SOURCE_PACKAGE_FILE_NAME - "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Source") -cpack_set_if_not_set(CPACK_SOURCE_IGNORE_FILES - "/CVS/;/\\\\\\\\.svn/;/\\\\\\\\.bzr/;/\\\\\\\\.hg/;/\\\\\\\\.git/;\\\\\\\\.swp$;\\\\\\\\.#;/#") -set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_SOURCE_INSTALL_CMAKE_PROJECTS}") -set(CPACK_INSTALLED_DIRECTORIES "${CPACK_SOURCE_INSTALLED_DIRECTORIES}") -set(CPACK_GENERATOR "${CPACK_SOURCE_GENERATOR}") -set(CPACK_TOPLEVEL_TAG "${CPACK_SOURCE_TOPLEVEL_TAG}") -set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}") -set(CPACK_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES}") -set(CPACK_STRIP_FILES "${CPACK_SOURCE_STRIP_FILES}") - -cpack_encode_variables() -configure_file("${cpack_source_input_file}" - "${CPACK_SOURCE_OUTPUT_CONFIG_FILE}" @ONLY IMMEDIATE) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index cb32827..6d3f0ee 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -1,6 +1,6 @@ -SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 3000) +set (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 3000) -SET (CTEST_CUSTOM_WARNING_EXCEPTION +set (CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} # "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning C4090:" # "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning:[ \t]*passing argument" @@ -17,7 +17,7 @@ SET (CTEST_CUSTOM_WARNING_EXCEPTION # "fpp:[ \t]*warning:[ \t]*cannot remove H5_DEBUG_API - not a predefined macro" ) -SET (CTEST_CUSTOM_MEMCHECK_IGNORE +set (CTEST_CUSTOM_MEMCHECK_IGNORE ${CTEST_CUSTOM_MEMCHECK_IGNORE} flush1 #designed to fail flush2 #designed to need flush1 diff --git a/config/cmake/CheckTypeSize.cmake b/config/cmake/CheckTypeSize.cmake index eca6e76..0fe2cbc 100644 --- a/config/cmake/CheckTypeSize.cmake +++ b/config/cmake/CheckTypeSize.cmake @@ -8,23 +8,23 @@ # MACRO (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) - SET (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1) - IF ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") - SET (MACRO_CHECK_TYPE_SIZE_FLAGS + set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1) + if ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") + set (MACRO_CHECK_TYPE_SIZE_FLAGS "-DCHECK_TYPE_SIZE_TYPE=\"${TYPE}\" ${CMAKE_REQUIRED_FLAGS}" ) - FOREACH (def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H HAVE_INTTYPES_H) - IF ("${def}") - SET (MACRO_CHECK_TYPE_SIZE_FLAGS "${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}") + foreach (def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H HAVE_INTTYPES_H) + if ("${def}") + set (MACRO_CHECK_TYPE_SIZE_FLAGS "${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}") ENDIF("${def}") - ENDFOREACH (def) + endforeach (def) - MESSAGE (STATUS "Check size of ${TYPE}") - IF (CMAKE_REQUIRED_LIBRARIES) - SET (CHECK_TYPE_SIZE_ADD_LIBRARIES + message (STATUS "Check size of ${TYPE}") + if (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_TYPE_SIZE_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}" ) - ENDIF (CMAKE_REQUIRED_LIBRARIES) + endif (CMAKE_REQUIRED_LIBRARIES) TRY_RUN (${VARIABLE} HAVE_${VARIABLE} ${CMAKE_BINARY_DIR} ${HDF5_RESOURCES_DIR}/CheckTypeSize.c @@ -32,17 +32,17 @@ MACRO (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) "${CHECK_TYPE_SIZE_ADD_LIBRARIES}" OUTPUT_VARIABLE OUTPUT ) - IF (HAVE_${VARIABLE}) - MESSAGE (STATUS "Check size of ${TYPE} - done") + if (HAVE_${VARIABLE}) + message (STATUS "Check size of ${TYPE} - done") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log "Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n" ) - ELSE (HAVE_${VARIABLE}) - MESSAGE (STATUS "Check size of ${TYPE} - failed") + else (HAVE_${VARIABLE}) + message (STATUS "Check size of ${TYPE} - failed") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\n\n" ) - ENDIF (HAVE_${VARIABLE}) - ENDIF ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") - SET (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS) + endif (HAVE_${VARIABLE}) + endif ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") + set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS) ENDMACRO (HDF_CHECK_TYPE_SIZE) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 769483e..93c6138 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -1,63 +1,68 @@ #----------------------------------------------------------------------------- # Include all the necessary files for macros #----------------------------------------------------------------------------- -INCLUDE (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake) -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) +include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) +include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) +include (${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake) +include (${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake) +include (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake) +include (${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake) +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) #----------------------------------------------------------------------------- # APPLE/Darwin setup #----------------------------------------------------------------------------- -IF (APPLE) - LIST(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_LENGTH) - IF(ARCH_LENGTH GREATER 1) +if (APPLE) + list (LENGTH CMAKE_OSX_ARCHITECTURES ARCH_LENGTH) + if (ARCH_LENGTH GREATER 1) set (CMAKE_OSX_ARCHITECTURES "" CACHE STRING "" FORCE) message(FATAL_ERROR "Building Universal Binaries on OS X is NOT supported by the HDF5 project. This is" "due to technical reasons. The best approach would be build each architecture in separate directories" "and use the 'lipo' tool to combine them into a single executable or library. The 'CMAKE_OSX_ARCHITECTURES'" "variable has been set to a blank value which will build the default architecture for this system.") - ENDIF() - SET (H5_AC_APPLE_UNIVERSAL_BUILD 0) -ENDIF (APPLE) + endif () + set (H5_AC_APPLE_UNIVERSAL_BUILD 0) +endif (APPLE) # Check for Darwin (not just Apple - we also want to catch OpenDarwin) -IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - SET (H5_HAVE_DARWIN 1) -ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set (H5_HAVE_DARWIN 1) +endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + +# Check for Solaris +if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + set (H5_HAVE_SOLARIS 1) +endif (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") #----------------------------------------------------------------------------- # Option to Clear File Buffers before write --enable-clear-file-buffers #----------------------------------------------------------------------------- -OPTION (HDF5_Enable_Clear_File_Buffers "Securely clear file buffers before writing to file" ON) -IF (HDF5_Enable_Clear_File_Buffers) - SET (H5_CLEAR_MEMORY 1) -ENDIF (HDF5_Enable_Clear_File_Buffers) +option (HDF5_Enable_Clear_File_Buffers "Securely clear file buffers before writing to file" ON) +if (HDF5_Enable_Clear_File_Buffers) + set (H5_CLEAR_MEMORY 1) +endif (HDF5_Enable_Clear_File_Buffers) MARK_AS_ADVANCED (HDF5_Enable_Clear_File_Buffers) #----------------------------------------------------------------------------- # Option for --enable-strict-format-checks #----------------------------------------------------------------------------- -OPTION (HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF) -IF (HDF5_STRICT_FORMAT_CHECKS) - SET (H5_STRICT_FORMAT_CHECKS 1) -ENDIF (HDF5_STRICT_FORMAT_CHECKS) +option (HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF) +if (HDF5_STRICT_FORMAT_CHECKS) + set (H5_STRICT_FORMAT_CHECKS 1) +endif (HDF5_STRICT_FORMAT_CHECKS) MARK_AS_ADVANCED (HDF5_STRICT_FORMAT_CHECKS) #----------------------------------------------------------------------------- # Option for --enable-metadata-trace-file #----------------------------------------------------------------------------- -OPTION (HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF) -IF (HDF5_METADATA_TRACE_FILE) - SET (H5_METADATA_TRACE_FILE 1) -ENDIF (HDF5_METADATA_TRACE_FILE) +option (HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF) +if (HDF5_METADATA_TRACE_FILE) + set (H5_METADATA_TRACE_FILE 1) +endif (HDF5_METADATA_TRACE_FILE) MARK_AS_ADVANCED (HDF5_METADATA_TRACE_FILE) # ---------------------------------------------------------------------- @@ -66,10 +71,10 @@ MARK_AS_ADVANCED (HDF5_METADATA_TRACE_FILE) # though the data may be wrong (for example, some compilers don't # support denormalized floating values) to maximize speed. # -OPTION (HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON) -IF (HDF5_WANT_DATA_ACCURACY) - SET (H5_WANT_DATA_ACCURACY 1) -ENDIF(HDF5_WANT_DATA_ACCURACY) +option (HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON) +if (HDF5_WANT_DATA_ACCURACY) + set (H5_WANT_DATA_ACCURACY 1) +endif (HDF5_WANT_DATA_ACCURACY) MARK_AS_ADVANCED (HDF5_WANT_DATA_ACCURACY) # ---------------------------------------------------------------------- @@ -78,199 +83,199 @@ MARK_AS_ADVANCED (HDF5_WANT_DATA_ACCURACY) # for the speed optimization of hard conversions. Soft conversions can # actually benefit little. # -OPTION (HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON) -IF (HDF5_WANT_DCONV_EXCEPTION) - SET (H5_WANT_DCONV_EXCEPTION 1) -ENDIF (HDF5_WANT_DCONV_EXCEPTION) +option (HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON) +if (HDF5_WANT_DCONV_EXCEPTION) + set (H5_WANT_DCONV_EXCEPTION 1) +endif (HDF5_WANT_DCONV_EXCEPTION) MARK_AS_ADVANCED (HDF5_WANT_DCONV_EXCEPTION) # ---------------------------------------------------------------------- # Check if they would like the function stack support compiled in # -OPTION (HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF) -IF (HDF5_ENABLE_CODESTACK) - SET (H5_HAVE_CODESTACK 1) -ENDIF (HDF5_ENABLE_CODESTACK) +option (HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF) +if (HDF5_ENABLE_CODESTACK) + set (H5_HAVE_CODESTACK 1) +endif (HDF5_ENABLE_CODESTACK) MARK_AS_ADVANCED (HDF5_ENABLE_CODESTACK) -OPTION (HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON) +option (HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can handle converting # floating-point to long long values. # (This flag should be _unset_ for all machines) # -# SET (H5_HW_FP_TO_LLONG_NOT_WORKS 0) +# set (H5_HW_FP_TO_LLONG_NOT_WORKS 0) # so far we have no check for this -SET(H5_HAVE_TMPFILE 1) +set (H5_HAVE_TMPFILE 1) #----------------------------------------------------------------------------- # This MACRO checks IF the symbol exists in the library and IF it # does, it appends library to the list. #----------------------------------------------------------------------------- -SET (LINK_LIBS "") +set (LINK_LIBS "") MACRO (CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE) CHECK_LIBRARY_EXISTS ("${LIBRARY};${LINK_LIBS}" ${SYMBOL} "" ${VARIABLE}) - IF (${VARIABLE}) - SET (LINK_LIBS ${LINK_LIBS} ${LIBRARY}) - ENDIF (${VARIABLE}) + if (${VARIABLE}) + set (LINK_LIBS ${LINK_LIBS} ${LIBRARY}) + endif (${VARIABLE}) ENDMACRO (CHECK_LIBRARY_EXISTS_CONCAT) # ---------------------------------------------------------------------- # WINDOWS Hard code Values # ---------------------------------------------------------------------- -SET (WINDOWS) -IF (WIN32) - IF (MINGW) - SET (H5_HAVE_MINGW 1) - SET (WINDOWS 1) # MinGW tries to imitate Windows - SET (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1") - ENDIF (MINGW) - SET (H5_HAVE_WIN32_API 1) - SET (CMAKE_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib") - IF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) - SET (WINDOWS 1) - SET (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1") - IF (MSVC) - SET (H5_HAVE_VISUAL_STUDIO 1) - ENDIF (MSVC) - ENDIF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) -ENDIF (WIN32) - -#IF (WIN32) -# SET (DEFAULT_STREAM_VFD OFF) -#ELSE (WIN32) -# SET (DEFAULT_STREAM_VFD ON) -#ENDIF (WIN32) -#OPTION (HDF5_STREAM_VFD "Compile Stream Virtual File Driver support" ${DEFAULT_STREAM_VFD}) +set (WINDOWS) +if (WIN32) + if (MINGW) + set (H5_HAVE_MINGW 1) + set (WINDOWS 1) # MinGW tries to imitate Windows + set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1") + endif (MINGW) + set (H5_HAVE_WIN32_API 1) + set (CMAKE_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib") + if (NOT UNIX AND NOT CYGWIN AND NOT MINGW) + set (WINDOWS 1) + set (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1") + if (MSVC) + set (H5_HAVE_VISUAL_STUDIO 1) + endif (MSVC) + endif (NOT UNIX AND NOT CYGWIN AND NOT MINGW) +endif (WIN32) + +#if (WIN32) +# set (DEFAULT_STREAM_VFD OFF) +#else (WIN32) +# set (DEFAULT_STREAM_VFD ON) +#endif (WIN32) +#option (HDF5_STREAM_VFD "Compile Stream Virtual File Driver support" ${DEFAULT_STREAM_VFD}) # TODO -------------------------------------------------------------------------- # 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 (NOT DEFINED "H5_DEFAULT_PLUGINDIR") - IF (WINDOWS) - SET (H5_DEFAULT_PLUGINDIR "%ALLUSERSPROFILE%/hdf5/lib/plugin") - ELSE (WINDOWS) - SET (H5_DEFAULT_PLUGINDIR "/usr/local/hdf5/lib/plugin") - ENDIF (WINDOWS) -ENDIF (NOT DEFINED "H5_DEFAULT_PLUGINDIR") - -IF (WINDOWS) - SET (H5_HAVE_WINDOWS 1) +set (H5_DEFAULT_VFD H5FD_SEC2) + +if (NOT DEFINED "H5_DEFAULT_PLUGINDIR") + if (WINDOWS) + set (H5_DEFAULT_PLUGINDIR "%ALLUSERSPROFILE%/hdf5/lib/plugin") + else (WINDOWS) + set (H5_DEFAULT_PLUGINDIR "/usr/local/hdf5/lib/plugin") + endif (WINDOWS) +endif (NOT DEFINED "H5_DEFAULT_PLUGINDIR") + +if (WINDOWS) + set (H5_HAVE_WINDOWS 1) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine has window style pathname, # 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) -ENDIF (WINDOWS) - -IF (WINDOWS) - SET (H5_HAVE_STDDEF_H 1) - SET (H5_HAVE_SYS_STAT_H 1) - SET (H5_HAVE_SYS_TYPES_H 1) - SET (H5_HAVE_LIBM 1) - SET (H5_HAVE_STRDUP 1) - SET (H5_HAVE_SYSTEM 1) - SET (H5_HAVE_LONGJMP 1) - IF (NOT MINGW) - SET (H5_HAVE_GETHOSTNAME 1) - ENDIF (NOT MINGW) - IF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) - SET (H5_HAVE_GETCONSOLESCREENBUFFERINFO 1) - ENDIF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) - SET (H5_HAVE_FUNCTION 1) - SET (H5_GETTIMEOFDAY_GIVES_TZ 1) - SET (H5_HAVE_TIMEZONE 1) - SET (H5_HAVE_GETTIMEOFDAY 1) - SET (H5_LONE_COLON 0) - IF (MINGW) - SET (H5_HAVE_WINSOCK2_H 1) - ENDIF (MINGW) - SET (H5_HAVE_LIBWS2_32 1) - SET (H5_HAVE_LIBWSOCK32 1) + set (H5_HAVE_WINDOW_PATH 1) +endif (WINDOWS) + +if (WINDOWS) + set (H5_HAVE_STDDEF_H 1) + set (H5_HAVE_SYS_STAT_H 1) + set (H5_HAVE_SYS_TYPES_H 1) + set (H5_HAVE_LIBM 1) + set (H5_HAVE_STRDUP 1) + set (H5_HAVE_SYSTEM 1) + set (H5_HAVE_LONGJMP 1) + if (NOT MINGW) + set (H5_HAVE_GETHOSTNAME 1) + endif (NOT MINGW) + if (NOT UNIX AND NOT CYGWIN AND NOT MINGW) + set (H5_HAVE_GETCONSOLESCREENBUFFERINFO 1) + endif (NOT UNIX AND NOT CYGWIN AND NOT MINGW) + set (H5_HAVE_FUNCTION 1) + set (H5_GETTIMEOFDAY_GIVES_TZ 1) + set (H5_HAVE_TIMEZONE 1) + set (H5_HAVE_GETTIMEOFDAY 1) + set (H5_LONE_COLON 0) + if (MINGW) + set (H5_HAVE_WINSOCK2_H 1) + endif (MINGW) + set (H5_HAVE_LIBWS2_32 1) + set (H5_HAVE_LIBWSOCK32 1) #----------------------------------------------------------------------------- # These tests need to be manually SET for windows since there is currently # something not quite correct with the actual test implementation. This affects # the 'dt_arith' test and most likely lots of other code # ---------------------------------------------------------------------------- - SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") -ENDIF (WINDOWS) + set (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") +endif (WINDOWS) # ---------------------------------------------------------------------- # END of WINDOWS Hard code Values # ---------------------------------------------------------------------- -IF (CYGWIN) - SET (H5_HAVE_LSEEK64 0) -ENDIF (CYGWIN) +if (CYGWIN) + set (H5_HAVE_LSEEK64 0) +endif (CYGWIN) #----------------------------------------------------------------------------- # Check for the math library "m" #----------------------------------------------------------------------------- -IF (NOT WINDOWS) +if (NOT WINDOWS) CHECK_LIBRARY_EXISTS_CONCAT ("m" ceil H5_HAVE_LIBM) CHECK_LIBRARY_EXISTS_CONCAT ("dl" dlopen H5_HAVE_LIBDL) CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup H5_HAVE_LIBWS2_32) CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" gethostbyname H5_HAVE_LIBWSOCK32) -ENDIF (NOT WINDOWS) +endif (NOT WINDOWS) 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) -IF (NOT NOT_NEED_LIBNSL) +if (NOT NOT_NEED_LIBNSL) CHECK_LIBRARY_EXISTS_CONCAT ("nsl" gethostbyname H5_HAVE_LIBNSL) -ENDIF (NOT NOT_NEED_LIBNSL) +endif (NOT NOT_NEED_LIBNSL) # For other tests to use the same libraries -SET (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LINK_LIBS}) +set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LINK_LIBS}) -SET (USE_INCLUDES "") -IF (WINDOWS) - SET (USE_INCLUDES ${USE_INCLUDES} "windows.h") -ENDIF (WINDOWS) +set (USE_INCLUDES "") +if (WINDOWS) + set (USE_INCLUDES ${USE_INCLUDES} "windows.h") +endif (WINDOWS) -IF (NOT WINDOWS) - TEST_BIG_ENDIAN(H5_WORDS_BIGENDIAN) -ENDIF (NOT WINDOWS) +if (NOT WINDOWS) + TEST_BIG_ENDIAN (H5_WORDS_BIGENDIAN) +endif (NOT WINDOWS) # 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 + 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 ("${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 + if (LARGEFILE) + set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ) - ENDIF (LARGEFILE) + endif (LARGEFILE) - #MESSAGE (STATUS "Performing ${OTHER_TEST}") + #message (STATUS "Performing ${OTHER_TEST}") TRY_COMPILE (${OTHER_TEST} ${CMAKE_BINARY_DIR} ${HDF5_RESOURCES_DIR}/HDF5Tests.c @@ -278,18 +283,18 @@ MACRO (HDF5_FUNCTION_TEST OTHER_TEST) "${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}) + 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}$") + endif (${OTHER_TEST}) + endif ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") ENDMACRO (HDF5_FUNCTION_TEST) #----------------------------------------------------------------------------- @@ -301,58 +306,58 @@ 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$") +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 (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$") + 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) + 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) +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) + 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) #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- @@ -360,9 +365,9 @@ ENDIF (NOT WINDOWS) #----------------------------------------------------------------------------- MACRO (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE) CHECK_INCLUDE_FILES ("${USE_INCLUDES};${FILE}" ${VARIABLE}) - IF (${VARIABLE}) - SET (USE_INCLUDES ${USE_INCLUDES} ${FILE}) - ENDIF (${VARIABLE}) + if (${VARIABLE}) + set (USE_INCLUDES ${USE_INCLUDES} ${FILE}) + endif (${VARIABLE}) ENDMACRO (CHECK_INCLUDE_FILE_CONCAT) #----------------------------------------------------------------------------- @@ -384,31 +389,31 @@ 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 # has been initialized (e.g. the project also includes some c++) -IF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) +if (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) CHECK_INCLUDE_FILE_CXX ("stdint.h" H5_HAVE_STDINT_H_CXX) - IF (NOT H5_HAVE_STDINT_H_CXX) - SET (H5_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H") - SET (USE_INCLUDES ${USE_INCLUDES} "stdint.h") - ENDIF (NOT H5_HAVE_STDINT_H_CXX) -ENDIF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) + if (NOT H5_HAVE_STDINT_H_CXX) + set (H5_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H") + set (USE_INCLUDES ${USE_INCLUDES} "stdint.h") + 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) +if (NOT CYGWIN) CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" H5_HAVE_WINSOCK2_H) -ENDIF (NOT CYGWIN) +endif (NOT CYGWIN) CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" H5_HAVE_SYS_TIMEB_H) -IF (CMAKE_SYSTEM_NAME MATCHES "OSF") +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") +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) @@ -428,11 +433,12 @@ CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" H5_HAVE_NETINET_IN_H) #----------------------------------------------------------------------------- # The linux-lfs option is deprecated. -SET (LINUX_LFS 0) +set (LINUX_LFS 0) -SET (HDF5_EXTRA_C_FLAGS) -SET (HDF5_EXTRA_FLAGS) -IF (NOT WINDOWS) +set (HDF5_EXTRA_C_FLAGS) +set (HDF5_EXTRA_FLAGS) +if (NOT WINDOWS) + if (NOT H5_HAVE_SOLARIS) # Linux Specific flags # This was originally defined as _POSIX_SOURCE which was updated to # _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX @@ -440,92 +446,93 @@ IF (NOT WINDOWS) # correctly. # POSIX feature information can be found in the gcc manual at: # http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html - SET (HDF5_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=199506L) - SET (HDF5_EXTRA_FLAGS -D_BSD_SOURCE) + set (HDF5_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=199506L) + set (HDF5_EXTRA_FLAGS -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") + 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") TRY_RUN (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE ${HDF5_BINARY_DIR}/CMake ${HDF5_RESOURCES_DIR}/HDF5Tests.c CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DTEST_LFS_WORKS OUTPUT_VARIABLE OUTPUT ) - IF (TEST_LFS_WORKS_COMPILE) - IF (TEST_LFS_WORKS_RUN MATCHES 0) - SET (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg}) - SET (LARGEFILE 1) - SET (HDF5_EXTRA_FLAGS ${HDF5_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) - MESSAGE (STATUS "${msg}... yes") - ELSE (TEST_LFS_WORKS_RUN MATCHES 0) - SET (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... no") + if (TEST_LFS_WORKS_COMPILE) + if (TEST_LFS_WORKS_RUN MATCHES 0) + set (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg}) + set (LARGEFILE 1) + set (HDF5_EXTRA_FLAGS ${HDF5_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) + message (STATUS "${msg}... yes") + else (TEST_LFS_WORKS_RUN MATCHES 0) + set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_LFS_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" ) - ENDIF (TEST_LFS_WORKS_RUN MATCHES 0) - ELSE (TEST_LFS_WORKS_COMPILE ) - SET (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... no") + endif (TEST_LFS_WORKS_RUN MATCHES 0) + else (TEST_LFS_WORKS_COMPILE ) + set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_LFS_WORKS Compile failed with the following output:\n ${OUTPUT}\n" ) - ENDIF (TEST_LFS_WORKS_COMPILE) - ENDIF (HDF5_ENABLE_LARGE_FILE) - SET (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF5_EXTRA_FLAGS}) -ENDIF (NOT WINDOWS) + endif (TEST_LFS_WORKS_COMPILE) + endif (HDF5_ENABLE_LARGE_FILE) + set (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF5_EXTRA_FLAGS}) + endif (NOT H5_HAVE_SOLARIS) +endif (NOT WINDOWS) -ADD_DEFINITIONS (${HDF5_EXTRA_FLAGS}) +add_definitions (${HDF5_EXTRA_FLAGS}) #----------------------------------------------------------------------------- # Check for HAVE_OFF64_T functionality #----------------------------------------------------------------------------- -IF (NOT WINDOWS OR MINGW) +if (NOT WINDOWS OR MINGW) HDF5_FUNCTION_TEST (HAVE_OFF64_T) - IF (H5_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) + 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) + 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 OR MINGW) + endif (HAVE_STAT64_STRUCT) +endif (NOT WINDOWS OR MINGW) #----------------------------------------------------------------------------- # Check the size in bytes of all the int and float types #----------------------------------------------------------------------------- MACRO (H5_CHECK_TYPE_SIZE type var) - SET (aType ${type}) - SET (aVar ${var}) -# MESSAGE (STATUS "Checking size of ${aType} and storing into ${aVar}") + set (aType ${type}) + set (aVar ${var}) +# message (STATUS "Checking size of ${aType} and storing into ${aVar}") CHECK_TYPE_SIZE (${aType} ${aVar}) - IF (NOT ${aVar}) - SET (${aVar} 0 CACHE INTERNAL "SizeOf for ${aType}") -# MESSAGE (STATUS "Size of ${aType} was NOT Found") - ENDIF (NOT ${aVar}) + if (NOT ${aVar}) + set (${aVar} 0 CACHE INTERNAL "SizeOf for ${aType}") +# message (STATUS "Size of ${aType} was NOT Found") + 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) H5_CHECK_TYPE_SIZE (unsigned H5_SIZEOF_UNSIGNED) -IF (NOT APPLE) +if (NOT APPLE) H5_CHECK_TYPE_SIZE (long H5_SIZEOF_LONG) -ENDIF (NOT APPLE) +endif (NOT APPLE) H5_CHECK_TYPE_SIZE ("long long" H5_SIZEOF_LONG_LONG) H5_CHECK_TYPE_SIZE (__int64 H5_SIZEOF___INT64) -IF (NOT H5_SIZEOF___INT64) - SET (H5_SIZEOF___INT64 0) -ENDIF (NOT H5_SIZEOF___INT64) +if (NOT H5_SIZEOF___INT64) + set (H5_SIZEOF___INT64 0) +endif (NOT H5_SIZEOF___INT64) H5_CHECK_TYPE_SIZE (float H5_SIZEOF_FLOAT) H5_CHECK_TYPE_SIZE (double H5_SIZEOF_DOUBLE) @@ -559,24 +566,24 @@ 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) +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) - IF (NOT WINDOWS) + if (NOT H5_SIZEOF_SSIZE_T) + set (H5_SIZEOF_SSIZE_T 0) + endif (NOT H5_SIZEOF_SSIZE_T) + if (NOT WINDOWS) H5_CHECK_TYPE_SIZE (ptrdiff_t H5_SIZEOF_PTRDIFF_T) - ENDIF (NOT WINDOWS) -ENDIF (NOT APPLE) + endif (NOT WINDOWS) +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 H5_SIZEOF_OFF64_T) + set (H5_SIZEOF_OFF64_T 0) +endif (NOT H5_SIZEOF_OFF64_T) -IF (NOT WINDOWS) +if (NOT WINDOWS) #----------------------------------------------------------------------------- # Check if the dev_t type is a scalar type #----------------------------------------------------------------------------- @@ -591,7 +598,7 @@ IF (NOT WINDOWS) #----------------------------------------------------------------------------- # Check a bunch of time functions #----------------------------------------------------------------------------- - FOREACH (test + foreach (test HAVE_TM_GMTOFF HAVE___TM_GMTOFF # HAVE_TIMEZONE @@ -602,11 +609,11 @@ IF (NOT WINDOWS) HAVE_STRUCT_TM_TM_ZONE ) HDF5_FUNCTION_TEST (${test}) - ENDFOREACH (test) - IF (NOT CYGWIN AND NOT MINGW) + 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 CYGWIN AND NOT MINGW) # ---------------------------------------------------------------------- # Does the struct stat have the st_blocks field? This field is not Posix. @@ -622,12 +629,12 @@ IF (NOT WINDOWS) CHECK_FUNCTION_EXISTS (_getvideoconfig H5_HAVE__GETVIDEOCONFIG) CHECK_FUNCTION_EXISTS (gettextinfo H5_HAVE_GETTEXTINFO) CHECK_FUNCTION_EXISTS (_scrsize H5_HAVE__SCRSIZE) - IF (NOT CYGWIN AND NOT MINGW) + if (NOT CYGWIN AND NOT MINGW) CHECK_FUNCTION_EXISTS (GetConsoleScreenBufferInfo H5_HAVE_GETCONSOLESCREENBUFFERINFO) - ENDIF (NOT CYGWIN AND NOT MINGW) + endif (NOT CYGWIN AND NOT MINGW) CHECK_SYMBOL_EXISTS (TIOCGWINSZ "sys/ioctl.h" H5_HAVE_TIOCGWINSZ) CHECK_SYMBOL_EXISTS (TIOCGETD "sys/ioctl.h" H5_HAVE_TIOCGETD) -ENDIF (NOT WINDOWS) +endif (NOT WINDOWS) #----------------------------------------------------------------------------- # Check for some functions that are used @@ -666,23 +673,23 @@ CHECK_FUNCTION_EXISTS (vasprintf H5_HAVE_VASPRINTF) CHECK_FUNCTION_EXISTS (waitpid H5_HAVE_WAITPID) CHECK_FUNCTION_EXISTS (vsnprintf H5_HAVE_VSNPRINTF) -IF (NOT WINDOWS) - IF (H5_HAVE_VSNPRINTF) +if (NOT WINDOWS) + if (H5_HAVE_VSNPRINTF) HDF5_FUNCTION_TEST (VSNPRINTF_WORKS) - ENDIF (H5_HAVE_VSNPRINTF) -ENDIF (NOT WINDOWS) + endif (H5_HAVE_VSNPRINTF) +endif (NOT WINDOWS) #----------------------------------------------------------------------------- # sigsetjmp is special; may actually be a macro #----------------------------------------------------------------------------- -IF (NOT H5_HAVE_SIGSETJMP) - IF (H5_HAVE_SETJMP_H) +if (NOT H5_HAVE_SIGSETJMP) + if (H5_HAVE_SETJMP_H) CHECK_SYMBOL_EXISTS (sigsetjmp "setjmp.h" H5_HAVE_MACRO_SIGSETJMP) - IF (H5_HAVE_MACRO_SIGSETJMP) - SET (H5_HAVE_SIGSETJMP 1) - ENDIF (H5_HAVE_MACRO_SIGSETJMP) - ENDIF (H5_HAVE_SETJMP_H) -ENDIF (NOT H5_HAVE_SIGSETJMP) + if (H5_HAVE_MACRO_SIGSETJMP) + set (H5_HAVE_SIGSETJMP 1) + endif (H5_HAVE_MACRO_SIGSETJMP) + endif (H5_HAVE_SETJMP_H) +endif (NOT H5_HAVE_SIGSETJMP) #----------------------------------------------------------------------------- # Check for Symbols @@ -691,8 +698,8 @@ CHECK_SYMBOL_EXISTS (tzname "time.h" H5_HAVE_DECL_TZNAME) #----------------------------------------------------------------------------- # Check a bunch of other functions #----------------------------------------------------------------------------- -IF (NOT WINDOWS) - FOREACH (test +if (NOT WINDOWS) + foreach (test LONE_COLON HAVE_ATTRIBUTE HAVE_C99_FUNC @@ -703,40 +710,40 @@ IF (NOT WINDOWS) CXX_HAVE_OFFSETOF ) HDF5_FUNCTION_TEST (${test}) - ENDFOREACH (test) -ENDIF (NOT WINDOWS) + endforeach (test) +endif (NOT WINDOWS) # 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) - 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 + 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) + 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 ("${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 + if (LARGEFILE) + set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ) - ENDIF (LARGEFILE) + endif (LARGEFILE) - #MESSAGE (STATUS "Performing ${OTHER_TEST}") + #message (STATUS "Performing ${OTHER_TEST}") TRY_COMPILE (${OTHER_TEST} ${CMAKE_BINARY_DIR} ${HDF5_RESOURCES_DIR}/HDF5CXXTests.cpp @@ -744,25 +751,25 @@ MACRO (HDF5_CXX_FUNCTION_TEST OTHER_TEST) "${OTHER_TEST_ADD_LIBRARIES}" OUTPUT_VARIABLE OUTPUT ) - 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}") + 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 CXX Test ${OTHER_TEST} failed with the following output:\n" "${OUTPUT}\n" ) - ENDIF ("${OTHER_TEST}" EQUAL 0) - ENDIF ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") + endif ("${OTHER_TEST}" EQUAL 0) + endif ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") ENDMACRO (HDF5_CXX_FUNCTION_TEST) #----------------------------------------------------------------------------- # Check a bunch of cxx functions #----------------------------------------------------------------------------- -IF (CMAKE_CXX_COMPILER_LOADED) - FOREACH (test +if (CMAKE_CXX_COMPILER_LOADED) + foreach (test OLD_HEADER_FILENAME H5_NO_NAMESPACE H5_NO_STD @@ -770,81 +777,81 @@ IF (CMAKE_CXX_COMPILER_LOADED) NO_STATIC_CAST ) HDF5_CXX_FUNCTION_TEST (${test}) - ENDFOREACH (test) -ENDIF (CMAKE_CXX_COMPILER_LOADED) + endforeach (test) +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}") +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) + 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") + 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") + 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) + endif (TEST_DIRECT_VFD_WORKS_COMPILE) + endif (HDF5_ENABLE_DIRECT_VFD) +endif (NOT WINDOWS) #----------------------------------------------------------------------------- # Check for the Stream VFD driver #----------------------------------------------------------------------------- -IF (HDF5_STREAM_VFD) +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) + set (H5_HAVE_STREAM 1) +endif (HDF5_STREAM_VFD) #----------------------------------------------------------------------------- # Check if InitOnceExecuteOnce is available #----------------------------------------------------------------------------- -IF (WINDOWS) - IF (NOT HDF5_NO_IOEO_TEST) - MESSAGE (STATUS "Checking for InitOnceExecuteOnce:") - IF("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") - IF (LARGEFILE) - SET (CMAKE_REQUIRED_DEFINITIONS +if (WINDOWS) + if (NOT HDF5_NO_IOEO_TEST) + message (STATUS "Checking for InitOnceExecuteOnce:") + if ("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") + if (LARGEFILE) + set (CMAKE_REQUIRED_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ) - ENDIF (LARGEFILE) - SET(MACRO_CHECK_FUNCTION_DEFINITIONS + endif (LARGEFILE) + set (MACRO_CHECK_FUNCTION_DEFINITIONS "-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}") - IF(CMAKE_REQUIRED_LIBRARIES) - SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES + if (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - ELSE(CMAKE_REQUIRED_LIBRARIES) - SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) - ENDIF(CMAKE_REQUIRED_LIBRARIES) - IF(CMAKE_REQUIRED_INCLUDES) - SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES + else (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) + endif (CMAKE_REQUIRED_LIBRARIES) + if (CMAKE_REQUIRED_INCLUDES) + set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") - ELSE(CMAKE_REQUIRED_INCLUDES) - SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) - ENDIF(CMAKE_REQUIRED_INCLUDES) + else (CMAKE_REQUIRED_INCLUDES) + set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) + endif (CMAKE_REQUIRED_INCLUDES) TRY_RUN(HAVE_IOEO_EXITCODE HAVE_IOEO_COMPILED ${CMAKE_BINARY_DIR} @@ -856,108 +863,108 @@ IF (WINDOWS) "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}" COMPILE_OUTPUT_VARIABLE OUTPUT) # if it did not compile make the return value fail code of 1 - IF(NOT HAVE_IOEO_COMPILED) - SET(HAVE_IOEO_EXITCODE 1) - ENDIF(NOT HAVE_IOEO_COMPILED) + if (NOT HAVE_IOEO_COMPILED) + set (HAVE_IOEO_EXITCODE 1) + endif (NOT HAVE_IOEO_COMPILED) # if the return value was 0 then it worked - IF("${HAVE_IOEO_EXITCODE}" EQUAL 0) - SET(H5_HAVE_IOEO 1 CACHE INTERNAL "Test InitOnceExecuteOnce") - MESSAGE(STATUS "Performing Test InitOnceExecuteOnce - Success") - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + if ("${HAVE_IOEO_EXITCODE}" EQUAL 0) + set (H5_HAVE_IOEO 1 CACHE INTERNAL "Test InitOnceExecuteOnce") + message (STATUS "Performing Test InitOnceExecuteOnce - Success") + FILE (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing C SOURCE FILE Test InitOnceExecuteOnce succeded with the following output:\n" "${OUTPUT}\n" "Return value: ${HAVE_IOEO}\n") - ELSE("${HAVE_IOEO_EXITCODE}" EQUAL 0) - IF(CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") - SET(H5_HAVE_IOEO "${HAVE_IOEO_EXITCODE}") - ELSE(CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") - SET(H5_HAVE_IOEO "" CACHE INTERNAL "Test InitOnceExecuteOnce") - ENDIF(CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") - - MESSAGE(STATUS "Performing Test InitOnceExecuteOnce - Failed") - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + else ("${HAVE_IOEO_EXITCODE}" EQUAL 0) + if (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") + set (H5_HAVE_IOEO "${HAVE_IOEO_EXITCODE}") + else (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") + set (H5_HAVE_IOEO "" CACHE INTERNAL "Test InitOnceExecuteOnce") + endif (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") + + message (STATUS "Performing Test InitOnceExecuteOnce - Failed") + FILE (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing InitOnceExecuteOnce Test failed with the following output:\n" "${OUTPUT}\n" "Return value: ${HAVE_IOEO_EXITCODE}\n") - ENDIF("${HAVE_IOEO_EXITCODE}" EQUAL 0) - ENDIF("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") - ENDIF (NOT HDF5_NO_IOEO_TEST) -ENDIF (WINDOWS) + endif ("${HAVE_IOEO_EXITCODE}" EQUAL 0) + 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 #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GPFS "Enable GPFS hints for the MPI/POSIX file driver" OFF) -IF (HDF5_ENABLE_GPFS) +option (HDF5_ENABLE_GPFS "Enable GPFS hints for the MPI/POSIX file driver" OFF) +if (HDF5_ENABLE_GPFS) CHECK_INCLUDE_FILE_CONCAT ("gpfs.h" HAVE_GPFS) - IF (HAVE_GPFS) + if (HAVE_GPFS) HDF5_FUNCTION_TEST (HAVE_GPFS) - ENDIF (HAVE_GPFS) -ENDIF (HDF5_ENABLE_GPFS) + endif (HAVE_GPFS) +endif (HDF5_ENABLE_GPFS) MARK_AS_ADVANCED (HDF5_ENABLE_GPFS) #----------------------------------------------------------------------------- # Determine how 'inline' is used #----------------------------------------------------------------------------- -SET (HDF5_EXTRA_TEST_DEFINITIONS INLINE_TEST_INLINE) -FOREACH (inline_test inline __inline__ __inline) - SET (INLINE_TEST_INLINE ${inline_test}) +set (HDF5_EXTRA_TEST_DEFINITIONS INLINE_TEST_INLINE) +foreach (inline_test inline __inline__ __inline) + set (INLINE_TEST_INLINE ${inline_test}) HDF5_FUNCTION_TEST (INLINE_TEST_${inline_test}) -ENDFOREACH (inline_test) - -SET (HDF5_EXTRA_TEST_DEFINITIONS) -IF (INLINE_TEST___inline__) - SET (H5_inline __inline__) -ELSE (INLINE_TEST___inline__) - IF (INLINE_TEST___inline) - SET (H5_inline __inline) - ELSE (INLINE_TEST___inline) - IF (INLINE_TEST_inline) - SET (H5_inline inline) - ENDIF (INLINE_TEST_inline) - ENDIF (INLINE_TEST___inline) -ENDIF (INLINE_TEST___inline__) +endforeach (inline_test) + +set (HDF5_EXTRA_TEST_DEFINITIONS) +if (INLINE_TEST___inline__) + set (H5_inline __inline__) +else (INLINE_TEST___inline__) + if (INLINE_TEST___inline) + set (H5_inline __inline) + else (INLINE_TEST___inline) + if (INLINE_TEST_inline) + set (H5_inline inline) + endif (INLINE_TEST_inline) + endif (INLINE_TEST___inline) +endif (INLINE_TEST___inline__) #----------------------------------------------------------------------------- # Check how to print a Long Long integer #----------------------------------------------------------------------------- -IF (NOT H5_PRINTF_LL_WIDTH OR H5_PRINTF_LL_WIDTH MATCHES "unknown") - SET (PRINT_LL_FOUND 0) - MESSAGE (STATUS "Checking for appropriate format for 64 bit long:") - FOREACH (HDF5_PRINTF_LL l64 l L q I64 ll) - SET (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH=${HDF5_PRINTF_LL}") - IF (H5_SIZEOF_LONG_LONG) - SET (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG") - ENDIF (H5_SIZEOF_LONG_LONG) +if (NOT H5_PRINTF_LL_WIDTH OR H5_PRINTF_LL_WIDTH MATCHES "unknown") + set (PRINT_LL_FOUND 0) + message (STATUS "Checking for appropriate format for 64 bit long:") + foreach (HDF5_PRINTF_LL l64 l L q I64 ll) + set (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH=${HDF5_PRINTF_LL}") + if (H5_SIZEOF_LONG_LONG) + set (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG") + endif (H5_SIZEOF_LONG_LONG) TRY_RUN (HDF5_PRINTF_LL_TEST_RUN HDF5_PRINTF_LL_TEST_COMPILE ${HDF5_BINARY_DIR}/CMake ${HDF5_RESOURCES_DIR}/HDF5Tests.c CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CURRENT_TEST_DEFINITIONS} OUTPUT_VARIABLE OUTPUT ) - IF (HDF5_PRINTF_LL_TEST_COMPILE) - IF (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) - SET (H5_PRINTF_LL_WIDTH "\"${HDF5_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll") - SET (PRINT_LL_FOUND 1) - ELSE (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) - MESSAGE ("Width with ${HDF5_PRINTF_LL} failed with result: ${HDF5_PRINTF_LL_TEST_RUN}") - ENDIF (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) - ELSE (HDF5_PRINTF_LL_TEST_COMPILE) + if (HDF5_PRINTF_LL_TEST_COMPILE) + if (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) + set (H5_PRINTF_LL_WIDTH "\"${HDF5_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll") + set (PRINT_LL_FOUND 1) + else (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) + message ("Width with ${HDF5_PRINTF_LL} failed with result: ${HDF5_PRINTF_LL_TEST_RUN}") + endif (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) + else (HDF5_PRINTF_LL_TEST_COMPILE) FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test H5_PRINTF_LL_WIDTH for ${HDF5_PRINTF_LL} failed with the following output:\n ${OUTPUT}\n" ) - ENDIF (HDF5_PRINTF_LL_TEST_COMPILE) - ENDFOREACH (HDF5_PRINTF_LL) - - IF (PRINT_LL_FOUND) - MESSAGE (STATUS "Checking for apropriate format for 64 bit long: found ${H5_PRINTF_LL_WIDTH}") - ELSE (PRINT_LL_FOUND) - MESSAGE (STATUS "Checking for apropriate format for 64 bit long: not found") - SET (H5_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL + endif (HDF5_PRINTF_LL_TEST_COMPILE) + endforeach (HDF5_PRINTF_LL) + + if (PRINT_LL_FOUND) + message (STATUS "Checking for apropriate format for 64 bit long: found ${H5_PRINTF_LL_WIDTH}") + else (PRINT_LL_FOUND) + message (STATUS "Checking for apropriate format for 64 bit long: not found") + set (H5_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll" ) - ENDIF (PRINT_LL_FOUND) -ENDIF (NOT H5_PRINTF_LL_WIDTH OR H5_PRINTF_LL_WIDTH MATCHES "unknown") + endif (PRINT_LL_FOUND) +endif (NOT H5_PRINTF_LL_WIDTH OR H5_PRINTF_LL_WIDTH MATCHES "unknown") # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can handle converting @@ -965,62 +972,62 @@ ENDIF (NOT H5_PRINTF_LL_WIDTH OR H5_PRINTF_LL_WIDTH MATCHES "unknown") # (This flag should be set for all machines, except for the Crays, where # the cache value is set in it's config file) # -SET (H5_CONVERT_DENORMAL_FLOAT 1) +set (H5_CONVERT_DENORMAL_FLOAT 1) #----------------------------------------------------------------------------- # Are we going to use HSIZE_T #----------------------------------------------------------------------------- -IF (HDF5_ENABLE_HSIZET) - SET (H5_HAVE_LARGE_HSIZET 1) -ENDIF (HDF5_ENABLE_HSIZET) +if (HDF5_ENABLE_HSIZET) + set (H5_HAVE_LARGE_HSIZET 1) +endif (HDF5_ENABLE_HSIZET) #----------------------------------------------------------------------------- # Macro to determine the various conversion capabilities #----------------------------------------------------------------------------- MACRO (H5ConversionTests TEST msg) - IF ("${TEST}" MATCHES "^${TEST}$") - # MESSAGE (STATUS "===> ${TEST}") + if ("${TEST}" MATCHES "^${TEST}$") + # message (STATUS "===> ${TEST}") TRY_RUN (${TEST}_RUN ${TEST}_COMPILE ${HDF5_BINARY_DIR}/CMake ${HDF5_RESOURCES_DIR}/ConversionTests.c CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-D${TEST}_TEST OUTPUT_VARIABLE OUTPUT ) - IF (${TEST}_COMPILE) - IF (${TEST}_RUN MATCHES 0) - SET (${TEST} 1 CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... yes") - ELSE (${TEST}_RUN MATCHES 0) - SET (${TEST} "" CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... no") + if (${TEST}_COMPILE) + if (${TEST}_RUN MATCHES 0) + set (${TEST} 1 CACHE INTERNAL ${msg}) + message (STATUS "${msg}... yes") + else (${TEST}_RUN MATCHES 0) + set (${TEST} "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Run failed with the following output and exit code:\n ${OUTPUT}\n" ) - ENDIF (${TEST}_RUN MATCHES 0) - ELSE (${TEST}_COMPILE ) - SET (${TEST} "" CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... no") + endif (${TEST}_RUN MATCHES 0) + else (${TEST}_COMPILE ) + set (${TEST} "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Compile failed with the following output:\n ${OUTPUT}\n" ) - ENDIF (${TEST}_COMPILE) + endif (${TEST}_COMPILE) - ENDIF("${TEST}" MATCHES "^${TEST}$") + endif ("${TEST}" MATCHES "^${TEST}$") ENDMACRO (H5ConversionTests) #----------------------------------------------------------------------------- # Macro to make some of the conversion tests easier to write/read #----------------------------------------------------------------------------- MACRO (H5MiscConversionTest VAR TEST msg) - IF ("${TEST}" MATCHES "^${TEST}$") - IF (${VAR}) - SET (${TEST} 1 CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... yes") - ELSE (${VAR}) - SET (${TEST} "" CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... no") - ENDIF (${VAR}) - ENDIF ("${TEST}" MATCHES "^${TEST}$") + if ("${TEST}" MATCHES "^${TEST}$") + if (${VAR}) + set (${TEST} 1 CACHE INTERNAL ${msg}) + message (STATUS "${msg}... yes") + else (${VAR}) + set (${TEST} "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") + endif (${VAR}) + endif ("${TEST}" MATCHES "^${TEST}$") ENDMACRO (H5MiscConversionTest) #----------------------------------------------------------------------------- @@ -1043,9 +1050,9 @@ H5MiscConversionTest (H5_SIZEOF_LONG_DOUBLE H5_LDOUBLE_TO_INTEGER_ACCURATE "chec # integers except 'unsigned long long'. Other HP-UX systems are unknown # yet. (1/8/05 - SLU) # -IF (NOT MSVC) +if (NOT MSVC) H5ConversionTests (H5_LDOUBLE_TO_INTEGER_WORKS "Checking IF converting from long double to integers works") -ENDIF (NOT MSVC) +endif (NOT MSVC) # ----------------------------------------------------------------------- # Set flag to indicate that the machine can handle conversion from # integers to long double. (This flag should be set "yes" for all @@ -1071,11 +1078,11 @@ H5ConversionTests (H5_ULONG_TO_FLOAT_ACCURATE "Checking IF accurately converting # 64-bit machines, where the short program below tests if round-up is # correctly handled. # -IF (CMAKE_SYSTEM MATCHES "solaris2.*") +if (CMAKE_SYSTEM MATCHES "solaris2.*") H5ConversionTests (H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE "Checking IF accurately converting unsigned long long to floating-point values") -ELSE (CMAKE_SYSTEM MATCHES "solaris2.*") - SET(H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE 1) -ENDIF (CMAKE_SYSTEM MATCHES "solaris2.*") +else (CMAKE_SYSTEM MATCHES "solaris2.*") + set (H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE 1) +endif (CMAKE_SYSTEM MATCHES "solaris2.*") # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can accurately convert # 'float' or 'double' to 'unsigned long long' values. @@ -1103,19 +1110,19 @@ H5ConversionTests (H5_LDOUBLE_TO_UINT_ACCURATE "Checking IF correctly converting # 'unsigned long long' to 'float' and 'double' typecasts. # (This flag should be set for all machines.) # -IF (H5_ULLONG_TO_FP_CAST_WORKS MATCHES ^H5_ULLONG_TO_FP_CAST_WORKS$) - SET (H5_ULLONG_TO_FP_CAST_WORKS 1 CACHE INTERNAL "Checking IF compiling unsigned long long to floating-point typecasts work") - MESSAGE (STATUS "Checking IF compiling unsigned long long to floating-point typecasts work... yes") -ENDIF (H5_ULLONG_TO_FP_CAST_WORKS MATCHES ^H5_ULLONG_TO_FP_CAST_WORKS$) +if (H5_ULLONG_TO_FP_CAST_WORKS MATCHES ^H5_ULLONG_TO_FP_CAST_WORKS$) + set (H5_ULLONG_TO_FP_CAST_WORKS 1 CACHE INTERNAL "Checking IF compiling unsigned long long to floating-point typecasts work") + message (STATUS "Checking IF compiling unsigned long long to floating-point typecasts work... yes") +endif (H5_ULLONG_TO_FP_CAST_WORKS MATCHES ^H5_ULLONG_TO_FP_CAST_WORKS$) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can _compile_ # 'long long' to 'float' and 'double' typecasts. # (This flag should be set for all machines.) # -IF (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) - SET (H5_LLONG_TO_FP_CAST_WORKS 1 CACHE INTERNAL "Checking IF compiling long long to floating-point typecasts work") - MESSAGE (STATUS "Checking IF compiling long long to floating-point typecasts work... yes") -ENDIF (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) +if (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) + set (H5_LLONG_TO_FP_CAST_WORKS 1 CACHE INTERNAL "Checking IF compiling long long to floating-point typecasts work") + message (STATUS "Checking IF compiling long long to floating-point typecasts work... yes") +endif (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can convert from # 'unsigned long long' to 'long double' without precision loss. @@ -1123,9 +1130,9 @@ ENDIF (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) # where the last 2 bytes of mantissa are lost when compiler tries to do # the conversion, and Cygwin where compiler doesn't do rounding correctly.) # -IF (NOT MSVC) +if (NOT MSVC) H5ConversionTests (H5_ULLONG_TO_LDOUBLE_PRECISION "Checking IF converting unsigned long long to long double with precision") -ENDIF (NOT MSVC) +endif (NOT MSVC) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can handle overflow converting # all floating-point to all integer types. @@ -1143,10 +1150,10 @@ H5ConversionTests (H5_FP_TO_INTEGER_OVERFLOW_WORKS "Checking IF overflows norma # 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$) +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. @@ -1155,10 +1162,10 @@ ENDIF (H5_LDOUBLE_TO_LONG_SPECIAL MATCHES ^H5_LDOUBLE_TO_LONG_SPECIAL$) # ..., 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$) +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 @@ -1179,14 +1186,14 @@ H5ConversionTests (H5_LDOUBLE_TO_LLONG_ACCURATE "Checking IF correctly convertin 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 +# for the H5VM_log2_gen() routine in src/H5VMprivate.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$) +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 # @@ -1194,21 +1201,21 @@ H5ConversionTests (H5_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restricti # 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) +if (CYGWIN) + set (H5_CYGWIN_ULLONG_TO_LDOUBLE_ROUND_PROBLEM 1) +endif (CYGWIN) # ----------------------------------------------------------------------- # wrapper script variables # -SET (prefix ${CMAKE_INSTALL_PREFIX}) -SET (exec_prefix "\${prefix}") -SET (libdir "${exec_prefix}/lib") -SET (includedir "\${prefix}/include") -SET (host_os ${CMAKE_HOST_SYSTEM_NAME}) -SET (CC ${CMAKE_C_COMPILER}) -SET (CXX ${CMAKE_CXX_COMPILER}) -SET (FC ${CMAKE_Fortran_COMPILER}) -FOREACH (LINK_LIB ${LINK_LIBS}) - SET (LIBS "${LIBS} -l${LINK_LIB}") -ENDFOREACH (LINK_LIB ${LINK_LIBS}) +set (prefix ${CMAKE_INSTALL_PREFIX}) +set (exec_prefix "\${prefix}") +set (libdir "${exec_prefix}/lib") +set (includedir "\${prefix}/include") +set (host_os ${CMAKE_HOST_SYSTEM_NAME}) +set (CC ${CMAKE_C_COMPILER}) +set (CXX ${CMAKE_CXX_COMPILER}) +set (FC ${CMAKE_Fortran_COMPILER}) +foreach (LINK_LIB ${LINK_LIBS}) + set (LIBS "${LIBS} -l${LINK_LIB}") +endforeach (LINK_LIB ${LINK_LIBS}) diff --git a/config/cmake/FindHDF5.cmake.in b/config/cmake/FindHDF5.cmake.in index 1b51ed4..0ac8bc9 100644 --- a/config/cmake/FindHDF5.cmake.in +++ b/config/cmake/FindHDF5.cmake.in @@ -38,18 +38,18 @@ # To aid in finding HDF5 as part of a subproject set
# HDF5_ROOT_DIR_HINT to the location where @HDF5_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake lies
-INCLUDE (SelectLibraryConfigurations)
-INCLUDE (FindPackageHandleStandardArgs)
+include (SelectLibraryConfigurations)
+include (FindPackageHandleStandardArgs)
# The HINTS option should only be used for values computed from the system.
-SET (_HDF5_HINTS
+set (_HDF5_HINTS
$ENV{HOME}/.local
$ENV{HDF5_ROOT}
$ENV{HDF5_ROOT_DIR_HINT}
)
# Hard-coded guesses should still go in PATHS. This ensures that the user
# environment can always override hard guesses.
-SET (_HDF5_PATHS
+set (_HDF5_PATHS
$ENV{HOME}/.local
$ENV{HDF5_ROOT}
$ENV{HDF5_ROOT_DIR_HINT}
@@ -78,9 +78,9 @@ FIND_PATH (HDF5_INCLUDE_DIRS "H5public.h" # For backwards compatibility we set HDF5_INCLUDE_DIR to the value of
# HDF5_INCLUDE_DIRS
-SET ( HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIRS}" )
+set ( HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIRS}" )
-IF (HDF5_INCLUDE_DIR)
- SET (HDF5_FOUND "YES")
- INCLUDE (${HDF5_ROOT_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake)
-ENDIF (HDF5_INCLUDE_DIR)
+if (HDF5_INCLUDE_DIR)
+ set (HDF5_FOUND "YES")
+ include (${HDF5_ROOT_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake)
+endif (HDF5_INCLUDE_DIR)
diff --git a/config/cmake/FindSZIP.cmake b/config/cmake/FindSZIP.cmake index b358862..f657cfa 100644 --- a/config/cmake/FindSZIP.cmake +++ b/config/cmake/FindSZIP.cmake @@ -11,7 +11,7 @@ # SZIP_LIBRARY_DEBUG - Debug version of SZIP library # SZIP_LIBRARY_RELEASE - Release Version of SZIP library -# MESSAGE (STATUS "Finding SZIP library and headers..." ) +# message (STATUS "Finding SZIP library and headers..." ) ############################################ # @@ -25,41 +25,41 @@ ######################################################################### MACRO (SZIP_ADJUST_LIB_VARS basename) - IF (${basename}_INCLUDE_DIR) + if (${basename}_INCLUDE_DIR) # if only the release version was found, set the debug variable also to the release version - IF (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG) - SET (${basename}_LIBRARY_DEBUG ${${basename}_LIBRARY_RELEASE}) - SET (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE}) - SET (${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE}) - ENDIF (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG) + if (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG) + set (${basename}_LIBRARY_DEBUG ${${basename}_LIBRARY_RELEASE}) + set (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE}) + set (${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE}) + endif (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG) # if only the debug version was found, set the release variable also to the debug version - IF (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) - SET (${basename}_LIBRARY_RELEASE ${${basename}_LIBRARY_DEBUG}) - SET (${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG}) - SET (${basename}_LIBRARIES ${${basename}_LIBRARY_DEBUG}) - ENDIF (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) - IF (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) + if (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) + set (${basename}_LIBRARY_RELEASE ${${basename}_LIBRARY_DEBUG}) + set (${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG}) + set (${basename}_LIBRARIES ${${basename}_LIBRARY_DEBUG}) + endif (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) + if (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) # if the generator supports configuration types then set # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value - IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET (${basename}_LIBRARY optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) + if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set (${basename}_LIBRARY optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) # if there are no configuration types and CMAKE_BUILD_TYPE has no value # then just use the release libraries - SET (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) - ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET (${basename}_LIBRARIES optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) - ENDIF (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) + set (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) + endif (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set (${basename}_LIBRARIES optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) + endif (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) - SET (${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH "The ${basename} library") + set (${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH "The ${basename} library") - IF (${basename}_LIBRARY) - SET (${basename}_FOUND 1) - ENDIF (${basename}_LIBRARY) + if (${basename}_LIBRARY) + set (${basename}_FOUND 1) + endif (${basename}_LIBRARY) - ENDIF (${basename}_INCLUDE_DIR ) + endif (${basename}_INCLUDE_DIR ) # Make variables changeble to the advanced user MARK_AS_ADVANCED (${basename}_LIBRARY ${basename}_LIBRARY_RELEASE ${basename}_LIBRARY_DEBUG ${basename}_INCLUDE_DIR ) @@ -67,19 +67,19 @@ ENDMACRO (SZIP_ADJUST_LIB_VARS) # Look for the header file. -SET (SZIP_INCLUDE_SEARCH_DIRS +set (SZIP_INCLUDE_SEARCH_DIRS $ENV{SZIP_INSTALL}/include $ENV{SZIP_INSTALL}/include/szip /usr/include /usr/include/szip ) -SET (SZIP_LIB_SEARCH_DIRS +set (SZIP_LIB_SEARCH_DIRS $ENV{SZIP_INSTALL}/lib /usr/lib ) -SET (SZIP_BIN_SEARCH_DIRS +set (SZIP_BIN_SEARCH_DIRS $ENV{SZIP_INSTALL}/bin /usr/bin ) @@ -90,13 +90,13 @@ FIND_PATH (SZIP_INCLUDE_DIR NO_DEFAULT_PATH ) -IF (WIN32) - SET (SZIP_SEARCH_DEBUG_NAMES "sz_d;libsz_d") - SET (SZIP_SEARCH_RELEASE_NAMES "sz;libsz;libszip") -ELSE (WIN32) - SET (SZIP_SEARCH_DEBUG_NAMES "sz_d") - SET (SZIP_SEARCH_RELEASE_NAMES "sz;szip") -ENDIF (WIN32) +if (WIN32) + set (SZIP_SEARCH_DEBUG_NAMES "sz_d;libsz_d") + set (SZIP_SEARCH_RELEASE_NAMES "sz;libsz;libszip") +else (WIN32) + set (SZIP_SEARCH_DEBUG_NAMES "sz_d") + set (SZIP_SEARCH_RELEASE_NAMES "sz;szip") +endif (WIN32) # Look for the library. FIND_LIBRARY (SZIP_LIBRARY_DEBUG @@ -113,67 +113,67 @@ FIND_LIBRARY (SZIP_LIBRARY_RELEASE SZIP_ADJUST_LIB_VARS (SZIP) -IF (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) - SET (SZIP_FOUND 1) - SET (SZIP_LIBRARIES ${SZIP_LIBRARY}) - SET (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR}) - IF (SZIP_LIBRARY_DEBUG) +if (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) + set (SZIP_FOUND 1) + set (SZIP_LIBRARIES ${SZIP_LIBRARY}) + set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR}) + if (SZIP_LIBRARY_DEBUG) GET_FILENAME_COMPONENT (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_DEBUG} PATH) - SET (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) - ELSEIF (SZIP_LIBRARY_RELEASE) + set (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) + elseif (SZIP_LIBRARY_RELEASE) GET_FILENAME_COMPONENT (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_RELEASE} PATH) - SET (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) - ENDIF (SZIP_LIBRARY_DEBUG) + set (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) + endif (SZIP_LIBRARY_DEBUG) -ELSE (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) - SET (SZIP_FOUND 0) - SET (SZIP_LIBRARIES) - SET (SZIP_INCLUDE_DIRS) -ENDIF (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) +else (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) + set (SZIP_FOUND 0) + set (SZIP_LIBRARIES) + set (SZIP_INCLUDE_DIRS) +endif (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) # Report the results. -IF (NOT SZIP_FOUND) - SET (SZIP_DIR_MESSAGE +if (NOT SZIP_FOUND) + set (SZIP_DIR_MESSAGE "SZip was not found. Make sure SZIP_LIBRARY and SZIP_INCLUDE_DIR are set or set the SZIP_INSTALL environment variable." ) - IF (NOT SZIP_FIND_QUIETLY) - MESSAGE (STATUS "${SZIP_DIR_MESSAGE}") - ELSE (NOT SZIP_FIND_QUIETLY) - IF (SZIP_FIND_REQUIRED) - MESSAGE (FATAL_ERROR "SZip was NOT found and is Required by this project") - ENDIF (SZIP_FIND_REQUIRED) - ENDIF (NOT SZIP_FIND_QUIETLY) -ENDIF (NOT SZIP_FOUND) - -IF (SZIP_FOUND) - INCLUDE (CheckSymbolExists) + if (NOT SZIP_FIND_QUIETLY) + message (STATUS "${SZIP_DIR_MESSAGE}") + else (NOT SZIP_FIND_QUIETLY) + if (SZIP_FIND_REQUIRED) + message (FATAL_ERROR "SZip was NOT found and is Required by this project") + endif (SZIP_FIND_REQUIRED) + endif (NOT SZIP_FIND_QUIETLY) +endif (NOT SZIP_FOUND) + +if (SZIP_FOUND) + include (CheckSymbolExists) ############################################# # Find out if SZIP was build using dll's ############################################# # Save required variable - SET (CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) - SET (CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS}) + set (CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set (CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS}) # Add SZIP_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES - SET (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${SZIP_INCLUDE_DIRS}") + set (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${SZIP_INCLUDE_DIRS}") CHECK_SYMBOL_EXISTS (SZIP_BUILT_AS_DYNAMIC_LIB "SZconfig.h" HAVE_SZIP_DLL) - IF (HAVE_SZIP_DLL STREQUAL "TRUE") - SET (HAVE_SZIP_DLL "1") - ENDIF (HAVE_SZIP_DLL STREQUAL "TRUE") + if (HAVE_SZIP_DLL STREQUAL "TRUE") + set (HAVE_SZIP_DLL "1") + endif (HAVE_SZIP_DLL STREQUAL "TRUE") # Restore CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_FLAGS variables - SET (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) - SET (CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE}) + set (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + set (CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE}) # ############################################# -ENDIF (SZIP_FOUND) - -IF (FIND_SZIP_DEBUG) - MESSAGE (STATUS "SZIP_INCLUDE_DIR: ${SZIP_INCLUDE_DIR}") - MESSAGE (STATUS "SZIP_INCLUDE_DIRS: ${SZIP_INCLUDE_DIRS}") - MESSAGE (STATUS "SZIP_LIBRARY_DEBUG: ${SZIP_LIBRARY_DEBUG}") - MESSAGE (STATUS "SZIP_LIBRARY_RELEASE: ${SZIP_LIBRARY_RELEASE}") - MESSAGE (STATUS "HAVE_SZIP_DLL: ${HAVE_SZIP_DLL}") - MESSAGE (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") -ENDIF (FIND_SZIP_DEBUG) +endif (SZIP_FOUND) + +if (FIND_SZIP_DEBUG) + message (STATUS "SZIP_INCLUDE_DIR: ${SZIP_INCLUDE_DIR}") + message (STATUS "SZIP_INCLUDE_DIRS: ${SZIP_INCLUDE_DIRS}") + message (STATUS "SZIP_LIBRARY_DEBUG: ${SZIP_LIBRARY_DEBUG}") + message (STATUS "SZIP_LIBRARY_RELEASE: ${SZIP_LIBRARY_RELEASE}") + message (STATUS "HAVE_SZIP_DLL: ${HAVE_SZIP_DLL}") + message (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") +endif (FIND_SZIP_DEBUG) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 287fa0f..f3e1d75 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -569,7 +569,7 @@ #define H5_PACKAGE_URL "@HDF5_PACKAGE_URL@" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "@HDF5_PACKAGE_VERSION@" +#define H5_PACKAGE_VERSION "@HDF5_PACKAGE_VERSION_STRING@" /* Width for printf() for type `long long' or `__int64', use `ll' */ #cmakedefine H5_PRINTF_LL_WIDTH @H5_PRINTF_LL_WIDTH@ @@ -754,7 +754,7 @@ #cmakedefine H5_USING_MEMCHECKER @H5_USING_MEMCHECKER@ /* Version number of package */ -#define H5_VERSION "@HDF5_PACKAGE_VERSION@" +#define H5_VERSION "@HDF5_PACKAGE_VERSION_STRING@" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index c6be9ff..075920e 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -1,119 +1,119 @@ -cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR) -############################################################################################################### -# This script will build and run the examples from a compressed file -# Execute from a command line: -# ctest -S HDF518_Examples.cmake,HDF5Examples-0.1.1-Source -C Release -O test.log -############################################################################################################### - -set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@/@HDF5_PACKAGE_VERSION@") -set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -set(STATICLIBRARIES "@H5_ENABLE_STATIC_LIB@") -set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG}) -set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) -set(CTEST_BUILD_CONFIGURATION "Release") -#set(NO_MAC_FORTRAN "true") -#set(BUILD_OPTIONS ""${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") -#set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_ENABLE_F2003:BOOL=ON) - -############################################################################################################### -# Adjust the following SET Commands as needed -############################################################################################################### -if(WIN32) - if(STATICLIBRARIES) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DUSE_SHARED_LIBS:BOOL=OFF") - endif(STATICLIBRARIES) - set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake/hdf5") - set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) - set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") - set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") -else(WIN32) - if(STATICLIBRARIES) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DUSE_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - endif(STATICLIBRARIES) - set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake/hdf5") - set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") - set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) - set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") - set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") -endif(WIN32) - -############################################################################################################### -# For any comments please contact cdashhelp@hdfgroup.org -# -############################################################################################################### - -#----------------------------------------------------------------------------- -# MAC machines need special option -#----------------------------------------------------------------------------- -if(APPLE) - # Compiler choice - execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set(ENV{CC} "${XCODE_CC}") - set(ENV{CXX} "${XCODE_CXX}") - if(NOT NO_MAC_FORTRAN) - # Shared fortran is not supported, build static - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else(NOT NO_MAC_FORTRAN) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") - endif(NOT NO_MAC_FORTRAN) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif(APPLE) - -#----------------------------------------------------------------------------- -set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") -## Uncompress source in tar file provided -## -------------------------- -if(WIN32) - set(CTEST_7Z_COMMAND "C:/Program Files/7-Zip/7z.exe") - message("extracting... [${CTEST_7Z_COMMAND} x ${CTEST_SOURCE_NAME}.zip]") - execute_process(COMMAND ${CTEST_7Z_COMMAND} x ${CTEST_SOURCE_NAME}.zip RESULT_VARIABLE rv) -else(WIN32) - message("extracting... [${CTEST_CMAKE_COMMAND} -E tar -xvf ${CTEST_SOURCE_NAME}.tar.gz]") - execute_process(COMMAND tar -xvf ${CTEST_SOURCE_NAME}.tar.gz RESULT_VARIABLE rv) -endif(WIN32) - -if(NOT rv EQUAL 0) - message("extracting... [error-(${rv}) clean up]") - file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") - message(FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") -endif(NOT rv EQUAL 0) - -#----------------------------------------------------------------------------- -## Clear the build directory -## -------------------------- -set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) -file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") -ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) - -# Use multiple CPU cores to build -include(ProcessorCount) -ProcessorCount(N) -if(NOT N EQUAL 0) - if(NOT WIN32) - set(CTEST_BUILD_FLAGS -j${N}) - endif(NOT WIN32) - set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) -endif() -set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" -) - -#----------------------------------------------------------------------------- -## -- set output to english -set($ENV{LC_MESSAGES} "en_EN") - -#----------------------------------------------------------------------------- - ## NORMAL process - ## -------------------------- - CTEST_START (Experimental) - CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}") - CTEST_READ_CUSTOM_FILES ("${CTEST_BINARY_DIRECTORY}") - CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) - CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) - if(res GREATER 0) - message (FATAL_ERROR "tests FAILED") - endif(res GREATER 0) -#----------------------------------------------------------------------------- -############################################################################################################## +cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR)
+###############################################################################################################
+# This script will build and run the examples from a compressed file
+# Execute from a command line:
+# ctest -S HDF518_Examples.cmake,HDF5Examples-0.1.1-Source -C Release -O test.log
+###############################################################################################################
+
+set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
+set(STATICLIBRARIES "@H5_ENABLE_STATIC_LIB@")
+set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG})
+set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY})
+set(CTEST_BUILD_CONFIGURATION "Release")
+#set(NO_MAC_FORTRAN "true")
+#set(BUILD_OPTIONS ""${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF")
+#set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_ENABLE_F2003:BOOL=ON)
+
+###############################################################################################################
+# Adjust the following SET Commands as needed
+###############################################################################################################
+if(WIN32)
+ if(STATICLIBRARIES)
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DUSE_SHARED_LIBS:BOOL=OFF")
+ endif(STATICLIBRARIES)
+ set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake/hdf5")
+ set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build)
+ set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}")
+ set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
+else(WIN32)
+ if(STATICLIBRARIES)
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DUSE_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
+ endif(STATICLIBRARIES)
+ set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake/hdf5")
+ set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib")
+ set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build)
+ set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}")
+ set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}")
+endif(WIN32)
+
+###############################################################################################################
+# For any comments please contact cdashhelp@hdfgroup.org
+#
+###############################################################################################################
+
+#-----------------------------------------------------------------------------
+# MAC machines need special option
+#-----------------------------------------------------------------------------
+if(APPLE)
+ # Compiler choice
+ execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE)
+ execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set(ENV{CC} "${XCODE_CC}")
+ set(ENV{CXX} "${XCODE_CXX}")
+ if(NOT NO_MAC_FORTRAN)
+ # Shared fortran is not supported, build static
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
+ else(NOT NO_MAC_FORTRAN)
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
+ endif(NOT NO_MAC_FORTRAN)
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
+endif(APPLE)
+
+#-----------------------------------------------------------------------------
+set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"")
+## Uncompress source in tar file provided
+## --------------------------
+if(WIN32)
+ set(CTEST_7Z_COMMAND "C:/Program Files/7-Zip/7z.exe")
+ message("extracting... [${CTEST_7Z_COMMAND} x ${CTEST_SOURCE_NAME}.zip]")
+ execute_process(COMMAND ${CTEST_7Z_COMMAND} x ${CTEST_SOURCE_NAME}.zip RESULT_VARIABLE rv)
+else(WIN32)
+ message("extracting... [${CTEST_CMAKE_COMMAND} -E tar -xvf ${CTEST_SOURCE_NAME}.tar.gz]")
+ execute_process(COMMAND tar -xvf ${CTEST_SOURCE_NAME}.tar.gz RESULT_VARIABLE rv)
+endif(WIN32)
+
+if(NOT rv EQUAL 0)
+ message("extracting... [error-(${rv}) clean up]")
+ file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}")
+ message(FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed")
+endif(NOT rv EQUAL 0)
+
+#-----------------------------------------------------------------------------
+## Clear the build directory
+## --------------------------
+set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE)
+file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
+ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
+
+# Use multiple CPU cores to build
+include(ProcessorCount)
+ProcessorCount(N)
+if(NOT N EQUAL 0)
+ if(NOT WIN32)
+ set(CTEST_BUILD_FLAGS -j${N})
+ endif(NOT WIN32)
+ set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
+endif()
+set (CTEST_CONFIGURE_COMMAND
+ "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\""
+)
+
+#-----------------------------------------------------------------------------
+## -- set output to english
+set($ENV{LC_MESSAGES} "en_EN")
+
+#-----------------------------------------------------------------------------
+ ## NORMAL process
+ ## --------------------------
+ CTEST_START (Experimental)
+ CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}")
+ CTEST_READ_CUSTOM_FILES ("${CTEST_BINARY_DIRECTORY}")
+ CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND)
+ CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res)
+ if(res GREATER 0)
+ message (FATAL_ERROR "tests FAILED")
+ endif(res GREATER 0)
+#-----------------------------------------------------------------------------
+##############################################################################################################
message("DONE")
\ No newline at end of file diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index 3e6ee18..d0379db 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -1,31 +1,31 @@ #------------------------------------------------------------------------------- MACRO (H5_SET_LIB_OPTIONS libtarget libname libtype) - SET (LIB_OUT_NAME "${libname}") - IF (${libtype} MATCHES "SHARED") - IF (WIN32) - SET (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) - ELSE (WIN32) - SET (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION}) - ENDIF (WIN32) - SET_TARGET_PROPERTIES (${libtarget} PROPERTIES VERSION ${LIBHDF_VERSION}) - IF (WIN32) - SET (${LIB_OUT_NAME} "${LIB_OUT_NAME}-${HDF5_PACKAGE_SOVERSION}") - ELSE (WIN32) - SET_TARGET_PROPERTIES (${libtarget} PROPERTIES SOVERSION ${HDF5_PACKAGE_SOVERSION}) - ENDIF (WIN32) - ENDIF (${libtype} MATCHES "SHARED") + set (LIB_OUT_NAME "${libname}") + if (${libtype} MATCHES "SHARED") + if (WIN32) + set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) + else (WIN32) + set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION}) + endif (WIN32) + set_target_properties (${libtarget} PROPERTIES VERSION ${LIBHDF_VERSION}) + if (WIN32) + set (${LIB_OUT_NAME} "${LIB_OUT_NAME}-${HDF5_PACKAGE_SOVERSION}") + else (WIN32) + set_target_properties (${libtarget} PROPERTIES SOVERSION ${HDF5_PACKAGE_SOVERSION}) + endif (WIN32) + endif (${libtype} MATCHES "SHARED") HDF_SET_LIB_OPTIONS (${libtarget} ${LIB_OUT_NAME} ${libtype}) #-- Apple Specific install_name for libraries - IF (APPLE) - OPTION (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF) - IF (HDF5_BUILD_WITH_INSTALL_NAME) + if (APPLE) + option (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF) + if (HDF5_BUILD_WITH_INSTALL_NAME) SET_TARGET_PROPERTIES(${libtarget} PROPERTIES LINK_FLAGS "-current_version ${HDF5_PACKAGE_VERSION} -compatibility_version ${HDF5_PACKAGE_VERSION}" INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME} ) - ENDIF (HDF5_BUILD_WITH_INSTALL_NAME) - ENDIF (APPLE) + endif (HDF5_BUILD_WITH_INSTALL_NAME) + endif (APPLE) ENDMACRO (H5_SET_LIB_OPTIONS) diff --git a/config/cmake/HDF5Tests.c b/config/cmake/HDF5Tests.c index 2f69ec8..21206e0 100644 --- a/config/cmake/HDF5Tests.c +++ b/config/cmake/HDF5Tests.c @@ -377,10 +377,10 @@ int main(int argc, char **argv) #endif #ifdef GETTIMEOFDAY_GIVES_TZ +#include <time.h> #ifdef HAVE_SYS_TIME_H #include <sys/time.h> #endif -#include <time.h> int main(void) { struct timeval tv; diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index 8fa76b8..69ff5b3 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -7,7 +7,7 @@ ENABLE_LANGUAGE (Fortran) #----------------------------------------------------------------------------- # Detect name mangling convention used between Fortran and C #----------------------------------------------------------------------------- -INCLUDE (FortranCInterface) +include (FortranCInterface) FortranCInterface_HEADER ( ${CMAKE_BINARY_DIR}/FCMangle.h MACRO_NAMESPACE "H5_FC_" @@ -16,26 +16,26 @@ FortranCInterface_HEADER ( ) FILE (STRINGS ${CMAKE_BINARY_DIR}/FCMangle.h CONTENTS REGEX "H5_FC_GLOBAL\\(.*,.*\\) +(.*)") -STRING (REGEX MATCH "H5_FC_GLOBAL\\(.*,.*\\) +(.*)" RESULT ${CONTENTS}) -SET (H5_FC_FUNC "H5_FC_FUNC(name,NAME) ${CMAKE_MATCH_1}") +string (REGEX MATCH "H5_FC_GLOBAL\\(.*,.*\\) +(.*)" RESULT ${CONTENTS}) +set (H5_FC_FUNC "H5_FC_FUNC(name,NAME) ${CMAKE_MATCH_1}") FILE (STRINGS ${CMAKE_BINARY_DIR}/FCMangle.h CONTENTS REGEX "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)") -STRING (REGEX MATCH "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)" RESULT ${CONTENTS}) -SET (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) ${CMAKE_MATCH_1}") +string (REGEX MATCH "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)" RESULT ${CONTENTS}) +set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) ${CMAKE_MATCH_1}") #----------------------------------------------------------------------------- # The provided CMake Fortran macros don't provide a general check function # so this one is used for a sizeof test. #----------------------------------------------------------------------------- MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) - IF (NOT DEFINED ${VARIABLE}) - MESSAGE (STATUS "Testing Fortran ${FUNCTION}") - IF (CMAKE_REQUIRED_LIBRARIES) - SET (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES + if (NOT DEFINED ${VARIABLE}) + message (STATUS "Testing Fortran ${FUNCTION}") + if (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - ELSE (CMAKE_REQUIRED_LIBRARIES) - SET (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) - ENDIF (CMAKE_REQUIRED_LIBRARIES) + else (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) + endif (CMAKE_REQUIRED_LIBRARIES) FILE (WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f "${CODE}" @@ -47,25 +47,25 @@ MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) OUTPUT_VARIABLE OUTPUT ) -# MESSAGE ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") -# MESSAGE ( "Test result ${OUTPUT}") -# MESSAGE ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") +# message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") +# message ( "Test result ${OUTPUT}") +# message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - IF (${VARIABLE}) - SET (${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}") - MESSAGE (STATUS "Testing Fortran ${FUNCTION} - OK") + if (${VARIABLE}) + set (${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}") + message (STATUS "Testing Fortran ${FUNCTION} - OK") FILE (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n" "${OUTPUT}\n\n" ) - ELSE (${VARIABLE}) - MESSAGE (STATUS "Testing Fortran ${FUNCTION} - Fail") - SET (${VARIABLE} "" CACHE INTERNAL "Have Fortran function ${FUNCTION}") + else (${VARIABLE}) + message (STATUS "Testing Fortran ${FUNCTION} - Fail") + set (${VARIABLE} "" CACHE INTERNAL "Have Fortran function ${FUNCTION}") FILE (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n" "${OUTPUT}\n\n") - ENDIF (${VARIABLE}) - ENDIF (NOT DEFINED ${VARIABLE}) + endif (${VARIABLE}) + endif (NOT DEFINED ${VARIABLE}) ENDMACRO (CHECK_FORTRAN_FEATURE) #----------------------------------------------------------------------------- @@ -131,9 +131,9 @@ CHECK_FORTRAN_FEATURE(iso_c_binding #----------------------------------------------------------------------------- # Add debug information (intel Fortran : JB) #----------------------------------------------------------------------------- -IF (CMAKE_Fortran_COMPILER MATCHES ifort) - IF (WIN32) - SET (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE "flags" STRING FORCE) - SET (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE "flags" STRING FORCE) - ENDIF (WIN32) -ENDIF (CMAKE_Fortran_COMPILER MATCHES ifort) +if (CMAKE_Fortran_COMPILER MATCHES ifort) + if (WIN32) + set (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE "flags" STRING FORCE) + set (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE "flags" STRING FORCE) + endif (WIN32) +endif (CMAKE_Fortran_COMPILER MATCHES ifort) diff --git a/config/cmake/HDFLibMacros.cmake b/config/cmake/HDFLibMacros.cmake index 57e6be7..505a9d5 100644 --- a/config/cmake/HDFLibMacros.cmake +++ b/config/cmake/HDFLibMacros.cmake @@ -3,7 +3,7 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type libtype jpeg_pic) # May need to build JPEG with PIC on x64 machines with gcc # Need to use CMAKE_ANSI_CFLAGS define so that compiler test works - IF (${compress_type} MATCHES "SVN") + if (${compress_type} MATCHES "SVN") EXTERNALPROJECT_ADD (JPEG SVN_REPOSITORY ${JPEG_URL} # [SVN_REVISION rev] @@ -19,7 +19,7 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type libtype jpeg_pic) -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} ) - ELSEIF (${compress_type} MATCHES "TGZ") + elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (JPEG URL ${JPEG_URL} URL_MD5 "" @@ -35,72 +35,72 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type libtype jpeg_pic) -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} ) - ENDIF (${compress_type} MATCHES "SVN") + endif (${compress_type} MATCHES "SVN") EXTERNALPROJECT_GET_PROPERTY (JPEG BINARY_DIR SOURCE_DIR) - IF (${CMAKE_BUILD_TYPE} MATCHES "Debug") - IF (WIN32) - SET (JPEG_LIB_NAME "jpeg_D") - ELSE (WIN32) - SET (JPEG_LIB_NAME "jpeg_debug") - ENDIF (WIN32) - ELSE (${CMAKE_BUILD_TYPE} MATCHES "Debug") - SET (JPEG_LIB_NAME "jpeg") - ENDIF (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (WIN32) + set (JPEG_LIB_NAME "jpeg_D") + else (WIN32) + set (JPEG_LIB_NAME "jpeg_debug") + endif (WIN32) + else (${CMAKE_BUILD_TYPE} MATCHES "Debug") + set (JPEG_LIB_NAME "jpeg") + endif (${CMAKE_BUILD_TYPE} MATCHES "Debug") # Create imported target szip ADD_LIBRARY(jpeg ${libtype} IMPORTED) ADD_DEPENDENCIES (jpeg JPEG) - IF (${libtype} MATCHES "SHARED") - IF (WIN32) - IF (MINGW) + if (${libtype} MATCHES "SHARED") + if (WIN32) + if (MINGW) SET_TARGET_PROPERTIES(jpeg PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${JPEG_LIB_NAME}.lib" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ELSE (MINGW) + else (MINGW) SET_TARGET_PROPERTIES(jpeg PROPERTIES 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) - IF (CYGWIN) + endif (MINGW) + else (WIN32) + if (CYGWIN) SET_TARGET_PROPERTIES(jpeg PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ELSE (CYGWIN) + else (CYGWIN) SET_TARGET_PROPERTIES(jpeg PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" IMPORTED_SONAME "${CMAKE_SHARED_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${JPEG_VERSION_STRING}" SOVERSION "${JPEG_VERSION_STRING}" ) - ENDIF (CYGWIN) - ENDIF (WIN32) - ELSE (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) + endif (CYGWIN) + endif (WIN32) + else (${libtype} MATCHES "SHARED") + if (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(jpeg PROPERTIES 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) + else (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(jpeg PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${JPEG_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - ENDIF (WIN32 AND NOT MINGW) - ENDIF (${libtype} MATCHES "SHARED") + endif (WIN32 AND NOT MINGW) + endif (${libtype} MATCHES "SHARED") -# INCLUDE (${BINARY_DIR}/JPEG-targets.cmake) - SET (JPEG_LIBRARY "jpeg") +# include (${BINARY_DIR}/JPEG-targets.cmake) + set (JPEG_LIBRARY "jpeg") - SET (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}") - SET (JPEG_INCLUDE_DIR "${SOURCE_DIR}/src") - SET (JPEG_FOUND 1) - SET (JPEG_LIBRARIES ${JPEG_LIBRARY}) - SET (JPEG_INCLUDE_DIRS ${JPEG_INCLUDE_DIR_GEN} ${JPEG_INCLUDE_DIR}) + set (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}") + set (JPEG_INCLUDE_DIR "${SOURCE_DIR}/src") + set (JPEG_FOUND 1) + set (JPEG_LIBRARIES ${JPEG_LIBRARY}) + set (JPEG_INCLUDE_DIRS ${JPEG_INCLUDE_DIR_GEN} ${JPEG_INCLUDE_DIR}) ENDMACRO (EXTERNAL_JPEG_LIBRARY) #------------------------------------------------------------------------------- @@ -109,15 +109,15 @@ MACRO (PACKAGE_JPEG_LIBRARY compress_type) COMMAND ${CMAKE_COMMAND} -E copy_if_different ${JPEG_INCLUDE_DIR_GEN}/jconfig.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ COMMENT "Copying ${JPEG_INCLUDE_DIR_GEN}/jconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) - SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/jconfig.h) - IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/jconfig.h) + if (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") ADD_DEPENDENCIES (JPEG-GenHeader-Copy JPEG) - ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + endif (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") ENDMACRO (PACKAGE_JPEG_LIBRARY) #------------------------------------------------------------------------------- MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) - IF (${compress_type} MATCHES "SVN") + if (${compress_type} MATCHES "SVN") EXTERNALPROJECT_ADD (SZIP SVN_REPOSITORY ${SZIP_URL} # [SVN_REVISION rev] @@ -134,7 +134,7 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} ) - ELSEIF (${compress_type} MATCHES "TGZ") + elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (SZIP URL ${SZIP_URL} URL_MD5 "" @@ -151,72 +151,72 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} ) - ENDIF (${compress_type} MATCHES "SVN") + endif (${compress_type} MATCHES "SVN") EXTERNALPROJECT_GET_PROPERTY (SZIP BINARY_DIR SOURCE_DIR) - IF (${CMAKE_BUILD_TYPE} MATCHES "Debug") - IF (WIN32) - SET (SZIP_LIB_NAME "szip_D") - ELSE (WIN32) - SET (SZIP_LIB_NAME "szip_debug") - ENDIF (WIN32) - ELSE (${CMAKE_BUILD_TYPE} MATCHES "Debug") - SET (SZIP_LIB_NAME "szip") - ENDIF (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (WIN32) + set (SZIP_LIB_NAME "szip_D") + else (WIN32) + set (SZIP_LIB_NAME "szip_debug") + endif (WIN32) + else (${CMAKE_BUILD_TYPE} MATCHES "Debug") + set (SZIP_LIB_NAME "szip") + endif (${CMAKE_BUILD_TYPE} MATCHES "Debug") # Create imported target szip ADD_LIBRARY(szip ${libtype} IMPORTED) ADD_DEPENDENCIES (szip SZIP) - IF (${libtype} MATCHES "SHARED") - IF (WIN32) - IF (MINGW) + if (${libtype} MATCHES "SHARED") + if (WIN32) + if (MINGW) SET_TARGET_PROPERTIES(szip PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${SZIP_LIB_NAME}.lib" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ELSE (MINGW) + else (MINGW) SET_TARGET_PROPERTIES(szip PROPERTIES 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) - IF (CYGWIN) + endif (MINGW) + else (WIN32) + if (CYGWIN) SET_TARGET_PROPERTIES(szip PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ELSE (CYGWIN) + else (CYGWIN) SET_TARGET_PROPERTIES(szip PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" IMPORTED_SONAME "${CMAKE_SHARED_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${SZIP_VERSION_STRING}" SOVERSION "${SZIP_VERSION_STRING}" ) - ENDIF (CYGWIN) - ENDIF (WIN32) - ELSE (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) + endif (CYGWIN) + endif (WIN32) + else (${libtype} MATCHES "SHARED") + if (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(szip PROPERTIES 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) + else (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(szip PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${SZIP_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - ENDIF (WIN32 AND NOT MINGW) - ENDIF (${libtype} MATCHES "SHARED") + endif (WIN32 AND NOT MINGW) + endif (${libtype} MATCHES "SHARED") -# INCLUDE (${BINARY_DIR}/SZIP-targets.cmake) - SET (SZIP_LIBRARY "szip") +# include (${BINARY_DIR}/SZIP-targets.cmake) + set (SZIP_LIBRARY "szip") - SET (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}") - SET (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src") - SET (SZIP_FOUND 1) - SET (SZIP_LIBRARIES ${SZIP_LIBRARY}) - SET (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR_GEN} ${SZIP_INCLUDE_DIR}) + set (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}") + set (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src") + set (SZIP_FOUND 1) + set (SZIP_LIBRARIES ${SZIP_LIBRARY}) + set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR_GEN} ${SZIP_INCLUDE_DIR}) ENDMACRO (EXTERNAL_SZIP_LIBRARY) #------------------------------------------------------------------------------- @@ -225,15 +225,15 @@ MACRO (PACKAGE_SZIP_LIBRARY compress_type) COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ COMMENT "Copying ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) - SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SZconfig.h) - IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SZconfig.h) + if (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") ADD_DEPENDENCIES (SZIP-GenHeader-Copy SZIP) - ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + endif (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") ENDMACRO (PACKAGE_SZIP_LIBRARY) #------------------------------------------------------------------------------- MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) - IF (${compress_type} MATCHES "SVN") + if (${compress_type} MATCHES "SVN") EXTERNALPROJECT_ADD (ZLIB SVN_REPOSITORY ${ZLIB_URL} # [SVN_REVISION rev] @@ -249,7 +249,7 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} ) - ELSEIF (${compress_type} MATCHES "TGZ") + elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (ZLIB URL ${ZLIB_URL} URL_MD5 "" @@ -265,76 +265,76 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} ) - ENDIF (${compress_type} MATCHES "SVN") + endif (${compress_type} MATCHES "SVN") EXTERNALPROJECT_GET_PROPERTY (ZLIB BINARY_DIR SOURCE_DIR) - IF (${CMAKE_BUILD_TYPE} MATCHES "Debug") - IF (WIN32) - SET (ZLIB_LIB_NAME "zlib_D") - ELSE (WIN32) - SET (ZLIB_LIB_NAME "z_debug") - ENDIF (WIN32) - ELSE (${CMAKE_BUILD_TYPE} MATCHES "Debug") - IF (WIN32) - SET (ZLIB_LIB_NAME "zlib") - ELSE (WIN32) - SET (ZLIB_LIB_NAME "z") - ENDIF (WIN32) - ENDIF (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (WIN32) + set (ZLIB_LIB_NAME "zlib_D") + else (WIN32) + set (ZLIB_LIB_NAME "z_debug") + endif (WIN32) + else (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (WIN32) + set (ZLIB_LIB_NAME "zlib") + else (WIN32) + set (ZLIB_LIB_NAME "z") + endif (WIN32) + endif (${CMAKE_BUILD_TYPE} MATCHES "Debug") # Create imported target szip ADD_LIBRARY(zlib ${libtype} IMPORTED) ADD_DEPENDENCIES (zlib ZLIB) - IF (${libtype} MATCHES "SHARED") - IF (WIN32) - IF (MINGW) + if (${libtype} MATCHES "SHARED") + if (WIN32) + if (MINGW) SET_TARGET_PROPERTIES(zlib PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${ZLIB_LIB_NAME}.lib" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ELSE (MINGW) + else (MINGW) SET_TARGET_PROPERTIES(zlib PROPERTIES 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) - IF (CYGWIN) + endif (MINGW) + else (WIN32) + if (CYGWIN) SET_TARGET_PROPERTIES(zlib PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ELSE (CYGWIN) + else (CYGWIN) SET_TARGET_PROPERTIES(zlib PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" IMPORTED_SONAME "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${ZLIB_VERSION_STRING}" SOVERSION "${ZLIB_VERSION_STRING}" ) - ENDIF (CYGWIN) - ENDIF (WIN32) - ELSE (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) + endif (CYGWIN) + endif (WIN32) + else (${libtype} MATCHES "SHARED") + if (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(zlib PROPERTIES 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) + else (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(zlib PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${ZLIB_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - ENDIF (WIN32 AND NOT MINGW) - ENDIF (${libtype} MATCHES "SHARED") + endif (WIN32 AND NOT MINGW) + endif (${libtype} MATCHES "SHARED") -# INCLUDE (${BINARY_DIR}/ZLIB-targets.cmake) - SET (ZLIB_LIBRARY "zlib") +# include (${BINARY_DIR}/ZLIB-targets.cmake) + set (ZLIB_LIBRARY "zlib") - SET (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}") - SET (ZLIB_INCLUDE_DIR "${SOURCE_DIR}") - SET (ZLIB_FOUND 1) - SET (ZLIB_LIBRARIES ${ZLIB_LIBRARY}) - SET (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR_GEN} ${ZLIB_INCLUDE_DIR}) + set (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}") + set (ZLIB_INCLUDE_DIR "${SOURCE_DIR}") + set (ZLIB_FOUND 1) + set (ZLIB_LIBRARIES ${ZLIB_LIBRARY}) + set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR_GEN} ${ZLIB_INCLUDE_DIR}) ENDMACRO (EXTERNAL_ZLIB_LIBRARY) #------------------------------------------------------------------------------- @@ -343,8 +343,8 @@ MACRO (PACKAGE_ZLIB_LIBRARY compress_type) COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_INCLUDE_DIR_GEN}/zconf.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ COMMENT "Copying ${ZLIB_INCLUDE_DIR_GEN}/zconf.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) - SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/zconf.h) - IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/zconf.h) + if (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") ADD_DEPENDENCIES (ZLIB-GenHeader-Copy ZLIB) - ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + endif (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") ENDMACRO (PACKAGE_ZLIB_LIBRARY) diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake index b0788f2..56fdf83 100644 --- a/config/cmake/HDFMacros.cmake +++ b/config/cmake/HDFMacros.cmake @@ -1,52 +1,52 @@ #------------------------------------------------------------------------------- MACRO (SET_GLOBAL_VARIABLE name value) - SET (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE) + set (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE) ENDMACRO (SET_GLOBAL_VARIABLE) #------------------------------------------------------------------------------- MACRO (IDE_GENERATED_PROPERTIES SOURCE_PATH HEADERS SOURCES) #set(source_group_path "Source/AIM/${NAME}") - STRING (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH}) + string (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH}) source_group (${source_group_path} FILES ${HEADERS} ${SOURCES}) #-- The following is needed if we ever start to use OS X Frameworks but only #-- works on CMake 2.6 and greater - #SET_PROPERTY (SOURCE ${HEADERS} + #set_property (SOURCE ${HEADERS} # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} #) ENDMACRO (IDE_GENERATED_PROPERTIES) #------------------------------------------------------------------------------- MACRO (IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES) - # INSTALL (FILES ${HEADERS} + # install (FILES ${HEADERS} # DESTINATION include/R3D/${NAME} # COMPONENT Headers # ) - STRING (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH} ) + string (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH} ) source_group (${source_group_path} FILES ${HEADERS} ${SOURCES}) #-- The following is needed if we ever start to use OS X Frameworks but only #-- works on CMake 2.6 and greater - #SET_PROPERTY (SOURCE ${HEADERS} + #set_property (SOURCE ${HEADERS} # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} #) ENDMACRO (IDE_SOURCE_PROPERTIES) #------------------------------------------------------------------------------- MACRO (TARGET_NAMING libtarget libtype) - IF (WIN32) - IF (${libtype} MATCHES "SHARED") - SET_TARGET_PROPERTIES (${libtarget} PROPERTIES OUTPUT_NAME "${libtarget}dll") - ENDIF (${libtype} MATCHES "SHARED") - ENDIF (WIN32) + if (WIN32) + if (${libtype} MATCHES "SHARED") + set_target_properties (${libtarget} PROPERTIES OUTPUT_NAME "${libtarget}dll") + endif (${libtype} MATCHES "SHARED") + endif (WIN32) ENDMACRO (TARGET_NAMING) #------------------------------------------------------------------------------- MACRO (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) - IF (WIN32 AND MSVC) - GET_TARGET_PROPERTY (target_name ${libtarget} RELWITHDEBINFO_OUTPUT_NAME) - INSTALL ( + if (WIN32 AND MSVC) + get_target_property (target_name ${libtarget} RELWITHDEBINFO_OUTPUT_NAME) + install ( FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${target_name}.pdb DESTINATION @@ -54,15 +54,15 @@ MACRO (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) CONFIGURATIONS RelWithDebInfo COMPONENT ${targetcomponent} ) - ENDIF (WIN32 AND MSVC) + endif (WIN32 AND MSVC) ENDMACRO (INSTALL_TARGET_PDB) #------------------------------------------------------------------------------- MACRO (INSTALL_PROGRAM_PDB progtarget targetdestination targetcomponent) - IF (WIN32 AND MSVC) - GET_TARGET_PROPERTY (target_name ${progtarget} RELWITHDEBINFO_OUTPUT_NAME) - GET_TARGET_PROPERTY (target_prefix ${progtarget} PREFIX) - INSTALL ( + if (WIN32 AND MSVC) + get_target_property (target_name ${progtarget} RELWITHDEBINFO_OUTPUT_NAME) + get_target_property (target_prefix ${progtarget} PREFIX) + install ( FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${target_prefix}${target_name}.pdb DESTINATION @@ -70,37 +70,37 @@ MACRO (INSTALL_PROGRAM_PDB progtarget targetdestination targetcomponent) CONFIGURATIONS RelWithDebInfo COMPONENT ${targetcomponent} ) - ENDIF (WIN32 AND MSVC) + 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") - IF (WIN32) - SET (LIB_RELEASE_NAME "${libname}") - SET (LIB_DEBUG_NAME "${libname}_D") - ELSE (WIN32) - SET (LIB_RELEASE_NAME "${libname}") - SET (LIB_DEBUG_NAME "${libname}_debug") - ENDIF (WIN32) - ELSE (${libtype} MATCHES "SHARED") - IF (WIN32) - SET (LIB_RELEASE_NAME "lib${libname}") - SET (LIB_DEBUG_NAME "lib${libname}_D") - ELSE (WIN32) + if (${libtype} MATCHES "SHARED") + if (WIN32) + set (LIB_RELEASE_NAME "${libname}") + set (LIB_DEBUG_NAME "${libname}_D") + else (WIN32) + set (LIB_RELEASE_NAME "${libname}") + set (LIB_DEBUG_NAME "${libname}_debug") + endif (WIN32) + else (${libtype} MATCHES "SHARED") + if (WIN32) + set (LIB_RELEASE_NAME "lib${libname}") + set (LIB_DEBUG_NAME "lib${libname}_D") + else (WIN32) # if the generator supports configuration types or if the CMAKE_BUILD_TYPE has a value - IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET (LIB_RELEASE_NAME "${libname}") - SET (LIB_DEBUG_NAME "${libname}_debug") - ELSE (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET (LIB_RELEASE_NAME "lib${libname}") - SET (LIB_DEBUG_NAME "lib${libname}_debug") - ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - ENDIF (WIN32) - ENDIF (${libtype} MATCHES "SHARED") + if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set (LIB_RELEASE_NAME "${libname}") + set (LIB_DEBUG_NAME "${libname}_debug") + else (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set (LIB_RELEASE_NAME "lib${libname}") + set (LIB_DEBUG_NAME "lib${libname}_debug") + endif (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + endif (WIN32) + endif (${libtype} MATCHES "SHARED") - SET_TARGET_PROPERTIES (${libtarget} + set_target_properties (${libtarget} PROPERTIES DEBUG_OUTPUT_NAME ${LIB_DEBUG_NAME} RELEASE_OUTPUT_NAME ${LIB_RELEASE_NAME} @@ -109,79 +109,79 @@ MACRO (HDF_SET_LIB_OPTIONS libtarget libname libtype) ) #----- Use MSVC Naming conventions for Shared Libraries - IF (MINGW AND ${libtype} MATCHES "SHARED") - SET_TARGET_PROPERTIES (${libtarget} + if (MINGW AND ${libtype} MATCHES "SHARED") + set_target_properties (${libtarget} PROPERTIES IMPORT_SUFFIX ".lib" IMPORT_PREFIX "" PREFIX "" ) - ENDIF (MINGW AND ${libtype} MATCHES "SHARED") + endif (MINGW AND ${libtype} MATCHES "SHARED") ENDMACRO (HDF_SET_LIB_OPTIONS) #------------------------------------------------------------------------------- MACRO (TARGET_C_PROPERTIES wintarget addcompileflags addlinkflags) - IF (MSVC) + if (MSVC) TARGET_MSVC_PROPERTIES (${wintarget} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") - ELSE (MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${wintarget} + else (MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" ) - ELSE (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${wintarget} + else (BUILD_SHARED_LIBS) + set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" ) - ENDIF (BUILD_SHARED_LIBS) - ENDIF (MSVC) + endif (BUILD_SHARED_LIBS) + endif (MSVC) ENDMACRO (TARGET_C_PROPERTIES) #------------------------------------------------------------------------------- MACRO (TARGET_MSVC_PROPERTIES wintarget addcompileflags addlinkflags) - IF (MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${wintarget} + if (MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" ) - ELSE (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${wintarget} + else (BUILD_SHARED_LIBS) + set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" ) - ENDIF (BUILD_SHARED_LIBS) - ENDIF (MSVC) + endif (BUILD_SHARED_LIBS) + endif (MSVC) ENDMACRO (TARGET_MSVC_PROPERTIES) #------------------------------------------------------------------------------- MACRO (TARGET_FORTRAN_PROPERTIES forttarget addcompileflags addlinkflags) - IF (WIN32) + if (WIN32) TARGET_FORTRAN_WIN_PROPERTIES (${forttarget} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") - ENDIF (WIN32) + endif (WIN32) ENDMACRO (TARGET_FORTRAN_PROPERTIES) #------------------------------------------------------------------------------- MACRO (TARGET_FORTRAN_WIN_PROPERTIES forttarget addcompileflags addlinkflags) - IF (MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${forttarget} + if (MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "/dll ${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" ) - ELSE (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${forttarget} + else (BUILD_SHARED_LIBS) + set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" ) - ENDIF (BUILD_SHARED_LIBS) - ENDIF (MSVC) + endif (BUILD_SHARED_LIBS) + endif (MSVC) ENDMACRO (TARGET_FORTRAN_WIN_PROPERTIES) diff --git a/config/cmake/NSIS.template.in b/config/cmake/NSIS.template.in index f28db0f..ecced05 100644 --- a/config/cmake/NSIS.template.in +++ b/config/cmake/NSIS.template.in @@ -25,7 +25,7 @@ !include "MUI.nsh" ;Default installation folder - InstallDir "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_DIRECTORY@\@CPACK_PACKAGE_VERSION@" + InstallDir "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_INSTALL_DIRECTORY@" ;-------------------------------- ;General @@ -37,7 +37,7 @@ ;Set compression SetCompressor @CPACK_NSIS_COMPRESSOR@ -@CPACK_NSIS_DEFINES@ +@CPACK_NSIS_DEFINES@ !include Sections.nsh @@ -71,10 +71,10 @@ Var AR_RegFlags ; This macro reads component installed flag from the registry and ;changes checked state of the section on the components page. ;Input: section index constant name specified in Section command. - + ClearErrors ;Reading component status from registry - ReadRegDWORD $AR_RegFlags HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" "Installed" + ReadRegDWORD $AR_RegFlags HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@\Components\${SecName}" "Installed" IfErrors "default_${SecName}" ;Status will stay default if registry value not found ;(component was never installed) @@ -86,20 +86,20 @@ Var AR_RegFlags ; Note whether this component was installed before !insertmacro StoreVar ${SecName}_was_installed $AR_RegFlags IntOp $R0 $AR_RegFlags & $AR_RegFlags - + ;Writing modified flags SectionSetFlags ${${SecName}} $AR_SecFlags - + "default_${SecName}:" !insertmacro LoadSectionSelectedIntoVar ${SecName} ${SecName}_selected !macroend - + !macro FinishSection SecName ; This macro reads section flag set by user and removes the section ;if it is not selected. ;Then it writes component installed flag to registry ;Input: section index constant name specified in Section command. - + SectionGetFlags ${${SecName}} $AR_SecFlags ;Reading section flags ;Checking lowest bit: IntOp $AR_SecFlags $AR_SecFlags & ${SF_SELECTED} @@ -107,23 +107,23 @@ Var AR_RegFlags ;Section is not selected: ;Calling Section uninstall macro and writing zero installed flag !insertmacro "Remove_${${SecName}}" - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" \ + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@\Components\${SecName}" \ "Installed" 0 Goto "exit_${SecName}" - + "leave_${SecName}:" ;Section is selected: - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" \ + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@\Components\${SecName}" \ "Installed" 1 - + "exit_${SecName}:" !macroend - -!macro RemoveSection SecName + +!macro RemoveSection_CPack SecName ; This macro is used to call section's Remove_... macro ;from the uninstaller. ;Input: section index constant name specified in Section command. - + !insertmacro "Remove_${${SecName}}" !macroend @@ -132,18 +132,18 @@ Var AR_RegFlags !insertmacro LoadVar ${SecName}_selected SectionGetFlags ${${SecName}} $R1 IntOp $R1 $R1 & ${SF_SELECTED} ;Turn off all other bits - + ; See if the status has changed: IntCmp $R0 $R1 "${SecName}_unchanged" !insertmacro LoadSectionSelectedIntoVar ${SecName} ${SecName}_selected - + IntCmp $R1 ${SF_SELECTED} "${SecName}_was_selected" !insertmacro "Deselect_required_by_${SecName}" goto "${SecName}_unchanged" - + "${SecName}_was_selected:" !insertmacro "Select_${SecName}_depends" - + "${SecName}_unchanged:" !macroend ;--- End of Add/Remove macros --- @@ -153,7 +153,7 @@ Var AR_RegFlags !define MUI_HEADERIMAGE !define MUI_ABORTWARNING - + ;-------------------------------- ; path functions @@ -168,7 +168,7 @@ Var AR_RegFlags !include "WinMessages.NSH" !verbose 4 ;==================================================== -; get_NT_environment +; get_NT_environment ; Returns: the selected environment ; Output : head of the stack ;==================================================== @@ -198,22 +198,22 @@ FunctionEnd !define WriteEnvStr_RegKey 'HKCU "Environment"' !endif !endif - + ; AddToPath - Adds the given dir to the search path. ; Input - head of the stack ; Note - Win9x systems requires reboot - + Function AddToPath Exch $0 Push $1 Push $2 Push $3 - + # don't add if the path doesn't exist IfFileExists "$0\*.*" "" AddToPath_done - + ReadEnvStr $1 PATH - ; if the path is too long for a NSIS variable NSIS will return a 0 + ; if the path is too long for a NSIS variable NSIS will return a 0 ; length string. If we find that, then warn and skip any path ; modification as it will trash the existing path. StrLen $2 $1 @@ -243,7 +243,7 @@ Function AddToPath Call StrStr Pop $2 StrCmp $2 "" "" AddToPath_done - + Call IsNT Pop $1 StrCmp $1 1 AddToPath_NT @@ -258,7 +258,7 @@ Function AddToPath FileClose $1 SetRebootFlag true Goto AddToPath_done - + AddToPath_NT: StrCmp $ADD_TO_PATH_ALL_USERS "1" ReadAllKey ReadRegStr $1 ${NT_current_env} "PATH" @@ -279,7 +279,7 @@ Function AddToPath WriteRegExpandStr ${NT_all_env} "PATH" $0 DoSend: SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 - + AddToPath_done: Pop $3 Pop $2 @@ -287,10 +287,10 @@ Function AddToPath Pop $0 FunctionEnd - + ; RemoveFromPath - Remove a given dir from the path ; Input: head of the stack - + Function un.RemoveFromPath Exch $0 Push $1 @@ -299,9 +299,9 @@ Function un.RemoveFromPath Push $4 Push $5 Push $6 - + IntFmt $6 "%c" 26 # DOS EOF - + Call un.IsNT Pop $1 StrCmp $1 1 unRemoveFromPath_NT @@ -313,7 +313,7 @@ Function un.RemoveFromPath GetFullPathName /SHORT $0 $0 StrCpy $0 "SET PATH=%PATH%;$0" Goto unRemoveFromPath_dosLoop - + unRemoveFromPath_dosLoop: FileRead $1 $3 StrCpy $5 $3 1 -1 # read last char @@ -328,7 +328,7 @@ Function un.RemoveFromPath unRemoveFromPath_dosLoopRemoveLine: SetRebootFlag true Goto unRemoveFromPath_dosLoop - + unRemoveFromPath_dosLoopEnd: FileClose $2 FileClose $1 @@ -337,7 +337,7 @@ Function un.RemoveFromPath CopyFiles /SILENT $4 "$1\autoexec.bat" Delete $4 Goto unRemoveFromPath_done - + unRemoveFromPath_NT: StrCmp $ADD_TO_PATH_ALL_USERS "1" unReadAllKey ReadRegStr $1 ${NT_current_env} "PATH" @@ -361,11 +361,11 @@ Function un.RemoveFromPath StrCpy $5 $1 -$4 # $5 is now the part before the path to remove StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove StrCpy $3 $5$6 - + StrCpy $5 $3 1 -1 # copy last char StrCmp $5 ";" 0 +2 # if last char == ; StrCpy $3 $3 -1 # remove last char - + StrCmp $ADD_TO_PATH_ALL_USERS "1" unWriteAllKey WriteRegExpandStr ${NT_current_env} "PATH" $3 Goto unDoSend @@ -373,7 +373,7 @@ Function un.RemoveFromPath WriteRegExpandStr ${NT_all_env} "PATH" $3 unDoSend: SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 - + unRemoveFromPath_done: Pop $6 Pop $5 @@ -383,7 +383,7 @@ Function un.RemoveFromPath Pop $1 Pop $0 FunctionEnd - + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Uninstall sutff ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -391,7 +391,7 @@ FunctionEnd ########################################### # Utility Functions # ########################################### - + ;==================================================== ; IsNT - Returns 1 if the current system is NT, 0 ; otherwise. @@ -405,7 +405,7 @@ FunctionEnd ; Call IsNT ; Pop $R0 ; ($R0 at this point is 1 or 0) - + !macro IsNT un Function ${un}IsNT Push $0 @@ -415,7 +415,7 @@ Function ${un}IsNT Pop $0 Push 0 Return - + IsNT_yes: ; NT!!! Pop $0 @@ -424,7 +424,7 @@ FunctionEnd !macroend !insertmacro IsNT "" !insertmacro IsNT "un." - + ; StrStr ; input, top of stack = string to search for ; top of stack-1 = string to search in @@ -437,7 +437,7 @@ FunctionEnd ; Call StrStr ; Pop $R0 ; ($R0 at this point is "ass string") - + !macro StrStr un Function ${un}StrStr Exch $R1 ; st=haystack,old$R1, $R1=needle @@ -472,28 +472,28 @@ FunctionEnd !insertmacro StrStr "un." Function Trim ; Added by Pelaca - Exch $R1 - Push $R2 + Exch $R1 + Push $R2 Loop: - StrCpy $R2 "$R1" 1 -1 - StrCmp "$R2" " " RTrim - StrCmp "$R2" "$\n" RTrim - StrCmp "$R2" "$\r" RTrim - StrCmp "$R2" ";" RTrim - GoTo Done -RTrim: - StrCpy $R1 "$R1" -1 - Goto Loop + StrCpy $R2 "$R1" 1 -1 + StrCmp "$R2" " " RTrim + StrCmp "$R2" "$\n" RTrim + StrCmp "$R2" "$\r" RTrim + StrCmp "$R2" ";" RTrim + GoTo Done +RTrim: + StrCpy $R1 "$R1" -1 + Goto Loop Done: - Pop $R2 - Exch $R1 + Pop $R2 + Exch $R1 FunctionEnd Function ConditionalAddToRegisty Pop $0 Pop $1 StrCmp "$0" "" ConditionalAddToRegisty_EmptyString - WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" \ + WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" \ "$1" "$0" ;MessageBox MB_OK "Set Registry: '$1' to '$0'" DetailPrint "Set install registry entry: '$1' to '$0'" @@ -516,7 +516,7 @@ Function DownloadFile try_again: NSISdl::download "$1/$0" "$INSTDIR\$0" - + Pop $1 StrCmp $1 "success" success StrCmp $1 "Cancelled" cancel @@ -549,10 +549,10 @@ FunctionEnd !insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@" Page custom InstallOptionsPage !insertmacro MUI_PAGE_DIRECTORY - + ;Start Menu Folder Page Configuration - !define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX" - !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" + !define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX" + !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER @@ -637,11 +637,12 @@ Section "-Core installation" ;Use the entire tree produced by the INSTALL target. Keep the ;list of directories here in sync with the RMDir commands below. SetOutPath "$INSTDIR" + @CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS@ @CPACK_NSIS_FULL_INSTALL@ - + ;Store installation folder WriteRegStr SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "" $INSTDIR - + ;Create uninstaller WriteUninstaller "$INSTDIR\Uninstall.exe" Push "DisplayName" @@ -659,7 +660,7 @@ Section "-Core installation" Push "NoRepair" Push "1" Call ConditionalAddToRegisty - + !ifdef CPACK_NSIS_ADD_REMOVE ;Create add/remove functionality Push "ModifyPath" @@ -670,7 +671,7 @@ Section "-Core installation" Push "1" Call ConditionalAddToRegisty !endif - + ; Optional registration Push "DisplayIcon" Push "$INSTDIR\@CPACK_NSIS_INSTALLED_ICON_NAME@" @@ -686,7 +687,7 @@ Section "-Core installation" Call ConditionalAddToRegisty !insertmacro MUI_INSTALLOPTIONS_READ $INSTALL_DESKTOP "NSIS.InstallOptions.ini" "Field 5" "State" !insertmacro MUI_STARTMENU_WRITE_BEGIN Application - + ;Create shortcuts CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" @CPACK_NSIS_CREATE_ICONS@ @@ -724,7 +725,7 @@ SectionEnd Section "-Add to path" Push $INSTDIR\bin StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 doNotAddToPath - StrCmp $DO_NOT_ADD_TO_PATH "1" doNotAddToPath 0 + StrCmp $DO_NOT_ADD_TO_PATH "1" doNotAddToPath 0 Call AddToPath doNotAddToPath: SectionEnd @@ -755,12 +756,12 @@ Function un.onInit SetShellVarContext all ;MessageBox MB_OK 'User "$0" is in the Power Users group' Goto done - + noLM: ;Get installation folder from registry if available done: - + FunctionEnd ;--- Add/Remove callback functions: --- @@ -769,25 +770,25 @@ FunctionEnd ;List all of your components in following manner here. @CPACK_NSIS_COMPONENT_SECTION_LIST@ !macroend - + Section -FinishComponents ;Removes unselected components and writes component status to registry !insertmacro SectionList "FinishSection" - -!ifdef CPACK_NSIS_ADD_REMOVE + +!ifdef CPACK_NSIS_ADD_REMOVE ; Get the name of the installer executable System::Call 'kernel32::GetModuleFileNameA(i 0, t .R0, i 1024) i r1' StrCpy $R3 $R0 - + ; Strip off the last 13 characters, to see if we have AddRemove.exe StrLen $R1 $R0 IntOp $R1 $R0 - 13 StrCpy $R2 $R0 13 $R1 StrCmp $R2 "AddRemove.exe" addremove_installed - + ; We're not running AddRemove.exe, so install it CopyFiles $R3 $INSTDIR\AddRemove.exe - + addremove_installed: !endif SectionEnd @@ -804,17 +805,17 @@ FunctionEnd Section "Uninstall" ReadRegStr $START_MENU SHCTX \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "StartMenu" + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "StartMenu" ;MessageBox MB_OK "Start menu is in: $START_MENU" ReadRegStr $DO_NOT_ADD_TO_PATH SHCTX \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "DoNotAddToPath" + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "DoNotAddToPath" ReadRegStr $ADD_TO_PATH_ALL_USERS SHCTX \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "AddToPathAllUsers" + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "AddToPathAllUsers" ReadRegStr $ADD_TO_PATH_CURRENT_USER SHCTX \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "AddToPathCurrentUser" + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "AddToPathCurrentUser" ;MessageBox MB_OK "Add to path: $DO_NOT_ADD_TO_PATH all users: $ADD_TO_PATH_ALL_USERS" ReadRegStr $INSTALL_DESKTOP SHCTX \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "InstallToDesktop" + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "InstallToDesktop" ;MessageBox MB_OK "Install to desktop: $INSTALL_DESKTOP " @CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS@ @@ -824,14 +825,14 @@ Section "Uninstall" @CPACK_NSIS_DELETE_FILES@ @CPACK_NSIS_DELETE_DIRECTORIES@ -!ifdef CPACK_NSIS_ADD_REMOVE +!ifdef CPACK_NSIS_ADD_REMOVE ;Remove the add/remove program Delete "$INSTDIR\AddRemove.exe" !endif ;Remove the uninstaller itself. Delete "$INSTDIR\Uninstall.exe" - DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" + DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" ;Remove the installation directory if it is empty. RMDir "$INSTDIR" @@ -840,24 +841,24 @@ Section "Uninstall" DeleteRegKey SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" ; Removes all optional components - !insertmacro SectionList "RemoveSection" - + !insertmacro SectionList "RemoveSection_CPack" + !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP - + Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" @CPACK_NSIS_DELETE_ICONS@ @CPACK_NSIS_DELETE_ICONS_EXTRA@ - + ;Delete empty start menu parent diretories StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" - + startMenuDeleteLoop: ClearErrors RMDir $MUI_TEMP GetFullPathName $MUI_TEMP "$MUI_TEMP\.." - + IfErrors startMenuDeleteLoopDone - + StrCmp "$MUI_TEMP" "$SMPROGRAMS" startMenuDeleteLoopDone startMenuDeleteLoop startMenuDeleteLoopDone: @@ -866,17 +867,17 @@ Section "Uninstall" StrCpy $MUI_TEMP "$START_MENU" Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" @CPACK_NSIS_DELETE_ICONS_EXTRA@ - + ;Delete empty start menu parent diretories StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" - + secondStartMenuDeleteLoop: ClearErrors RMDir $MUI_TEMP GetFullPathName $MUI_TEMP "$MUI_TEMP\.." - + IfErrors secondStartMenuDeleteLoopDone - + StrCmp "$MUI_TEMP" "$SMPROGRAMS" secondStartMenuDeleteLoopDone secondStartMenuDeleteLoop secondStartMenuDeleteLoopDone: @@ -899,22 +900,46 @@ SectionEnd ; "Program Files" for AllUsers, "My Documents" for JustMe... Function .onInit + StrCmp "@CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL@" "ON" 0 inst + + ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "UninstallString" + StrCmp $0 "" inst + + MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION \ + "@CPACK_NSIS_PACKAGE_NAME@ is already installed. $\n$\nDo you want to uninstall the old version before installing the new one?" \ + IDYES uninst IDNO inst + Abort + +;Run the uninstaller +uninst: + ClearErrors + StrLen $2 "\Uninstall.exe" + StrCpy $3 $0 -$2 # remove "\Uninstall.exe" from UninstallString to get path + ExecWait '$0 _?=$3' ;Do not copy the uninstaller to a temp file + + IfErrors uninst_failed inst +uninst_failed: + MessageBox MB_OK|MB_ICONSTOP "Uninstall failed." + Abort + + +inst: ; Reads components status for registry !insertmacro SectionList "InitSection" - ; check to see if /D has been used to change - ; the install directory by comparing it to the + ; check to see if /D has been used to change + ; the install directory by comparing it to the ; install directory that is expected to be the ; default StrCpy $IS_DEFAULT_INSTALLDIR 0 - StrCmp "$INSTDIR" "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_DIRECTORY@\@CPACK_PACKAGE_VERSION@" 0 +2 + StrCmp "$INSTDIR" "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_INSTALL_DIRECTORY@" 0 +2 StrCpy $IS_DEFAULT_INSTALLDIR 1 - + StrCpy $SV_ALLUSERS "JustMe" ; if default install dir then change the default ; if it is installed for JustMe StrCmp "$IS_DEFAULT_INSTALLDIR" "1" 0 +2 - StrCpy $INSTDIR "$DOCUMENTS\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_DIRECTORY@\@CPACK_PACKAGE_VERSION@" + StrCpy $INSTDIR "$DOCUMENTS\@CPACK_PACKAGE_INSTALL_DIRECTORY@" ClearErrors UserInfo::GetName @@ -922,17 +947,17 @@ Function .onInit Pop $0 UserInfo::GetAccountType Pop $1 - StrCmp $1 "Admin" 0 +3 + StrCmp $1 "Admin" 0 +4 SetShellVarContext all ;MessageBox MB_OK 'User "$0" is in the Admin group' StrCpy $SV_ALLUSERS "AllUsers" Goto done - StrCmp $1 "Power" 0 +3 + StrCmp $1 "Power" 0 +4 SetShellVarContext all ;MessageBox MB_OK 'User "$0" is in the Power Users group' StrCpy $SV_ALLUSERS "AllUsers" Goto done - + noLM: StrCpy $SV_ALLUSERS "AllUsers" ;Get installation folder from registry if available @@ -940,7 +965,7 @@ Function .onInit done: StrCmp $SV_ALLUSERS "AllUsers" 0 +3 StrCmp "$IS_DEFAULT_INSTALLDIR" "1" 0 +2 - StrCpy $INSTDIR "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_DIRECTORY@\@CPACK_PACKAGE_VERSION@" + StrCpy $INSTDIR "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_INSTALL_DIRECTORY@" StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 noOptionsPage !insertmacro MUI_INSTALLOPTIONS_EXTRACT "NSIS.InstallOptions.ini" diff --git a/config/cmake/PkgInfo.in b/config/cmake/PkgInfo.in new file mode 100644 index 0000000..e530f88 --- /dev/null +++ b/config/cmake/PkgInfo.in @@ -0,0 +1 @@ +FMWK????
\ No newline at end of file diff --git a/config/cmake/README.txt.cmake.in b/config/cmake/README.txt.cmake.in new file mode 100755 index 0000000..4d3ab3d --- /dev/null +++ b/config/cmake/README.txt.cmake.in @@ -0,0 +1,53 @@ +@HDF5_PACKAGE_NAME@ version @HDF5_PACKAGE_VERSION_STRING@
+------------------------------------------------------------------------------
+
+This directory contains the binary (release) distribution of
+@HDF5_PACKAGE_NAME@ @HDF5_PACKAGE_VERSION_MAJOR@ that was compiled on;
+ @BINARY_PLATFORM@.
+
+It was built with the following options:
+ -- @LIB_TYPE@ C/C++/Fortran libraries
+ -- SZIP (encoder enabled) and ZLIB
+ -- @LIB_TYPE@ HDF5 tools
+
+The contents of this directory are:
+
+ COPYING - Copyright notice
+ README.txt - This file
+ @HDF5_PACKAGE_NAME@-@HDF5_PACKAGE_VERSION@-@BINARY_SYSTEM_NAME@.@BINARY_INSTALL_ENDING@ - HDF5 Install Package
+
+Installation
+===========================================================================
+1. Execute @HDF5_PACKAGE_NAME@-@HDF5_PACKAGE_VERSION@-@BINARY_SYSTEM_NAME@.@BINARY_INSTALL_ENDING@
+2. Follow prompts
+===========================================================================
+
+After Installation
+===========================================================================
+The compressed examples file HDF5Examples-0.1.1-Source.@BINARY_EXAMPLE_ENDING@, located in the
+HDF5 install folder, can be built and tested with CMake and the supplied
+HDF518_Examples.cmake file. The HDF518_Examples.cmake expects HDF5 to have
+been installed in the default location with above compilers.
+
+To test the installation with the examples;
+ Create a directory to run the examples.
+ Copy HDF5Examples-0.1.1-Source.@BINARY_EXAMPLE_ENDING@ to this directory, do NOT unzip.
+ Copy HDF518_Examples.cmake to this directory.
+ Edit HDF518_Examples.cmake line 8 to set INSTALLDIR to where HDF5 is installed.
+ Execute from this directory:
+ ctest -S HDF518_Examples.cmake,HDF5Examples-0.1.1-Source -C Release -O test.log
+
+When executed, the ctest script will save the results to the log file, test.log, as
+indicated by the ctest command. If you wish the to see more build and test information,
+add "-VV" to the ctest command.
+
+For more information see USING_CMake_Examples.txt in the install folder.
+===========================================================================
+
+Documentation for this release can be found at the following URL:
+ http://www.hdfgroup.org/HDF5/doc/.
+
+See the HDF5 home page for further details:
+ http://hdfgroup.org/HDF5/
+
+Bugs should be reported to help@hdfgroup.org.
diff --git a/config/cmake/UserMacros/Windows_MT.cmake b/config/cmake/UserMacros/Windows_MT.cmake index 175c420..a54f22c 100644 --- a/config/cmake/UserMacros/Windows_MT.cmake +++ b/config/cmake/UserMacros/Windows_MT.cmake @@ -11,31 +11,31 @@ # Option to Build with Static CRT libraries on Windows #------------------------------------------------------------------------------- MACRO (TARGET_STATIC_CRT_FLAGS) - IF (MSVC AND NOT BUILD_SHARED_LIBS) - FOREACH (flag_var + if (MSVC AND NOT BUILD_SHARED_LIBS) + foreach (flag_var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) - IF (${flag_var} MATCHES "/MD") - STRING (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") - ENDIF (${flag_var} MATCHES "/MD") - ENDFOREACH (flag_var) - FOREACH (flag_var + if (${flag_var} MATCHES "/MD") + string (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + endif (${flag_var} MATCHES "/MD") + endforeach (flag_var) + foreach (flag_var CMAKE_Fortran_FLAGS CMAKE_Fortran_FLAGS_DEBUG CMAKE_Fortran_FLAGS_RELEASE CMAKE_Fortran_FLAGS_MINSIZEREL CMAKE_Fortran_FLAGS_RELWITHDEBINFO) - IF (${flag_var} MATCHES "/libs:dll") - STRING (REGEX REPLACE "/libs:dll" "/libs:static" ${flag_var} "${${flag_var}}") - ENDIF (${flag_var} MATCHES "/libs:dll") - ENDFOREACH (flag_var) - SET (WIN_COMPILE_FLAGS "") - SET (WIN_LINK_FLAGS "/NODEFAULTLIB:MSVCRT") - ENDIF (MSVC AND NOT BUILD_SHARED_LIBS) + if (${flag_var} MATCHES "/libs:dll") + string (REGEX REPLACE "/libs:dll" "/libs:static" ${flag_var} "${${flag_var}}") + endif (${flag_var} MATCHES "/libs:dll") + endforeach (flag_var) + set (WIN_COMPILE_FLAGS "") + set (WIN_LINK_FLAGS "/NODEFAULTLIB:MSVCRT") + endif (MSVC AND NOT BUILD_SHARED_LIBS) ENDMACRO (TARGET_STATIC_CRT_FLAGS) #----------------------------------------------------------------------------- -OPTION (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" OFF) -IF (BUILD_STATIC_CRT_LIBS) +option (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" OFF) +if (BUILD_STATIC_CRT_LIBS) TARGET_STATIC_CRT_FLAGS () -ENDIF (BUILD_STATIC_CRT_LIBS) +endif (BUILD_STATIC_CRT_LIBS)
\ No newline at end of file diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 43ba754..f715a3f 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -4,75 +4,75 @@ # EXTERNAL cache entries
########################
-SET (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE)
+set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE)
-SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE)
+set (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE)
-SET (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE)
+set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE)
-SET (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE)
+set (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE)
-SET (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE)
+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_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE)
-SET (HDF5_ENABLE_F2003 OFF CACHE BOOL "Enable FORTRAN 2003 Standard" 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_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_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE)
-SET (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" 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_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE)
-SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE)
+set (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE)
-SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE)
+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_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_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_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_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 (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 (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_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_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)
+set (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE)
-SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" 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_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_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_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_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE)
-SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" 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_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE)
-SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO SVN TGZ)" FORCE)
+set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO SVN TGZ)" FORCE)
SET_PROPERTY(CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO SVN TGZ)
-SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE)
+set (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE)
-SET (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk" CACHE STRING "Use SZip from HDF repository" FORCE)
+set (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk" CACHE STRING "Use SZip from HDF repository" FORCE)
-SET (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE)
+set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE)
-SET (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE)
+set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE)
-SET (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE)
+set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE)
-SET (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE)
+set (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE)
diff --git a/config/cmake/grepTest.cmake b/config/cmake/grepTest.cmake index 74ac912..7670ad5 100644 --- a/config/cmake/grepTest.cmake +++ b/config/cmake/grepTest.cmake @@ -2,29 +2,29 @@ # against a reference file. Exit status of command can also be compared. # arguments checking -IF (NOT TEST_PROGRAM) - MESSAGE (FATAL_ERROR "Require TEST_PROGRAM to be defined") -ENDIF (NOT TEST_PROGRAM) -#IF (NOT TEST_ARGS) -# MESSAGE (STATUS "Require TEST_ARGS to be defined") -#ENDIF (NOT TEST_ARGS) -IF (NOT TEST_FOLDER) - MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") -ENDIF (NOT TEST_FOLDER) -IF (NOT TEST_OUTPUT) - MESSAGE (FATAL_ERROR "Require TEST_OUTPUT to be defined") -ENDIF (NOT TEST_OUTPUT) -#IF (NOT TEST_EXPECT) -# MESSAGE (STATUS "Require TEST_EXPECT to be defined") -#ENDIF (NOT TEST_EXPECT) -IF (NOT TEST_FILTER) - MESSAGE (STATUS "Require TEST_FILTER to be defined") -ENDIF (NOT TEST_FILTER) -IF (NOT TEST_REFERENCE) - MESSAGE (FATAL_ERROR "Require TEST_REFERENCE to be defined") -ENDIF (NOT TEST_REFERENCE) +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM to be defined") +endif (NOT TEST_PROGRAM) +#if (NOT TEST_ARGS) +# message (STATUS "Require TEST_ARGS to be defined") +#endif (NOT TEST_ARGS) +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif (NOT TEST_FOLDER) +if (NOT TEST_OUTPUT) + message (FATAL_ERROR "Require TEST_OUTPUT to be defined") +endif (NOT TEST_OUTPUT) +#if (NOT TEST_EXPECT) +# message (STATUS "Require TEST_EXPECT to be defined") +#endif (NOT TEST_EXPECT) +if (NOT TEST_FILTER) + message (STATUS "Require TEST_FILTER to be defined") +endif (NOT TEST_FILTER) +if (NOT TEST_REFERENCE) + message (FATAL_ERROR "Require TEST_REFERENCE to be defined") +endif (NOT TEST_REFERENCE) -MESSAGE (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") +message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") # run the test program, capture the stdout/stderr and the result var EXECUTE_PROCESS ( @@ -37,8 +37,8 @@ EXECUTE_PROCESS ( ERROR_VARIABLE TEST_ERROR ) -MESSAGE (STATUS "COMMAND Result: ${TEST_RESULT}") -MESSAGE (STATUS "COMMAND Error: ${TEST_ERROR}") +message (STATUS "COMMAND Result: ${TEST_RESULT}") +message (STATUS "COMMAND Error: ${TEST_ERROR}") # now grep the output with the reference FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) @@ -46,19 +46,19 @@ FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) # TEST_REFERENCE should always be matched STRING(REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) STRING(COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) -IF (${TEST_RESULT} STREQUAL "0") - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") -ENDIF (${TEST_RESULT} STREQUAL "0") +if (${TEST_RESULT} STREQUAL "0") + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") +endif (${TEST_RESULT} STREQUAL "0") STRING(REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) -IF (${TEST_EXPECT} STREQUAL "1") +if (${TEST_EXPECT} STREQUAL "1") # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match STRING(LENGTH "${TEST_MATCH}" TEST_RESULT) - IF (NOT ${TEST_RESULT} STREQUAL "0") - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") - ENDIF (NOT ${TEST_RESULT} STREQUAL "0") -ENDIF (${TEST_EXPECT} STREQUAL "1") + if (NOT ${TEST_RESULT} STREQUAL "0") + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") + endif (NOT ${TEST_RESULT} STREQUAL "0") +endif (${TEST_EXPECT} STREQUAL "1") # everything went fine... -MESSAGE ("Passed: The output of ${TEST_PROGRAM} matched") +message ("Passed: The output of ${TEST_PROGRAM} matched") diff --git a/config/cmake/hdf.bmp b/config/cmake/hdf.bmp Binary files differnew file mode 100644 index 0000000..9e9e4aa --- /dev/null +++ b/config/cmake/hdf.bmp diff --git a/config/cmake/hdf.gif b/config/cmake/hdf.gif Binary files differdeleted file mode 100644 index 656617b..0000000 --- a/config/cmake/hdf.gif +++ /dev/null diff --git a/config/cmake/hdf.icns b/config/cmake/hdf.icns Binary files differnew file mode 100755 index 0000000..22afa2e --- /dev/null +++ b/config/cmake/hdf.icns diff --git a/config/cmake/hdf.ico b/config/cmake/hdf.ico Binary files differnew file mode 100644 index 0000000..26abc96 --- /dev/null +++ b/config/cmake/hdf.ico diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in index c1201cc..c3d0811 100644 --- a/config/cmake/hdf5-config-version.cmake.in +++ b/config/cmake/hdf5-config-version.cmake.in @@ -2,26 +2,26 @@ # HDF5 Version file for install directory
#-----------------------------------------------------------------------------
-SET (PACKAGE_VERSION @HDF5_VERSION_STRING@)
+set (PACKAGE_VERSION @HDF5_VERSION_STRING@)
-IF ("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @H5_VERS_MAJOR@)
+if ("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @H5_VERS_MAJOR@)
# exact match for version @H5_VERS_MAJOR@.@H5_VERS_MINOR@
- IF ("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @H5_VERS_MINOR@)
+ if ("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @H5_VERS_MINOR@)
# compatible with any version @H5_VERS_MAJOR@.@H5_VERS_MINOR@.x
- SET (PACKAGE_VERSION_COMPATIBLE 1)
+ set (PACKAGE_VERSION_COMPATIBLE 1)
- IF ("${PACKAGE_FIND_VERSION_PATCH}" EQUAL @H5_VERS_RELEASE@)
- SET (PACKAGE_VERSION_EXACT 1)
+ if ("${PACKAGE_FIND_VERSION_PATCH}" EQUAL @H5_VERS_RELEASE@)
+ set (PACKAGE_VERSION_EXACT 1)
- IF ("${PACKAGE_FIND_VERSION_TWEAK}" EQUAL @H5_VERS_SUBRELEASE@)
+ if ("${PACKAGE_FIND_VERSION_TWEAK}" EQUAL @H5_VERS_SUBRELEASE@)
# not using this yet
- ENDIF ("${PACKAGE_FIND_VERSION_TWEAK}" EQUAL @H5_VERS_SUBRELEASE@)
+ endif ("${PACKAGE_FIND_VERSION_TWEAK}" EQUAL @H5_VERS_SUBRELEASE@)
- ENDIF ("${PACKAGE_FIND_VERSION_PATCH}" EQUAL @H5_VERS_RELEASE@)
+ endif ("${PACKAGE_FIND_VERSION_PATCH}" EQUAL @H5_VERS_RELEASE@)
- ENDIF ("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @H5_VERS_MINOR@)
-ENDIF ("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @H5_VERS_MAJOR@)
+ endif ("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @H5_VERS_MINOR@)
+endif ("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @H5_VERS_MAJOR@)
diff --git a/config/cmake/hdf5-config.cmake.build.in b/config/cmake/hdf5-config.cmake.build.in index fbe97ac..60888c8 100644 --- a/config/cmake/hdf5-config.cmake.build.in +++ b/config/cmake/hdf5-config.cmake.build.in @@ -6,16 +6,16 @@ GET_FILENAME_COMPONENT (SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) #-----------------------------------------------------------------------------
# User Options
#-----------------------------------------------------------------------------
-SET (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@)
-SET (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@)
-SET (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@)
-SET (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@)
-SET (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@)
-SET (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@)
-SET (HDF5_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@)
-SET (HDF5_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@)
-SET (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@)
-SET (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
+set (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@)
+set (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@)
+set (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@)
+set (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@)
+set (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@)
+set (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@)
+set (HDF5_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@)
+set (HDF5_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@)
+set (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@)
+set (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
#-----------------------------------------------------------------------------
# Dependencies
@@ -28,46 +28,46 @@ ENDIF(HDF5_ENABLE_PARALLEL) #-----------------------------------------------------------------------------
# Directories
#-----------------------------------------------------------------------------
-SET (HDF5_INCLUDE_DIR "@HDF5_INCLUDES_BUILD_TIME@" "${HDF5_MPI_C_INCLUDE_PATH}" )
+set (HDF5_INCLUDE_DIR "@HDF5_INCLUDES_BUILD_TIME@" "${HDF5_MPI_C_INCLUDE_PATH}" )
-IF (HDF5_BUILD_FORTRAN)
- SET (HDF5_INCLUDE_DIR_FORTRAN "@CMAKE_Fortran_MODULE_DIRECTORY@" )
-ENDIF (HDF5_BUILD_FORTRAN)
+if (HDF5_BUILD_FORTRAN)
+ set (HDF5_INCLUDE_DIR_FORTRAN "@CMAKE_Fortran_MODULE_DIRECTORY@" )
+endif (HDF5_BUILD_FORTRAN)
-IF (HDF5_BUILD_CPP_LIB)
- SET (HDF5_INCLUDE_DIR_CPP ${HDF5_INCLUDE_DIR} )
-ENDIF (HDF5_BUILD_CPP_LIB)
+if (HDF5_BUILD_CPP_LIB)
+ set (HDF5_INCLUDE_DIR_CPP ${HDF5_INCLUDE_DIR} )
+endif (HDF5_BUILD_CPP_LIB)
-IF (HDF5_BUILD_HL_LIB)
- SET (HDF5_INCLUDE_DIR_HL ${HDF5_INCLUDE_DIR} )
-ENDIF (HDF5_BUILD_HL_LIB)
+if (HDF5_BUILD_HL_LIB)
+ set (HDF5_INCLUDE_DIR_HL ${HDF5_INCLUDE_DIR} )
+endif (HDF5_BUILD_HL_LIB)
-IF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
- SET (HDF5_INCLUDE_DIR_HL_CPP ${HDF5_INCLUDE_DIR} )
-ENDIF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
+if (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
+ set (HDF5_INCLUDE_DIR_HL_CPP ${HDF5_INCLUDE_DIR} )
+endif (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
-IF (HDF5_BUILD_TOOLS)
- SET (HDF5_INCLUDE_DIR_TOOLS ${HDF5_INCLUDE_DIR} )
-ENDIF (HDF5_BUILD_TOOLS)
+if (HDF5_BUILD_TOOLS)
+ set (HDF5_INCLUDE_DIR_TOOLS ${HDF5_INCLUDE_DIR} )
+endif (HDF5_BUILD_TOOLS)
-IF (HDF5_BUILD_SHARED_LIBS)
- SET (H5_BUILT_AS_DYNAMIC_LIB 1 )
-ELSE (HDF5_BUILD_SHARED_LIBS)
- SET (H5_BUILT_AS_STATIC_LIB 1 )
-ENDIF (HDF5_BUILD_SHARED_LIBS)
+if (HDF5_BUILD_SHARED_LIBS)
+ set (H5_BUILT_AS_DYNAMIC_LIB 1 )
+else (HDF5_BUILD_SHARED_LIBS)
+ set (H5_BUILT_AS_STATIC_LIB 1 )
+endif (HDF5_BUILD_SHARED_LIBS)
#-----------------------------------------------------------------------------
# Version Strings
#-----------------------------------------------------------------------------
-SET (HDF5_VERSION_STRING @HDF5_VERSION_STRING@)
-SET (HDF5_VERSION_MAJOR @HDF5_VERSION_MAJOR@)
-SET (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@)
+set (HDF5_VERSION_STRING @HDF5_VERSION_STRING@)
+set (HDF5_VERSION_MAJOR @HDF5_VERSION_MAJOR@)
+set (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@)
#-----------------------------------------------------------------------------
# Don't include targets if this file is being picked up by another
# project which has already build hdf5 as a subproject
#-----------------------------------------------------------------------------
-IF (NOT TARGET "@HDF5_PACKAGE@")
- INCLUDE (${SELF_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
- SET (HDF5_LIBRARIES "@HDF5_LIBRARIES_TO_EXPORT@")
-ENDIF (NOT TARGET "@HDF5_PACKAGE@")
+if (NOT TARGET "@HDF5_PACKAGE@")
+ include (${SELF_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
+ set (HDF5_LIBRARIES "@HDF5_LIBRARIES_TO_EXPORT@")
+endif (NOT TARGET "@HDF5_PACKAGE@")
diff --git a/config/cmake/hdf5-config.cmake.install.in b/config/cmake/hdf5-config.cmake.install.in index 9c5a5a1..799ff9d 100644 --- a/config/cmake/hdf5-config.cmake.install.in +++ b/config/cmake/hdf5-config.cmake.install.in @@ -4,24 +4,24 @@ GET_FILENAME_COMPONENT (SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${SELF_DIR}" PATH)
GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
-IF (NOT WIN32)
+if (NOT WIN32)
GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
-ENDIF (NOT WIN32)
+endif (NOT WIN32)
#-----------------------------------------------------------------------------
# User Options
#-----------------------------------------------------------------------------
-SET (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@)
-SET (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@)
-SET (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@)
-SET (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@)
-SET (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@)
-SET (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@)
-SET (HDF5_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@)
-SET (HDF5_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@)
-SET (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@)
-SET (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
-SET (HDF5_PACKAGE_EXTLIBS @HDF5_PACKAGE_EXTLIBS@)
+set (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@)
+set (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@)
+set (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@)
+set (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@)
+set (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@)
+set (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@)
+set (HDF5_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@)
+set (HDF5_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@)
+set (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@)
+set (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
+set (HDF5_PACKAGE_EXTLIBS @HDF5_PACKAGE_EXTLIBS@)
#-----------------------------------------------------------------------------
# Dependencies
@@ -34,48 +34,48 @@ ENDIF(HDF5_ENABLE_PARALLEL) #-----------------------------------------------------------------------------
# Directories
#-----------------------------------------------------------------------------
-SET (HDF5_INCLUDE_DIR "${_IMPORT_PREFIX}/include" "${HDF5_MPI_C_INCLUDE_PATH}" )
+set (HDF5_INCLUDE_DIR "${_IMPORT_PREFIX}/include" "${HDF5_MPI_C_INCLUDE_PATH}" )
-IF (HDF5_BUILD_FORTRAN)
- SET (HDF5_INCLUDE_DIR_FORTRAN "${_IMPORT_PREFIX}/include/fortran" )
-ENDIF (HDF5_BUILD_FORTRAN)
+if (HDF5_BUILD_FORTRAN)
+ set (HDF5_INCLUDE_DIR_FORTRAN "${_IMPORT_PREFIX}/include/fortran" )
+endif (HDF5_BUILD_FORTRAN)
-IF (HDF5_BUILD_CPP_LIB)
- SET (HDF5_INCLUDE_DIR_CPP "${_IMPORT_PREFIX}/include/cpp" )
-ENDIF (HDF5_BUILD_CPP_LIB)
+if (HDF5_BUILD_CPP_LIB)
+ set (HDF5_INCLUDE_DIR_CPP "${_IMPORT_PREFIX}/include/cpp" )
+endif (HDF5_BUILD_CPP_LIB)
-IF (HDF5_BUILD_HL_LIB)
- SET (HDF5_INCLUDE_DIR_HL "${_IMPORT_PREFIX}/include/hl" )
-ENDIF (HDF5_BUILD_HL_LIB)
+if (HDF5_BUILD_HL_LIB)
+ set (HDF5_INCLUDE_DIR_HL "${_IMPORT_PREFIX}/include/hl" )
+endif (HDF5_BUILD_HL_LIB)
-IF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
- SET (HDF5_INCLUDE_DIR_HL_CPP "${_IMPORT_PREFIX}/include/hl/cpp" )
-ENDIF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
+if (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
+ set (HDF5_INCLUDE_DIR_HL_CPP "${_IMPORT_PREFIX}/include/hl/cpp" )
+endif (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
-IF (HDF5_BUILD_TOOLS)
- SET (HDF5_INCLUDE_DIR_TOOLS "${_IMPORT_PREFIX}/include" )
- SET (HDF5_TOOLS_DIR "${_IMPORT_PREFIX}/bin" )
-ENDIF (HDF5_BUILD_TOOLS)
+if (HDF5_BUILD_TOOLS)
+ set (HDF5_INCLUDE_DIR_TOOLS "${_IMPORT_PREFIX}/include" )
+ set (HDF5_TOOLS_DIR "${_IMPORT_PREFIX}/bin" )
+endif (HDF5_BUILD_TOOLS)
#-----------------------------------------------------------------------------
# Version Strings
#-----------------------------------------------------------------------------
-SET (HDF5_VERSION_STRING @HDF5_VERSION_STRING@)
-SET (HDF5_VERSION_MAJOR @HDF5_VERSION_MAJOR@)
-SET (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@)
+set (HDF5_VERSION_STRING @HDF5_VERSION_STRING@)
+set (HDF5_VERSION_MAJOR @HDF5_VERSION_MAJOR@)
+set (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@)
#-----------------------------------------------------------------------------
# Don't include targets if this file is being picked up by another
# project which has already built hdf5 as a subproject
#-----------------------------------------------------------------------------
-IF (NOT TARGET "@HDF5_PACKAGE@")
- IF (HDF5_ENABLE_Z_LIB_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "zlib")
- INCLUDE (${SELF_DIR}/../ZLIB/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
- ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "zlib")
- IF (HDF5_ENABLE_SZIP_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "szip")
- INCLUDE (${SELF_DIR}/../SZIP/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
- ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "szip")
- INCLUDE (${SELF_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
- SET (HDF5_LIBRARIES "@HDF5_LIBRARIES_TO_EXPORT@")
-ENDIF (NOT TARGET "@HDF5_PACKAGE@")
+if (NOT TARGET "@HDF5_PACKAGE@")
+ if (HDF5_ENABLE_Z_LIB_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "zlib")
+ include (${SELF_DIR}/../ZLIB/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
+ endif (HDF5_ENABLE_Z_LIB_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "zlib")
+ if (HDF5_ENABLE_SZIP_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "szip")
+ include (${SELF_DIR}/../SZIP/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
+ endif (HDF5_ENABLE_SZIP_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "szip")
+ include (${SELF_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
+ set (HDF5_LIBRARIES "@HDF5_LIBRARIES_TO_EXPORT@")
+endif (NOT TARGET "@HDF5_PACKAGE@")
diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index 4027c55..3970a9f 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -3,7 +3,7 @@ General Information: ------------------- - HDF5 Version: @HDF5_PACKAGE_VERSION@ + HDF5 Version: @HDF5_PACKAGE_VERSION_STRING@ Configured on: @CONFIG_DATE@ Configured by: @CMAKE_GENERATOR@ Configure mode: CMAKE @CMAKE_VERSION@ diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index 8ca3879..dd1a311 100644 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -4,78 +4,78 @@ # EXTERNAL cache entries
########################
-SET (BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libraries" FORCE)
+set (BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libraries" FORCE)
-SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE)
+set (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE)
-SET (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE)
+set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE)
-SET (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE)
+set (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE)
-SET (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE)
+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_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE)
-SET (HDF5_ENABLE_F2003 OFF CACHE BOOL "Enable FORTRAN 2003 Standard" 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_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_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE)
-SET (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" 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_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE)
-SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE)
+set (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE)
-SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE)
+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_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_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_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_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 (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 (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_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_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_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_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_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_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_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_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE)
-SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE)
+set (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE)
-SET (HDF5_NO_PACKAGES ON CACHE BOOL "CPACK - Disable packaging" FORCE)
+set (HDF5_NO_PACKAGES ON CACHE BOOL "CPACK - Disable packaging" FORCE)
-SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building" 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)
+set (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE)
-SET (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk" CACHE STRING "Use SZip from HDF repository" FORCE)
+set (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk" CACHE STRING "Use SZip from HDF repository" FORCE)
-SET (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE)
+set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE)
-SET (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE)
+set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE)
-SET (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Debug" FORCE)
+set (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Debug" FORCE)
-SET (CTEST_BUILD_CONFIGURATION "Debug" CACHE STRING "Build Debug" FORCE)
+set (CTEST_BUILD_CONFIGURATION "Debug" CACHE STRING "Build Debug" FORCE)
-SET (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE)
+set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE)
-SET (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE)
+set (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE)
diff --git a/config/cmake/prunTest.cmake b/config/cmake/prunTest.cmake index b9ead6f..9cf0c55 100644 --- a/config/cmake/prunTest.cmake +++ b/config/cmake/prunTest.cmake @@ -3,35 +3,35 @@ cmake_policy(SET CMP0007 NEW) # arguments checking -IF (NOT TEST_PROGRAM) - MESSAGE (FATAL_ERROR "Require TEST_PROGRAM to be defined") -ENDIF (NOT TEST_PROGRAM) -#IF (NOT TEST_ARGS) -# MESSAGE (STATUS "Require TEST_ARGS to be defined") -#ENDIF (NOT TEST_ARGS) -IF (NOT TEST_FOLDER) - MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") -ENDIF (NOT TEST_FOLDER) -IF (NOT TEST_OUTPUT) - MESSAGE (FATAL_ERROR "Require TEST_OUTPUT to be defined") -ENDIF (NOT TEST_OUTPUT) -#IF (NOT TEST_EXPECT) -# MESSAGE (STATUS "Require TEST_EXPECT to be defined") -#ENDIF (NOT TEST_EXPECT) -#IF (NOT TEST_FILTER) -# MESSAGE (STATUS "Require TEST_FILTER to be defined") -#ENDIF (NOT TEST_FILTER) -IF (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) - MESSAGE (FATAL_ERROR "Require TEST_REFERENCE to be defined") -ENDIF (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) - -SET (ERROR_APPEND 1) - -MESSAGE (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") - -IF (TEST_ENV_VAR) - SET (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") -ENDIF (TEST_ENV_VAR) +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM to be defined") +endif (NOT TEST_PROGRAM) +#if (NOT TEST_ARGS) +# message (STATUS "Require TEST_ARGS to be defined") +#endif (NOT TEST_ARGS) +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif (NOT TEST_FOLDER) +if (NOT TEST_OUTPUT) + message (FATAL_ERROR "Require TEST_OUTPUT to be defined") +endif (NOT TEST_OUTPUT) +#if (NOT TEST_EXPECT) +# message (STATUS "Require TEST_EXPECT to be defined") +#endif (NOT TEST_EXPECT) +#if (NOT TEST_FILTER) +# message (STATUS "Require TEST_FILTER to be defined") +#endif (NOT TEST_FILTER) +if (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) + message (FATAL_ERROR "Require TEST_REFERENCE to be defined") +endif (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) + +set (ERROR_APPEND 1) + +message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") + +if (TEST_ENV_VAR) + set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") +endif (TEST_ENV_VAR) # run the test program, capture the stdout/stderr and the result var EXECUTE_PROCESS ( @@ -44,35 +44,35 @@ EXECUTE_PROCESS ( ERROR_VARIABLE TEST_ERROR ) -MESSAGE (STATUS "COMMAND Result: ${TEST_RESULT}") +message (STATUS "COMMAND Result: ${TEST_RESULT}") FILE (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) FILE (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") -IF (ERROR_APPEND) +if (ERROR_APPEND) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (ERROR_APPEND) +endif (ERROR_APPEND) -IF (TEST_APPEND) +if (TEST_APPEND) FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_ERROR}\n") -ENDIF (TEST_APPEND) +endif (TEST_APPEND) -MESSAGE (STATUS "COMMAND Error: ${TEST_ERROR}") +message (STATUS "COMMAND Error: ${TEST_ERROR}") -IF (TEST_MASK) +if (TEST_MASK) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "Storage:[^\n]+\n" "Storage: <details removed for portability>\n" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_MASK) +endif (TEST_MASK) -IF (TEST_MASK_MOD) +if (TEST_MASK_MOD) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_MASK_MOD) +endif (TEST_MASK_MOD) -IF (TEST_MASK_ERROR) +if (TEST_MASK_ERROR) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") @@ -82,64 +82,64 @@ IF (TEST_MASK_ERROR) STRING(REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_MASK_ERROR) +endif (TEST_MASK_ERROR) -IF (TEST_FILTER) +if (TEST_FILTER) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_FILTER) +endif (TEST_FILTER) -#IF (TEST_REF_FILTER) -# MESSAGE (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") +#if (TEST_REF_FILTER) +# message (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") # FILE (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) # STRING(REGEX REPLACE "${TEST_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}") # FILE (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") -#ENDIF (TEST_REF_FILTER) +#endif (TEST_REF_FILTER) -IF (NOT TEST_SKIP_COMPARE) - IF (WIN32 AND NOT MINGW) +if (NOT TEST_SKIP_COMPARE) + if (WIN32 AND NOT MINGW) FILE (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) FILE (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") - ENDIF (WIN32 AND NOT MINGW) + endif (WIN32 AND NOT MINGW) # now compare the output with the reference EXECUTE_PROCESS ( COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/P_${TEST_REFERENCE} RESULT_VARIABLE TEST_RESULT ) - IF (NOT ${TEST_RESULT} STREQUAL 0) - SET (TEST_RESULT 0) + if (NOT ${TEST_RESULT} STREQUAL 0) + set (TEST_RESULT 0) FILE (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) LIST (LENGTH test_act len_act) FILE (STRINGS ${TEST_FOLDER}/P_${TEST_REFERENCE} test_ref) LIST (LENGTH test_ref len_ref) - IF (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL "0") MATH (EXPR _FP_LEN "${len_ref} - 1") - FOREACH (line RANGE 0 ${_FP_LEN}) + foreach (line RANGE 0 ${_FP_LEN}) LIST (GET test_act ${line} str_act) LIST (GET test_ref ${line} str_ref) - IF (NOT "${str_act}" STREQUAL "${str_ref}") - IF (NOT "${str_act}" STREQUAL "") - SET (TEST_RESULT 1) - MESSAGE ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - ENDIF (NOT "${str_act}" STREQUAL "") - ENDIF (NOT "${str_act}" STREQUAL "${str_ref}") - ENDFOREACH (line RANGE 0 ${_FP_LEN}) - ENDIF (NOT ${len_act} STREQUAL "0") - IF (NOT ${len_act} STREQUAL ${len_ref}) - SET (TEST_RESULT 1) - ENDIF (NOT ${len_act} STREQUAL ${len_ref}) - ENDIF (NOT ${TEST_RESULT} STREQUAL 0) - - MESSAGE (STATUS "COMPARE Result: ${TEST_RESULT}") + if (NOT "${str_act}" STREQUAL "${str_ref}") + if (NOT "${str_act}" STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif (NOT "${str_act}" STREQUAL "") + endif (NOT "${str_act}" STREQUAL "${str_ref}") + endforeach (line RANGE 0 ${_FP_LEN}) + endif (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL ${len_ref}) + set (TEST_RESULT 1) + endif (NOT ${len_act} STREQUAL ${len_ref}) + endif (NOT ${TEST_RESULT} STREQUAL 0) + + message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - IF (NOT ${TEST_RESULT} STREQUAL 0) - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match P_${TEST_REFERENCE}") - ENDIF (NOT ${TEST_RESULT} STREQUAL 0) -ENDIF (NOT TEST_SKIP_COMPARE) + if (NOT ${TEST_RESULT} STREQUAL 0) + message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match P_${TEST_REFERENCE}") + endif (NOT ${TEST_RESULT} STREQUAL 0) +endif (NOT TEST_SKIP_COMPARE) # everything went fine... -MESSAGE ("Passed: The output of ${TEST_PROGRAM} matches P_${TEST_REFERENCE}") +message ("Passed: The output of ${TEST_PROGRAM} matches P_${TEST_REFERENCE}") diff --git a/config/cmake/runTest.cmake b/config/cmake/runTest.cmake index 0a80873..9a891e6 100644 --- a/config/cmake/runTest.cmake +++ b/config/cmake/runTest.cmake @@ -3,37 +3,37 @@ cmake_policy(SET CMP0007 NEW) # arguments checking -IF (NOT TEST_PROGRAM) - MESSAGE (FATAL_ERROR "Require TEST_PROGRAM to be defined") -ENDIF (NOT TEST_PROGRAM) -#IF (NOT TEST_ARGS) -# MESSAGE (STATUS "Require TEST_ARGS to be defined") -#ENDIF (NOT TEST_ARGS) -IF (NOT TEST_FOLDER) - MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") -ENDIF (NOT TEST_FOLDER) -IF (NOT TEST_OUTPUT) - MESSAGE (FATAL_ERROR "Require TEST_OUTPUT to be defined") -ENDIF (NOT TEST_OUTPUT) -IF (NOT TEST_EXPECT) - MESSAGE (STATUS "Require TEST_EXPECT to be defined") -ENDIF (NOT TEST_EXPECT) -#IF (NOT TEST_FILTER) -# MESSAGE (STATUS "Require TEST_FILTER to be defined") -#ENDIF (NOT TEST_FILTER) -IF (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) - MESSAGE (FATAL_ERROR "Require TEST_REFERENCE to be defined") -ENDIF (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) - -IF (NOT TEST_ERRREF) - SET (ERROR_APPEND 1) -ENDIF (NOT TEST_ERRREF) - -MESSAGE (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") - -IF (TEST_ENV_VAR) - SET (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") -ENDIF (TEST_ENV_VAR) +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM to be defined") +endif (NOT TEST_PROGRAM) +#if (NOT TEST_ARGS) +# message (STATUS "Require TEST_ARGS to be defined") +#endif (NOT TEST_ARGS) +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif (NOT TEST_FOLDER) +if (NOT TEST_OUTPUT) + message (FATAL_ERROR "Require TEST_OUTPUT to be defined") +endif (NOT TEST_OUTPUT) +if (NOT TEST_EXPECT) + message (STATUS "Require TEST_EXPECT to be defined") +endif (NOT TEST_EXPECT) +#if (NOT TEST_FILTER) +# message (STATUS "Require TEST_FILTER to be defined") +#endif (NOT TEST_FILTER) +if (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) + message (FATAL_ERROR "Require TEST_REFERENCE to be defined") +endif (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) + +if (NOT TEST_ERRREF) + set (ERROR_APPEND 1) +endif (NOT TEST_ERRREF) + +message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") + +if (TEST_ENV_VAR) + set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") +endif (TEST_ENV_VAR) # run the test program, capture the stdout/stderr and the result var EXECUTE_PROCESS ( @@ -46,42 +46,42 @@ EXECUTE_PROCESS ( ERROR_VARIABLE TEST_ERROR ) -MESSAGE (STATUS "COMMAND Result: ${TEST_RESULT}") +message (STATUS "COMMAND Result: ${TEST_RESULT}") -IF (ERROR_APPEND) +if (ERROR_APPEND) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (ERROR_APPEND) +endif (ERROR_APPEND) -IF (TEST_APPEND) +if (TEST_APPEND) FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_RESULT}\n") -ENDIF (TEST_APPEND) +endif (TEST_APPEND) # if the return value is !=${TEST_EXPECT} bail out -IF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) - MESSAGE ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") -ENDIF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) +if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + message ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") +endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) -MESSAGE (STATUS "COMMAND Error: ${TEST_ERROR}") +message (STATUS "COMMAND Error: ${TEST_ERROR}") -IF (TEST_MASK) +if (TEST_MASK) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "Storage:[^\n]+\n" "Storage: <details removed for portability>\n" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_MASK) +endif (TEST_MASK) -IF (TEST_MASK_MOD) +if (TEST_MASK_MOD) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_MASK_MOD) +endif (TEST_MASK_MOD) -IF (TEST_MASK_ERROR) - IF (NOT TEST_ERRREF) +if (TEST_MASK_ERROR) + if (NOT TEST_ERRREF) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - ELSE (NOT TEST_ERRREF) + else (NOT TEST_ERRREF) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) - ENDIF (NOT TEST_ERRREF) + endif (NOT TEST_ERRREF) STRING(REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}") @@ -89,105 +89,105 @@ IF (TEST_MASK_ERROR) STRING(REGEX REPLACE "[1-9]*[.][0-9]*[.][0-9]*[^)]*" "version (number)" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") - IF (NOT TEST_ERRREF) + if (NOT TEST_ERRREF) FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") - ELSE (NOT TEST_ERRREF) + else (NOT TEST_ERRREF) FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") - ENDIF (NOT TEST_ERRREF) -ENDIF (TEST_MASK_ERROR) + endif (NOT TEST_ERRREF) +endif (TEST_MASK_ERROR) -IF (TEST_FILTER) +if (TEST_FILTER) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_FILTER) +endif (TEST_FILTER) -IF (NOT TEST_SKIP_COMPARE) - IF (WIN32 AND NOT MINGW) +if (NOT TEST_SKIP_COMPARE) + if (WIN32 AND NOT MINGW) FILE (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) FILE (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") - ENDIF (WIN32 AND NOT MINGW) + endif (WIN32 AND NOT MINGW) # now compare the output with the reference EXECUTE_PROCESS ( COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} RESULT_VARIABLE TEST_RESULT ) - IF (NOT ${TEST_RESULT} STREQUAL 0) - SET (TEST_RESULT 0) + if (NOT ${TEST_RESULT} STREQUAL 0) + set (TEST_RESULT 0) FILE (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) LIST (LENGTH test_act len_act) FILE (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) LIST (LENGTH test_ref len_ref) - IF (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL "0") MATH (EXPR _FP_LEN "${len_ref} - 1") - FOREACH (line RANGE 0 ${_FP_LEN}) + foreach (line RANGE 0 ${_FP_LEN}) LIST (GET test_act ${line} str_act) LIST (GET test_ref ${line} str_ref) - IF (NOT "${str_act}" STREQUAL "${str_ref}") - IF (NOT "${str_act}" STREQUAL "") - SET (TEST_RESULT 1) - MESSAGE ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - ENDIF (NOT "${str_act}" STREQUAL "") - ENDIF (NOT "${str_act}" STREQUAL "${str_ref}") - ENDFOREACH (line RANGE 0 ${_FP_LEN}) - ENDIF (NOT ${len_act} STREQUAL "0") - IF (NOT ${len_act} STREQUAL ${len_ref}) - SET (TEST_RESULT 1) - ENDIF (NOT ${len_act} STREQUAL ${len_ref}) - ENDIF (NOT ${TEST_RESULT} STREQUAL 0) - - MESSAGE (STATUS "COMPARE Result: ${TEST_RESULT}") + if (NOT "${str_act}" STREQUAL "${str_ref}") + if (NOT "${str_act}" STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif (NOT "${str_act}" STREQUAL "") + endif (NOT "${str_act}" STREQUAL "${str_ref}") + endforeach (line RANGE 0 ${_FP_LEN}) + endif (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL ${len_ref}) + set (TEST_RESULT 1) + endif (NOT ${len_act} STREQUAL ${len_ref}) + endif (NOT ${TEST_RESULT} STREQUAL 0) + + message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - IF (NOT ${TEST_RESULT} STREQUAL 0) - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") - ENDIF (NOT ${TEST_RESULT} STREQUAL 0) + if (NOT ${TEST_RESULT} STREQUAL 0) + message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") + endif (NOT ${TEST_RESULT} STREQUAL 0) - IF (TEST_ERRREF) - IF (WIN32 AND NOT MINGW) + if (TEST_ERRREF) + if (WIN32 AND NOT MINGW) FILE (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) FILE (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}") - ENDIF (WIN32 AND NOT MINGW) + endif (WIN32 AND NOT MINGW) # now compare the error output with the error reference EXECUTE_PROCESS ( COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} RESULT_VARIABLE TEST_RESULT ) - IF (NOT ${TEST_RESULT} STREQUAL 0) - SET (TEST_RESULT 0) + if (NOT ${TEST_RESULT} STREQUAL 0) + set (TEST_RESULT 0) FILE (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) LIST (LENGTH test_act len_act) FILE (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) LIST (LENGTH test_ref len_ref) MATH (EXPR _FP_LEN "${len_ref} - 1") - IF (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL "0") MATH (EXPR _FP_LEN "${len_ref} - 1") - FOREACH (line RANGE 0 ${_FP_LEN}) + foreach (line RANGE 0 ${_FP_LEN}) LIST (GET test_act ${line} str_act) LIST (GET test_ref ${line} str_ref) - IF (NOT "${str_act}" STREQUAL "${str_ref}") - IF (NOT "${str_act}" STREQUAL "") - SET (TEST_RESULT 1) - MESSAGE ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - ENDIF (NOT "${str_act}" STREQUAL "") - ENDIF (NOT "${str_act}" STREQUAL "${str_ref}") - ENDFOREACH (line RANGE 0 ${_FP_LEN}) - ENDIF (NOT ${len_act} STREQUAL "0") - IF (NOT ${len_act} STREQUAL ${len_ref}) - SET (TEST_RESULT 1) - ENDIF (NOT ${len_act} STREQUAL ${len_ref}) - ENDIF (NOT ${TEST_RESULT} STREQUAL 0) - - MESSAGE (STATUS "COMPARE Result: ${TEST_RESULT}") + if (NOT "${str_act}" STREQUAL "${str_ref}") + if (NOT "${str_act}" STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif (NOT "${str_act}" STREQUAL "") + endif (NOT "${str_act}" STREQUAL "${str_ref}") + endforeach (line RANGE 0 ${_FP_LEN}) + endif (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL ${len_ref}) + set (TEST_RESULT 1) + endif (NOT ${len_act} STREQUAL ${len_ref}) + endif (NOT ${TEST_RESULT} STREQUAL 0) + + message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - IF (NOT ${TEST_RESULT} STREQUAL 0) - MESSAGE (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") - ENDIF (NOT ${TEST_RESULT} STREQUAL 0) - ENDIF (TEST_ERRREF) -ENDIF (NOT TEST_SKIP_COMPARE) + if (NOT ${TEST_RESULT} STREQUAL 0) + message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") + endif (NOT ${TEST_RESULT} STREQUAL 0) + endif (TEST_ERRREF) +endif (NOT TEST_SKIP_COMPARE) # everything went fine... -MESSAGE ("Passed: The output of ${TEST_PROGRAM} matches ${TEST_REFERENCE}") +message ("Passed: The output of ${TEST_PROGRAM} matches ${TEST_REFERENCE}") diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake index 8910bb2..2b6b934 100644 --- a/config/cmake/userblockTest.cmake +++ b/config/cmake/userblockTest.cmake @@ -2,44 +2,44 @@ # against a reference file. Exit status of command can also be compared. # arguments checking -IF (NOT TEST_PROGRAM) - MESSAGE (FATAL_ERROR "Require TEST_PROGRAM tellub to be defined") -ENDIF (NOT TEST_PROGRAM) -IF (NOT TEST_GET_PROGRAM) - MESSAGE (FATAL_ERROR "Require TEST_GET_PROGRAM getub to be defined") -ENDIF (NOT TEST_GET_PROGRAM) -IF (NOT TEST_FOLDER) - MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") -ENDIF (NOT TEST_FOLDER) -IF (NOT TEST_HFILE) - MESSAGE (FATAL_ERROR "Require TEST_HFILE the hdf file to be defined") -ENDIF (NOT TEST_HFILE) -IF (NOT TEST_UFILE) - MESSAGE (FATAL_ERROR "Require TEST_UFILE the ub file to be defined") -ENDIF (NOT TEST_UFILE) -IF (NOT TEST_CHECKUB) - MESSAGE (STATUS "Require TEST_CHECKUB - YES or NO - to be defined") -ENDIF (NOT TEST_CHECKUB) -#IF (NOT TEST_EXPECT) -# MESSAGE (STATUS "Require TEST_EXPECT to be defined") -#ENDIF (NOT TEST_EXPECT) -#IF (NOT TEST_OFILE) -# MESSAGE (FATAL_ERROR "Require TEST_OFILE the original hdf file to be defined") -#ENDIF (NOT TEST_OFILE) +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM tellub to be defined") +endif (NOT TEST_PROGRAM) +if (NOT TEST_GET_PROGRAM) + message (FATAL_ERROR "Require TEST_GET_PROGRAM getub to be defined") +endif (NOT TEST_GET_PROGRAM) +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif (NOT TEST_FOLDER) +if (NOT TEST_HFILE) + message (FATAL_ERROR "Require TEST_HFILE the hdf file to be defined") +endif (NOT TEST_HFILE) +if (NOT TEST_UFILE) + message (FATAL_ERROR "Require TEST_UFILE the ub file to be defined") +endif (NOT TEST_UFILE) +if (NOT TEST_CHECKUB) + message (STATUS "Require TEST_CHECKUB - YES or NO - to be defined") +endif (NOT TEST_CHECKUB) +#if (NOT TEST_EXPECT) +# message (STATUS "Require TEST_EXPECT to be defined") +#endif (NOT TEST_EXPECT) +#if (NOT TEST_OFILE) +# message (FATAL_ERROR "Require TEST_OFILE the original hdf file to be defined") +#endif (NOT TEST_OFILE) -SET (TEST_U_STRING_LEN 0) -SET (TEST_O_STRING_LEN 0) -SET (TEST_H_STRING_LEN 0) -SET (TEST_STRING_SIZE 0) +set (TEST_U_STRING_LEN 0) +set (TEST_O_STRING_LEN 0) +set (TEST_H_STRING_LEN 0) +set (TEST_STRING_SIZE 0) -IF (TEST_CHECKUB STREQUAL "YES") +if (TEST_CHECKUB STREQUAL "YES") # find the length of the user block to check #s1=`cat $ufile | wc -c | sed -e 's/ //g'` FILE (STRINGS ${TEST_FOLDER}/${TEST_UFILE} TEST_U_STRING) - STRING (LENGTH ${TEST_U_STRING} TEST_U_STRING_LEN) + string (LENGTH ${TEST_U_STRING} TEST_U_STRING_LEN) # Get the size of the original user block, if any. - IF (TEST_OFILE) + if (TEST_OFILE) # 'tellub' calls H5Fget_user_block to get the size # of the user block #s2=`$JAM_BIN/tellub $origfile` @@ -51,15 +51,15 @@ IF (TEST_CHECKUB STREQUAL "YES") OUTPUT_VARIABLE TEST_ERROR ERROR_VARIABLE TEST_ERROR ) - IF (NOT ${TEST_RESULT} STREQUAL "0") - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} ${TEST_OFILE} is: ${TEST_ERROR}") - ENDIF (NOT ${TEST_RESULT} STREQUAL "0") + if (NOT ${TEST_RESULT} STREQUAL "0") + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} ${TEST_OFILE} is: ${TEST_ERROR}") + endif (NOT ${TEST_RESULT} STREQUAL "0") FILE (READ ${TEST_HFILE}.len.txt TEST_O_STRING_LEN) - ENDIF (TEST_OFILE) + endif (TEST_OFILE) MATH( EXPR TEST_STRING_SIZE "${TEST_U_STRING_LEN} + ${TEST_O_STRING_LEN}" ) - IF (NOT TEST_O_STRING_LEN STREQUAL "0") + if (NOT TEST_O_STRING_LEN STREQUAL "0") #$JAM_BIN/getub -c $s2 $origfile > $cmpfile EXECUTE_PROCESS ( COMMAND ${TEST_GET_PROGRAM} -c ${TEST_O_STRING_LEN} ${TEST_OFILE} @@ -73,10 +73,10 @@ IF (TEST_CHECKUB STREQUAL "YES") #cat $ufile >> $cmpfile FILE (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) FILE (APPEND ${TEST_HFILE}-ub.cmp "${TEST_STREAM}") - ELSE (NOT TEST_O_STRING_LEN STREQUAL "0") + else (NOT TEST_O_STRING_LEN STREQUAL "0") FILE (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) FILE (WRITE ${TEST_HFILE}-ub.cmp ${TEST_STREAM}) - ENDIF (NOT TEST_O_STRING_LEN STREQUAL "0") + endif (NOT TEST_O_STRING_LEN STREQUAL "0") #$JAM_BIN/getub -c $size $hfile > $tfile EXECUTE_PROCESS ( @@ -95,12 +95,12 @@ IF (TEST_CHECKUB STREQUAL "YES") RESULT_VARIABLE TEST_RESULT ) - MESSAGE (STATUS "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}+${TEST_O_STRING_LEN}") + message (STATUS "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}+${TEST_O_STRING_LEN}") # if the return value is !=${TEST_EXPECT} bail out - IF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_HFILE}-ub did not match ${TEST_HFILE}.\n${TEST_ERROR}") - ENDIF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) -ELSE (TEST_CHECKUB STREQUAL "YES") + if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + message (FATAL_ERROR "Failed: The output of ${TEST_HFILE}-ub did not match ${TEST_HFILE}.\n${TEST_ERROR}") + endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) +else (TEST_CHECKUB STREQUAL "YES") # call 'ubsize' to get the size of the user block #ubsize=`$JAM_BIN/tellub $hfile` EXECUTE_PROCESS ( @@ -110,11 +110,11 @@ ELSE (TEST_CHECKUB STREQUAL "YES") OUTPUT_VARIABLE TEST_ERROR ERROR_VARIABLE TEST_ERROR ) - IF (NOT TEST_H_STRING_LEN STREQUAL "0") - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_HFILE} was NOT empty") - ENDIF (NOT TEST_H_STRING_LEN STREQUAL "0") -ENDIF (TEST_CHECKUB STREQUAL "YES") + if (NOT TEST_H_STRING_LEN STREQUAL "0") + message (FATAL_ERROR "Failed: The output of ${TEST_HFILE} was NOT empty") + endif (NOT TEST_H_STRING_LEN STREQUAL "0") +endif (TEST_CHECKUB STREQUAL "YES") # everything went fine... -MESSAGE ("Passed: The output of CHECK matched expectation") +message ("Passed: The output of CHECK matched expectation") diff --git a/config/cmake/version.plist.in b/config/cmake/version.plist.in new file mode 100644 index 0000000..817d89e --- /dev/null +++ b/config/cmake/version.plist.in @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> + +<plist version="1.0"> +<dict> + <key>BuildVersion</key> + <string>@CPACK_PACKAGE_VERSION_MAJOR@</string> + <key>CFBundleShortVersionString</key> + <string>@CPACK_APPLE_GUI_SHORT_VERSION_STRING@</string> + <key>CFBundleVersion</key> + <string>@CPACK_APPLE_GUI_SHORT_VERSION_STRING@</string> + <key>ProjectName</key> + <string>@CPACK_APPLE_GUI_BUNDLE_NAME@</string> + <key>SourceVersion</key> + <string>@CPACK_PACKAGE_VERSION_MINOR@</string> +</dict> +</plist> diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake index 2e854fb..f12dee7 100644 --- a/config/cmake/vfdTest.cmake +++ b/config/cmake/vfdTest.cmake @@ -2,27 +2,27 @@ # Exit status of command can also be compared. # arguments checking -IF (NOT TEST_PROGRAM) - MESSAGE (FATAL_ERROR "Require TEST_PROGRAM to be defined") -ENDIF (NOT TEST_PROGRAM) -#IF (NOT TEST_ARGS) -# MESSAGE (STATUS "Require TEST_ARGS to be defined") -#ENDIF (NOT TEST_ARGS) -#IF (NOT TEST_EXPECT) -# MESSAGE (STATUS "Require TEST_EXPECT to be defined") -#ENDIF (NOT TEST_EXPECT) -IF (NOT TEST_FOLDER) - MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") -ENDIF (NOT TEST_FOLDER) -IF (NOT TEST_VFD) - MESSAGE (FATAL_ERROR "Require TEST_VFD to be defined") -ENDIF (NOT TEST_VFD) - -SET (ERROR_APPEND 1) - -MESSAGE (STATUS "USING ${TEST_VFD} ON COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") - -SET (ENV{HDF5_DRIVER} "${TEST_VFD}") +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM to be defined") +endif (NOT TEST_PROGRAM) +#if (NOT TEST_ARGS) +# message (STATUS "Require TEST_ARGS to be defined") +#endif (NOT TEST_ARGS) +#if (NOT TEST_EXPECT) +# message (STATUS "Require TEST_EXPECT to be defined") +#endif (NOT TEST_EXPECT) +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif (NOT TEST_FOLDER) +if (NOT TEST_VFD) + message (FATAL_ERROR "Require TEST_VFD to be defined") +endif (NOT TEST_VFD) + +set (ERROR_APPEND 1) + +message (STATUS "USING ${TEST_VFD} ON COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") + +set (ENV{HDF5_DRIVER} "${TEST_VFD}") # run the test program, capture the stdout/stderr and the result var EXECUTE_PROCESS ( COMMAND ${TEST_PROGRAM} ${TEST_ARGS} @@ -33,18 +33,18 @@ EXECUTE_PROCESS ( ERROR_VARIABLE TEST_ERROR ) -MESSAGE (STATUS "COMMAND Result: ${TEST_RESULT}") +message (STATUS "COMMAND Result: ${TEST_RESULT}") -IF (ERROR_APPEND) +if (ERROR_APPEND) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err TEST_STREAM) FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out "${TEST_STREAM}") -ENDIF (ERROR_APPEND) +endif (ERROR_APPEND) # if the return value is !=${TEST_EXPECT} bail out -IF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) - MESSAGE ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") -ENDIF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) +if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + message ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") +endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) # everything went fine... -MESSAGE ("Passed: The ${TEST_PROGRAM} program used vfd ${TEST_VFD}") +message ("Passed: The ${TEST_PROGRAM} program used vfd ${TEST_VFD}") diff --git a/config/cmake/xlatefile.c b/config/cmake/xlatefile.c deleted file mode 100644 index e220289..0000000 --- a/config/cmake/xlatefile.c +++ /dev/null @@ -1,56 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <stdlib.h> - -#define BUFFERSIZE 1024 - -int main(int argc, char *argv[]) { - FILE *infile = NULL; - FILE *outfile = NULL; - char *buffer = NULL; - char argbuf[8]; - size_t bytes = 0; - size_t idx = 0; - unsigned int lineidx = 0; - unsigned int stripXlines = 3; - - if(argc < 3) - exit(1); - if(NULL == (infile = fopen(argv[1], "rb"))) - exit(2); - if(NULL == (outfile = fopen(argv[2], "wb+"))) - exit(3); - if(argc > 3) - if(argv[3][0] == '-') - if(argv[3][1] == 'l') { - strcpy(argbuf, &argv[3][2]); - stripXlines = atoi(argbuf); - } - buffer = (char*)malloc(BUFFERSIZE); - if(buffer) { - while(!feof(infile)) { - /* read the file into the buffer. */ - bytes = fread(buffer, 1, BUFFERSIZE, infile); - if(lineidx < stripXlines) { - for(idx = 0; idx < bytes; idx++) { - if(buffer[idx] == '\n') { - lineidx++; - if(buffer[idx+1] == '\r') - idx++; - } - if(lineidx >= stripXlines) { - fwrite(&buffer[idx+1], 1, bytes-idx-1, outfile); - idx = bytes; - } - } - } - else - fwrite(buffer, 1, bytes, outfile); - } - free(buffer); - } - fclose(outfile); - fclose(infile); - - return 0; -} diff --git a/config/irix6.x b/config/irix6.x index 8179b86..8907a66 100644 --- a/config/irix6.x +++ b/config/irix6.x @@ -171,7 +171,7 @@ hdf5_cv_ulong_to_fp_bottom_bit_accurate=${hdf5_cv_ulong_to_fp_bottom_bit_accurat hdf5_cv_ldouble_to_integer_accurate=${hdf5_cv_ldouble_to_integer_accurate='no'} hdf5_cv_integer_to_ldouble_accurate=${hdf5_cv_integer_to_ldouble_accurate='no'} -# Set flag to generate alternate code for H5V_log2_gen, to avoid +# Set flag to generate alternate code for H5VM_log2_gen, to avoid # problems with the MIPSpro compiler 7.30 and IRIX64 6.5 (ie. other # combinations might work, but haven't been tested) # (9/15/06 - QAK) diff --git a/config/lt_vers.am b/config/lt_vers.am index 7dd12cc..153a579 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 160 +LT_VERS_REVISION = 165 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.170. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.175. # # Report bugs to <help@hdfgroup.org>. # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.170' -PACKAGE_STRING='HDF5 1.9.170' +PACKAGE_VERSION='1.9.175' +PACKAGE_STRING='HDF5 1.9.175' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1492,7 +1492,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.170 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.175 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1562,7 +1562,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.170:";; + short | recursive ) echo "Configuration of HDF5 1.9.175:";; esac cat <<\_ACEOF @@ -1761,7 +1761,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.170 +HDF5 configure 1.9.175 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2855,7 +2855,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.170, which was +It was created by HDF5 $as_me 1.9.175, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3687,7 +3687,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.170' + VERSION='1.9.175' cat >>confdefs.h <<_ACEOF @@ -30719,7 +30719,7 @@ fi ## ---------------------------------------------------------------------- ## Set the flag to indicate that the machine generates bad code -## for the H5V_log2_gen() routine in src/H5Vprivate.h +## for the H5VM_log2_gen() routine in src/H5VMprivate.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) ## @@ -31676,7 +31676,7 @@ Usage: $0 [OPTIONS] Report bugs to <bug-libtool@gnu.org>." lt_cl_version="\ -HDF5 config.lt 1.9.170 +HDF5 config.lt 1.9.175 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -33814,7 +33814,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.170, which was +This file was extended by HDF5 $as_me 1.9.175, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33880,7 +33880,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.170 +HDF5 config.status 1.9.175 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index bcd75c0..8121326 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.170], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.175], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) @@ -4020,7 +4020,7 @@ fi ## ---------------------------------------------------------------------- ## Set the flag to indicate that the machine generates bad code -## for the H5V_log2_gen() routine in src/H5Vprivate.h +## for the H5VM_log2_gen() routine in src/H5VMprivate.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) ## diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index e7a1326..fe8216d 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,15 +1,15 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_EXAMPLES) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -SET (examples +set (examples h5_crtdat h5_rdwt h5_crtatt @@ -36,22 +36,22 @@ SET (examples h5_shared_mesg ) -FOREACH (example ${examples}) - ADD_EXECUTABLE (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) +foreach (example ${examples}) + add_executable (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) TARGET_NAMING (${example} ${LIB_TYPE}) TARGET_C_PROPERTIES (${example} " " " ") - TARGET_LINK_LIBRARIES (${example} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (${example} PROPERTIES FOLDER examples) -ENDFOREACH (example ${examples}) + target_link_libraries (${example} ${HDF5_LIB_TARGET}) + set_target_properties (${example} PROPERTIES FOLDER examples) +endforeach (example ${examples}) -IF (H5_HAVE_PARALLEL) - ADD_EXECUTABLE (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) +if (H5_HAVE_PARALLEL) + add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) TARGET_NAMING (ph5example ${LIB_TYPE}) TARGET_C_PROPERTIES (ph5example " " " ") - TARGET_LINK_LIBRARIES (ph5example ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (ph5example PROPERTIES FOLDER examples) -ENDIF (H5_HAVE_PARALLEL) + target_link_libraries (ph5example ${HDF5_LIB_TARGET}) + set_target_properties (ph5example PROPERTIES FOLDER examples) +endif (H5_HAVE_PARALLEL) -IF (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +if (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake index 58a2858..9f51d74 100644 --- a/examples/CMakeTests.cmake +++ b/examples/CMakeTests.cmake @@ -7,7 +7,7 @@ FILE (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/red ${PROJECT_BINARY_DIR}/blue ${PROJECT_BINARY_DIR}/u2w) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME EXAMPLES-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -43,23 +43,23 @@ red/prefix_target.h5 u2w/u2w_target.h5 ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (EXAMPLES-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "EXAMPLES-clear-objects") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (EXAMPLES-clear-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "EXAMPLES-clear-objects") - FOREACH (example ${examples}) - ADD_TEST (NAME EXAMPLES-${example} COMMAND $<TARGET_FILE:${example}>) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (EXAMPLES-${example} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "EXAMPLES-${example}") - ENDFOREACH (example ${examples}) + foreach (example ${examples}) + add_test (NAME EXAMPLES-${example} COMMAND $<TARGET_FILE:${example}>) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (EXAMPLES-${example} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "EXAMPLES-${example}") + endforeach (example ${examples}) - IF (H5_HAVE_PARALLEL) - ADD_TEST (NAME EXAMPLES-ph5example COMMAND $<TARGET_FILE:ph5example>) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (EXAMPLES-ph5example PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "EXAMPLES-ph5example") - ENDIF (H5_HAVE_PARALLEL) + if (H5_HAVE_PARALLEL) + add_test (NAME EXAMPLES-ph5example COMMAND $<TARGET_FILE:ph5example>) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (EXAMPLES-ph5example PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "EXAMPLES-ph5example") + endif (H5_HAVE_PARALLEL) diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index 9dbe8ca..c0f5a03 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -1,9 +1,9 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_F90 C CXX Fortran) -IF (H5_HAVE_PARALLEL) +if (H5_HAVE_PARALLEL) FIND_PACKAGE (MPI) -ENDIF (H5_HAVE_PARALLEL) +endif (H5_HAVE_PARALLEL) #----------------------------------------------------------------------------- # Traverse source subdirectory @@ -13,16 +13,16 @@ ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/src ${HDF5_F90_BINARY_DIR}/src) #----------------------------------------------------------------------------- # Build the Fortran Examples #----------------------------------------------------------------------------- -IF (HDF5_BUILD_EXAMPLES) +if (HDF5_BUILD_EXAMPLES) ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/examples ${HDF5_F90_BINARY_DIR}/examples) -ENDIF (HDF5_BUILD_EXAMPLES) +endif (HDF5_BUILD_EXAMPLES) #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- -IF (BUILD_TESTING) +if (BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/test ${HDF5_F90_BINARY_DIR}/test) - IF (MPI_Fortran_FOUND) + if (MPI_Fortran_FOUND) ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/testpar ${HDF5_F90_BINARY_DIR}/testpar) - ENDIF (MPI_Fortran_FOUND) -ENDIF (BUILD_TESTING) + endif (MPI_Fortran_FOUND) +endif (BUILD_TESTING) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index f57df63..6f11895 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_F90_EXAMPLES C CXX Fortran) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed @@ -13,7 +13,7 @@ INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${ #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -SET (examples +set (examples h5_cmprss h5_crtdat h5_rdwt @@ -31,69 +31,69 @@ SET (examples compound ) -SET (F2003_examples +set (F2003_examples rwdset_fortran2003 nested_derived_type compound_fortran2003 compound_complex_fortran2003 ) -FOREACH (example ${examples}) - ADD_EXECUTABLE (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) +foreach (example ${examples}) + add_executable (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f90_ex_${example} ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (f90_ex_${example} " " " ") - IF (WIN32 AND NOT CYGWIN) - SET_PROPERTY (TARGET f90_ex_${example} + if (WIN32 AND NOT CYGWIN) + set_property (TARGET f90_ex_${example} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) - ENDIF (WIN32 AND NOT CYGWIN) - TARGET_LINK_LIBRARIES (f90_ex_${example} + endif (WIN32 AND NOT CYGWIN) + target_link_libraries (f90_ex_${example} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) - SET_TARGET_PROPERTIES (f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) - SET_TARGET_PROPERTIES (f90_ex_${example} PROPERTIES FOLDER examples/fortran) -ENDFOREACH (example ${examples}) + set_target_properties (f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) + set_target_properties (f90_ex_${example} PROPERTIES FOLDER examples/fortran) +endforeach (example ${examples}) -IF (HDF5_ENABLE_F2003) - FOREACH (example ${F2003_examples}) - ADD_EXECUTABLE (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) +if (HDF5_ENABLE_F2003) + foreach (example ${F2003_examples}) + add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f03_ex_${example} ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (f03_ex_${example} " " " ") - IF (WIN32 AND NOT CYGWIN) - SET_PROPERTY (TARGET f03_ex_${example} + if (WIN32 AND NOT CYGWIN) + set_property (TARGET f03_ex_${example} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) - ENDIF (WIN32 AND NOT CYGWIN) - TARGET_LINK_LIBRARIES (f03_ex_${example} + endif (WIN32 AND NOT CYGWIN) + target_link_libraries (f03_ex_${example} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) - SET_TARGET_PROPERTIES (f03_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) - SET_TARGET_PROPERTIES (f03_ex_${example} PROPERTIES FOLDER examples/fortran03) - ENDFOREACH (example ${F2003_examples}) -ENDIF (HDF5_ENABLE_F2003) + set_target_properties (f03_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) + set_target_properties (f03_ex_${example} PROPERTIES FOLDER examples/fortran03) + endforeach (example ${F2003_examples}) +endif (HDF5_ENABLE_F2003) -IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - ADD_EXECUTABLE (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) +if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) TARGET_NAMING (f90_ex_ph5example ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example " " " ") - IF (WIN32 AND NOT CYGWIN) - SET_PROPERTY (TARGET f90_ex_ph5example + if (WIN32 AND NOT CYGWIN) + set_property (TARGET f90_ex_ph5example APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) - ENDIF (WIN32 AND NOT CYGWIN) - TARGET_LINK_LIBRARIES (f90_ex_ph5example + endif (WIN32 AND NOT CYGWIN) + target_link_libraries (f90_ex_ph5example ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ${MPI_Fortran_LIBRARIES} ) - SET_TARGET_PROPERTIES (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran) - SET_TARGET_PROPERTIES (f90_ex_ph5example PROPERTIES FOLDER examples/fortran) -ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + set_target_properties (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran) + set_target_properties (f90_ex_ph5example PROPERTIES FOLDER examples/fortran) +endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) -IF (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +if (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake index aebd39b..57aec53 100644 --- a/fortran/examples/CMakeTests.cmake +++ b/fortran/examples/CMakeTests.cmake @@ -6,7 +6,7 @@ ############################################################################## # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME f90_ex-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -24,29 +24,29 @@ sdsf.h5 subset.h5 ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (f90_ex-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "f90_ex-clear-objects") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (f90_ex-clear-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "f90_ex-clear-objects") -FOREACH (example ${examples}) - ADD_TEST (NAME f90_ex_${example} COMMAND $<TARGET_FILE:f90_ex_${example}>) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (f90_ex_${example} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "f90_ex_${example}") -ENDFOREACH (example ${examples}) +foreach (example ${examples}) + add_test (NAME f90_ex_${example} COMMAND $<TARGET_FILE:f90_ex_${example}>) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (f90_ex_${example} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "f90_ex_${example}") +endforeach (example ${examples}) -IF (HDF5_ENABLE_F2003) - FOREACH (example ${F2003_examples}) - ADD_TEST (NAME f03_ex_${example} COMMAND $<TARGET_FILE:f03_ex_${example}>) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (f03_ex_${example} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "f03_ex_${example}") - ENDFOREACH (example ${F2003_examples}) -ENDIF (HDF5_ENABLE_F2003) +if (HDF5_ENABLE_F2003) + foreach (example ${F2003_examples}) + add_test (NAME f03_ex_${example} COMMAND $<TARGET_FILE:f03_ex_${example}>) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (f03_ex_${example} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "f03_ex_${example}") + endforeach (example ${F2003_examples}) +endif (HDF5_ENABLE_F2003) -IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - ADD_TEST (NAME f90_ex_ph5example COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:f90_ex_ph5example>) -ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) +if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + add_test (NAME f90_ex_ph5example COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:f90_ex_ph5example>) +endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 5d8c2d5..60057a3 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -1,21 +1,21 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- # configure def file for shared libs on windows -IF (WIN32 AND NOT CYGWIN) - IF (BUILD_SHARED_LIBS) - IF (MSVC) - IF (NOT H5_HAVE_PARALLEL) - SET (H5_NOPAREXP ";") - ENDIF (NOT H5_HAVE_PARALLEL) - IF (NOT HDF5_ENABLE_F2003) - SET (H5_NOF03EXP ";") - ENDIF (NOT HDF5_ENABLE_F2003) - CONFIGURE_FILE (${HDF5_F90_SRC_SOURCE_DIR}/hdf5_fortrandll.def.in ${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def @ONLY) - ENDIF (MSVC) - ENDIF (BUILD_SHARED_LIBS) -ENDIF (WIN32 AND NOT CYGWIN) +if (WIN32 AND NOT CYGWIN) + if (BUILD_SHARED_LIBS) + if (MSVC) + if (NOT H5_HAVE_PARALLEL) + set (H5_NOPAREXP ";") + endif (NOT H5_HAVE_PARALLEL) + if (NOT HDF5_ENABLE_F2003) + set (H5_NOF03EXP ";") + endif (NOT HDF5_ENABLE_F2003) + configure_file (${HDF5_F90_SRC_SOURCE_DIR}/hdf5_fortrandll.def.in ${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def @ONLY) + endif (MSVC) + endif (BUILD_SHARED_LIBS) +endif (WIN32 AND NOT CYGWIN) #----------------------------------------------------------------------------- # Setup the Fortran auto-detection utilities @@ -23,31 +23,31 @@ ENDIF (WIN32 AND NOT CYGWIN) # H5fortran_detect.f90 used to generate H5fort_type_defines.h # H5fort_type_defines.h used to generate H5f90i_gen.h + H5fortran_types.f90 #----------------------------------------------------------------------------- -IF (FORTRAN_HAVE_SIZEOF) - ADD_EXECUTABLE (H5test_FortranHavekind +if (FORTRAN_HAVE_SIZEOF) + add_executable (H5test_FortranHavekind ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind_SIZEOF.f90 ) -ELSE (FORTRAN_HAVE_SIZEOF) - ADD_EXECUTABLE (H5test_FortranHavekind +else (FORTRAN_HAVE_SIZEOF) + add_executable (H5test_FortranHavekind ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind.f90 ) -ENDIF (FORTRAN_HAVE_SIZEOF) -IF (WIN32 AND MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (H5test_FortranHavekind +endif (FORTRAN_HAVE_SIZEOF) +if (WIN32 AND MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (H5test_FortranHavekind PROPERTIES COMPILE_FLAGS "/MT" ) - ENDIF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (H5test_FortranHavekind + endif (BUILD_SHARED_LIBS) + set_target_properties (H5test_FortranHavekind PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE" ) -ENDIF (WIN32 AND MSVC) -SET_TARGET_PROPERTIES (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran) +endif (WIN32 AND MSVC) +set_target_properties (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran) -SET (CMD $<TARGET_FILE:H5test_FortranHavekind>) -ADD_CUSTOM_COMMAND ( +set (CMD $<TARGET_FILE:H5test_FortranHavekind>) +add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 COMMAND ${CMD} ARGS > ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 @@ -55,25 +55,25 @@ ADD_CUSTOM_COMMAND ( DEPENDS H5test_FortranHavekind ) #----------------------------------------------------------------------------- -ADD_EXECUTABLE (H5fortran_detect +add_executable (H5fortran_detect ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 ) -IF (WIN32 AND MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (H5fortran_detect +if (WIN32 AND MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (H5fortran_detect PROPERTIES COMPILE_FLAGS "/MT" ) - ENDIF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (H5fortran_detect + endif (BUILD_SHARED_LIBS) + set_target_properties (H5fortran_detect PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE" ) -ENDIF (WIN32 AND MSVC) -SET_TARGET_PROPERTIES (H5fortran_detect PROPERTIES LINKER_LANGUAGE Fortran) +endif (WIN32 AND MSVC) +set_target_properties (H5fortran_detect PROPERTIES LINKER_LANGUAGE Fortran) -SET (CMD $<TARGET_FILE:H5fortran_detect>) -ADD_CUSTOM_COMMAND ( +set (CMD $<TARGET_FILE:H5fortran_detect>) +add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h COMMAND ${CMD} ARGS > ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h @@ -83,12 +83,12 @@ ADD_CUSTOM_COMMAND ( INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) #----------------------------------------------------------------------------- -ADD_EXECUTABLE (H5match_types +add_executable (H5match_types ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h ${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c ) -SET (CMD $<TARGET_FILE:H5match_types>) -ADD_CUSTOM_COMMAND ( +set (CMD $<TARGET_FILE:H5match_types>) +add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/H5fortran_types.f90 COMMAND ${CMD} @@ -99,7 +99,7 @@ ADD_CUSTOM_COMMAND ( #----------------------------------------------------------------------------- # f90CStub lib #----------------------------------------------------------------------------- -SET (f90CStub_C_SRCS +set (f90CStub_C_SRCS # normal distribution ${HDF5_F90_SRC_SOURCE_DIR}/H5f90kit.c ${HDF5_F90_SRC_SOURCE_DIR}/H5_f.c @@ -118,54 +118,54 @@ SET (f90CStub_C_SRCS ${HDF5_F90_SRC_SOURCE_DIR}/H5Zf.c ) -IF (H5_HAVE_PARALLEL) - SET (f90CStub_C_SRCS +if (H5_HAVE_PARALLEL) + set (f90CStub_C_SRCS ${f90CStub_C_SRCS} ${HDF5_F90_SRC_SOURCE_DIR}/H5FDmpiof.c ) -ENDIF (H5_HAVE_PARALLEL) +endif (H5_HAVE_PARALLEL) -SET_SOURCE_FILES_PROPERTIES (${f90CStub_C_SRCS} PROPERTIES LANGUAGE C) +set_source_files_properties (${f90CStub_C_SRCS} PROPERTIES LANGUAGE C) -SET (f90CStub_C_HDRS +set (f90CStub_C_HDRS # generated files ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ) -ADD_LIBRARY (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} ${f90CStub_C_SRCS} ${f90CStub_C_HDRS}) +add_library (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} ${f90CStub_C_SRCS} ${f90CStub_C_HDRS}) TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") +target_link_libraries (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/fortran) -SET_TARGET_PROPERTIES (${HDF5_F90_C_LIB_TARGET} PROPERTIES LINKER_LANGUAGE C) +set_target_properties (${HDF5_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/fortran) +set_target_properties (${HDF5_F90_C_LIB_TARGET} PROPERTIES LINKER_LANGUAGE C) #----------------------------------------------------------------------------- # Fortran 2003 standard #----------------------------------------------------------------------------- -IF (HDF5_ENABLE_F2003) +if (HDF5_ENABLE_F2003) # default real is 4 bytes, so include double signatures - SET (F_STATUS "_F03") -ELSE (HDF5_ENABLE_F2003) + set (F_STATUS "_F03") +else (HDF5_ENABLE_F2003) # default real is 8 bytes, so exclude double signatures - SET (F_STATUS "_F90") -ENDIF (HDF5_ENABLE_F2003) + set (F_STATUS "_F90") +endif (HDF5_ENABLE_F2003) #----------------------------------------------------------------------------- # Fortran Real Size #----------------------------------------------------------------------------- -IF (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) +if (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) # default real is 4 bytes, so include double signatures - SET (F_DBLE "Include") -ELSE (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) + set (F_DBLE "Include") +else (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) # default real is 8 bytes, so exclude double signatures - SET (F_DBLE "Exclude") -ENDIF (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) + set (F_DBLE "Exclude") +endif (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) #----------------------------------------------------------------------------- # Fortran Modules #----------------------------------------------------------------------------- -SET (f90_F_SRCS +set (f90_F_SRCS # generated files ${HDF5_F90_BINARY_DIR}/H5fortran_types.f90 @@ -201,53 +201,53 @@ SET (f90_F_SRCS #----------------------------------------------------------------------------- # Add H5FDMPIO if parallel #----------------------------------------------------------------------------- -IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - SET (f90_F_SRCS +if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + set (f90_F_SRCS ${f90_F_SRCS} ${HDF5_F90_SRC_SOURCE_DIR}/HDF5mpio.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5FDmpioff.f90 ) -ELSE (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - SET (f90_F_SRCS +else (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + set (f90_F_SRCS ${f90_F_SRCS} ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.f90 ) -ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) +endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) #----------------------------------------------------------------------------- # Add Main fortran library #----------------------------------------------------------------------------- -ADD_LIBRARY (${HDF5_F90_LIB_TARGET} ${LIB_TYPE} ${f90_F_SRCS}) -SET (SHARED_LINK_FLAGS " ") -IF (WIN32 AND NOT CYGWIN) - IF (BUILD_SHARED_LIBS) - SET_PROPERTY (TARGET ${HDF5_F90_LIB_TARGET} +add_library (${HDF5_F90_LIB_TARGET} ${LIB_TYPE} ${f90_F_SRCS}) +set (SHARED_LINK_FLAGS " ") +if (WIN32 AND NOT CYGWIN) + if (BUILD_SHARED_LIBS) + set_property (TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS BUILD_HDF5_DLL ) - IF (MSVC) - SET (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def") - ENDIF (MSVC) - ENDIF (BUILD_SHARED_LIBS) - SET_PROPERTY (TARGET ${HDF5_F90_LIB_TARGET} + if (MSVC) + set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def") + endif (MSVC) + endif (BUILD_SHARED_LIBS) + set_property (TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) -ENDIF (WIN32 AND NOT CYGWIN) +endif (WIN32 AND NOT CYGWIN) TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} " " ${SHARED_LINK_FLAGS}) -SET_TARGET_PROPERTIES (${HDF5_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) -TARGET_LINK_LIBRARIES (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET}) -IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - TARGET_LINK_LIBRARIES (${HDF5_F90_LIB_TARGET} ${MPI_Fortran_LIBRARIES}) -ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIB_TARGET}") +set_target_properties (${HDF5_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) +target_link_libraries (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET}) +if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + target_link_libraries (${HDF5_F90_LIB_TARGET} ${MPI_Fortran_LIBRARIES}) +endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_LIB_TARGET} ${HDF5_F90_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_F90_LIB_TARGET} PROPERTIES FOLDER libraries/fortran) +set_target_properties (${HDF5_F90_LIB_TARGET} PROPERTIES FOLDER libraries/fortran) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -INSTALL ( +install ( FILES ${HDF5_F90_SRC_SOURCE_DIR}/H5f90.h ${HDF5_F90_SRC_SOURCE_DIR}/H5f90i.h @@ -260,8 +260,8 @@ INSTALL ( fortheaders ) -IF (WIN32 AND NOT CYGWIN) - INSTALL ( +if (WIN32 AND NOT CYGWIN) + install ( DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/ DESTINATION @@ -269,8 +269,8 @@ IF (WIN32 AND NOT CYGWIN) COMPONENT fortheaders ) -ELSE (WIN32 AND NOT CYGWIN) - INSTALL ( +else (WIN32 AND NOT CYGWIN) + install ( DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION @@ -278,17 +278,18 @@ ELSE (WIN32 AND NOT CYGWIN) COMPONENT fortheaders ) -ENDIF (WIN32 AND NOT CYGWIN) +endif (WIN32 AND NOT CYGWIN) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (HDF5_EXPORTED_TARGETS) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) + 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) + endif (BUILD_SHARED_LIBS) - 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 ( + install ( TARGETS ${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET} @@ -298,4 +299,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT fortlibraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT fortlibraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/fortran/src/H5Fff_F03.f90 b/fortran/src/H5Fff_F03.f90 index 1ccd39a..83d46be 100644 --- a/fortran/src/H5Fff_F03.f90 +++ b/fortran/src/H5Fff_F03.f90 @@ -46,16 +46,17 @@ CONTAINS ! PURPOSE ! Retrieves a copy of the image of an existing, open file. ! -! Inputs: +! INPUTS ! file_id - Target file identifier. ! buf_ptr - Pointer to the buffer into which the image of the HDF5 file is to be copied. ! buf_len - Size of the supplied buffer. ! -! Outputs: +! OUTPUTS ! hdferr - error code: ! 0 on success and -1 on failure -! Optional: -! buf_size - The size in bytes of the buffer required to store the file image. +! OPTIONAL PARAMETERS +! buf_size - Returns the size in bytes of the buffer required to store the file image, +! no data will be copied. ! ! AUTHOR ! M. Scot Breitenfeld @@ -65,11 +66,11 @@ CONTAINS SUBROUTINE h5fget_file_image_f(file_id, buf_ptr, buf_len, hdferr, buf_size) USE, INTRINSIC :: ISO_C_BINDING IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: file_id - TYPE(C_PTR) , INTENT(INOUT) :: buf_ptr - INTEGER(SIZE_T) , INTENT(IN) :: buf_len - INTEGER(SIZE_T) , INTENT(OUT), OPTIONAL :: buf_size - INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN) :: file_id + TYPE(C_PTR) , INTENT(INOUT) :: buf_ptr + INTEGER(SIZE_T), INTENT(IN) :: buf_len + INTEGER , INTENT(OUT) :: hdferr + INTEGER(SIZE_T), INTENT(OUT) , OPTIONAL :: buf_size !***** INTEGER(SIZE_T) :: buf_size_default diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index 262ce55..cf10efc 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -324,30 +324,23 @@ nh5pset_chunk_c ( hid_t_f *prp_id, int_f *rank, hsize_t_f *dims ) /******/ { int ret_value = -1; - hid_t c_prp_id; - int c_rank; - hsize_t *c_dims; + hid_t c_prp_id = (hid_t)*prp_id; + int c_rank = (int)*rank; + hsize_t c_dims[H5S_MAX_RANK]; herr_t status; int i; - c_dims = (hsize_t *)HDmalloc(sizeof(hsize_t) * (*rank )); - if (!c_dims) return ret_value; - /* * Transpose dimension arrays because of C-FORTRAN storage order */ - for (i = 0; i < *rank ; i++) { - c_dims[i] = dims[*rank - i - 1]; - } + for (i = 0; i < c_rank ; i++) + c_dims[i] = (hsize_t)dims[c_rank - i - 1]; - c_prp_id = (hid_t)*prp_id; - c_rank = (int)*rank; status = H5Pset_chunk(c_prp_id, c_rank, c_dims); if (status < 0) goto DONE; ret_value = 0; DONE: - HDfree (c_dims); return ret_value; } @@ -375,26 +368,19 @@ nh5pget_chunk_c ( hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims ) /******/ { int ret_value = -1; - hid_t c_prp_id; - hsize_t *c_dims; + hid_t c_prp_id = (hid_t)*prp_id; + hsize_t c_dims[H5S_MAX_RANK]; int rank; - int c_max_rank; + int c_max_rank = (int)*max_rank; int i; - c_dims = (hsize_t *)HDmalloc(sizeof(hsize_t) * (*max_rank )); - if (!c_dims) return ret_value; - - c_prp_id = (hid_t)*prp_id; - c_max_rank = (int)*max_rank; rank = H5Pget_chunk(c_prp_id, c_max_rank, c_dims); /* * Transpose dimension arrays because of C-FORTRAN storage order */ - for (i = 0; i < *max_rank ; i++) { - dims[*max_rank - i - 1] = (hsize_t_f)c_dims[i]; - } - HDfree (c_dims); + for (i = 0; i < c_max_rank ; i++) + dims[c_max_rank - i - 1] = (hsize_t_f)c_dims[i]; if (rank < 0) return ret_value; ret_value = (int_f)rank; return ret_value; @@ -1801,18 +1787,15 @@ nh5pset_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nel /******/ { int ret_value = -1; - hid_t c_prp_id; + hid_t c_prp_id = (hid_t)*prp_id; herr_t ret; - size_t c_cd_nelmts; - unsigned int c_flags; - H5Z_filter_t c_filter; + size_t c_cd_nelmts = (size_t)*cd_nelmts; + unsigned int c_flags = (unsigned)*flags; + H5Z_filter_t c_filter = (H5Z_filter_t)*filter; unsigned int * c_cd_values; unsigned i; - c_filter = (H5Z_filter_t)*filter; - c_flags = (unsigned)*flags; - c_cd_nelmts = (size_t)*cd_nelmts; - c_cd_values = (unsigned int*)HDmalloc(sizeof(unsigned int) * ((int)c_cd_nelmts)); + c_cd_values = (unsigned int*)HDmalloc(sizeof(unsigned int) * c_cd_nelmts); if (!c_cd_values) return ret_value; for (i = 0; i < c_cd_nelmts; i++) c_cd_values[i] = (unsigned int)cd_values[i]; @@ -1820,7 +1803,6 @@ nh5pset_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nel /* * Call H5Pset_filter function. */ - c_prp_id = (hid_t)*prp_id; ret = H5Pset_filter(c_prp_id, c_filter, c_flags, c_cd_nelmts,c_cd_values ); if (ret < 0) goto DONE; @@ -1967,13 +1949,12 @@ nh5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, off_t_f* offset, herr_t ret; hsize_t c_bytes; char* c_name; - size_t c_namelen; + size_t c_namelen = (size_t)*namelen; off_t c_offset; c_bytes = (hsize_t) *bytes; c_offset = (off_t) *offset; - c_namelen = (int)*namelen; c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; @@ -3819,7 +3800,7 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f * Check that we got correct values from Fortran for memb_addr array */ for (i=0; i < H5FD_MEM_NTYPES; i++) { - if(memb_addr[i] >= 1.) return ret_value; + if(memb_addr[i] >= 1.0f) return ret_value; } /* * Take care of names array @@ -3971,7 +3952,7 @@ HD5packFstring(tmp, _fcdtocp(memb_name), (size_t)(c_lenmax*H5FD_MEM_NTYPES)); memb_map[i] = (int_f)c_memb_map[i]; memb_fapl[i] = (hid_t_f)c_memb_fapl[i]; if(c_memb_addr[i] == HADDR_UNDEF) memb_addr[i] = -1; - else memb_addr[i] = (real_f) ((long)c_memb_addr[i]/HADDR_MAX); + else memb_addr[i] = (real_f) (c_memb_addr[i]/HADDR_MAX); } *flag = (int_f)relax; *maxlen_out = (int_f)length; @@ -4104,7 +4085,7 @@ nh5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f if(NULL == (c_name = (char *)HDmalloc((size_t)*namelen + 1))) goto DONE; - if(NULL == (c_cd_values = (unsigned int *)HDmalloc(sizeof(unsigned int) * ((int)c_cd_nelmts_in)))) + if(NULL == (c_cd_values = (unsigned int *)HDmalloc(sizeof(unsigned int) * c_cd_nelmts_in))) goto DONE; /* @@ -4157,18 +4138,15 @@ nh5pmodify_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_ /******/ { int_f ret_value = -1; - hid_t c_prp_id; + hid_t c_prp_id = (hid_t)*prp_id; herr_t ret; - size_t c_cd_nelmts; - unsigned int c_flags; - H5Z_filter_t c_filter; + size_t c_cd_nelmts = (size_t)*cd_nelmts; + unsigned int c_flags = (unsigned)*flags; + H5Z_filter_t c_filter = (H5Z_filter_t)*filter; unsigned int * c_cd_values; unsigned i; - c_filter = (H5Z_filter_t)*filter; - c_flags = (unsigned)*flags; - c_cd_nelmts = (size_t)*cd_nelmts; - c_cd_values = (unsigned int *)HDmalloc(sizeof(unsigned int) * ((int)c_cd_nelmts)); + c_cd_values = (unsigned int *)HDmalloc(sizeof(unsigned int) * c_cd_nelmts); if (!c_cd_values) return ret_value; for (i = 0; i < c_cd_nelmts; i++) c_cd_values[i] = (unsigned int)cd_values[i]; @@ -4176,7 +4154,6 @@ nh5pmodify_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_ /* * Call H5Pmodify_filter function. */ - c_prp_id = (hid_t)*prp_id; ret = H5Pmodify_filter(c_prp_id, c_filter, c_flags, c_cd_nelmts,c_cd_values ); if (ret < 0) goto DONE; @@ -4905,12 +4882,10 @@ nh5pget_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_l /******/ { char *c_expression = NULL; /* Buffer to hold C string */ - size_t c_expression_len; + size_t c_expression_len = (size_t)*expression_len + 1; ssize_t ret; int_f ret_value = 0; - c_expression_len = (size_t)*expression_len + 1; - /* * Allocate memory to store the expression. */ @@ -4928,7 +4903,7 @@ nh5pget_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_l HGOTO_DONE(FAIL) /* or strlen ? */ - HD5packFstring(c_expression, _fcdtocp(expression), c_expression_len - 1); + HD5packFstring(c_expression, _fcdtocp(expression), (size_t)*expression_len); *size = (size_t_f)ret; diff --git a/fortran/src/H5Sff.f90 b/fortran/src/H5Sff.f90 index 1bae584..c493d46 100644 --- a/fortran/src/H5Sff.f90 +++ b/fortran/src/H5Sff.f90 @@ -1323,8 +1323,8 @@ CONTAINS INTEGER, INTENT(IN) :: operator INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count - INTEGER(HSIZE_T), DIMENSION(*), OPTIONAL, INTENT(IN) :: stride - INTEGER(HSIZE_T), DIMENSION(*), OPTIONAL, INTENT(IN) :: block + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: stride + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: block END FUNCTION h5sselect_hyperslab_c END INTERFACE diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c index eb30775..3fa0efc 100644 --- a/fortran/src/H5match_types.c +++ b/fortran/src/H5match_types.c @@ -51,8 +51,8 @@ FILE * fort_header; void writeTypedef(const char* c_type, unsigned int size); void writeFloatTypedef(const char* c_type, unsigned int size); void writeTypedefDefault(unsigned int size); -void writeToFiles(const char* fortran_type, const char* c_type, unsigned int size, unsigned int kind); -void writeFloatToFiles(const char* fortran_type, const char* c_type, unsigned int size, unsigned int kind); +void writeToFiles(const char* fortran_type, const char* c_type, int size, unsigned int kind); +void writeFloatToFiles(const char* fortran_type, const char* c_type, int size, unsigned int kind); static void initCfile(void) @@ -141,26 +141,26 @@ void writeTypedefDefault(unsigned int size) } /* Create matching Fortran and C types by writing to both files */ -void writeToFiles(const char* fortran_type, const char* c_type, unsigned int size, unsigned int kind) +void writeToFiles(const char* fortran_type, const char* c_type, int size, unsigned int kind) { fprintf(fort_header, " INTEGER, PARAMETER :: %s = %u\n", fortran_type, kind); - fprintf(c_header, "typedef c_int_%u %s;\n", size, c_type); + fprintf(c_header, "typedef c_int_%d %s;\n", size, c_type); } /* Create matching Fortran and C floating types by writing to both files */ -void writeFloatToFiles(const char* fortran_type, const char* c_type, unsigned int size, unsigned int kind) +void writeFloatToFiles(const char* fortran_type, const char* c_type, int size, unsigned int kind) { fprintf(fort_header, " INTEGER, PARAMETER :: %s = %u\n", fortran_type, kind); - fprintf(c_header, "typedef c_float_%u %s;\n", size, c_type); + fprintf(c_header, "typedef c_float_%d %s;\n", size, c_type); } int main(void) { int FoundIntSize[4]; - int FoundIntSizeKind[4]; + unsigned FoundIntSizeKind[4]; int FoundRealSize[3]; - int FoundRealSizeKind[3]; + unsigned FoundRealSizeKind[3]; int i,j,flag; char chrA[20],chrB[20]; int H5_C_HAS_REAL_NATIVE_16; @@ -428,9 +428,7 @@ int main(void) } } if(flag == 0) /* No higher or lower one found, indicating an error */ - { return -1; - } } } @@ -496,9 +494,8 @@ int main(void) { sprintf(chrA, "Fortran_REAL_%d", (-1)*FoundRealSize[i]); sprintf(chrB, "real_%d_f", (-1)*FoundRealSize[i]); - if(FoundRealSize[j]>4) { + if(FoundRealSize[j]>4) writeFloatToFiles(chrA, chrB, FoundRealSize[j], FoundRealSizeKind[j]); - } /* else { */ /* writeFloatToFiles(chrA, chrB, FoundRealSize[j]); */ /* } */ @@ -508,9 +505,7 @@ int main(void) } } if(flag == 0) /* No higher or lower one found, indicating an error */ - { return -1; - } } } diff --git a/fortran/src/HDF5mpio.f90 b/fortran/src/HDF5mpio.f90 index ac4d2b1..b8fb645 100644 --- a/fortran/src/HDF5mpio.f90 +++ b/fortran/src/HDF5mpio.f90 @@ -28,6 +28,7 @@ MODULE HDF5 USE H5GLOBAL USE H5F + USE H5F_PROVISIONAL USE H5G USE H5E USE H5E_PROVISIONAL diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 61f729d..9c3ab8c 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -520,7 +520,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 160 +LT_VERS_REVISION = 165 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 643ec94..ff88919 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- @@ -9,42 +9,42 @@ INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${ #----------------------------------------------------------------------------- # Add Test Lib #----------------------------------------------------------------------------- -ADD_LIBRARY (${HDF5_F90_C_TEST_LIB_TARGET} ${LIB_TYPE} t.c) +add_library (${HDF5_F90_C_TEST_LIB_TARGET} ${LIB_TYPE} t.c) TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_F90_C_TEST_LIB_TARGET} +target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ) H5_SET_LIB_OPTIONS (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran) +set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran) -ADD_LIBRARY (${HDF5_F90_TEST_LIB_TARGET} ${LIB_TYPE} tf.f90) -SET (SHARED_LINK_FLAGS " ") -IF (WIN32 AND NOT CYGWIN) - IF (BUILD_SHARED_LIBS) - SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS BUILD_HDF5_DLL) - IF (MSVC) - SET (SHARED_LINK_FLAGS "/DLL") - ENDIF (MSVC) - ENDIF (BUILD_SHARED_LIBS) - SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS) -ENDIF (WIN32 AND NOT CYGWIN) +add_library (${HDF5_F90_TEST_LIB_TARGET} ${LIB_TYPE} tf.f90) +set (SHARED_LINK_FLAGS " ") +if (WIN32 AND NOT CYGWIN) + if (BUILD_SHARED_LIBS) + set_property (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS BUILD_HDF5_DLL) + if (MSVC) + set (SHARED_LINK_FLAGS "/DLL") + endif (MSVC) + endif (BUILD_SHARED_LIBS) + set_property (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS) +endif (WIN32 AND NOT CYGWIN) TARGET_FORTRAN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} " " ${SHARED_LINK_FLAGS}) -SET_TARGET_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) -TARGET_LINK_LIBRARIES (${HDF5_F90_TEST_LIB_TARGET} +set_target_properties (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) +target_link_libraries (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_TEST_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran) +set_target_properties (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran) #----------------------------------------------------------------------------- # Add Tests #----------------------------------------------------------------------------- #-- Adding test for testhdf5_fortran -ADD_EXECUTABLE (testhdf5_fortran +add_executable (testhdf5_fortran fortranlib_test.f90 tH5A.f90 tH5D.f90 @@ -62,19 +62,19 @@ ADD_EXECUTABLE (testhdf5_fortran ) TARGET_NAMING (testhdf5_fortran ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran " " " ") -TARGET_LINK_LIBRARIES (testhdf5_fortran +target_link_libraries (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) -IF (WIN32 AND MSVC) - TARGET_LINK_LIBRARIES (testhdf5_fortran "ws2_32.lib") -ENDIF (WIN32 AND MSVC) -SET_TARGET_PROPERTIES (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (testhdf5_fortran PROPERTIES FOLDER test/fortran) +if (WIN32 AND MSVC) + target_link_libraries (testhdf5_fortran "ws2_32.lib") +endif (WIN32 AND MSVC) +set_target_properties (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (testhdf5_fortran PROPERTIES FOLDER test/fortran) #-- Adding test for testhdf5_fortran_1_8 -ADD_EXECUTABLE (testhdf5_fortran_1_8 +add_executable (testhdf5_fortran_1_8 fortranlib_test_1_8.f90 tH5F.f90 tH5O.f90 @@ -83,20 +83,20 @@ ADD_EXECUTABLE (testhdf5_fortran_1_8 ) TARGET_NAMING (testhdf5_fortran_1_8 ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran_1_8 " " " ") -TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8 +target_link_libraries (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) -IF (WIN32 AND MSVC) - TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8 "ws2_32.lib") -ENDIF (WIN32 AND MSVC) -SET_TARGET_PROPERTIES (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (testhdf5_fortran_1_8 PROPERTIES FOLDER test/fortran) +if (WIN32 AND MSVC) + target_link_libraries (testhdf5_fortran_1_8 "ws2_32.lib") +endif (WIN32 AND MSVC) +set_target_properties (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (testhdf5_fortran_1_8 PROPERTIES FOLDER test/fortran) #-- Adding test for fortranlib_test_F03 -IF (HDF5_ENABLE_F2003) - ADD_EXECUTABLE (fortranlib_test_F03 +if (HDF5_ENABLE_F2003) + add_executable (fortranlib_test_F03 fortranlib_test_F03.f90 tH5F.f90 tH5E_F03.f90 @@ -108,46 +108,46 @@ IF (HDF5_ENABLE_F2003) ) TARGET_NAMING (fortranlib_test_F03 ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03 " " " ") - TARGET_LINK_LIBRARIES (fortranlib_test_F03 + target_link_libraries (fortranlib_test_F03 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) - IF (WIN32 AND MSVC) - TARGET_LINK_LIBRARIES (fortranlib_test_F03 "ws2_32.lib") - ENDIF (WIN32 AND MSVC) - SET_TARGET_PROPERTIES (fortranlib_test_F03 PROPERTIES LINKER_LANGUAGE Fortran) - SET_TARGET_PROPERTIES (fortranlib_test_F03 PROPERTIES FOLDER test/fortran) -ENDIF (HDF5_ENABLE_F2003) + if (WIN32 AND MSVC) + target_link_libraries (fortranlib_test_F03 "ws2_32.lib") + endif (WIN32 AND MSVC) + set_target_properties (fortranlib_test_F03 PROPERTIES LINKER_LANGUAGE Fortran) + set_target_properties (fortranlib_test_F03 PROPERTIES FOLDER test/fortran) +endif (HDF5_ENABLE_F2003) #-- Adding test for fflush1 -ADD_EXECUTABLE (fflush1 fflush1.f90) +add_executable (fflush1 fflush1.f90) TARGET_NAMING (fflush1 ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (fflush1 " " " ") -TARGET_LINK_LIBRARIES (fflush1 +target_link_libraries (fflush1 ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ) -IF (WIN32 AND MSVC) - TARGET_LINK_LIBRARIES (fflush1 "ws2_32.lib") -ENDIF (WIN32 AND MSVC) -SET_TARGET_PROPERTIES (fflush1 PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (fflush1 PROPERTIES FOLDER test/fortran) +if (WIN32 AND MSVC) + target_link_libraries (fflush1 "ws2_32.lib") +endif (WIN32 AND MSVC) +set_target_properties (fflush1 PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (fflush1 PROPERTIES FOLDER test/fortran) #-- Adding test for fflush2 -ADD_EXECUTABLE (fflush2 fflush2.f90) +add_executable (fflush2 fflush2.f90) TARGET_NAMING (fflush2 ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (fflush2 " " " ") -TARGET_LINK_LIBRARIES (fflush2 +target_link_libraries (fflush2 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) -IF (WIN32 AND MSVC) - TARGET_LINK_LIBRARIES (fflush2 "ws2_32.lib") -ENDIF (WIN32 AND MSVC) -SET_TARGET_PROPERTIES (fflush2 PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (fflush2 PROPERTIES FOLDER test/fortran) +if (WIN32 AND MSVC) + target_link_libraries (fflush2 "ws2_32.lib") +endif (WIN32 AND MSVC) +set_target_properties (fflush2 PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (fflush2 PROPERTIES FOLDER test/fortran) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake index d381b62..5b674db 100644 --- a/fortran/test/CMakeTests.cmake +++ b/fortran/test/CMakeTests.cmake @@ -5,22 +5,22 @@ ############################################################################## ############################################################################## -ADD_TEST (NAME testhdf5_fortran COMMAND $<TARGET_FILE:testhdf5_fortran>) +add_test (NAME testhdf5_fortran COMMAND $<TARGET_FILE:testhdf5_fortran>) SET_TESTS_PROPERTIES(testhdf5_fortran PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") #-- Adding test for testhdf5_fortran_1_8 -ADD_TEST (NAME testhdf5_fortran_1_8 COMMAND $<TARGET_FILE:testhdf5_fortran_1_8>) +add_test (NAME testhdf5_fortran_1_8 COMMAND $<TARGET_FILE:testhdf5_fortran_1_8>) SET_TESTS_PROPERTIES(testhdf5_fortran_1_8 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") #-- Adding test for fortranlib_test_F03 -IF (HDF5_ENABLE_F2003) - ADD_TEST (NAME fortranlib_test_F03 COMMAND $<TARGET_FILE:fortranlib_test_F03>) +if (HDF5_ENABLE_F2003) + add_test (NAME fortranlib_test_F03 COMMAND $<TARGET_FILE:fortranlib_test_F03>) SET_TESTS_PROPERTIES(fortranlib_test_F03 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") -ENDIF (HDF5_ENABLE_F2003) +endif (HDF5_ENABLE_F2003) #-- Adding test for fflush1 -ADD_TEST (NAME fflush1 COMMAND $<TARGET_FILE:fflush1>) +add_test (NAME fflush1 COMMAND $<TARGET_FILE:fflush1>) #-- Adding test for fflush2 -ADD_TEST (NAME fflush2 COMMAND $<TARGET_FILE:fflush2>) +add_test (NAME fflush2 COMMAND $<TARGET_FILE:fflush2>) SET_TESTS_PROPERTIES(fflush2 PROPERTIES DEPENDS fflush1) diff --git a/fortran/test/t.c b/fortran/test/t.c index 01d4cdd..fe69143 100644 --- a/fortran/test/t.c +++ b/fortran/test/t.c @@ -146,7 +146,7 @@ nh5_exit_c(int_f *status) * 0 - HDF5_NOCLEANUP is not set * Returns: none * Programmer: M.S. Breitenfeld - * September 30, 3008 + * September 30, 2008 * Modifications: *---------------------------------------------------------------------------*/ void diff --git a/fortran/test/tH5F_F03.f90 b/fortran/test/tH5F_F03.f90 index dea9a5d..79b0458 100644 --- a/fortran/test/tH5F_F03.f90 +++ b/fortran/test/tH5F_F03.f90 @@ -62,10 +62,6 @@ SUBROUTINE test_get_file_image(total_error) INTEGER(hid_t) :: fapl ! File access property INTEGER :: error ! Error flag - - RETURN ! DEBUG, PGI COMPILERS seem to have a bug in the INQUIRE functions, - ! waiting for an answer from PGI how to resolve the problem. - ! Create new properties for file access CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) CALL check("h5pcreate_f", error, total_error) @@ -151,9 +147,9 @@ SUBROUTINE test_get_file_image(total_error) ALLOCATE(file_image_ptr(1:image_size)) ! Open the test file using standard I/O calls - OPEN(UNIT=10,FILE='tget_file_image.h5', ACCESS='STREAM') + OPEN(UNIT=10,FILE='tget_file_image.h5', FORM='UNFORMATTED', ACCESS='STREAM') - ! Read the test file from disk into the buffer + ! Read the test file from disk into the buffer DO i = 1, image_size READ(10) file_image_ptr(i) ENDDO diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index d1aba51..3361220 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_FORTRAN_TESTPAR C CXX Fortran) #----------------------------------------------------------------------------- @@ -11,23 +11,23 @@ INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${ #----------------------------------------------------------------------------- #-- Adding test for parallel_test -ADD_EXECUTABLE (parallel_test +add_executable (parallel_test ptest.f90 hyper.f90 mdset.f90 ) TARGET_NAMING (parallel_test ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (parallel_test " " " ") -TARGET_LINK_LIBRARIES (parallel_test +target_link_libraries (parallel_test ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ${MPI_Fortran_LIBRARIES} ) -IF (WIN32 AND MSVC) - TARGET_LINK_LIBRARIES (parallel_test "ws2_32.lib") -ENDIF (WIN32 AND MSVC) -SET_TARGET_PROPERTIES (parallel_test PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (parallel_test PROPERTIES FOLDER test/fortran) +if (WIN32 AND MSVC) + target_link_libraries (parallel_test "ws2_32.lib") +endif (WIN32 AND MSVC) +set_target_properties (parallel_test PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (parallel_test PROPERTIES FOLDER test/fortran) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/fortran/testpar/CMakeTests.cmake b/fortran/testpar/CMakeTests.cmake index 2cd7ed0..f418e1a 100644 --- a/fortran/testpar/CMakeTests.cmake +++ b/fortran/testpar/CMakeTests.cmake @@ -4,4 +4,4 @@ ### T E S T I N G ### ############################################################################## ############################################################################## -ADD_TEST (NAME parallel_test COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:parallel_test>) +add_test (NAME parallel_test COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:parallel_test>) diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index 5c9403d..d50c62d 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -1,19 +1,19 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL C CXX) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Shared Libs #----------------------------------------------------------------------------- -IF (BUILD_SHARED_LIBS) - SET (HL_BUILT_AS_DYNAMIC_LIB 1) -ELSE (BUILD_SHARED_LIBS) - SET (HL_BUILT_AS_STATIC_LIB 1) -ENDIF (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) + set (HL_BUILT_AS_DYNAMIC_LIB 1) +else (BUILD_SHARED_LIBS) + set (HL_BUILT_AS_STATIC_LIB 1) +endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # List Source files @@ -23,22 +23,22 @@ INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/src ) ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/src ${HDF5_HL_BINARY_DIR}/src) #-- Build the High level Tools -IF (HDF5_BUILD_TOOLS) +if (HDF5_BUILD_TOOLS) ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/tools ${HDF5_HL_BINARY_DIR}/tools) -ENDIF (HDF5_BUILD_TOOLS) +endif (HDF5_BUILD_TOOLS) #-- Add High Level Examples -IF (HDF5_BUILD_EXAMPLES) +if (HDF5_BUILD_EXAMPLES) ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/examples ${HDF5_HL_BINARY_DIR}/examples) -ENDIF (HDF5_BUILD_EXAMPLES) +endif (HDF5_BUILD_EXAMPLES) #-- Build the Unit testing if requested -IF (NOT HDF5_EXTERNALLY_CONFIGURED) - IF (BUILD_TESTING) +if (NOT HDF5_EXTERNALLY_CONFIGURED) + if (BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/test ${HDF5_HL_BINARY_DIR}/test) - ENDIF (BUILD_TESTING) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) + endif (BUILD_TESTING) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) -IF (HDF5_BUILD_CPP_LIB) +if (HDF5_BUILD_CPP_LIB) ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/c++ ${HDF5_HL_BINARY_DIR}/c++) -ENDIF (HDF5_BUILD_CPP_LIB) +endif (HDF5_BUILD_CPP_LIB) diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt index 8d68dd0..386f5a6 100644 --- a/hl/c++/CMakeLists.txt +++ b/hl/c++/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_CPP) #----------------------------------------------------------------------------- @@ -9,14 +9,14 @@ ADD_SUBDIRECTORY (${HDF5_HL_CPP_SOURCE_DIR}/src ${HDF5_HL_CPP_BINARY_DIR}/src) # -------------------------------------------------------------------- # Add in the examples for the Packet Table codes # -------------------------------------------------------------------- -IF (HDF5_BUILD_EXAMPLES) +if (HDF5_BUILD_EXAMPLES) ADD_SUBDIRECTORY (${HDF5_HL_CPP_SOURCE_DIR}/examples ${HDF5_HL_CPP_BINARY_DIR}/examples) -ENDIF (HDF5_BUILD_EXAMPLES) +endif (HDF5_BUILD_EXAMPLES) # -------------------------------------------------------------------- # Add in the unit tests for the packet table c++ wrapper # -------------------------------------------------------------------- -IF (BUILD_TESTING) +if (BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_HL_CPP_SOURCE_DIR}/test ${HDF5_HL_CPP_BINARY_DIR}/test) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index f762839..8f9b43f 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_CPP_EXAMPLES) #----------------------------------------------------------------------------- @@ -10,17 +10,17 @@ INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_DIR}/src) # -------------------------------------------------------------------- # Add in the examples for the Packet Table codes # -------------------------------------------------------------------- -ADD_EXECUTABLE (ptExampleFL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleFL.cpp) +add_executable (ptExampleFL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleFL.cpp) TARGET_NAMING (ptExampleFL ${LIB_TYPE}) TARGET_C_PROPERTIES (ptExampleFL " " " ") -TARGET_LINK_LIBRARIES ( +target_link_libraries ( ptExampleFL ${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ) -SET_TARGET_PROPERTIES (ptExampleFL PROPERTIES FOLDER examples/hl/cpp) +set_target_properties (ptExampleFL PROPERTIES FOLDER examples/hl/cpp) -IF (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +if (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) diff --git a/hl/c++/examples/CMakeTests.cmake b/hl/c++/examples/CMakeTests.cmake index c73ceeb..dc279e5 100644 --- a/hl/c++/examples/CMakeTests.cmake +++ b/hl/c++/examples/CMakeTests.cmake @@ -5,12 +5,12 @@ ############################################################################## ############################################################################## # Remove any output file left over from previous test run -ADD_TEST ( +add_test ( NAME cpp_hl_ex_ptExampleFL-clear-objects COMMAND ${CMAKE_COMMAND} -E remove PTcppexampleFL.h5 ) -ADD_TEST (NAME cpp_hl_ex_ptExampleFL COMMAND $<TARGET_FILE:ptExampleFL>) -SET_TESTS_PROPERTIES (cpp_hl_ex_ptExampleFL PROPERTIES DEPENDS cpp_hl_ex_ptExampleFL-clear-objects) +add_test (NAME cpp_hl_ex_ptExampleFL COMMAND $<TARGET_FILE:ptExampleFL>) +set_tests_properties (cpp_hl_ex_ptExampleFL PROPERTIES DEPENDS cpp_hl_ex_ptExampleFL-clear-objects) diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index aa54889..39c6737 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_CPP_SRC) #----------------------------------------------------------------------------- @@ -7,24 +7,24 @@ PROJECT (HDF5_HL_CPP_SRC) INCLUDE_DIRECTORIES (${HDF5_HL_SRC_DIR}/src) INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_SOURCE_DIR}) -SET (HDF5_HL_CPP_SRCS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.cpp) -SET (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h) +set (HDF5_HL_CPP_SRCS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.cpp) +set (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h) -ADD_LIBRARY (${HDF5_HL_CPP_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_CPP_SRCS}) +add_library (${HDF5_HL_CPP_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_CPP_SRCS}) TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES ( +target_link_libraries ( ${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIB_TARGET}") +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_CPP_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/hl) +set_target_properties (${HDF5_HL_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/hl) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -INSTALL ( +install ( FILES ${HDF5_HL_CPP_HDRS} DESTINATION @@ -36,11 +36,12 @@ 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) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) + INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlcpplibraries) + endif (BUILD_SHARED_LIBS) - INSTALL ( + install ( TARGETS ${HDF5_HL_CPP_LIB_TARGET} EXPORT @@ -49,4 +50,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT hlcpplibraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hlcpplibraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/hl/c++/src/Makefile.am b/hl/c++/src/Makefile.am index 7961747..03289c0 100644 --- a/hl/c++/src/Makefile.am +++ b/hl/c++/src/Makefile.am @@ -22,7 +22,7 @@ include $(top_srcdir)/config/commence.am include $(top_srcdir)/config/lt_vers.am # Include src directory -INCLUDES=-I$(top_srcdir)/src -I$(top_srcdir)/hl/src +AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/hl/src # This is our main target lib_LTLIBRARIES=libhdf5_hl_cpp.la diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 3d28ac9..c13f26a 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -187,7 +187,10 @@ AMTAR = @AMTAR@ # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ -AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ + +# Include src directory +AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ + -I$(top_srcdir)/hl/src AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ @@ -460,12 +463,9 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 160 +LT_VERS_REVISION = 165 LT_VERS_AGE = 0 -# Include src directory -INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src - # This is our main target lib_LTLIBRARIES = libhdf5_hl_cpp.la diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index 46229ba..4a7523c 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_CPP_TEST) #----------------------------------------------------------------------------- @@ -15,10 +15,10 @@ INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) INCLUDE_DIRECTORIES (${HDF5_HL_SRC_DIR}/test) INCLUDE_DIRECTORIES (${HDF5_CPP_SRC_DIR}/src) -ADD_EXECUTABLE (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp) +add_executable (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp) TARGET_C_PROPERTIES (hl_ptableTest " " " ") TARGET_NAMING (hl_ptableTest ${LIB_TYPE}) -TARGET_LINK_LIBRARIES ( +target_link_libraries ( hl_ptableTest ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} @@ -26,6 +26,6 @@ TARGET_LINK_LIBRARIES ( ${HDF5_HL_LIB_TARGET} ${HDF5_HL_CPP_LIB_TARGET} ) -SET_TARGET_PROPERTIES (hl_ptableTest PROPERTIES FOLDER test/hl/cpp) +set_target_properties (hl_ptableTest PROPERTIES FOLDER test/hl/cpp) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/hl/c++/test/CMakeTests.cmake b/hl/c++/test/CMakeTests.cmake index cb9454b..5386624 100644 --- a/hl/c++/test/CMakeTests.cmake +++ b/hl/c++/test/CMakeTests.cmake @@ -5,4 +5,4 @@ ############################################################################## ############################################################################## - ADD_TEST (NAME hl_ptableTest COMMAND $<TARGET_FILE:hl_ptableTest>) + add_test (NAME hl_ptableTest COMMAND $<TARGET_FILE:hl_ptableTest>) diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index a9c5258..7847dbe 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -1,10 +1,10 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_EXAMPLES ) #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -SET (examples +set (examples ex_lite1 ex_lite2 #ex_lite2 PROPERTIES DEPENDS ex_lite1) ex_lite3 @@ -26,16 +26,16 @@ SET (examples ex_ds1 ) -FOREACH (example ${examples}) - ADD_EXECUTABLE (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c) +foreach (example ${examples}) + add_executable (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c) TARGET_NAMING (hl_ex_${example} ${LIB_TYPE}) TARGET_C_PROPERTIES (hl_ex_${example} " " " ") - TARGET_LINK_LIBRARIES (hl_ex_${example} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (hl_ex_${example} PROPERTIES FOLDER examples/hl) -ENDFOREACH (example ${examples}) + target_link_libraries (hl_ex_${example} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (hl_ex_${example} PROPERTIES FOLDER examples/hl) +endforeach (example ${examples}) -IF (BUILD_TESTING) +if (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) diff --git a/hl/examples/CMakeTests.cmake b/hl/examples/CMakeTests.cmake index 0f9ca11..bc51183 100644 --- a/hl/examples/CMakeTests.cmake +++ b/hl/examples/CMakeTests.cmake @@ -5,24 +5,24 @@ ############################################################################## ############################################################################## -SET (HDF5_TEST_FILES +set (HDF5_TEST_FILES image24pixel.txt image8.txt ) -FOREACH (h5_file ${HDF5_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( +foreach (h5_file ${HDF5_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/${h5_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET hl_ex_ex_ds1 POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/${h5_file} ${dest} ) -ENDFOREACH (h5_file ${HDF5_TEST_FILES}) +endforeach (h5_file ${HDF5_TEST_FILES}) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME hl_ex-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -46,15 +46,15 @@ ENDFOREACH (h5_file ${HDF5_TEST_FILES}) ex_table_12.h5 ex_ds1.h5 ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (hl_ex-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "hl_ex-clear-objects") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (hl_ex-clear-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "hl_ex-clear-objects") -FOREACH (example ${examples}) - ADD_TEST (NAME hl_ex_${example} COMMAND $<TARGET_FILE:hl_ex_${example}>) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (hl_ex_${example} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "hl_ex_${example}") -ENDFOREACH (example ${examples}) +foreach (example ${examples}) + add_test (NAME hl_ex_${example} COMMAND $<TARGET_FILE:hl_ex_${example}>) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (hl_ex_${example} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "hl_ex_${example}") +endforeach (example ${examples}) diff --git a/hl/examples/ex_image2.c b/hl/examples/ex_image2.c index 76c3a75..3276f7c 100644 --- a/hl/examples/ex_image2.c +++ b/hl/examples/ex_image2.c @@ -26,7 +26,7 @@ #define PAL_ENTRIES 256 static int read_data(const char* file_name, hsize_t *width, hsize_t *height ); -unsigned char *gbuf = 0; /* global buffer for image data */ +unsigned char *gbuf = NULL; /* global buffer for image data */ int main( void ) { @@ -79,18 +79,25 @@ int main( void ) /* make dataset */ status=H5IMmake_image_24bit( file_id, IMAGE2_NAME, width, height, "INTERLACE_PIXEL", gbuf ); - if (gbuf) { - free(gbuf); - gbuf = NULL; - } /* close the file. */ H5Fclose( file_id ); + if(gbuf) { + free(gbuf); + gbuf = NULL; + } + return 0; out: printf("Error on return function...Exiting\n"); + + if(gbuf) { + free(gbuf); + gbuf = NULL; + } + return 1; } diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt index 0da0825..72fc7a8 100644 --- a/hl/fortran/CMakeLists.txt +++ b/hl/fortran/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_F90 C CXX Fortran) #----------------------------------------------------------------------------- @@ -9,13 +9,13 @@ ADD_SUBDIRECTORY (${HDF5_HL_F90_SOURCE_DIR}/src ${HDF5_HL_F90_BINARY_DIR}/src) #----------------------------------------------------------------------------- # Build the HL Fortran Examples #----------------------------------------------------------------------------- -IF (HDF5_BUILD_FORTRAN_EXAMPLES) +if (HDF5_BUILD_FORTRAN_EXAMPLES) ADD_SUBDIRECTORY (${HDF5_HL_F90_SOURCE_DIR}/examples ${HDF5_HL_F90_BINARY_DIR}/examples) -ENDIF (HDF5_BUILD_FORTRAN_EXAMPLES) +endif (HDF5_BUILD_FORTRAN_EXAMPLES) #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- -IF (BUILD_TESTING) +if (BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_HL_F90_SOURCE_DIR}/test ${HDF5_HL_F90_BINARY_DIR}/test) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index 0f663c7..12467b8 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_F90_EXAMPLES C CXX Fortran) #----------------------------------------------------------------------------- @@ -10,27 +10,27 @@ INCLUDE_DIRECTORIES ( ${HDF5_F90_SRC_DIR}/src ) -SET (examples +set (examples exlite ex_ds1 ) -FOREACH (example ${examples}) - ADD_EXECUTABLE (hl_f90_ex_${example} ${HDF5_HL_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) +foreach (example ${examples}) + add_executable (hl_f90_ex_${example} ${HDF5_HL_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (hl_f90_ex_${example} ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (hl_f90_ex_${example} " " " ") - TARGET_LINK_LIBRARIES (hl_f90_ex_${example} + target_link_libraries (hl_f90_ex_${example} ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) - SET_TARGET_PROPERTIES (hl_f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) - SET_TARGET_PROPERTIES (hl_f90_ex_${example} PROPERTIES FOLDER examples/hl/fortran) + set_target_properties (hl_f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) + set_target_properties (hl_f90_ex_${example} PROPERTIES FOLDER examples/hl/fortran) -ENDFOREACH (example ${examples}) +endforeach (example ${examples}) -IF (BUILD_TESTING) +if (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) diff --git a/hl/fortran/examples/CMakeTests.cmake b/hl/fortran/examples/CMakeTests.cmake index 7e6c348..1784041 100644 --- a/hl/fortran/examples/CMakeTests.cmake +++ b/hl/fortran/examples/CMakeTests.cmake @@ -5,6 +5,6 @@ ############################################################################## ############################################################################## -FOREACH (example ${examples}) - ADD_TEST (NAME hl_f90_ex_${example} COMMAND $<TARGET_FILE:hl_f90_ex_${example}>) -ENDFOREACH (example ${examples}) +foreach (example ${examples}) + add_test (NAME hl_f90_ex_${example} COMMAND $<TARGET_FILE:hl_f90_ex_${example}>) +endforeach (example ${examples}) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 22353f8..6377211 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT(HDF5_HL_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- @@ -14,66 +14,66 @@ INCLUDE_DIRECTORIES ( #----------------------------------------------------------------------------- # hl_f90CStub lib #----------------------------------------------------------------------------- -SET (HDF5_HL_F90_C_SRCS +set (HDF5_HL_F90_C_SRCS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5DSfc.c ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTfc.c ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMfc.c ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMcc.c ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5TBfc.c ) -SET_SOURCE_FILES_PROPERTIES (${HDF5_HL_F90_C_SRCS} PROPERTIES LANGUAGE C) +set_source_files_properties (${HDF5_HL_F90_C_SRCS} PROPERTIES LANGUAGE C) -SET (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) +set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) -ADD_LIBRARY (${HDF5_HL_F90_C_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_C_SRCS} ${HDF5_HL_F90_HEADERS}) +add_library (${HDF5_HL_F90_C_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_C_SRCS} ${HDF5_HL_F90_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") +target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_C_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/hl/fortran) -SET_TARGET_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES LINKER_LANGUAGE C) +set_target_properties (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/hl/fortran) +set_target_properties (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES LINKER_LANGUAGE C) #----------------------------------------------------------------------------- # Fortran Modules #----------------------------------------------------------------------------- -SET (HDF5_HL_F90_F_SRCS +set (HDF5_HL_F90_F_SRCS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5DSff.f90 ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5TBff.f90 ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTff.f90 ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMff.f90 ) -ADD_LIBRARY (${HDF5_HL_F90_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_F_SRCS}) -SET (SHARED_LINK_FLAGS " ") -IF (BUILD_SHARED_LIBS) - IF (WIN32 AND NOT CYGWIN) - SET_PROPERTY (TARGET ${HDF5_HL_F90_LIB_TARGET} +add_library (${HDF5_HL_F90_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_F_SRCS}) +set (SHARED_LINK_FLAGS " ") +if (BUILD_SHARED_LIBS) + if (WIN32 AND NOT CYGWIN) + set_property (TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS BUILD_HDF5_DLL ) - IF (MSVC) - SET (SHARED_LINK_FLAGS "/DLL") - ENDIF (MSVC) - ENDIF (WIN32 AND NOT CYGWIN) -ENDIF (BUILD_SHARED_LIBS) -IF (WIN32 AND NOT CYGWIN) - SET_PROPERTY (TARGET ${HDF5_HL_F90_LIB_TARGET} + if (MSVC) + set (SHARED_LINK_FLAGS "/DLL") + endif (MSVC) + endif (WIN32 AND NOT CYGWIN) +endif (BUILD_SHARED_LIBS) +if (WIN32 AND NOT CYGWIN) + set_property (TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) -ENDIF (WIN32 AND NOT CYGWIN) +endif (WIN32 AND NOT CYGWIN) TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} " " ${SHARED_LINK_FLAGS}) -SET_TARGET_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) -TARGET_LINK_LIBRARIES (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}") +set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) +target_link_libraries (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} PROPERTIES FOLDER libraries/hl/fortran) +set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES FOLDER libraries/hl/fortran) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -IF (WIN32 AND NOT CYGWIN) - INSTALL ( +if (WIN32 AND NOT CYGWIN) + install ( DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/ DESTINATION @@ -81,8 +81,8 @@ IF (WIN32 AND NOT CYGWIN) COMPONENT fortheaders ) -ELSE (WIN32 AND NOT CYGWIN) - INSTALL ( +else (WIN32 AND NOT CYGWIN) + install ( DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION @@ -90,17 +90,17 @@ ELSE (WIN32 AND NOT CYGWIN) COMPONENT fortheaders ) -ENDIF (WIN32 AND NOT CYGWIN) +endif (WIN32 AND NOT CYGWIN) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (HDF5_EXPORTED_TARGETS) +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 ( + install ( TARGETS ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_LIB_TARGET} @@ -110,4 +110,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT hlfortlibraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hlfortlibraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index e1a3206..37aac6b 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -476,7 +476,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 160 +LT_VERS_REVISION = 165 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index 2084162..120d6a5 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- @@ -7,35 +7,35 @@ PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran) INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #-- Adding test for hl_f90_tstds -ADD_EXECUTABLE (hl_f90_tstds tstds.f90) +add_executable (hl_f90_tstds tstds.f90) TARGET_NAMING (hl_f90_tstds ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (hl_f90_tstds " " " ") -TARGET_LINK_LIBRARIES (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) -SET_TARGET_PROPERTIES (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran) +target_link_libraries (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +set_target_properties (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran) #-- Adding test for hl_f90_tstlite -ADD_EXECUTABLE (hl_f90_tstlite tstlite.f90) +add_executable (hl_f90_tstlite tstlite.f90) TARGET_NAMING (hl_f90_tstlite ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite " " " ") -TARGET_LINK_LIBRARIES (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) -SET_TARGET_PROPERTIES (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran) +target_link_libraries (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +set_target_properties (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran) #-- Adding test for hl_f90_tstimage -ADD_EXECUTABLE (hl_f90_tstimage tstimage.f90) +add_executable (hl_f90_tstimage tstimage.f90) TARGET_NAMING (hl_f90_tstimage ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage " " " ") -TARGET_LINK_LIBRARIES (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) -SET_TARGET_PROPERTIES (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran) +target_link_libraries (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +set_target_properties (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran) #-- Adding test for hl_f90_tsttable -ADD_EXECUTABLE (hl_f90_tsttable tsttable.f90) +add_executable (hl_f90_tsttable tsttable.f90) TARGET_NAMING (hl_f90_tsttable ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable " " " ") -TARGET_LINK_LIBRARIES (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) -SET_TARGET_PROPERTIES (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran) +target_link_libraries (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +set_target_properties (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake index 81253bd..94bb385 100644 --- a/hl/fortran/test/CMakeTests.cmake +++ b/hl/fortran/test/CMakeTests.cmake @@ -6,7 +6,7 @@ ############################################################################## # Remove any output file left over from previous test run -ADD_TEST ( +add_test ( NAME hl_fortran_test-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -20,10 +20,10 @@ ADD_TEST ( tstds.h5 ) -ADD_TEST (NAME hl_f90_tstds COMMAND $<TARGET_FILE:hl_f90_tstds>) +add_test (NAME hl_f90_tstds COMMAND $<TARGET_FILE:hl_f90_tstds>) -ADD_TEST (NAME hl_f90_tstlite COMMAND $<TARGET_FILE:hl_f90_tstlite>) +add_test (NAME hl_f90_tstlite COMMAND $<TARGET_FILE:hl_f90_tstlite>) -ADD_TEST (NAME hl_f90_tstimage COMMAND $<TARGET_FILE:hl_f90_tstimage>) +add_test (NAME hl_f90_tstimage COMMAND $<TARGET_FILE:hl_f90_tstimage>) -ADD_TEST (NAME hl_f90_tsttable COMMAND $<TARGET_FILE:hl_f90_tsttable>) +add_test (NAME hl_f90_tsttable COMMAND $<TARGET_FILE:hl_f90_tsttable>) diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 5904d05..e93a23a 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -1,19 +1,17 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_SRC) #----------------------------------------------------------------------------- # Shared Libs #----------------------------------------------------------------------------- -IF (BUILD_SHARED_LIBS) - SET (HL_BUILT_AS_DYNAMIC_LIB 1) -ENDIF (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) + set (HL_BUILT_AS_DYNAMIC_LIB 1) +endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # List Source files #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_HL_SRC_DIR}/src) - -SET (HL_SRCS +set (HL_SRCS ${HDF5_HL_SRC_SOURCE_DIR}/H5DO.c ${HDF5_HL_SRC_SOURCE_DIR}/H5DS.c ${HDF5_HL_SRC_SOURCE_DIR}/H5IM.c @@ -24,7 +22,7 @@ SET (HL_SRCS ${HDF5_HL_SRC_SOURCE_DIR}/H5TB.c ) -SET (HL_HEADERS +set (HL_HEADERS ${HDF5_HL_SRC_SOURCE_DIR}/H5DOpublic.h ${HDF5_HL_SRC_SOURCE_DIR}/H5DSpublic.h ${HDF5_HL_SRC_SOURCE_DIR}/H5IMpublic.h @@ -35,17 +33,20 @@ SET (HL_HEADERS ${HDF5_HL_SRC_SOURCE_DIR}/hdf5_hl.h ) -ADD_LIBRARY (${HDF5_HL_LIB_TARGET} ${LIB_TYPE} ${HL_SRCS} ${HL_HEADERS}) +add_library (${HDF5_HL_LIB_TARGET} ${LIB_TYPE} ${HL_SRCS} ${HL_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}") +target_link_libraries (${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_HL_LIB_TARGET} PROPERTIES FOLDER libraries/hl) +set_target_properties (${HDF5_HL_LIB_TARGET} PROPERTIES + FOLDER libraries/hl + INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" +) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}") #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -INSTALL ( +install ( FILES ${HL_HEADERS} DESTINATION @@ -57,11 +58,11 @@ INSTALL ( #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (HDF5_EXPORTED_TARGETS) +if (HDF5_EXPORTED_TARGETS) INSTALL_TARGET_PDB (${HDF5_HL_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hllibraries) - INSTALL ( + install ( TARGETS ${HDF5_HL_LIB_TARGET} EXPORT @@ -70,4 +71,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT hllibraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hllibraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/hl/src/H5DO.c b/hl/src/H5DO.c index 9cfd8c1..99dbd93 100644 --- a/hl/src/H5DO.c +++ b/hl/src/H5DO.c @@ -18,8 +18,14 @@ #include <assert.h> #include <stdio.h> -#include "H5DOprivate.h" +/* High-level library internal header file */ +#include "H5HLprivate2.h" +/* public LT prototypes */ +#include "H5DOpublic.h" + + + /*------------------------------------------------------------------------- * Function: H5DOwrite_chunk * @@ -30,108 +36,64 @@ * Programmer: Raymond Lu * 30 July 2012 * - * Modifications: *------------------------------------------------------------------------- */ herr_t H5DOwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *offset, size_t data_size, const void *buf) { - hbool_t created_dxpl = FALSE; - herr_t ret_value = SUCCEED; /* Return value */ + hbool_t created_dxpl = FALSE; /* Whether we created a DXPL */ + hbool_t do_direct_write = TRUE; /* Flag for direct writes */ + uint32_t data_size_32; /* Chunk data size (limited to 32-bits currently) */ + herr_t ret_value = FAIL; /* Return value */ - if(dset_id < 0) { - ret_value = FAIL; + /* Check arguments */ + if(dset_id < 0) goto done; - } - - if(!buf) { - ret_value = FAIL; + if(!buf) goto done; - } - - if(!offset) { - ret_value = FAIL; + if(!offset) goto done; - } - - if(!data_size) { - ret_value = FAIL; + if(!data_size) + goto done; + data_size_32 = (uint32_t)data_size; + if(data_size != (size_t)data_size_32) goto done; - } + /* If the user passed in a default DXPL, create one to pass to H5Dwrite() */ if(H5P_DEFAULT == dxpl_id) { - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) { - ret_value = FAIL; + if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) goto done; - } - created_dxpl = TRUE; - } + } /* end if */ - if(H5DO_write_chunk(dset_id, dxpl_id, filters, offset, data_size, buf) < 0) { - ret_value = FAIL; + /* Set direct write parameters */ + if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, &do_direct_write) < 0) goto done; - } - -done: - if(created_dxpl) { - if(H5Pclose(dxpl_id) < 0) - ret_value = FAIL; - } - - return ret_value; -} - -/*------------------------------------------------------------------------- - * Function: H5DO_write_chunk - * - * Purpose: Private function for H5DOwrite_chunk - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Raymond Lu - * 30 July 2012 - * - * Modifications: - *------------------------------------------------------------------------- - */ -herr_t -H5DO_write_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *offset, - size_t data_size, const void *buf) -{ - hbool_t do_direct_write = TRUE; - herr_t ret_value = SUCCEED; /* Return value */ - - if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, &do_direct_write) < 0) { - ret_value = FAIL; + if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME, &filters) < 0) goto done; - } - - if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME, &filters) < 0) { - ret_value = FAIL; + if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME, &offset) < 0) goto done; - } - - if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME, &offset) < 0) { - ret_value = FAIL; + if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME, &data_size_32) < 0) goto done; - } - if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME, &data_size) < 0) { - ret_value = FAIL; + /* Write chunk */ + if(H5Dwrite(dset_id, 0, H5S_ALL, H5S_ALL, dxpl_id, buf) < 0) goto done; - } - if(H5Dwrite(dset_id, 0, H5S_ALL, H5S_ALL, dxpl_id, buf) < 0) { - ret_value = FAIL; - goto done; - } + /* Indicate success */ + ret_value = SUCCEED; done: - do_direct_write = FALSE; - if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, &do_direct_write) < 0) - ret_value = FAIL; + if(created_dxpl) { + if(H5Pclose(dxpl_id) < 0) + ret_value = FAIL; + } /* end if */ + else + /* Reset the direct write flag on user DXPL */ + if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, &do_direct_write) < 0) + ret_value = FAIL; + + return(ret_value); +} /* end H5DOwrite_chunk() */ - return ret_value; -} diff --git a/hl/src/H5DOprivate.h b/hl/src/H5DOprivate.h deleted file mode 100644 index fcea585..0000000 --- a/hl/src/H5DOprivate.h +++ /dev/null @@ -1,37 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#ifndef _H5DOprivate_H -#define _H5DOprivate_H - -/* High-level library internal header file */ -#include "H5HLprivate2.h" - -/* public LT prototypes */ -#include "H5DOpublic.h" - -/*------------------------------------------------------------------------- - * Private functions - *------------------------------------------------------------------------- - */ - -H5_HLDLL herr_t H5DO_write_chunk(hid_t dset_id, - hid_t dxpl_id, - uint32_t filters, - const hsize_t *offset, - size_t data_size, - const void *buf); - -#endif diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 409f01c..f9f73c8 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -459,7 +459,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 160 +LT_VERS_REVISION = 165 LT_VERS_AGE = 0 # This library is our main target. diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index f969dbf..545210b 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_TEST) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed @@ -11,8 +11,8 @@ PROJECT (HDF5_HL_TEST) #----------------------------------------------------------------------------- # Generate the H5srcdir_str.h file containing user settings needed by compilation #----------------------------------------------------------------------------- -SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) -CONFIGURE_FILE (${HDF5_HL_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) +set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) +configure_file (${HDF5_HL_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) @@ -21,15 +21,15 @@ INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) # Macro used to add a unit test # -------------------------------------------------------------------- MACRO (HL_ADD_EXE hl_name) - ADD_EXECUTABLE (hl_${hl_name} ${hl_name}.c) + add_executable (hl_${hl_name} ${hl_name}.c) TARGET_NAMING (hl_${hl_name} ${LIB_TYPE}) TARGET_C_PROPERTIES (hl_${hl_name} " " " ") - TARGET_LINK_LIBRARIES (hl_${hl_name} + target_link_libraries (hl_${hl_name} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ) - SET_TARGET_PROPERTIES (hl_${hl_name} PROPERTIES FOLDER test/hl) + set_target_properties (hl_${hl_name} PROPERTIES FOLDER test/hl) ENDMACRO (HL_ADD_EXE) HL_ADD_EXE (test_ds) @@ -43,16 +43,16 @@ HL_ADD_EXE (test_table) # This executable is used to generate test files for the test_ds test. # It should only be run during development when new test files are needed # -------------------------------------------------------------------- -IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (hl_gen_test_ds gen_test_ds.c) +if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (hl_gen_test_ds gen_test_ds.c) TARGET_NAMING (hl_gen_test_ds ${LIB_TYPE}) TARGET_C_PROPERTIES (hl_gen_test_ds " " " ") - TARGET_LINK_LIBRARIES (hl_gen_test_ds + target_link_libraries (hl_gen_test_ds ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ) - SET_TARGET_PROPERTIES (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen) -ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + set_target_properties (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen) +endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/hl/test/CMakeTests.cmake b/hl/test/CMakeTests.cmake index 5d42b57..fda388a 100644 --- a/hl/test/CMakeTests.cmake +++ b/hl/test/CMakeTests.cmake @@ -9,29 +9,29 @@ # Macro used to add a unit test # -------------------------------------------------------------------- MACRO (HL_ADD_TEST hl_name files) - ADD_TEST (NAME hl_${hl_name} COMMAND $<TARGET_FILE:hl_${hl_name}>) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (hl_${hl_name} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + add_test (NAME hl_${hl_name} COMMAND $<TARGET_FILE:hl_${hl_name}>) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (hl_${hl_name} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") # -------------------------------------------------------------------- #-- Copy the necessary files. # -------------------------------------------------------------------- - FOREACH (h5_file ${files}) - SET (dest "${HDF5_HL_TEST_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying HL Test File ${h5_file} to ${dest}") - ADD_CUSTOM_COMMAND ( + foreach (h5_file ${files}) + set (dest "${HDF5_HL_TEST_BINARY_DIR}/${h5_file}") + #message (STATUS " Copying HL Test File ${h5_file} to ${dest}") + add_custom_command ( TARGET hl_${hl_name} PRE_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_HL_TEST_SOURCE_DIR}/${h5_file} ${dest} ) - ENDFOREACH (h5_file ${HL_REFERENCE_TEST_FILES}) + endforeach (h5_file ${HL_REFERENCE_TEST_FILES}) ENDMACRO (HL_ADD_TEST) # Remove any output file left over from previous test run -ADD_TEST ( +add_test ( NAME hl_test-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -60,14 +60,14 @@ ADD_TEST ( test_packet_table.h5 test_table.h5 ) -IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (hl_test-clear-objects PROPERTIES DEPENDS ${last_test}) -ENDIF (NOT "${last_test}" STREQUAL "") -SET (last_test "hl_test-clear-objects") +if (NOT "${last_test}" STREQUAL "") + set_tests_properties (hl_test-clear-objects PROPERTIES DEPENDS ${last_test}) +endif (NOT "${last_test}" STREQUAL "") +set (last_test "hl_test-clear-objects") -HL_ADD_TEST (test_ds "dsdata.txt;dslat.txt;dslon.txt;test_ds_be.h5;test_ds_le.h5") -HL_ADD_TEST (test_dset_opt "") -HL_ADD_TEST (test_image "image8.txt;sepia.pal;earth.pal;image24pixel.txt;image24plane.txt;usa.wri") -HL_ADD_TEST (test_lite "dtype_file.txt") -HL_ADD_TEST (test_packet "") -HL_ADD_TEST (test_table "test_table_be.h5;test_table_cray.h5;test_table_le.h5") +HL_add_test (test_ds "dsdata.txt;dslat.txt;dslon.txt;test_ds_be.h5;test_ds_le.h5") +HL_add_test (test_dset_opt "") +HL_add_test (test_image "image8.txt;sepia.pal;earth.pal;image24pixel.txt;image24plane.txt;usa.wri") +HL_add_test (test_lite "dtype_file.txt") +HL_add_test (test_packet "") +HL_add_test (test_table "test_table_be.h5;test_table_cray.h5;test_table_le.h5") diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index 256ff89..a41aecc 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -1,10 +1,10 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_TOOLS) #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -SET (GIF2H5_SRCS +set (GIF2H5_SRCS ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/gif.h ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/decompress.c ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/gif2hdf.c @@ -17,46 +17,46 @@ SET (GIF2H5_SRCS INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) INCLUDE_DIRECTORIES (${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5) -ADD_EXECUTABLE (gif2h5 ${GIF2H5_SRCS}) +add_executable (gif2h5 ${GIF2H5_SRCS}) TARGET_NAMING (gif2h5 ${LIB_TYPE}) TARGET_C_PROPERTIES (gif2h5 " " " ") -TARGET_LINK_LIBRARIES (gif2h5 ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (gif2h5 PROPERTIES FOLDER tools/hl) +target_link_libraries (gif2h5 ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (gif2h5 PROPERTIES FOLDER tools/hl) #-- Add h52gif program -SET (hdf2gif_SRCS +set (hdf2gif_SRCS ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/hdf2gif.c ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/hdfgifwr.c ) -ADD_EXECUTABLE (h52gif ${hdf2gif_SRCS}) +add_executable (h52gif ${hdf2gif_SRCS}) TARGET_NAMING (h52gif ${LIB_TYPE}) TARGET_C_PROPERTIES (h52gif " " " ") -TARGET_LINK_LIBRARIES (h52gif ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (h52gif PROPERTIES FOLDER tools/hl) +target_link_libraries (h52gif ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (h52gif PROPERTIES FOLDER tools/hl) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # This executable can generate the actual test files - Currently not # used in the CMake Build system as we rely on the test files that are # shipped with HDF5 source archives # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (hl_h52gifgentest ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/h52gifgentst.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (hl_h52gifgentest ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/h52gifgentst.c) TARGET_NAMING (hl_h52gifgentest ${LIB_TYPE}) TARGET_C_PROPERTIES (hl_h52gifgentest " " " ") - TARGET_LINK_LIBRARIES (hl_h52gifgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl) + target_link_libraries (hl_h52gifgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl) -# ADD_TEST (NAME hl_h52gifgentest COMMAND $<TARGET_FILE:hl_h52gifgentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) +# add_test (NAME hl_h52gifgentest COMMAND $<TARGET_FILE:hl_h52gifgentest>) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -INSTALL ( +install ( TARGETS gif2h5 h52gif diff --git a/hl/tools/CMakeTests.cmake b/hl/tools/CMakeTests.cmake index 9f987fd..7c5bd77 100644 --- a/hl/tools/CMakeTests.cmake +++ b/hl/tools/CMakeTests.cmake @@ -12,14 +12,14 @@ FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") # copy test files from source to build dir # -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET gif2h5 POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/testfiles/image1.gif ${PROJECT_BINARY_DIR}/testfiles/image1.gif ) -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET h52gif POST_BUILD COMMAND ${CMAKE_COMMAND} @@ -27,7 +27,7 @@ ADD_CUSTOM_COMMAND ( ) # Remove any output file left over from previous test run -ADD_TEST ( +add_test ( NAME HL_TOOLS-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -35,6 +35,6 @@ ADD_TEST ( image1.h5 ) -ADD_TEST (NAME HL_TOOLS_h52gif COMMAND $<TARGET_FILE:h52gif> testfiles/h52giftst.h5 image1.gif -i image) +add_test (NAME HL_TOOLS_h52gif COMMAND $<TARGET_FILE:h52gif> testfiles/h52giftst.h5 image1.gif -i image) -ADD_TEST (NAME HL_TOOLS_gif2h5 COMMAND $<TARGET_FILE:gif2h5> testfiles/image1.gif image1.h5) +add_test (NAME HL_TOOLS_gif2h5 COMMAND $<TARGET_FILE:gif2h5> testfiles/image1.gif image1.h5) diff --git a/perform/CMakeLists.txt b/perform/CMakeLists.txt index 0a6fa10..df7526e 100644 --- a/perform/CMakeLists.txt +++ b/perform/CMakeLists.txt @@ -1,10 +1,10 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_PERFORM ) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Setup include Directories @@ -16,125 +16,125 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib ) # Add the executables # -------------------------------------------------------------------- #-- Adding test for h5perf_serial -SET (h5perf_serial_SRCS +set (h5perf_serial_SRCS ${HDF5_PERFORM_SOURCE_DIR}/sio_timer.c ${HDF5_PERFORM_SOURCE_DIR}/sio_perf.c ${HDF5_PERFORM_SOURCE_DIR}/sio_engine.c ) -ADD_EXECUTABLE (h5perf_serial ${h5perf_serial_SRCS}) +add_executable (h5perf_serial ${h5perf_serial_SRCS}) TARGET_NAMING (h5perf_serial ${LIB_TYPE}) TARGET_C_PROPERTIES (h5perf_serial " " " ") -TARGET_LINK_LIBRARIES (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5perf_serial PROPERTIES FOLDER perform) +target_link_libraries (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (h5perf_serial PROPERTIES FOLDER perform) -IF (HDF5_BUILD_PERFORM_STANDALONE) +if (HDF5_BUILD_PERFORM_STANDALONE) #-- Adding test for h5perf_serial_alone - SET (h5perf_serial_alone_SRCS + set (h5perf_serial_alone_SRCS ${HDF5_PERFORM_SOURCE_DIR}/sio_timer.c ${HDF5_PERFORM_SOURCE_DIR}/sio_perf.c ${HDF5_PERFORM_SOURCE_DIR}/sio_engine.c ) - ADD_EXECUTABLE (h5perf_serial_alone ${h5perf_serial_alone_SRCS}) - SET_PROPERTY (TARGET h5perf_serial_alone + add_executable (h5perf_serial_alone ${h5perf_serial_alone_SRCS}) + set_property (TARGET h5perf_serial_alone APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE ) TARGET_NAMING (h5perf_serial_alone ${LIB_TYPE}) TARGET_C_PROPERTIES (h5perf_serial_alone " " " ") - TARGET_LINK_LIBRARIES (h5perf_serial_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5perf_serial_alone PROPERTIES FOLDER perform) -ENDIF (HDF5_BUILD_PERFORM_STANDALONE) + target_link_libraries (h5perf_serial_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5perf_serial_alone PROPERTIES FOLDER perform) +endif (HDF5_BUILD_PERFORM_STANDALONE) #-- Adding test for chunk -SET (chunk_SRCS +set (chunk_SRCS ${HDF5_PERFORM_SOURCE_DIR}/chunk.c ) ADD_EXECUTABLE(chunk ${chunk_SRCS}) TARGET_NAMING (chunk ${LIB_TYPE}) TARGET_C_PROPERTIES (chunk " " " ") TARGET_LINK_LIBRARIES(chunk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (chunk PROPERTIES FOLDER perform) +set_target_properties (chunk PROPERTIES FOLDER perform) #-- Adding test for iopipe -SET (iopipe_SRCS +set (iopipe_SRCS ${HDF5_PERFORM_SOURCE_DIR}/iopipe.c ) -ADD_EXECUTABLE (iopipe ${iopipe_SRCS}) +add_executable (iopipe ${iopipe_SRCS}) TARGET_NAMING (iopipe ${LIB_TYPE}) TARGET_C_PROPERTIES (iopipe " " " ") -TARGET_LINK_LIBRARIES (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (iopipe PROPERTIES FOLDER perform) +target_link_libraries (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (iopipe PROPERTIES FOLDER perform) #-- Adding test for overhead -SET (overhead_SRCS +set (overhead_SRCS ${HDF5_PERFORM_SOURCE_DIR}/overhead.c ) -ADD_EXECUTABLE (overhead ${overhead_SRCS}) +add_executable (overhead ${overhead_SRCS}) TARGET_NAMING (overhead ${LIB_TYPE}) TARGET_C_PROPERTIES (overhead " " " ") -TARGET_LINK_LIBRARIES (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (overhead PROPERTIES FOLDER perform) +target_link_libraries (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (overhead PROPERTIES FOLDER perform) #-- Adding test for perf_meta -SET (perf_meta_SRCS +set (perf_meta_SRCS ${HDF5_PERFORM_SOURCE_DIR}/perf_meta.c ) -ADD_EXECUTABLE (perf_meta ${perf_meta_SRCS}) +add_executable (perf_meta ${perf_meta_SRCS}) TARGET_NAMING (perf_meta ${LIB_TYPE}) TARGET_C_PROPERTIES (perf_meta " " " ") -TARGET_LINK_LIBRARIES (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (perf_meta PROPERTIES FOLDER perform) +target_link_libraries (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (perf_meta PROPERTIES FOLDER perform) #-- Adding test for zip_perf -SET (zip_perf_SRCS +set (zip_perf_SRCS ${HDF5_PERFORM_SOURCE_DIR}/zip_perf.c ) -ADD_EXECUTABLE (zip_perf ${zip_perf_SRCS}) +add_executable (zip_perf ${zip_perf_SRCS}) TARGET_NAMING (zip_perf ${LIB_TYPE}) TARGET_C_PROPERTIES (zip_perf " " " ") -TARGET_LINK_LIBRARIES (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (zip_perf PROPERTIES FOLDER perform) +target_link_libraries (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (zip_perf PROPERTIES FOLDER perform) -IF (H5_HAVE_PARALLEL) +if (H5_HAVE_PARALLEL) #-- Adding test for h5perf - SET (h5perf_SRCS + set (h5perf_SRCS ${HDF5_PERFORM_SOURCE_DIR}/pio_timer.c ${HDF5_PERFORM_SOURCE_DIR}/pio_perf.c ${HDF5_PERFORM_SOURCE_DIR}/pio_engine.c ) - ADD_EXECUTABLE (h5perf ${h5perf_SRCS}) + add_executable (h5perf ${h5perf_SRCS}) TARGET_NAMING (h5perf ${LIB_TYPE}) TARGET_C_PROPERTIES (h5perf " " " ") - TARGET_LINK_LIBRARIES (h5perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5perf PROPERTIES FOLDER perform) + target_link_libraries (h5perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (h5perf PROPERTIES FOLDER perform) - IF (HDF5_BUILD_PERFORM_STANDALONE) + if (HDF5_BUILD_PERFORM_STANDALONE) #-- Adding test for h5perf - SET (h5perf_alone_SRCS + set (h5perf_alone_SRCS ${HDF5_PERFORM_SOURCE_DIR}/pio_timer.c ${HDF5_PERFORM_SOURCE_DIR}/pio_perf.c ${HDF5_PERFORM_SOURCE_DIR}/pio_engine.c ) - ADD_EXECUTABLE (h5perf_alone ${h5perf_alone_SRCS}) - SET_PROPERTY (TARGET h5perf_alone + add_executable (h5perf_alone ${h5perf_alone_SRCS}) + set_property (TARGET h5perf_alone APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE ) TARGET_NAMING (h5perf_alone ${LIB_TYPE}) TARGET_C_PROPERTIES (h5perf_alone " " " ") - TARGET_LINK_LIBRARIES (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5perf_alone PROPERTIES FOLDER perform) - ENDIF (HDF5_BUILD_PERFORM_STANDALONE) + target_link_libraries (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (h5perf_alone PROPERTIES FOLDER perform) + endif (HDF5_BUILD_PERFORM_STANDALONE) - IF (HDF5_BUILD_PARALLEL_ALL) + if (HDF5_BUILD_PARALLEL_ALL) #-- Adding test for benchpar - SET (benchpar_SRCS + set (benchpar_SRCS ${HDF5_PERFORM_SOURCE_DIR}/benchpar.c ) - ADD_EXECUTABLE (benchpar ${benchpar_SRCS}) + add_executable (benchpar ${benchpar_SRCS}) TARGET_NAMING (benchpar ${LIB_TYPE}) TARGET_C_PROPERTIES (benchpar " " " ") - TARGET_LINK_LIBRARIES (benchpar ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (benchpar PROPERTIES FOLDER perform) - ENDIF (HDF5_BUILD_PARALLEL_ALL) -ENDIF (H5_HAVE_PARALLEL) + target_link_libraries (benchpar ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (benchpar PROPERTIES FOLDER perform) + endif (HDF5_BUILD_PARALLEL_ALL) +endif (H5_HAVE_PARALLEL) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/perform/CMakeTests.cmake b/perform/CMakeTests.cmake index fab6ab2..f8a5846 100644 --- a/perform/CMakeTests.cmake +++ b/perform/CMakeTests.cmake @@ -5,7 +5,7 @@ ############################################################################## ############################################################################## -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET zip_perf POST_BUILD COMMAND ${CMAKE_COMMAND} @@ -17,7 +17,7 @@ ADD_CUSTOM_COMMAND ( #----------------------------------------------------------------------------- # Remove any output file left over from previous test run -ADD_TEST ( +add_test ( NAME PERFORM_h5perform-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -31,31 +31,31 @@ ADD_TEST ( x-gnuplot ) -ADD_TEST (NAME PERFORM_h5perf_serial COMMAND $<TARGET_FILE:h5perf_serial>) +add_test (NAME PERFORM_h5perf_serial COMMAND $<TARGET_FILE:h5perf_serial>) -IF (HDF5_BUILD_PERFORM_STANDALONE) - ADD_TEST (NAME PERFORM_h5perf_serial_alone COMMAND $<TARGET_FILE:h5perf_serial_alone>) -ENDIF (HDF5_BUILD_PERFORM_STANDALONE) +if (HDF5_BUILD_PERFORM_STANDALONE) + add_test (NAME PERFORM_h5perf_serial_alone COMMAND $<TARGET_FILE:h5perf_serial_alone>) +endif (HDF5_BUILD_PERFORM_STANDALONE) -ADD_TEST (NAME PERFORM_chunk COMMAND $<TARGET_FILE:chunk>) +add_test (NAME PERFORM_chunk COMMAND $<TARGET_FILE:chunk>) -ADD_TEST (NAME PERFORM_iopipe COMMAND $<TARGET_FILE:iopipe>) +add_test (NAME PERFORM_iopipe COMMAND $<TARGET_FILE:iopipe>) -ADD_TEST (NAME PERFORM_overhead COMMAND $<TARGET_FILE:overhead>) +add_test (NAME PERFORM_overhead COMMAND $<TARGET_FILE:overhead>) -ADD_TEST (NAME PERFORM_perf_meta COMMAND $<TARGET_FILE:perf_meta>) +add_test (NAME PERFORM_perf_meta COMMAND $<TARGET_FILE:perf_meta>) -ADD_TEST (NAME PERFORM_zip_perf_help COMMAND $<TARGET_FILE:zip_perf> "-h") -ADD_TEST (NAME PERFORM_zip_perf COMMAND $<TARGET_FILE:zip_perf> tfilters.h5) +add_test (NAME PERFORM_zip_perf_help COMMAND $<TARGET_FILE:zip_perf> "-h") +add_test (NAME PERFORM_zip_perf COMMAND $<TARGET_FILE:zip_perf> tfilters.h5) -IF (H5_HAVE_PARALLEL) - ADD_TEST (NAME PERFORM_h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:h5perf>) +if (H5_HAVE_PARALLEL) + add_test (NAME PERFORM_h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:h5perf>) - IF (HDF5_BUILD_PERFORM_STANDALONE) - 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) + if (HDF5_BUILD_PERFORM_STANDALONE) + 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) - 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>) - ENDIF (HDF5_BUILD_PARALLEL_ALL) -ENDIF (H5_HAVE_PARALLEL) + 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>) + endif (HDF5_BUILD_PARALLEL_ALL) +endif (H5_HAVE_PARALLEL) diff --git a/perform/pio_engine.c b/perform/pio_engine.c index 5f6580c..8b18adf 100644 --- a/perform/pio_engine.c +++ b/perform/pio_engine.c @@ -462,7 +462,8 @@ pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si } else { /* We didn't append the prefix yet */ - HDstrncpy(fullname, prefix, MIN(HDstrlen(prefix), size)); + HDstrncpy(fullname, prefix, size); + fullname[size - 1] = '\0'; } if ((HDstrlen(fullname) + HDstrlen(base_name) + 1) < size) { diff --git a/perform/sio_engine.c b/perform/sio_engine.c index 8539f75..4ce3aa0 100644 --- a/perform/sio_engine.c +++ b/perform/sio_engine.c @@ -371,7 +371,8 @@ sio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si fullname[i] = subdir[j]; } else { /* We didn't append the prefix yet */ - HDstrncpy(fullname, prefix, MIN(HDstrlen(prefix), size)); + HDstrncpy(fullname, prefix, size); + fullname[size - 1] = '\0'; } if ((HDstrlen(fullname) + HDstrlen(base_name) + 1) < size) { diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 5811bec..dc359f6 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -4,23 +4,76 @@ Table of Contents -Section I: Quick Step Building HDF5 Libraries with CMake -Section II: Preconditions -Section III: Building HDF5 C/C++ Libraries with CMake -Section IV: All Options for HDF5 C/C++ Libraries with CMake -Section V: User Defined Options for HDF5 Libraries with CMake -Section VI: APPENDIX +Section I: Quick Step Building HDF5 Libraries with CMake Script Mode +Section II: Quick Step Building HDF5 Libraries with CMake Command Mode +Section III: Preconditions +Section IV: Building HDF5 C/C++ Libraries with CMake +Section V: All Options for HDF5 C/C++ Libraries with CMake +Section VI: User Defined Options for HDF5 Libraries with CMake +Section VII: APPENDIX ************************************************************************ ======================================================================== -I. Quick Step Building HDF5 Libraries with CMake +I. Quick Step Building HDF5 Libraries with CMake Script Mode +======================================================================== +This short set of instructions is written for users who want to quickly +build the HDF5 Library and tools from the HDF5 source code package +using the CMake tools. HDF Group recommends using a ctest script to build +HDF5. + +To build HDF5 with the SZIP and ZLIB external libraries you will need to: + + 1. Create a directory for your development; myhdfstuff. + + 2. Create a directory for the HDF5 source; hdf5-1.8 in myhdfstuff. + + 3. Download the SZip.tar.gz and ZLib.tar.gz to your development directory, + (See Section VII: APPENDIX for instructions). Both are needed if + building with external libraries; do not uncompress them. + + 4. Download or create the CTestScript.cmake file in your development + directory, (See Section VII: APPENDIX for instructions and an example). + + 5. Download or create a platform configuration file in your development + directory, (See Section VII: APPENDIX for instructions and an example). + This file calls CTestScript.cmake; the platform configuration file can + be modified. CTestScript.cmake file should not be modified. + + 6. From your development directory execute the CTest Script with the + following options: + + ctest -S <configuration file>,<hdf5src> -C RelWithDebInfo -VV -O hdf5.log + + 7. This will create an install package in the myhdfstuff/hdf5-1.8/build folder. + + Where: + "configuration file" is the platform configuration file from step6; + HDF518WindowsRWDICMake.cmake, HDF518LinuxRWDICMake.cmake, or + HDF518MacRWDICMake.cmake can be downloaded from the HDF Group website. + "hdf5src" is the uncompressed HDF5 source code directory. No path + should be specified. + + The -S option uses the script version of ctest. + + The value for the -C option (as shown above, "-C RelWithDebInfo") must + match the setting for CTEST_BUILD_CONFIGURATION in the platform + configuration file. + + The -VV option is for verbose; Use -V for less verbose. + + The "-O hdf5.log" option saves the output to a log file hdf5.log. + + + +======================================================================== +II. Quick Step Building HDF5 Libraries with CMake ======================================================================== Notes: This short set of instructions is written for users who want to quickly build the HDF5 Library and tools from the HDF5 source code - package using the CMake tools. + package using the CMake command line tools. A. Windows Quick Step Building HDF5 Libraries with CMake Using VS2010 @@ -37,17 +90,18 @@ Notes: This short set of instructions is written for users who want to 4. Configure the C library, tools and tests with this command: cmake -G "Visual Studio 10" -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON .. + The two dots on the end of the command is the location of the source. - 3. Build the C library, tools and tests with this command: + 5. Build the C library, tools and tests with this command: cmake --build . --config Release - 4. Test the C library and tools with this command: + 6. Test the C library and tools with this command: ctest . -C Release - 5. Create an install image with this command: + 7. Create an install image with this command: cpack -C Release CPackConfig.cmake - 6. Install with this command: + 8. Install with this command: HDF5-1.8.12-win32.exe B. Linux Quick Step Building HDF5 Libraries with CMake Using GCC @@ -55,41 +109,42 @@ Notes: This short set of instructions is written for users who want to Go through these steps: 1. Locate the source files in: - ~\MyHDFstuff\hdf5 + ~/MyHDFstuff/hdf5 2. Create a build folder at: - ~\MyHDFstuff\hdf5\build + ~/MyHDFstuff/hdf5/build 3. Open a command prompt at: - ~\MyHDFstuff\hdf5\build + ~/MyHDFstuff/hdf5/build 4. Configure the C library, tools and tests with this command: cmake -G "Unix Makefiles" -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON .. + The two dots on the end of the command is the location of the source. - 3. Build the C library, tools and tests with this command: + 5. Build the C library, tools and tests with this command: cmake --build . --config Release - 4. Test the C library and tools with this command: + 6. Test the C library and tools with this command: ctest . -C Release - 5. Create an install image with this command: + 7. Create an install image with this command: cpack -C Release CPackConfig.cmake - 6. Install with this command: + 8. Install with this command: HDF5-1.8.12-Linux.sh ======================================================================== -II. Preconditions +III. Preconditions ======================================================================== 1. We suggest you obtain the latest CMake for windows from the Kitware web site. The HDF5 1.8.x product requires a minimum CMake version 2.8.10. 2. If you plan to use Zlib or Szip: - A. Download the packages and install them in a central location. + A. Download the binary packages and install them in a central location. For example on Windows, create a folder extlibs and install the packages there. B. Use source packages from an SVN server by adding the following CMake @@ -121,47 +176,48 @@ II. Preconditions Visual Studio Express users will not be able to package HDF5 into an install image executable. - 5. Developers should copy the config/cmake/cacheinit.cmake file and alter the + 5. Developers can copy the config/cmake/cacheinit.cmake file and alter the the settings for the developers' environment. Then the only options needed on the command line are those options that are different. Example using HDF default cache file: cmake -C ../config/cmake/cacheinit.cmake -G "Visual Studio 10" \ -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF .. +Notes: CMake and HDF5 -Notes: More information about using CMake can be found at the KitWare site, - www.cmake.org. - - CMake uses the command line; however, the visual CMake tool is - available for the configuration step. The steps are similar for - all the operating systems supported by CMake. - - NOTES: - 1. Using CMake for building and using HDF5 is under active development. - While we have attempted to provide error-free files, please - understand that development with CMake has not been extensively - tested outside of HDF. The CMake specific files may change - before the next release. + 1. Using CMake for building and using HDF5 is under active development. + While we have attempted to provide error-free files, please + understand that development with CMake has not been extensively + tested outside of HDF. The CMake specific files may change + before the next release. - 2. CMake support for HDF5 development should be usable on any - system where CMake is supported. Please send us any comments on - how CMake support can be improved on any system. Visit the - KitWare site for more information about CMake. + 2. CMake support for HDF5 development should be usable on any + system where CMake is supported. Please send us any comments on + how CMake support can be improved on any system. Visit the + KitWare site for more information about CMake. - 3. Build and test results can be submitted to our CDash server at: + 3. Build and test results can be submitted to our CDash server at: cdash.hdfgroup.uiuc.edu. - Please read the HDF and CDash document at: + Please read the HDF and CDash document at: www.hdfgroup.org/CDash/HowToSubmit. - 4. See the appendix at the bottom of this file for examples of using - a ctest script for building and testing. Using a ctest script is - preferred because of its flexibility. + 4. See the appendix at the bottom of this file for examples of using + a ctest script for building and testing. Using a ctest script is + preferred because of its flexibility. +Notes: CMake in General + + 1. More information about using CMake can be found at the KitWare site at + www.cmake.org. + + 2. CMake uses the command line; however, the visual CMake tool is + available for the configuration step. The steps are similar for + all the operating systems supported by CMake. ======================================================================== -III. Building HDF5 C/C++ Libraries with CMake +IV. Building HDF5 C/C++ Libraries with CMake ======================================================================== To build the HDF5 C/C++ Libraries with CMake, go through these five steps: @@ -191,7 +247,7 @@ These five steps are described in detail below. then use c:\MyHDFstuff\hdf5\build or c:\MyHDFstuff\build\hdf5 as the build directory. - PREFERRED: + RECOMMENDED: Users can perform the configuration step without using the visual cmake-gui program. We use the file cacheinit.cmake in the config/cmake folder for our testing. This file enables all the @@ -230,42 +286,42 @@ These five steps are described in detail below. ######################## # EXTERNAL cache entries ######################## - SET (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE) - SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) - SET (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) - SET (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE) - 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) - 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) - 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) - SET (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk" CACHE STRING "Use SZip from HDF repository" FORCE) - SET (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) - SET (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) - SET (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) - SET (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) + set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE) + set (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) + set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) + set (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE) + 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) + 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) + 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) + set (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk" CACHE STRING "Use SZip from HDF repository" FORCE) + set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) + set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) + set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) + set (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) 2. Configure the cache settings @@ -388,7 +444,7 @@ These five steps are described in detail below. ======================================================================== -IV. All Options for HDF5 C/C++ Libraries with CMake +V. All Options for HDF5 C/C++ Libraries with CMake ======================================================================== In the options listed below, there are three columns of information: @@ -406,7 +462,7 @@ HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" OFF HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" OFF HDF5_BUILD_TOOLS "Build HDF5 Tools" OFF -IF (HDF5_BUILD_FORTRAN) +if (HDF5_BUILD_FORTRAN) HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" OFF ---------------- HDF5 Advanced Options --------------------- @@ -434,13 +490,13 @@ HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF -IF (APPLE) +if (APPLE) HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF -IF (CMAKE_BUILD_TYPE MATCHES Debug) +if (CMAKE_BUILD_TYPE MATCHES Debug) HDF5_ENABLE_TRACE "Enable API tracing capability" ON -IF (HDF5_TEST_VFD) +if (HDF5_TEST_VFD) HDF5_TEST_FHEAP_VFD "Execute fheap test with different VFDs" ON -IF (WIN32 AND NOT CYGWIN) +if (WIN32 AND NOT CYGWIN) HDF_LEGACY_NAMING "Use Legacy Names for Libraries and Programs" OFF ---------------- External Library Options --------------------- @@ -453,18 +509,18 @@ HDF5_USE_FILTER_FLETCHER32 "Use the FLETCHER32 Filter" ON HDF5_USE_FILTER_NBIT "Use the NBIT Filter" ON HDF5_USE_FILTER_SCALEOFFSET "Use the SCALEOFFSET Filter" ON HDF5_USE_FILTER_SHUFFLE "Use the SHUFFLE Filter" ON -IF (HDF5_ENABLE_SZIP_SUPPORT) +if (HDF5_ENABLE_SZIP_SUPPORT) HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF -IF (WINDOWS) +if (WINDOWS) H5_DEFAULT_PLUGINDIR "%ALLUSERSPROFILE%/hdf5/lib/plugin" -ELSE (WINDOWS) +else (WINDOWS) H5_DEFAULT_PLUGINDIR "/usr/local/hdf5/lib/plugin" -ENDIF (WINDOWS) +endif (WINDOWS) ======================================================================== -V. User Defined Options for HDF5 Libraries with CMake +VI. User Defined Options for HDF5 Libraries with CMake ======================================================================== Support for User Defined macros and options has been added. The file @@ -477,7 +533,7 @@ UserMacros.cmake file. Then enable the option to the CMake configuration, build and test process. ======================================================================== -VI. APPENDIX +VII. APPENDIX ======================================================================== Below are examples of the ctest scripts used by The HDF Group. @@ -551,7 +607,7 @@ else(NOT SITE_OS_NAME) endif(CMAKE_HOST_UNIX) if(SITE_BUILDNAME_SUFFIX) set(CTEST_BUILD_NAME ${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}) - endif() + endif(SITE_BUILDNAME_SUFFIX) set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") endif(NOT SITE_OS_NAME) @@ -562,10 +618,16 @@ if(APPLE) # Compiler choice execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - SET(ENV{CC} "${XCODE_CC}") - SET(ENV{CXX} "${XCODE_CXX}") - # Shared fortran is not supported, build static - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + set(ENV{CC} "${XCODE_CC}") + set(ENV{CXX} "${XCODE_CXX}") + + if(NOT NO_MAC_FORTRAN) + # Shared fortran is not supported, build static + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + else(NOT NO_MAC_FORTRAN) + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + endif(NOT NO_MAC_FORTRAN) + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") endif(APPLE) @@ -582,7 +644,7 @@ endif(NOT SITE_CYGWIN}) #----------------------------------------------------------------------------- set(NEED_REPOSITORY_CHECKOUT 0) set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") -if (CTEST_USE_TAR_SOURCE) +if(CTEST_USE_TAR_SOURCE) ## Uncompress source if tar file provided ## -------------------------- if(WIN32) @@ -602,20 +664,20 @@ if (CTEST_USE_TAR_SOURCE) file(RENAME ${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY}) set(LOCAL_SKIP_UPDATE "TRUE") -else (CTEST_USE_TAR_SOURCE) +else(CTEST_USE_TAR_SOURCE) ## use subversion to get source ## -------------------------- - if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") - set (NEED_REPOSITORY_CHECKOUT 1) - endif (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") + if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") + set(NEED_REPOSITORY_CHECKOUT 1) + endif(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") - if (${NEED_REPOSITORY_CHECKOUT}) - set (CTEST_CHECKOUT_COMMAND + if(${NEED_REPOSITORY_CHECKOUT}) + set(CTEST_CHECKOUT_COMMAND "${CTEST_UPDATE_COMMAND} co ${REPOSITORY_URL} \"${CTEST_SOURCE_DIRECTORY}\" -r HEAD") - else (${NEED_REPOSITORY_CHECKOUT}) - set (CTEST_CHECKOUT_COMMAND "${CTEST_UPDATE_COMMAND} update") - endif (${NEED_REPOSITORY_CHECKOUT}) -endif (CTEST_USE_TAR_SOURCE) + else(${NEED_REPOSITORY_CHECKOUT}) + set(CTEST_CHECKOUT_COMMAND "${CTEST_UPDATE_COMMAND} update") + endif(${NEED_REPOSITORY_CHECKOUT}) +endif(CTEST_USE_TAR_SOURCE) #----------------------------------------------------------------------------- ## Clear the build directory @@ -717,62 +779,69 @@ endforeach(v) message("Dashboard script configuration:\n${vars}\n") #----------------------------------------------------------------------------- -## NORMAL process -## -- LOCAL_UPDATE updates the source folder from svn -## -- LOCAL_SUBMIT reports to CDash server -## -- LOCAL_SKIP_TEST skips the test process (only builds) -## -- LOCAL_MEMCHECK_TEST executes the Valgrind testing -## -- LOCAL_COVERAGE_TEST executes code coverage process -## -------------------------- -CTEST_START (${MODEL} TRACK ${MODEL}) -if(LOCAL_UPDATE) - CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}") -endif(LOCAL_UPDATE) -CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}") -CTEST_READ_CUSTOM_FILES ("${CTEST_BINARY_DIRECTORY}") -if(LOCAL_SUBMIT) - CTEST_SUBMIT (PARTS Update Configure Notes) -endif(LOCAL_SUBMIT) - CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) -if(LOCAL_SUBMIT) - CTEST_SUBMIT (PARTS Build) -endif(LOCAL_SUBMIT) -if(NOT LOCAL_SKIP_TEST) - if(NOT LOCAL_MEMCHECK_TEST) - CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) - if(LOCAL_SUBMIT) - CTEST_SUBMIT (PARTS Test) - endif(LOCAL_SUBMIT) - else(NOT LOCAL_MEMCHECK_TEST) - CTEST_MEMCHECK (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) - if(LOCAL_SUBMIT) - CTEST_SUBMIT (PARTS MemCheck) - endif(LOCAL_SUBMIT) - endif(NOT LOCAL_MEMCHECK_TEST) - if(LOCAL_COVERAGE_TEST) - CTEST_COVERAGE (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) - if(LOCAL_SUBMIT) - CTEST_SUBMIT (PARTS Coverage) - endif(LOCAL_SUBMIT) - endif(LOCAL_COVERAGE_TEST) -endif(NOT LOCAL_SKIP_TEST) -if(NOT LOCAL_MEMCHECK_TEST) - ##----------------------------------------------- - ## Package the product - ##----------------------------------------------- - execute_process(COMMAND cpack -C ${CTEST_BUILD_CONFIGURATION} -V - WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} - RESULT_VARIABLE cpackResult - OUTPUT_VARIABLE cpackLog - ERROR_VARIABLE cpackLog.err - ) - file(WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") -endif(NOT LOCAL_MEMCHECK_TEST) #----------------------------------------------------------------------------- + ## NORMAL process + ## -- LOCAL_UPDATE updates the source folder from svn + ## -- LOCAL_SUBMIT reports to CDash server + ## -- LOCAL_SKIP_TEST skips the test process (only builds) + ## -- LOCAL_MEMCHECK_TEST executes the Valgrind testing + ## -- LOCAL_COVERAGE_TEST executes code coverage process + ## -------------------------- + CTEST_START (${MODEL} TRACK ${MODEL}) + if(LOCAL_UPDATE) + CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}") + endif(LOCAL_UPDATE) + CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}") + CTEST_READ_CUSTOM_FILES ("${CTEST_BINARY_DIRECTORY}") + if(LOCAL_SUBMIT) + CTEST_SUBMIT (PARTS Update Configure Notes) + endif(LOCAL_SUBMIT) + CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) + if(LOCAL_SUBMIT) + CTEST_SUBMIT (PARTS Build) + endif(LOCAL_SUBMIT) + if(NOT LOCAL_SKIP_TEST) + if(NOT LOCAL_MEMCHECK_TEST) + CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) + if(LOCAL_SUBMIT) + CTEST_SUBMIT (PARTS Test) + endif(LOCAL_SUBMIT) + if(res GREATER 0) + message(FATAL_ERROR "Failed tests: ${res}\n") + endif(res GREATER 0) + else(NOT LOCAL_MEMCHECK_TEST) + CTEST_MEMCHECK (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) + if(LOCAL_SUBMIT) + CTEST_SUBMIT (PARTS MemCheck) + endif(LOCAL_SUBMIT) + endif(NOT LOCAL_MEMCHECK_TEST) + if(LOCAL_COVERAGE_TEST) + CTEST_COVERAGE (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) + if(LOCAL_SUBMIT) + CTEST_SUBMIT (PARTS Coverage) + endif(LOCAL_SUBMIT) + endif(LOCAL_COVERAGE_TEST) + endif(NOT LOCAL_SKIP_TEST) + if(NOT LOCAL_MEMCHECK_TEST AND NOT LOCAL_NO_PACKAGE) + ##----------------------------------------------- + ## Package the product + ##----------------------------------------------- + execute_process(COMMAND cpack -C ${CTEST_BUILD_CONFIGURATION} -V + WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} + RESULT_VARIABLE cpackResult + OUTPUT_VARIABLE cpackLog + ERROR_VARIABLE cpackLog.err + ) + file(WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") + if(cpackResult GREATER 0) + message(FATAL_ERROR "Failed packaging: ${cpackResult}\n") + endif(cpackResult GREATER 0) + endif(NOT LOCAL_MEMCHECK_TEST AND NOT LOCAL_NO_PACKAGE) +#----------------------------------------------------------------------------- + message("DONE:CTestScript") - ======================================================================== ctest ======================================================================== @@ -790,46 +859,61 @@ and the build folder is created as a sub-folder. # "ctest -S HDF518Static.cmake,hdf518 -C Release -O hdf518static.log" # where hdf518 is the source folder relative to the location of these scripts ############################################################################ - cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR) - -# CTEST_SCRIPT_ARG is the source folder passed on the command line -set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG}) -set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/buildstatic) +set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) +set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") -set(CTEST_BUILD_CONFIGURATION "Release") set(MODEL "Experimental") -# build generator name, see cmake generator list +####### Following Line is one of [Release, RelWithDebInfo, Debug] ############# +set(CTEST_BUILD_CONFIGURATION "RelWithDebInfo") +######### Following describes computer ############ set(CTEST_CMAKE_GENERATOR "Unix Makefiles") -# machine description, can be removed on linux -set(CTEST_SITE "machine.domain") -set(SITE_OS_NAME "os name") -set(SITE_OS_VERSION "os version") -set(SITE_OS_BITS "os size") -set(SITE_COMPILER_NAME "compiler name") -set(SITE_COMPILER_VERSION "compiler version") - -# extra CDash build name description -set(SITE_BUILDNAME_SUFFIX "STATIC") - -# needed for source updates, change as required +## Set the following to unique id your computer ## +set(CTEST_SITE "LINUX.XXXX") +## following is optional to describe build ## +set(SITE_BUILDNAME_SUFFIX "RWDI-SHARED") +#################################################### + +##### Following controls CDash submission ##### +#set(LOCAL_SUBMIT "TRUE") +##### Following controls test process ##### +#set(LOCAL_SKIP_TEST "TRUE") +#set(LOCAL_MEMCHECK_TEST "TRUE") +#set(LOCAL_COVERAGE_TEST "TRUE") +##### Following controls cpack command ##### +set(LOCAL_NO_PACKAGE "TRUE") +##### Following controls source update ##### +#set(LOCAL_UPDATE "TRUE") set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8") +#uncomment to use a compressed source file *.zip +#set(CTEST_USE_TAR_SOURCE "hdf5-1.8.12") +############################################ + +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +### uncomment and change the following line for more configuration options +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:XXX=XXX") +### uncomment the following line to build static libraries +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") +### ext libs from svn +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=SVN") +### ext libs from tgz for 1.8.12 and after +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH=${CTEST_SCRIPT_DIRECTORY}") +### ext libs from tgz for 1.8.11 and before +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS}-DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZ_PATH:PATH=${CTEST_SCRIPT_DIRECTORY}") +### Create install package with external libraries (szip, zlib) +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") +### disable test program builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF") +### disable packaging +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NO_PACKAGES:BOOL=ON") +############################################ -# options to add/change from the cacheinit.cmake in the config/cmake folder -set(ADD_BUILD_OPTIONS "-DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/hdf5.1.8_static") -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_ANSI_CFLAGS:STRING=-fPIC -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=\"SVN\"") - -# include common script file include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) -message("DONE") - - ======================================================================== For further assistance, send email to help@hdfgroup.org diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 93dedaf..48ff4e0 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.170 currently under development +HDF5 version 1.9.175 currently under development ================================================================================ @@ -1282,34 +1282,34 @@ The following platforms are not supported but have been tested for this release. g++ 4.6.1 20110422 gfortran 4.6.1 20110422 - Debian7.1.0 3.2.0-4-686 #1 SMP Debian 3.2.46-1 i686 GNU/Linux + Debian7.2.0 3.2.0-4-686 #1 SMP Debian 3.2.51-1 i686 GNU/Linux gcc (Debian 4.7.2-5) 4.7.2 GNU Fortran (Debian 4.7.2-5) 4.7.2 (cmake and autotools) - Debian7.1.0 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux + Debian7.2.0 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux gcc (Debian 4.7.2-5) 4.7.2 GNU Fortran (Debian 4.7.2-5) 4.7.2 (cmake and autotools) - Fedora19 3.11.1-200.fc19.i6866 #1 SMP i686 i686 i386 GNU/Linux - gcc (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1) - GNU Fortran (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1) + Fedora20 3.11.10-301.fc20.i6866 #1 SMP i686 i686 i386 GNU/Linux + gcc (GCC) 4.8.2 20131212 (Red Hat 4.8.2-7) + GNU Fortran (GCC) 4.8.2 20130603 (Red Hat 4.8.2-7) (cmake and autotools) - Fedora19 3.11.1-200.fc19.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux - gcc (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1) - GNU Fortran (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1) + Fedora20 3.11.10-301.fc20.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.8.2 20131212 (Red Hat 4.8.2-7) + GNU Fortran (GCC) 4.8.2 20130603 (Red Hat 4.8.2-7) (cmake and autotools) - SUSE 12.3 3.7.10-1.16-desktop #1 SMP PREEMPT i686 i686 i386 GNU/Linux - gcc (SUSE Linux) 4.7.2 - GNU Fortran (SUSE Linux) 4.7.2 + SUSE 13.1 3.11.6-4-desktop #1 SMP PREEMPT i686 athlon i386 GNU/Linux + gcc (SUSE Linux) 4.8.1 + GNU Fortran (SUSE Linux) 4.8.1 (cmake and autotools) - SUSE 12.3 3.7.10-1.16-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux - gcc (SUSE Linux) 4.7.2 - GNU Fortran (SUSE Linux) 4.7.2 + SUSE 13.1 3.11.6-4-desktop #1 SMP PREEMPT x86_64 x86_64 x86_64 GNU/Linux + gcc (SUSE Linux) 4.8.1 + GNU Fortran (SUSE Linux) 4.8.1 (cmake and autotools) Ubuntu 13.10 3.11.0-13-generic #20-Ubuntu SMP i686 GNU/Linux diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 313e0f0..84a44c1 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -186,24 +186,24 @@ III. Minimum C Project Files for CMake following text in the file: ########################################################## -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5MyApp C CXX) FIND_PACKAGE (HDF5 NAMES hdf5) # FIND_PACKAGE (HDF5) # Find non-cmake built HDF5 INCLUDE_DIRECTORIES (${HDF5_INCLUDE_DIR}) -SET (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES}) +set (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES}) -SET (example hdf_example) +set (example hdf_example) -ADD_EXECUTABLE (${example} ${PROJECT_SOURCE_DIR}/${example}.c) +add_executable (${example} ${PROJECT_SOURCE_DIR}/${example}.c) TARGET_C_PROPERTIES (${example} " " " ") -TARGET_LINK_LIBRARIES (${example} ${LINK_LIBS}) +target_link_libraries (${example} ${LINK_LIBS}) ENABLE_TESTING () -INCLUDE (CTest) +include (CTest) -ADD_TEST (NAME test_example COMMAND ${example}) +add_test (NAME test_example COMMAND ${example}) ########################################################## diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 718a41f..63f59d5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,15 +1,15 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_SRC C CXX) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # List Source Files #----------------------------------------------------------------------------- -SET (H5_SRCS +set (H5_SRCS ${HDF5_SRC_DIR}/H5.c ${HDF5_SRC_DIR}/H5checksum.c ${HDF5_SRC_DIR}/H5dbg.c @@ -18,7 +18,7 @@ SET (H5_SRCS ${HDF5_SRC_DIR}/H5trace.c ) -SET (H5_HDRS +set (H5_HDRS ${HDF5_SRC_DIR}/hdf5.h ${HDF5_SRC_DIR}/H5api_adpt.h ${HDF5_SRC_DIR}/H5public.h @@ -27,7 +27,7 @@ SET (H5_HDRS ) IDE_GENERATED_PROPERTIES ("H5" "${H5_HDRS}" "${H5_SRCS}" ) -SET (H5A_SRCS +set (H5A_SRCS ${HDF5_SRC_DIR}/H5A.c ${HDF5_SRC_DIR}/H5Abtree2.c ${HDF5_SRC_DIR}/H5Adense.c @@ -36,35 +36,35 @@ SET (H5A_SRCS ${HDF5_SRC_DIR}/H5Atest.c ) -SET (H5A_HDRS +set (H5A_HDRS ${HDF5_SRC_DIR}/H5Apkg.h ${HDF5_SRC_DIR}/H5Apublic.h ) IDE_GENERATED_PROPERTIES ("H5A" "${H5A_HDRS}" "${H5A_SRCS}" ) -SET (H5AC_SRCS +set (H5AC_SRCS ${HDF5_SRC_DIR}/H5AC.c ) -SET (H5AC_HDRS +set (H5AC_HDRS ${HDF5_SRC_DIR}/H5ACpkg.h ${HDF5_SRC_DIR}/H5ACpublic.h ) IDE_GENERATED_PROPERTIES ("H5AC" "${H5AC_HDRS}" "${H5AC_SRCS}" ) -SET (H5B_SRCS +set (H5B_SRCS ${HDF5_SRC_DIR}/H5B.c ${HDF5_SRC_DIR}/H5Bcache.c ${HDF5_SRC_DIR}/H5Bdbg.c ) -SET (H5B_HDRS +set (H5B_HDRS ${HDF5_SRC_DIR}/H5Bpkg.h ${HDF5_SRC_DIR}/H5Bpublic.h ) IDE_GENERATED_PROPERTIES ("H5B" "${H5B_HDRS}" "${H5B_SRCS}" ) -SET (H5B2_SRCS +set (H5B2_SRCS ${HDF5_SRC_DIR}/H5B2.c ${HDF5_SRC_DIR}/H5B2cache.c ${HDF5_SRC_DIR}/H5B2dbg.c @@ -73,32 +73,32 @@ SET (H5B2_SRCS ${HDF5_SRC_DIR}/H5B2stat.c ${HDF5_SRC_DIR}/H5B2test.c ) -SET (H5B2_HDRS +set (H5B2_HDRS ${HDF5_SRC_DIR}/H5B2pkg.h ${HDF5_SRC_DIR}/H5B2public.h ) IDE_GENERATED_PROPERTIES ("H5B2" "${H5B2_HDRS}" "${H5B2_SRCS}" ) -SET (H5C_SRCS +set (H5C_SRCS ${HDF5_SRC_DIR}/H5C.c ) -SET (H5C_HDRS +set (H5C_HDRS ${HDF5_SRC_DIR}/H5Cpkg.h ${HDF5_SRC_DIR}/H5Cpublic.h ) IDE_GENERATED_PROPERTIES ("H5C" "${H5C_HDRS}" "${H5C_SRCS}" ) -SET (H5CS_SRCS +set (H5CS_SRCS ${HDF5_SRC_DIR}/H5CS.c ) -SET (H5CS_HDRS +set (H5CS_HDRS ) IDE_GENERATED_PROPERTIES ("H5CS" "${H5CS_HDRS}" "${H5CS_SRCS}" ) -SET (H5D_SRCS +set (H5D_SRCS ${HDF5_SRC_DIR}/H5D.c ${HDF5_SRC_DIR}/H5Dbtree.c ${HDF5_SRC_DIR}/H5Dchunk.c @@ -118,19 +118,19 @@ SET (H5D_SRCS ${HDF5_SRC_DIR}/H5Dtest.c ) -SET (H5D_HDRS +set (H5D_HDRS ${HDF5_SRC_DIR}/H5Dpkg.h ${HDF5_SRC_DIR}/H5Dpublic.h ) IDE_GENERATED_PROPERTIES ("H5D" "${H5D_HDRS}" "${H5D_SRCS}" ) -SET (H5E_SRCS +set (H5E_SRCS ${HDF5_SRC_DIR}/H5E.c ${HDF5_SRC_DIR}/H5Edeprec.c ${HDF5_SRC_DIR}/H5Eint.c ) -SET (H5E_HDRS +set (H5E_HDRS ${HDF5_SRC_DIR}/H5Edefin.h ${HDF5_SRC_DIR}/H5Einit.h ${HDF5_SRC_DIR}/H5Epkg.h @@ -141,7 +141,7 @@ SET (H5E_HDRS IDE_GENERATED_PROPERTIES ("H5E" "${H5E_HDRS}" "${H5E_SRCS}" ) -SET (H5EA_SRCS +set (H5EA_SRCS ${HDF5_SRC_DIR}/H5EA.c ${HDF5_SRC_DIR}/H5EAcache.c ${HDF5_SRC_DIR}/H5EAdbg.c @@ -154,13 +154,13 @@ SET (H5EA_SRCS ${HDF5_SRC_DIR}/H5EAstat.c ${HDF5_SRC_DIR}/H5EAtest.c ) -SET (H5EA_HDRS +set (H5EA_HDRS ${HDF5_SRC_DIR}/H5EApkg.h ) IDE_GENERATED_PROPERTIES ("H5EA" "${H5EA_HDRS}" "${H5EA_SRCS}" ) -SET (H5F_SRCS +set (H5F_SRCS ${HDF5_SRC_DIR}/H5F.c ${HDF5_SRC_DIR}/H5Faccum.c ${HDF5_SRC_DIR}/H5Fcwfs.c @@ -178,14 +178,14 @@ SET (H5F_SRCS ${HDF5_SRC_DIR}/H5Ftest.c ) -SET (H5F_HDRS +set (H5F_HDRS ${HDF5_SRC_DIR}/H5Fpkg.h ${HDF5_SRC_DIR}/H5Fpublic.h ) IDE_GENERATED_PROPERTIES ("H5F" "${H5F_HDRS}" "${H5F_SRCS}" ) -SET (H5FA_SRCS +set (H5FA_SRCS ${HDF5_SRC_DIR}/H5FA.c ${HDF5_SRC_DIR}/H5FAcache.c ${HDF5_SRC_DIR}/H5FAdbg.c @@ -195,13 +195,13 @@ SET (H5FA_SRCS ${HDF5_SRC_DIR}/H5FAstat.c ${HDF5_SRC_DIR}/H5FAtest.c ) -SET (H5FA_HDRS +set (H5FA_HDRS ${HDF5_SRC_DIR}/H5FApkg.h ) IDE_GENERATED_PROPERTIES ("H5FA" "${H5FA_HDRS}" "${H5FA_SRCS}" ) -SET (H5FD_SRCS +set (H5FD_SRCS ${HDF5_SRC_DIR}/H5FD.c ${HDF5_SRC_DIR}/H5FDcore.c ${HDF5_SRC_DIR}/H5FDdirect.c @@ -218,7 +218,7 @@ SET (H5FD_SRCS ${HDF5_SRC_DIR}/H5FDwindows.c ) -SET (H5FD_HDRS +set (H5FD_HDRS ${HDF5_SRC_DIR}/H5FDcore.h ${HDF5_SRC_DIR}/H5FDdirect.h ${HDF5_SRC_DIR}/H5FDfamily.h @@ -236,23 +236,23 @@ SET (H5FD_HDRS IDE_GENERATED_PROPERTIES ("H5FD" "${H5FD_HDRS}" "${H5FD_SRCS}" ) -SET (H5FL_SRCS +set (H5FL_SRCS ${HDF5_SRC_DIR}/H5FL.c ) -SET (H5FL_HDRS +set (H5FL_HDRS ) IDE_GENERATED_PROPERTIES ("H5FL" "${H5FL_HDRS}" "${H5FL_SRCS}" ) -SET (H5FO_SRCS +set (H5FO_SRCS ${HDF5_SRC_DIR}/H5FO.c ) -SET (H5FO_HDRS +set (H5FO_HDRS ) IDE_GENERATED_PROPERTIES ("H5FO" "${H5FO_HDRS}" "${H5FO_SRCS}" ) -SET (H5FS_SRCS +set (H5FS_SRCS ${HDF5_SRC_DIR}/H5FS.c ${HDF5_SRC_DIR}/H5FScache.c ${HDF5_SRC_DIR}/H5FSdbg.c @@ -261,13 +261,13 @@ SET (H5FS_SRCS ${HDF5_SRC_DIR}/H5FStest.c ) -SET (H5FS_HDRS +set (H5FS_HDRS ${HDF5_SRC_DIR}/H5FSpkg.h ${HDF5_SRC_DIR}/H5FSpublic.h ) IDE_GENERATED_PROPERTIES ("H5FS" "${H5FS_HDRS}" "${H5FS_SRCS}" ) -SET (H5G_SRCS +set (H5G_SRCS ${HDF5_SRC_DIR}/H5G.c ${HDF5_SRC_DIR}/H5Gbtree2.c ${HDF5_SRC_DIR}/H5Gcache.c @@ -288,13 +288,13 @@ SET (H5G_SRCS ${HDF5_SRC_DIR}/H5Gtraverse.c ) -SET (H5G_HDRS +set (H5G_HDRS ${HDF5_SRC_DIR}/H5Gpkg.h ${HDF5_SRC_DIR}/H5Gpublic.h ) IDE_GENERATED_PROPERTIES ("H5G" "${H5G_HDRS}" "${H5G_SRCS}" ) -SET (H5HF_SRCS +set (H5HF_SRCS ${HDF5_SRC_DIR}/H5HF.c ${HDF5_SRC_DIR}/H5HFbtree2.c ${HDF5_SRC_DIR}/H5HFcache.c @@ -313,101 +313,101 @@ SET (H5HF_SRCS ${HDF5_SRC_DIR}/H5HFtiny.c ) -SET (H5HF_HDRS +set (H5HF_HDRS ${HDF5_SRC_DIR}/H5HFpkg.h ${HDF5_SRC_DIR}/H5HFpublic.h ) IDE_GENERATED_PROPERTIES ("H5HF" "${H5HF_HDRS}" "${H5HF_SRCS}" ) -SET (H5HG_SRCS +set (H5HG_SRCS ${HDF5_SRC_DIR}/H5HG.c ${HDF5_SRC_DIR}/H5HGcache.c ${HDF5_SRC_DIR}/H5HGdbg.c ${HDF5_SRC_DIR}/H5HGquery.c ) -SET (H5HG_HDRS +set (H5HG_HDRS ${HDF5_SRC_DIR}/H5HGpkg.h ${HDF5_SRC_DIR}/H5HGpublic.h ) IDE_GENERATED_PROPERTIES ("H5HG" "${H5HG_HDRS}" "${H5HG_SRCS}" ) -SET (H5HL_SRCS +set (H5HL_SRCS ${HDF5_SRC_DIR}/H5HL.c ${HDF5_SRC_DIR}/H5HLcache.c ${HDF5_SRC_DIR}/H5HLdbg.c ${HDF5_SRC_DIR}/H5HLint.c ) -SET (H5HL_HDRS +set (H5HL_HDRS ${HDF5_SRC_DIR}/H5HLpkg.h ${HDF5_SRC_DIR}/H5HLpublic.h ) IDE_GENERATED_PROPERTIES ("H5HL" "${H5HL_HDRS}" "${H5HL_SRCS}" ) -SET (H5HP_SRCS +set (H5HP_SRCS ${HDF5_SRC_DIR}/H5HP.c ) -SET (H5HP_HDRS +set (H5HP_HDRS ) IDE_GENERATED_PROPERTIES ("H5HP" "${H5HP_HDRS}" "${H5HP_SRCS}" ) -SET (H5I_SRCS +set (H5I_SRCS ${HDF5_SRC_DIR}/H5I.c ${HDF5_SRC_DIR}/H5Itest.c ) -SET (H5I_HDRS +set (H5I_HDRS ${HDF5_SRC_DIR}/H5Ipkg.h ${HDF5_SRC_DIR}/H5Ipublic.h ) IDE_GENERATED_PROPERTIES ("H5I" "${H5I_HDRS}" "${H5I_SRCS}" ) -SET (H5L_SRCS +set (H5L_SRCS ${HDF5_SRC_DIR}/H5L.c ${HDF5_SRC_DIR}/H5Lexternal.c ) -SET (H5L_HDRS +set (H5L_HDRS ${HDF5_SRC_DIR}/H5Lpkg.h ${HDF5_SRC_DIR}/H5Lpublic.h ) IDE_GENERATED_PROPERTIES ("H5L" "${H5L_HDRS}" "${H5L_SRCS}" ) -SET (H5MF_SRCS +set (H5MF_SRCS ${HDF5_SRC_DIR}/H5MF.c ${HDF5_SRC_DIR}/H5MFaggr.c ${HDF5_SRC_DIR}/H5MFdbg.c ${HDF5_SRC_DIR}/H5MFsection.c ) -SET (H5MF_HDRS +set (H5MF_HDRS ) IDE_GENERATED_PROPERTIES ("H5MF" "${H5MF_HDRS}" "${H5MF_SRCS}" ) -SET (H5MM_SRCS +set (H5MM_SRCS ${HDF5_SRC_DIR}/H5MM.c ) -SET (H5MM_HDRS +set (H5MM_HDRS ${HDF5_SRC_DIR}/H5MMpublic.h ) IDE_GENERATED_PROPERTIES ("H5MM" "${H5MM_HDRS}" "${H5MM_SRCS}" ) -SET (H5MP_SRCS +set (H5MP_SRCS ${HDF5_SRC_DIR}/H5MP.c ${HDF5_SRC_DIR}/H5MPtest.c ) -SET (H5MP_HDRS +set (H5MP_HDRS ${HDF5_SRC_DIR}/H5MPpkg.h ) IDE_GENERATED_PROPERTIES ("H5MP" "${H5MP_HDRS}" "${H5MP_SRCS}" ) -SET (H5O_SRCS +set (H5O_SRCS ${HDF5_SRC_DIR}/H5O.c ${HDF5_SRC_DIR}/H5Oainfo.c ${HDF5_SRC_DIR}/H5Oalloc.c @@ -443,14 +443,14 @@ SET (H5O_SRCS ${HDF5_SRC_DIR}/H5Ounknown.c ) -SET (H5O_HDRS +set (H5O_HDRS ${HDF5_SRC_DIR}/H5Opkg.h ${HDF5_SRC_DIR}/H5Opublic.h ${HDF5_SRC_DIR}/H5Oshared.h ) IDE_GENERATED_PROPERTIES ("H5O" "${H5O_HDRS}" "${H5O_SRCS}" ) -SET (H5P_SRCS +set (H5P_SRCS ${HDF5_SRC_DIR}/H5P.c ${HDF5_SRC_DIR}/H5Pacpl.c ${HDF5_SRC_DIR}/H5Pdapl.c @@ -471,50 +471,50 @@ SET (H5P_SRCS ${HDF5_SRC_DIR}/H5Ptest.c ) -SET (H5P_HDRS +set (H5P_HDRS ${HDF5_SRC_DIR}/H5Ppkg.h ${HDF5_SRC_DIR}/H5Ppublic.h ) IDE_GENERATED_PROPERTIES ("H5P" "${H5P_HDRS}" "${H5P_SRCS}" ) -SET (H5PL_SRCS +set (H5PL_SRCS ${HDF5_SRC_DIR}/H5PL.c ) -SET (H5PL_HDRS +set (H5PL_HDRS ${HDF5_SRC_DIR}/H5PLextern.h ) IDE_GENERATED_PROPERTIES ("H5PL" "${H5PL_HDRS}" "${H5PL_SRCS}" ) -SET (H5R_SRCS +set (H5R_SRCS ${HDF5_SRC_DIR}/H5R.c ${HDF5_SRC_DIR}/H5Rdeprec.c ) -SET (H5R_HDRS +set (H5R_HDRS ${HDF5_SRC_DIR}/H5Rpkg.h ${HDF5_SRC_DIR}/H5Rpublic.h ) IDE_GENERATED_PROPERTIES ("H5R" "${H5R_HDRS}" "${H5R_SRCS}" ) -SET (H5UC_SRCS +set (H5UC_SRCS ${HDF5_SRC_DIR}/H5UC.c ) -SET (H5UC_HDRS +set (H5UC_HDRS ) IDE_GENERATED_PROPERTIES ("H5UC" "${H5UC_HDRS}" "${H5UC_SRCS}" ) -SET (H5RS_SRCS +set (H5RS_SRCS ${HDF5_SRC_DIR}/H5RS.c ) -SET (H5RS_HDRS +set (H5RS_HDRS ) IDE_GENERATED_PROPERTIES ("H5RS" "${H5RS_HDRS}" "${H5RS_SRCS}" ) -SET (H5S_SRCS +set (H5S_SRCS ${HDF5_SRC_DIR}/H5S.c ${HDF5_SRC_DIR}/H5Sall.c ${HDF5_SRC_DIR}/H5Sdbg.c @@ -526,22 +526,22 @@ SET (H5S_SRCS ${HDF5_SRC_DIR}/H5Stest.c ) -SET (H5S_HDRS +set (H5S_HDRS ${HDF5_SRC_DIR}/H5Spkg.h ${HDF5_SRC_DIR}/H5Spublic.h ) IDE_GENERATED_PROPERTIES ("H5S" "${H5S_HDRS}" "${H5S_SRCS}" ) -SET (H5SL_SRCS +set (H5SL_SRCS ${HDF5_SRC_DIR}/H5SL.c ) -SET (H5SL_HDRS +set (H5SL_HDRS ) IDE_GENERATED_PROPERTIES ("H5SL" "${H5SL_HDRS}" "${H5SL_SRCS}" ) -SET (H5SM_SRCS +set (H5SM_SRCS ${HDF5_SRC_DIR}/H5SM.c ${HDF5_SRC_DIR}/H5SMbtree2.c ${HDF5_SRC_DIR}/H5SMcache.c @@ -549,21 +549,21 @@ SET (H5SM_SRCS ${HDF5_SRC_DIR}/H5SMtest.c ) -SET (H5SM_HDRS +set (H5SM_HDRS ${HDF5_SRC_DIR}/H5SMpkg.h ) IDE_GENERATED_PROPERTIES ("H5SM" "${H5SM_HDRS}" "${H5SM_SRCS}" ) -SET (H5ST_SRCS +set (H5ST_SRCS ${HDF5_SRC_DIR}/H5ST.c ) -SET (H5ST_HDRS +set (H5ST_HDRS ) IDE_GENERATED_PROPERTIES ("H5ST" "${H5ST_HDRS}" "${H5ST_SRCS}" ) -SET (H5T_SRCS +set (H5T_SRCS ${HDF5_SRC_DIR}/H5T.c ${HDF5_SRC_DIR}/H5Tarray.c ${HDF5_SRC_DIR}/H5Tbit.c @@ -589,38 +589,38 @@ SET (H5T_SRCS ${HDF5_SRC_DIR}/H5Tvlen.c ) -SET (H5T_HDRS +set (H5T_HDRS ${HDF5_SRC_DIR}/H5Tpkg.h ${HDF5_SRC_DIR}/H5Tpublic.h ) IDE_GENERATED_PROPERTIES ("H5T" "${H5T_HDRS}" "${H5T_SRCS}" ) -SET (H5TS_SRCS +set (H5TS_SRCS ${HDF5_SRC_DIR}/H5TS.c ) -SET (H5TS_HDRS +set (H5TS_HDRS ) IDE_GENERATED_PROPERTIES ("H5TS" "${H5TS_HDRS}" "${H5TS_SRCS}" ) -SET (H5V_SRCS - ${HDF5_SRC_DIR}/H5V.c +set (H5VM_SRCS + ${HDF5_SRC_DIR}/H5VM.c ) -SET (H5V_HDRS +set (H5VM_HDRS ) -IDE_GENERATED_PROPERTIES ("H5V" "${H5V_HDRS}" "${H5V_SRCS}" ) +IDE_GENERATED_PROPERTIES ("H5VM" "${H5VM_HDRS}" "${H5VM_SRCS}" ) -SET (H5WB_SRCS +set (H5WB_SRCS ${HDF5_SRC_DIR}/H5WB.c ) -SET (H5WB_HDRS +set (H5WB_HDRS ) IDE_GENERATED_PROPERTIES ("H5WB" "${H5WB_HDRS}" "${H5WB_SRCS}" ) -SET (H5Z_SRCS +set (H5Z_SRCS ${HDF5_SRC_DIR}/H5Z.c ${HDF5_SRC_DIR}/H5Zdeflate.c ${HDF5_SRC_DIR}/H5Zfletcher32.c @@ -630,19 +630,19 @@ SET (H5Z_SRCS ${HDF5_SRC_DIR}/H5Zszip.c ${HDF5_SRC_DIR}/H5Ztrans.c ) -IF (H5_ZLIB_HEADER) +if (H5_ZLIB_HEADER) SET_PROPERTY(SOURCE ${HDF5_SRC_DIR}/H5Zdeflate.c PROPERTY COMPILE_DEFINITIONS H5_ZLIB_HEADER="${H5_ZLIB_HEADER}") -ENDIF (H5_ZLIB_HEADER) +endif (H5_ZLIB_HEADER) -SET (H5Z_HDRS +set (H5Z_HDRS ${HDF5_SRC_DIR}/H5Zpkg.h ${HDF5_SRC_DIR}/H5Zpublic.h ) IDE_GENERATED_PROPERTIES ("H5Z" "${H5Z_HDRS}" "${H5Z_SRCS}" ) -SET (common_SRCS +set (common_SRCS ${H5_SRCS} ${H5A_SRCS} ${H5AC_SRCS} @@ -681,12 +681,12 @@ SET (common_SRCS ${H5ST_SRCS} ${H5T_SRCS} ${H5TS_SRCS} - ${H5V_SRCS} + ${H5VM_SRCS} ${H5WB_SRCS} ${H5Z_SRCS} ) -SET (H5_PUBLIC_HEADERS +set (H5_PUBLIC_HEADERS ${H5_HDRS} ${H5A_HDRS} ${H5AC_HDRS} @@ -720,7 +720,7 @@ SET (H5_PUBLIC_HEADERS ) -SET (H5_PRIVATE_HEADERS +set (H5_PRIVATE_HEADERS ${HDF5_SRC_DIR}/H5private.h ${HDF5_SRC_DIR}/H5Aprivate.h ${HDF5_SRC_DIR}/H5ACprivate.h @@ -760,41 +760,38 @@ SET (H5_PRIVATE_HEADERS ${HDF5_SRC_DIR}/H5STprivate.h ${HDF5_SRC_DIR}/H5Tprivate.h ${HDF5_SRC_DIR}/H5TSprivate.h - ${HDF5_SRC_DIR}/H5Vprivate.h + ${HDF5_SRC_DIR}/H5VMprivate.h ${HDF5_SRC_DIR}/H5WBprivate.h ${HDF5_SRC_DIR}/H5Zprivate.h ${HDF5_SRC_DIR}/H5win32defs.h ) -INCLUDE_DIRECTORIES (${HDF5_SOURCE_DIR}) -INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR}) - #----------------------------------------------------------------------------- # Setup the H5Detect utility which generates H5Tinit with platform # specific type checks inside #----------------------------------------------------------------------------- -ADD_EXECUTABLE (H5detect ${HDF5_SRC_DIR}/H5detect.c) +add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c) TARGET_C_PROPERTIES (H5detect " " " ") -IF (MSVC) - TARGET_LINK_LIBRARIES (H5detect "ws2_32.lib") -ENDIF (MSVC) +if (MSVC) + target_link_libraries (H5detect "ws2_32.lib") +endif (MSVC) -SET (CMD $<TARGET_FILE:H5detect>) -ADD_CUSTOM_COMMAND ( +set (CMD $<TARGET_FILE:H5detect>) +add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c COMMAND ${CMD} ARGS > ${HDF5_BINARY_DIR}/H5Tinit.c DEPENDS H5detect ) -ADD_EXECUTABLE (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) +add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) TARGET_C_PROPERTIES (H5make_libsettings " " " ") -IF (MSVC) - TARGET_LINK_LIBRARIES (H5make_libsettings "ws2_32.lib") -ENDIF (MSVC) +if (MSVC) + target_link_libraries (H5make_libsettings "ws2_32.lib") +endif (MSVC) -SET (CMD $<TARGET_FILE:H5make_libsettings>) -ADD_CUSTOM_COMMAND ( +set (CMD $<TARGET_FILE:H5make_libsettings>) +add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c COMMAND ${CMD} ARGS > ${HDF5_BINARY_DIR}/H5lib_settings.c @@ -802,21 +799,21 @@ ADD_CUSTOM_COMMAND ( WORKING_DIRECTORY ${HDF5_BINARY_DIR} ) -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET ${HDF5_BINARY_DIR}/H5Edefin.h PRE_BUILD COMMAND ${CMAKE_COMMAND} -E perl ${HDF5_SOURCE_DIR}/bin/make_err ${HDF5_SOURCE_DIR}/src/H5err.txt COMMENT " Creating err headers" ) -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET ${HDF5_BINARY_DIR}/H5version.h PRE_BUILD COMMAND ${CMAKE_COMMAND} -E perl ${HDF5_SOURCE_DIR}/bin/make_vers ${HDF5_SOURCE_DIR}/src/H5vers.txt COMMENT " Creating API version macro" ) -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET ${HDF5_BINARY_DIR}/H5overflow.h PRE_BUILD COMMAND ${CMAKE_COMMAND} -E perl ${HDF5_SOURCE_DIR}/bin/make_overflow ${HDF5_SOURCE_DIR}/src/H5overflow.txt @@ -826,50 +823,64 @@ ADD_CUSTOM_COMMAND ( #----------------------------------------------------------------------------- # Add H5Tinit source to build - generated by H5Detect/CMake at configure time #----------------------------------------------------------------------------- -SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Tinit.c) -SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5Tinit.c GENERATED) -SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5lib_settings.c) -SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5lib_settings.c GENERATED) -SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Edefin.h) -SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5Edefin.h GENERATED) -SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5version.h) -SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5version.h GENERATED) -SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5overflow.h) -SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5overflow.h GENERATED) - -ADD_LIBRARY (${HDF5_LIB_TARGET} ${LIB_TYPE} ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS}) +set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Tinit.c) +set_source_files_properties (${HDF5_BINARY_DIR}/H5Tinit.c GENERATED) +set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5lib_settings.c) +set_source_files_properties (${HDF5_BINARY_DIR}/H5lib_settings.c GENERATED) +set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Edefin.h) +set_source_files_properties (${HDF5_BINARY_DIR}/H5Edefin.h GENERATED) +set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5version.h) +set_source_files_properties (${HDF5_BINARY_DIR}/H5version.h GENERATED) +set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5overflow.h) +set_source_files_properties (${HDF5_BINARY_DIR}/H5overflow.h GENERATED) + +add_library (${HDF5_LIB_TARGET} ${LIB_TYPE} ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} ${LINK_LIBS}) -IF (NOT WIN32) - TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} dl) -ENDIF (NOT WIN32) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) +target_link_libraries (${HDF5_LIB_TARGET} ${LINK_LIBS}) +if (NOT WIN32) + target_link_libraries (${HDF5_LIB_TARGET} dl) +endif (NOT WIN32) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries) +set_target_properties (${HDF5_LIB_TARGET} PROPERTIES + FOLDER libraries + INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" +) + +option (HDF5_ENABLE_DEBUG_APIS "Turn on debugging in all packages" OFF) +if (HDF5_ENABLE_DEBUG_APIS) + set_target_properties (${HDF5_LIB_TARGET} PROPERTIES + COMPILE_DEFINITIONS + "-DH5Z_DEBUG -DH5VM_DEBUG -DH5T_DEBUG + -DH5S_DEBUG -DH5P_DEBUG -DH5O_DEBUG -DH5MM_DEBUG -DH5MF_DEBUG + -DH5I_DEBUG -DH5HL_DEBUG -DH5HG_DEBUG -DH5G_DEBUG -DH5F_DEBUG + -DH5E_DEBUG -DH5D_DEBUG -DH5B_DEBUG -DH5AC_DEBUG -UNDEBUG" + ) +endif (HDF5_ENABLE_DEBUG_APIS) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -IF (NOT HDF5_INSTALL_NO_DEVELOPMENT) - INSTALL ( +if (NOT HDF5_INSTALL_NO_DEVELOPMENT) + install ( FILES ${H5_PUBLIC_HEADERS} - ${H5_PRIVATE_HEADERS} DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT headers ) -ENDIF (NOT HDF5_INSTALL_NO_DEVELOPMENT) +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) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) + INSTALL_TARGET_PDB (${HDF5_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} libraries) + endif (BUILD_SHARED_LIBS) - INSTALL ( + install ( TARGETS ${HDF5_LIB_TARGET} EXPORT @@ -878,4 +889,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT libraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT libraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index 2148f1e..443a2e5 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -37,7 +37,7 @@ #include "H5B2pkg.h" /* v2 B-trees */ #include "H5Eprivate.h" /* Error handling */ #include "H5MFprivate.h" /* File memory management */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ /* Local Macros */ @@ -181,7 +181,7 @@ HDmemset(hdr->page, 0, hdr->node_size); /* Compute size to store # of records in each node */ /* (uses leaf # of records because its the largest) */ - u_max_nrec_size = H5V_limit_enc_size((uint64_t)hdr->node_info[0].max_nrec); + u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[0].max_nrec); H5_ASSIGN_OVERFLOW(/* To: */ hdr->max_nrec_size, /* From: */ u_max_nrec_size, /* From: */ unsigned, /* To: */ uint8_t) HDassert(hdr->max_nrec_size <= H5B2_SIZEOF_RECORDS_PER_NODE); @@ -197,7 +197,7 @@ HDmemset(hdr->page, 0, hdr->node_size); hdr->node_info[u].cum_max_nrec = ((hdr->node_info[u].max_nrec + 1) * hdr->node_info[u - 1].cum_max_nrec) + hdr->node_info[u].max_nrec; - u_max_nrec_size = H5V_limit_enc_size((uint64_t)hdr->node_info[u].cum_max_nrec); + u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[u].cum_max_nrec); H5_ASSIGN_OVERFLOW(/* To: */ hdr->node_info[u].cum_max_nrec_size, /* From: */ u_max_nrec_size, /* From: */ unsigned, /* To: */ uint8_t) if(NULL == (hdr->node_info[u].nat_rec_fac = H5FL_fac_init(hdr->cls->nrec_size * hdr->node_info[u].max_nrec))) diff --git a/src/H5B2int.c b/src/H5B2int.c index 8ea8426..630ff98 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -37,7 +37,7 @@ #include "H5B2pkg.h" /* v2 B-trees */ #include "H5Eprivate.h" /* Error handling */ #include "H5MFprivate.h" /* File memory management */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ /* Local Macros */ @@ -387,7 +387,7 @@ H5B2_split_root(H5B2_hdr_t *hdr, hid_t dxpl_id) hdr->node_info[hdr->depth].merge_nrec = (hdr->node_info[hdr->depth].max_nrec * hdr->merge_percent) / 100; hdr->node_info[hdr->depth].cum_max_nrec = ((hdr->node_info[hdr->depth].max_nrec + 1) * hdr->node_info[hdr->depth - 1].cum_max_nrec) + hdr->node_info[hdr->depth].max_nrec; - u_max_nrec_size = H5V_limit_enc_size((uint64_t)hdr->node_info[hdr->depth].cum_max_nrec); + u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[hdr->depth].cum_max_nrec); H5_ASSIGN_OVERFLOW(/* To: */ hdr->node_info[hdr->depth].cum_max_nrec_size, /* From: */ u_max_nrec_size, /* From: */ unsigned, /* To: */ uint8_t) if(NULL == (hdr->node_info[hdr->depth].nat_rec_fac = H5FL_fac_init(hdr->cls->nrec_size * hdr->node_info[hdr->depth].max_nrec))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create node native key block factory") diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index 37780e7..039ebdc 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -43,7 +43,7 @@ #include "H5MFprivate.h" /* File space management */ #include "H5Oprivate.h" /* Object headers */ #include "H5Sprivate.h" /* Dataspaces */ -#include "H5Vprivate.h" /* Vector and array functions */ +#include "H5VMprivate.h" /* Vector and array functions */ /****************/ /* Local Macros */ @@ -345,7 +345,7 @@ H5D__btree_cmp2(void *_lt_key, void *_udata, void *_rt_key) HDassert(udata->layout->ndims > 0 && udata->layout->ndims <= H5O_LAYOUT_NDIMS); /* Compare the offsets but ignore the other fields */ - ret_value = H5V_vector_cmp_u(udata->layout->ndims, lt_key->offset, rt_key->offset); + ret_value = H5VM_vector_cmp_u(udata->layout->ndims, lt_key->offset, rt_key->offset); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__btree_cmp2() */ @@ -409,9 +409,9 @@ H5D__btree_cmp3(void *_lt_key, void *_udata, void *_rt_key) ret_value = (-1); } /* end if */ else { - if(H5V_vector_ge_u(udata->layout->ndims, udata->offset, rt_key->offset)) + if(H5VM_vector_ge_u(udata->layout->ndims, udata->offset, rt_key->offset)) ret_value = 1; - else if(H5V_vector_lt_u(udata->layout->ndims, udata->offset, lt_key->offset)) + else if(H5VM_vector_lt_u(udata->layout->ndims, udata->offset, lt_key->offset)) ret_value = (-1); } /* end else */ @@ -540,7 +540,7 @@ H5D__btree_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, /* Negative indices not supported yet */ HGOTO_ERROR(H5E_STORAGE, H5E_UNSUPPORTED, H5B_INS_ERROR, "internal error") - } else if(H5V_vector_eq_u(udata->common.layout->ndims, + } else if(H5VM_vector_eq_u(udata->common.layout->ndims, udata->common.offset, lt_key->offset) && lt_key->nbytes > 0) { /* @@ -579,10 +579,10 @@ H5D__btree_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, ret_value = H5B_INS_NOOP; } - } else if (H5V_hyper_disjointp(udata->common.layout->ndims, + } else if (H5VM_hyper_disjointp(udata->common.layout->ndims, lt_key->offset, udata->common.layout->dim, udata->common.offset, udata->common.layout->dim)) { - HDassert(H5V_hyper_disjointp(udata->common.layout->ndims, + HDassert(H5VM_hyper_disjointp(udata->common.layout->ndims, rt_key->offset, udata->common.layout->dim, udata->common.offset, udata->common.layout->dim)); /* diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 5d0b625..4dfe418 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -59,7 +59,7 @@ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ -#include "H5Vprivate.h" /* Vector and array functions */ +#include "H5VMprivate.h" /* Vector and array functions */ /****************/ @@ -164,10 +164,18 @@ typedef struct H5D_chunk_it_ud4_t { /* Callback info for nonexistent readvv operation */ typedef struct H5D_chunk_readvv_ud_t { unsigned char *rbuf; /* Read buffer to initialize */ - H5D_t *dset; /* Dataset to operate on */ + const H5D_t *dset; /* Dataset to operate on */ hid_t dxpl_id; /* DXPL for operation */ } H5D_chunk_readvv_ud_t; +/* Callback info for file selection iteration */ +typedef struct H5D_chunk_file_iter_ud_t { + H5D_chunk_map_t *fm; /* File->memory chunk mapping info */ +#ifdef H5_HAVE_PARALLEL + const H5D_io_info_t *io_info; /* I/O info for operation */ +#endif /* H5_HAVE_PARALLEL */ +} H5D_chunk_file_iter_ud_t; + /********************/ /* Local Prototypes */ @@ -324,7 +332,7 @@ H5FL_BLK_DEFINE_STATIC(chunk); */ herr_t H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, hsize_t *offset, - size_t data_size, const void *buf) + uint32_t data_size, const void *buf) { const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ H5D_chunk_ud_t udata; /* User data for querying chunk info */ @@ -351,13 +359,12 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, hsiz HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get simple dataspace info") /* Calculate the index of this chunk */ - if(H5V_chunk_index((unsigned)space_ndims, offset, + if(H5VM_chunk_index((unsigned)space_ndims, offset, layout->u.chunk.dim, layout->u.chunk.down_chunks, &chunk_idx) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get chunk index") /* Find out the file address of the chunk */ - if(H5D__chunk_lookup(dset, dxpl_id, offset, chunk_idx, - &udata) < 0) + if(H5D__chunk_lookup(dset, dxpl_id, offset, chunk_idx, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") udata.filter_mask = filters; @@ -446,7 +453,7 @@ H5D__chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims, const hsize } /* end for */ /* Get the "down" sizes for each dimension */ - if(H5V_array_down(ndims, layout->chunks, layout->down_chunks) < 0) + if(H5VM_array_down(ndims, layout->chunks, layout->down_chunks) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute 'down' chunk size value") done: @@ -712,7 +719,7 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm) { - H5D_t *dataset = io_info->dset; /* Local pointer to dataset info */ + const H5D_t *dataset = io_info->dset; /* Local pointer to dataset info */ const H5T_t *mem_type = type_info->mem_type; /* Local pointer to memory datatype */ H5S_t *tmp_mspace = NULL; /* Temporary memory dataspace */ hssize_t old_offset[H5O_LAYOUT_NDIMS]; /* Old selection offset */ @@ -725,7 +732,6 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf H5S_sel_type fsel_type; /* Selection type on disk */ char bogus; /* "bogus" buffer to pass to selection iterator */ unsigned u; /* Local index variable */ - hbool_t sel_hyper_flag; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -823,6 +829,8 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create chunk selections for single element") } /* end if */ else { + hbool_t sel_hyper_flag; /* Whether file selection is a hyperslab */ + /* Initialize skip list for chunk selections */ if(NULL == dataset->shared->cache.chunk.sel_chunks) { if(NULL == (dataset->shared->cache.chunk.sel_chunks = H5SL_create(H5SL_TYPE_HSIZE, NULL))) @@ -870,12 +878,20 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf } /* end while */ } /* end if */ else { + H5D_chunk_file_iter_ud_t udata; /* User data for iteration */ + /* Create temporary datatypes for selection iteration */ if((f_tid = H5I_register(H5I_DATATYPE, H5T_copy(dataset->shared->type, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register file datatype") + /* Initialize the user data */ + udata.fm = fm; +#ifdef H5_HAVE_PARALLEL + udata.io_info = io_info; +#endif /* H5_HAVE_PARALLEL */ + /* Spaces might not be the same shape, iterate over the file selection directly */ - if(H5S_select_iterate(&bogus, f_tid, file_space, H5D__chunk_file_cb, fm) < 0) + if(H5S_select_iterate(&bogus, f_tid, file_space, H5D__chunk_file_cb, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create file chunk selections") /* Reset "last chunk" info */ @@ -992,7 +1008,7 @@ H5D__chunk_io_init_mdset(H5D_io_info_md_t *io_info_md, const H5D_type_info_t *ty hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_dset_info_t *dinfo) { - H5D_t *dataset = dinfo->dset; /* Local pointer to dataset info */ + const H5D_t *dataset = dinfo->dset; /* Local pointer to dataset info */ const H5T_t *mem_type = type_info->mem_type; /* Local pointer to memory datatype */ H5S_t *tmp_mspace = NULL; /* Temporary memory dataspace */ hssize_t old_offset[H5O_LAYOUT_NDIMS]; /* Old selection offset */ @@ -1005,7 +1021,6 @@ H5D__chunk_io_init_mdset(H5D_io_info_md_t *io_info_md, const H5D_type_info_t *ty H5S_sel_type fsel_type; /* Selection type on disk */ char bogus; /* "bogus" buffer to pass to selection iterator */ unsigned u; /* Local index variable */ - hbool_t sel_hyper_flag; H5D_io_info_md_wrap_t io_info_md_wrap; herr_t ret_value = SUCCEED; /* Return value */ @@ -1093,6 +1108,8 @@ H5D__chunk_io_init_mdset(H5D_io_info_md_t *io_info_md, const H5D_type_info_t *ty HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create chunk selections for single element") } /* end if */ else { + hbool_t sel_hyper_flag; /* Whether file selection is a hyperslab */ + /* Initialize skip list for chunk selections */ if(NULL == dataset->shared->cache.chunk.sel_chunks) { if(NULL == (dataset->shared->cache.chunk.sel_chunks = H5SL_create(H5SL_TYPE_HSIZE, NULL))) @@ -1485,7 +1502,7 @@ H5D__create_chunk_map_single(H5D_chunk_map_t *fm, const H5D_io_info_t chunk_info->coords[fm->f_ndims] = 0; /* Calculate the index of this chunk */ - if(H5V_chunk_index(fm->f_ndims, chunk_info->coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_info->index) < 0) + if(H5VM_chunk_index(fm->f_ndims, chunk_info->coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_info->index) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") /* Copy selection for file's dataspace into chunk dataspace */ @@ -1564,7 +1581,7 @@ H5D__create_piece_map_single(H5D_dset_info_t *di, piece_info->coords[di->f_ndims] = 0; /* Calculate the index of this chunk */ - if(H5V_chunk_index(di->f_ndims, piece_info->coords, di->layout->u.chunk.dim, di->layout->u.chunk.down_chunks, &piece_info->index) < 0) + if(H5VM_chunk_index(di->f_ndims, piece_info->coords, di->layout->u.chunk.dim, di->layout->u.chunk.down_chunks, &piece_info->index) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") /* Copy selection for file's dataspace into chunk dataspace */ @@ -1656,7 +1673,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t } /* end for */ /* Calculate the index of this chunk */ - if(H5V_chunk_index(fm->f_ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_index) < 0) + if(H5VM_chunk_index(fm->f_ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_index) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") /* Iterate through each chunk in the dataset */ @@ -1699,7 +1716,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t /* Add temporary chunk to the list of chunks */ /* Allocate the file & memory chunk information */ - if (NULL==(new_chunk_info = H5FL_MALLOC (H5D_chunk_info_t))) { + if (NULL==(new_chunk_info = H5FL_MALLOC(H5D_chunk_info_t))) { (void)H5S_close(tmp_fchunk); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate chunk info") } /* end if */ @@ -1710,7 +1727,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t new_chunk_info->index=chunk_index; #ifdef H5_HAVE_PARALLEL - /* store chunk selection information */ + /* Store chunk selection information, for multi-chunk I/O */ if(io_info->using_mpi_vfd) fm->select_chunk[chunk_index] = new_chunk_info; #endif /* H5_HAVE_PARALLEL */ @@ -1774,7 +1791,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t } while(coords[curr_dim] > sel_end[curr_dim]); /* Re-calculate the index of this chunk */ - if(H5V_chunk_index(fm->f_ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_index) < 0) + if(H5VM_chunk_index(fm->f_ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_index) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") } /* end if */ } /* end while */ @@ -1831,7 +1848,7 @@ H5D__create_piece_file_map_hyper(H5D_dset_info_t *dinfo, const H5D_io_info_md_t } /* end for */ /* Calculate the index of this chunk */ - if(H5V_chunk_index(dinfo->f_ndims, coords, dinfo->layout->u.chunk.dim, dinfo->layout->u.chunk.down_chunks, &chunk_index) < 0) + if(H5VM_chunk_index(dinfo->f_ndims, coords, dinfo->layout->u.chunk.dim, dinfo->layout->u.chunk.down_chunks, &chunk_index) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") /* Iterate through each chunk in the dataset */ @@ -1876,7 +1893,7 @@ H5D__create_piece_file_map_hyper(H5D_dset_info_t *dinfo, const H5D_io_info_md_t /* Add temporary chunk to the list of chunks */ /* Allocate the file & memory chunk information */ - if (NULL==(new_piece_info = H5FL_MALLOC (H5D_piece_info_t))) { + if (NULL==(new_piece_info = H5FL_MALLOC(H5D_piece_info_t))) { (void)H5S_close(tmp_fchunk); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate chunk info") } /* end if */ @@ -1961,7 +1978,7 @@ H5D__create_piece_file_map_hyper(H5D_dset_info_t *dinfo, const H5D_io_info_md_t } while(coords[curr_dim] > sel_end[curr_dim]); /* Re-calculate the index of this chunk */ - if(H5V_chunk_index(dinfo->f_ndims, coords, dinfo->layout->u.chunk.dim, dinfo->layout->u.chunk.down_chunks, &chunk_index) < 0) + if(H5VM_chunk_index(dinfo->f_ndims, coords, dinfo->layout->u.chunk.dim, dinfo->layout->u.chunk.down_chunks, &chunk_index) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") } /* end if */ } /* end while */ @@ -2208,9 +2225,10 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_fm) +H5D__chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_udata) { - H5D_chunk_map_t *fm = (H5D_chunk_map_t *)_fm; /* File<->memory chunk mapping info */ + H5D_chunk_file_iter_ud_t *udata = (H5D_chunk_file_iter_ud_t *)_udata; /* User data for operation */ + H5D_chunk_map_t *fm = udata->fm; /* File<->memory chunk mapping info */ H5D_chunk_info_t *chunk_info; /* Chunk information for current chunk */ hsize_t coords_in_chunk[H5O_LAYOUT_NDIMS]; /* Coordinates of element in chunk */ hsize_t chunk_index; /* Chunk index */ @@ -2220,7 +2238,7 @@ H5D__chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, cons FUNC_ENTER_STATIC /* Calculate the index of this chunk */ - if(H5V_chunk_index(ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_index) < 0) + if(H5VM_chunk_index(ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_index) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") /* Find correct chunk in file & memory skip list */ @@ -2228,7 +2246,7 @@ H5D__chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, cons /* If the chunk index is the same as the last chunk index we used, * get the cached info to operate on. */ - chunk_info=fm->last_chunk_info; + chunk_info = fm->last_chunk_info; } /* end if */ else { /* If the chunk index is not the same as the last chunk index we used, @@ -2285,14 +2303,20 @@ H5D__chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, cons } /* end if */ } /* end if */ +#ifdef H5_HAVE_PARALLEL + /* Store chunk selection information, for collective multi-chunk I/O */ + if(udata->io_info->using_mpi_vfd) + fm->select_chunk[chunk_index] = chunk_info; +#endif /* H5_HAVE_PARALLEL */ + /* Update the "last chunk seen" information */ - fm->last_index=chunk_index; - fm->last_chunk_info=chunk_info; + fm->last_index = chunk_index; + fm->last_chunk_info = chunk_info; } /* end else */ - /* Get the coordinates of the element in the chunk */ + /* Get the offset of the element within the chunk */ for(u = 0; u < fm->f_ndims; u++) - coords_in_chunk[u] = coords[u] % fm->layout->u.chunk.dim[u]; + coords_in_chunk[u] = coords[u] - chunk_info->coords[u]; /* Add point to file selection for chunk */ if(H5S_select_elements(chunk_info->fspace, H5S_SELECT_APPEND, (size_t)1, coords_in_chunk) < 0) @@ -2334,7 +2358,7 @@ H5D__piece_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, cons FUNC_ENTER_STATIC /* Calculate the index of this chunk */ - if(H5V_chunk_index(ndims, coords, dinfo->layout->u.chunk.dim, dinfo->layout->u.chunk.down_chunks, &chunk_index) < 0) + if(H5VM_chunk_index(ndims, coords, dinfo->layout->u.chunk.dim, dinfo->layout->u.chunk.down_chunks, &chunk_index) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") /* Find correct chunk in file & memory skip list */ @@ -2342,7 +2366,7 @@ H5D__piece_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, cons /* If the chunk index is the same as the last chunk index we used, * get the cached info to operate on. */ - piece_info=dinfo->last_piece_info; + piece_info = dinfo->last_piece_info; } /* end if */ else { haddr_t prev_tag = HADDR_UNDEF; @@ -2361,7 +2385,7 @@ H5D__piece_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, cons /* Initialize the chunk information */ /* Set the chunk index */ - piece_info->index=chunk_index; + piece_info->index = chunk_index; /* Create a dataspace for the chunk */ if((fspace = H5S_create_simple(dinfo->f_ndims,dinfo->chunk_dim,NULL))==NULL) { @@ -2423,13 +2447,13 @@ H5D__piece_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, cons } /* end if */ /* Update the "last chunk seen" information */ - dinfo->last_index=chunk_index; - dinfo->last_piece_info=piece_info; + dinfo->last_index = chunk_index; + dinfo->last_piece_info = piece_info; } /* end else */ - /* Get the coordinates of the element in the chunk */ + /* Get the offset of the element within the chunk */ for(u = 0; u < dinfo->f_ndims; u++) - coords_in_chunk[u] = coords[u] % dinfo->layout->u.chunk.dim[u]; + coords_in_chunk[u] = coords[u] - piece_info->coords[u]; /* Add point to file selection for chunk */ if(H5S_select_elements(piece_info->fspace, H5S_SELECT_APPEND, (size_t)1, coords_in_chunk) < 0) @@ -2469,7 +2493,7 @@ H5D__chunk_mem_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const FUNC_ENTER_STATIC /* Calculate the index of this chunk */ - if(H5V_chunk_index(ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_index) < 0) + if(H5VM_chunk_index(ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_index) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") /* Find correct chunk in file & memory skip list */ @@ -2547,7 +2571,7 @@ H5D__piece_mem_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const FUNC_ENTER_STATIC /* Calculate the index of this chunk */ - if(H5V_chunk_index(ndims, coords, dinfo->layout->u.chunk.dim, dinfo->layout->u.chunk.down_chunks, &chunk_index) < 0) + if(H5VM_chunk_index(ndims, coords, dinfo->layout->u.chunk.dim, dinfo->layout->u.chunk.down_chunks, &chunk_index) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") /* Find correct chunk in file & memory skip list */ @@ -2615,8 +2639,8 @@ done: htri_t H5D__chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, hbool_t write_op) { - const H5D_t *dataset = io_info->dset; - htri_t ret_value = FAIL; + const H5D_t *dataset = io_info->dset; /* Local pointer to dataset info */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE @@ -2761,8 +2785,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, chunk_info = H5D_CHUNK_GET_NODE_INFO(fm, chunk_node); /* Get the info for the chunk in the file */ - if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, - chunk_info->coords, chunk_info->index, &udata) < 0) + if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords, chunk_info->index, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Check for non-existant chunk & skip it if appropriate */ @@ -2891,8 +2914,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, /* Load the chunk into cache. But if the whole chunk is written, * simply allocate space instead of load the chunk. */ - if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords, - chunk_info->index, &udata) < 0) + if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords, chunk_info->index, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") if((cacheable = H5D__chunk_cacheable(io_info, udata.addr, TRUE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't tell if chunk is cacheable") @@ -3297,7 +3319,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_create(H5D_t *dset /*in,out*/, hid_t dxpl_id) +H5D__chunk_create(const H5D_t *dset /*in,out*/, hid_t dxpl_id) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ herr_t ret_value = SUCCEED; /* Return value */ @@ -3778,7 +3800,7 @@ void * H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, hbool_t relax) { - H5D_t *dset = io_info->dset; /* Local pointer to the dataset info */ + const H5D_t *dset = io_info->dset; /* Local pointer to the dataset info */ const H5O_pline_t *pline = &(dset->shared->dcpl_cache.pline); /* I/O pipeline info - always equal to the pline passed to H5D__chunk_alloc */ const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ const H5O_fill_t *fill = &(dset->shared->dcpl_cache.fill); /* Fill value info */ @@ -4217,7 +4239,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, +H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, hsize_t old_dim[]) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ @@ -4413,13 +4435,12 @@ H5D__chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, hsize_t chunk_idx; /* Calculate the index of this chunk */ - if(H5V_chunk_index((unsigned)space_ndims, chunk_offset, + if(H5VM_chunk_index((unsigned)space_ndims, chunk_offset, layout->u.chunk.dim, layout->u.chunk.down_chunks, &chunk_idx) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get chunk index") - if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chunk_idx, - &udata) < 0) + if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chunk_idx, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") HDassert(!H5F_addr_defined(udata.addr)); @@ -4584,7 +4605,7 @@ static herr_t H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata) { const H5D_io_info_t *io_info = udata->io_info; /* Local pointer to I/O info */ - H5D_t *dset = io_info->dset; /* Local pointer to the dataset info */ + const H5D_t *dset = io_info->dset; /* Local pointer to the dataset info */ const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset's layout */ unsigned rank = udata->common.layout->ndims - 1; /* Dataset rank */ const hsize_t *chunk_offset = io_info->store->chunk.offset; /* Chunk offset */ @@ -4606,8 +4627,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata) H5_ASSIGN_OVERFLOW(chunk_size, layout->u.chunk.size, uint32_t, size_t); /* Get the info for the chunk in the file */ - if(H5D__chunk_lookup(dset, io_info->dxpl_id, chunk_offset, - io_info->store->chunk.index, &chk_udata) < 0) + if(H5D__chunk_lookup(dset, io_info->dxpl_id, chunk_offset, io_info->store->chunk.index, &chk_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* If this chunk does not exist in cache or on disk, no need to do anything @@ -4987,7 +5007,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) while(!carry) { /* Calculate the index of this chunk */ - if(H5V_chunk_index((unsigned)space_ndims, chunk_offset, + if(H5VM_chunk_index((unsigned)space_ndims, chunk_offset, layout->u.chunk.dim, layout->u.chunk.down_chunks, &(chk_io_info.store->chunk.index)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get chunk index") @@ -5016,8 +5036,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) #endif /* NDEBUG */ /* Check if the chunk exists in cache or on disk */ - if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, - chk_io_info.store->chunk.index, &chk_udata) < 0) + if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chk_io_info.store->chunk.index, &chk_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk") /* Evict the entry from the cache if present, but do not flush @@ -5102,7 +5121,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_prune_by_extent() */ - /*------------------------------------------------------------------------- * Function: H5D__chunk_delete @@ -5233,7 +5251,7 @@ H5D__chunk_update_cache(H5D_t *dset, hid_t dxpl_id) next = ent->next; /* Calculate the index of this chunk */ - if(H5V_chunk_index(rank, ent->offset, dset->shared->layout.u.chunk.dim, dset->shared->layout.u.chunk.down_chunks, &idx) < 0) + if(H5VM_chunk_index(rank, ent->offset, dset->shared->layout.u.chunk.dim, dset->shared->layout.u.chunk.down_chunks, &idx) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index") /* Compute the index for the chunk entry */ @@ -6002,7 +6020,7 @@ static herr_t H5D__nonexistent_readvv_cb(hsize_t UNUSED dst_off, hsize_t src_off, size_t len, void *_udata) { - H5D_chunk_readvv_ud_t *udata = (H5D_chunk_readvv_ud_t *)_udata; /* User data for H5V_opvv() operator */ + H5D_chunk_readvv_ud_t *udata = (H5D_chunk_readvv_ud_t *)_udata; /* User data for H5VM_opvv() operator */ H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ herr_t ret_value = SUCCEED; /* Return value */ @@ -6054,7 +6072,7 @@ H5D__nonexistent_readvv(const H5D_io_info_t *io_info, size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_off_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { - H5D_chunk_readvv_ud_t udata; /* User data for H5V_opvv() operator */ + H5D_chunk_readvv_ud_t udata; /* User data for H5VM_opvv() operator */ ssize_t ret_value; /* Return value */ FUNC_ENTER_STATIC @@ -6068,13 +6086,13 @@ H5D__nonexistent_readvv(const H5D_io_info_t *io_info, HDassert(mem_len_arr); HDassert(mem_off_arr); - /* Set up user data for H5V_opvv() */ + /* Set up user data for H5VM_opvv() */ udata.rbuf = (unsigned char *)io_info->u.rbuf; udata.dset = io_info->dset; udata.dxpl_id = io_info->dxpl_id; /* Call generic sequence operation routine */ - if((ret_value = H5V_opvv(chunk_max_nseq, chunk_curr_seq, chunk_len_arr, chunk_off_arr, + if((ret_value = H5VM_opvv(chunk_max_nseq, chunk_curr_seq, chunk_len_arr, chunk_off_arr, mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, H5D__nonexistent_readvv_cb, &udata)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized fill value init") diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 9f2a340..327f399 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -40,7 +40,7 @@ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Oprivate.h" /* Object headers */ -#include "H5Vprivate.h" /* Vector and array functions */ +#include "H5VMprivate.h" /* Vector and array functions */ /****************/ @@ -121,7 +121,7 @@ H5FL_BLK_EXTERN(type_conv); *------------------------------------------------------------------------- */ herr_t -H5D__compact_fill(H5D_t *dset, hid_t dxpl_id) +H5D__compact_fill(const H5D_t *dset, hid_t dxpl_id) { H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ @@ -301,7 +301,7 @@ H5D__compact_readvv(const H5D_io_info_t *io_info, HDassert(io_info); /* Use the vectorized memory copy routine to do actual work */ - if((ret_value = H5V_memcpyvv(io_info->u.rbuf, mem_max_nseq, mem_curr_seq, mem_size_arr, mem_offset_arr, io_info->store->compact.buf, dset_max_nseq, dset_curr_seq, dset_size_arr, dset_offset_arr)) < 0) + if((ret_value = H5VM_memcpyvv(io_info->u.rbuf, mem_max_nseq, mem_curr_seq, mem_size_arr, mem_offset_arr, io_info->store->compact.buf, dset_max_nseq, dset_curr_seq, dset_size_arr, dset_offset_arr)) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed") done: @@ -342,7 +342,7 @@ H5D__compact_writevv(const H5D_io_info_t *io_info, HDassert(io_info); /* Use the vectorized memory copy routine to do actual work */ - if((ret_value = H5V_memcpyvv(io_info->store->compact.buf, dset_max_nseq, dset_curr_seq, dset_size_arr, dset_offset_arr, io_info->u.wbuf, mem_max_nseq, mem_curr_seq, mem_size_arr, mem_offset_arr)) < 0) + if((ret_value = H5VM_memcpyvv(io_info->store->compact.buf, dset_max_nseq, dset_curr_seq, dset_size_arr, dset_offset_arr, io_info->u.wbuf, mem_max_nseq, mem_curr_seq, mem_size_arr, mem_offset_arr)) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed") /* Mark the compact dataset's buffer as dirty */ diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 9c14e25..326c648 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -43,7 +43,7 @@ #include "H5MFprivate.h" /* File memory management */ #include "H5Oprivate.h" /* Object headers */ #include "H5Pprivate.h" /* Property lists */ -#include "H5Vprivate.h" /* Vector and array functions */ +#include "H5VMprivate.h" /* Vector and array functions */ /****************/ @@ -199,7 +199,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__contig_fill(H5D_t *dset, hid_t dxpl_id) +H5D__contig_fill(const H5D_t *dset, hid_t dxpl_id) { H5D_io_info_t ioinfo; /* Dataset I/O info */ H5D_storage_t store; /* Union of storage info for dataset */ @@ -516,6 +516,7 @@ H5D__contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED * FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D__contig_io_init() */ + /*------------------------------------------------------------------------- * Function: H5D__contig_io_init_mdset * @@ -626,19 +627,15 @@ H5D__contig_io_init_mdset(H5D_io_info_md_t *io_info_md, else sel_hyper_flag = TRUE; - /* Check if file selection is a hyperslab selection */ - if(sel_hyper_flag) { - /* - * This section is referred from H5D__create_piece_file_map_hyper - * as part of multi-dset work - * Note: may be able to make a seperate function as a seperate - * task later. - */ - { + /* + * This block is referred from H5D__create_piece_file_map_hyper as part of + * multi-dset work + * Note: may be able to make a seperate function as a seperate task later. + */ + { unsigned u; - /* Sanity check */ - HDassert(dinfo->f_ndims > 0); + /* if selected elements exist */ if (dinfo->nelmts) { @@ -652,10 +649,16 @@ H5D__contig_io_init_mdset(H5D_io_info_md_t *io_info_md, if(NULL == (tmp_fspace = H5S_copy(dinfo->file_space, TRUE, FALSE))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy memory space") - /* Make certain selections are stored in span tree form (not "optimized hyperslab" or "all") */ - if(H5S_hyper_convert(tmp_fspace) < 0) { - (void)H5S_close(tmp_fspace); - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to convert selection to span trees") + /* Actions specific to hyperslab selections */ + if(sel_hyper_flag) { + /* Sanity check */ + HDassert(dinfo->f_ndims > 0); + + /* Make certain selections are stored in span tree form (not "optimized hyperslab" or "all") */ + if(H5S_hyper_convert(tmp_fspace) < 0) { + (void)H5S_close(tmp_fspace); + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to convert selection to span trees") + } /* end if */ } /* end if */ /* Add temporary chunk to the list of pieces */ @@ -710,11 +713,11 @@ H5D__contig_io_init_mdset(H5D_io_info_md_t *io_info_md, /* only scratch for this dset */ /* Clean hyperslab span's "scratch" information */ - if(H5S_hyper_reset_scratch(new_piece_info->fspace) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reset span scratch info") + if(sel_hyper_flag) + if(H5S_hyper_reset_scratch(new_piece_info->fspace) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reset span scratch info") } /* end if */ - } /* referred from H5D__create_piece_file_map_hype */ - } + } /* end block referred from H5D__create_piece_file_map_hyper */ done: if(ret_value < 0) { @@ -860,7 +863,7 @@ static herr_t H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) { - H5D_contig_readvv_sieve_ud_t *udata = (H5D_contig_readvv_sieve_ud_t *)_udata; /* User data for H5V_opvv() operator */ + H5D_contig_readvv_sieve_ud_t *udata = (H5D_contig_readvv_sieve_ud_t *)_udata; /* User data for H5VM_opvv() operator */ H5F_t *file = udata->file; /* File for dataset */ H5D_rdcdc_t *dset_contig = udata->dset_contig; /* Cached information about contiguous data */ const H5D_contig_storage_t *store_contig = udata->store_contig; /* Contiguous storage info for this I/O operation */ @@ -1026,7 +1029,7 @@ done: static herr_t H5D__contig_readvv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) { - H5D_contig_readvv_ud_t *udata = (H5D_contig_readvv_ud_t *)_udata; /* User data for H5V_opvv() operator */ + H5D_contig_readvv_ud_t *udata = (H5D_contig_readvv_ud_t *)_udata; /* User data for H5VM_opvv() operator */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1079,9 +1082,9 @@ H5D__contig_readvv(const H5D_io_info_t *io_info, /* Check if data sieving is enabled */ if(H5F_HAS_FEATURE(io_info->dset->oloc.file, H5FD_FEAT_DATA_SIEVE)) { - H5D_contig_readvv_sieve_ud_t udata; /* User data for H5V_opvv() operator */ + H5D_contig_readvv_sieve_ud_t udata; /* User data for H5VM_opvv() operator */ - /* Set up user data for H5V_opvv() */ + /* Set up user data for H5VM_opvv() */ udata.file = io_info->dset->oloc.file; udata.dset_contig = &(io_info->dset->shared->cache.contig); udata.store_contig = &(io_info->store->contig); @@ -1089,22 +1092,22 @@ H5D__contig_readvv(const H5D_io_info_t *io_info, udata.dxpl_id = io_info->dxpl_id; /* Call generic sequence operation routine */ - if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, + if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, H5D__contig_readvv_sieve_cb, &udata)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized sieve buffer read") } /* end if */ else { - H5D_contig_readvv_ud_t udata; /* User data for H5V_opvv() operator */ + H5D_contig_readvv_ud_t udata; /* User data for H5VM_opvv() operator */ - /* Set up user data for H5V_opvv() */ + /* Set up user data for H5VM_opvv() */ udata.file = io_info->dset->oloc.file; udata.dset_addr = io_info->store->contig.dset_addr; udata.rbuf = (unsigned char *)io_info->u.rbuf; udata.dxpl_id = io_info->dxpl_id; /* Call generic sequence operation routine */ - if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, + if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, H5D__contig_readvv_cb, &udata)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized read") @@ -1131,7 +1134,7 @@ static herr_t H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) { - H5D_contig_writevv_sieve_ud_t *udata = (H5D_contig_writevv_sieve_ud_t *)_udata; /* User data for H5V_opvv() operator */ + H5D_contig_writevv_sieve_ud_t *udata = (H5D_contig_writevv_sieve_ud_t *)_udata; /* User data for H5VM_opvv() operator */ H5F_t *file = udata->file; /* File for dataset */ H5D_rdcdc_t *dset_contig = udata->dset_contig; /* Cached information about contiguous data */ const H5D_contig_storage_t *store_contig = udata->store_contig; /* Contiguous storage info for this I/O operation */ @@ -1348,7 +1351,7 @@ done: static herr_t H5D__contig_writevv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) { - H5D_contig_writevv_ud_t *udata = (H5D_contig_writevv_ud_t *)_udata; /* User data for H5V_opvv() operator */ + H5D_contig_writevv_ud_t *udata = (H5D_contig_writevv_ud_t *)_udata; /* User data for H5VM_opvv() operator */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1400,9 +1403,9 @@ H5D__contig_writevv(const H5D_io_info_t *io_info, /* Check if data sieving is enabled */ if(H5F_HAS_FEATURE(io_info->dset->oloc.file, H5FD_FEAT_DATA_SIEVE)) { - H5D_contig_writevv_sieve_ud_t udata; /* User data for H5V_opvv() operator */ + H5D_contig_writevv_sieve_ud_t udata; /* User data for H5VM_opvv() operator */ - /* Set up user data for H5V_opvv() */ + /* Set up user data for H5VM_opvv() */ udata.file = io_info->dset->oloc.file; udata.dset_contig = &(io_info->dset->shared->cache.contig); udata.store_contig = &(io_info->store->contig); @@ -1410,22 +1413,22 @@ H5D__contig_writevv(const H5D_io_info_t *io_info, udata.dxpl_id = io_info->dxpl_id; /* Call generic sequence operation routine */ - if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, + if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, H5D__contig_writevv_sieve_cb, &udata)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized sieve buffer write") } /* end if */ else { - H5D_contig_writevv_ud_t udata; /* User data for H5V_opvv() operator */ + H5D_contig_writevv_ud_t udata; /* User data for H5VM_opvv() operator */ - /* Set up user data for H5V_opvv() */ + /* Set up user data for H5VM_opvv() */ udata.file = io_info->dset->oloc.file; udata.dset_addr = io_info->store->contig.dset_addr; udata.wbuf = (const unsigned char *)io_info->u.wbuf; udata.dxpl_id = io_info->dxpl_id; /* Call generic sequence operation routine */ - if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, + if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, H5D__contig_writevv_cb, &udata)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized read") diff --git a/src/H5Defl.c b/src/H5Defl.c index 14abc28..57c5a3c 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -33,7 +33,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* Files */ #include "H5HLprivate.h" /* Local Heaps */ -#include "H5Vprivate.h" /* Vector and array functions */ +#include "H5VMprivate.h" /* Vector and array functions */ /****************/ @@ -429,7 +429,7 @@ done: static herr_t H5D__efl_readvv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) { - H5D_efl_readvv_ud_t *udata = (H5D_efl_readvv_ud_t *)_udata; /* User data for H5V_opvv() operator */ + H5D_efl_readvv_ud_t *udata = (H5D_efl_readvv_ud_t *)_udata; /* User data for H5VM_opvv() operator */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -463,7 +463,7 @@ H5D__efl_readvv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_off_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { - H5D_efl_readvv_ud_t udata; /* User data for H5V_opvv() operator */ + H5D_efl_readvv_ud_t udata; /* User data for H5VM_opvv() operator */ ssize_t ret_value; /* Return value (Total size of sequence in bytes) */ FUNC_ENTER_STATIC @@ -479,12 +479,12 @@ H5D__efl_readvv(const H5D_io_info_t *io_info, HDassert(mem_len_arr); HDassert(mem_off_arr); - /* Set up user data for H5V_opvv() */ + /* Set up user data for H5VM_opvv() */ udata.efl = &(io_info->store->efl); udata.rbuf = (unsigned char *)io_info->u.rbuf; /* Call generic sequence operation routine */ - if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, + if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, H5D__efl_readvv_cb, &udata)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized EFL read") @@ -509,7 +509,7 @@ done: static herr_t H5D__efl_writevv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) { - H5D_efl_writevv_ud_t *udata = (H5D_efl_writevv_ud_t *)_udata; /* User data for H5V_opvv() operator */ + H5D_efl_writevv_ud_t *udata = (H5D_efl_writevv_ud_t *)_udata; /* User data for H5VM_opvv() operator */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -543,7 +543,7 @@ H5D__efl_writevv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_off_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { - H5D_efl_writevv_ud_t udata; /* User data for H5V_opvv() operator */ + H5D_efl_writevv_ud_t udata; /* User data for H5VM_opvv() operator */ ssize_t ret_value; /* Return value (Total size of sequence in bytes) */ FUNC_ENTER_STATIC @@ -559,12 +559,12 @@ H5D__efl_writevv(const H5D_io_info_t *io_info, HDassert(mem_len_arr); HDassert(mem_off_arr); - /* Set up user data for H5V_opvv() */ + /* Set up user data for H5VM_opvv() */ udata.efl = &(io_info->store->efl); udata.wbuf = (const unsigned char *)io_info->u.wbuf; /* Call generic sequence operation routine */ - if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, + if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, H5D__efl_writevv_cb, &udata)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized EFL write") diff --git a/src/H5Dfill.c b/src/H5Dfill.c index 2edb363..e682dd6 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -38,7 +38,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ -#include "H5Vprivate.h" /* Vector and array functions */ +#include "H5VMprivate.h" /* Vector and array functions */ #include "H5WBprivate.h" /* Wrapped Buffers */ @@ -262,7 +262,7 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Replicate the file's fill value into the temporary buffer */ - H5V_array_fill(tmp_buf, fill, src_type_size, (size_t)nelmts); + H5VM_array_fill(tmp_buf, fill, src_type_size, (size_t)nelmts); /* Convert from file's fill value into memory form */ if(H5T_convert(tpath, src_id, dst_id, (size_t)nelmts, (size_t)0, (size_t)0, tmp_buf, bkg_buf, dxpl_id) < 0) @@ -494,7 +494,7 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, } /* end else */ /* Replicate the fill value into the cached buffer */ - H5V_array_fill(fb_info->fill_buf, fill->buf, fb_info->max_elmt_size, fb_info->elmts_per_buf); + H5VM_array_fill(fb_info->fill_buf, fill->buf, fb_info->max_elmt_size, fb_info->elmts_per_buf); } /* end else */ } /* end if */ else { /* Fill the buffer with the default fill value */ @@ -588,7 +588,7 @@ H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, hid_t dxpl_id) /* Replicate the fill value into the cached buffer */ if(nelmts > 1) - H5V_array_fill((void *)((unsigned char *)fb_info->fill_buf + fb_info->mem_elmt_size), fb_info->fill_buf, fb_info->mem_elmt_size, (nelmts - 1)); + H5VM_array_fill((void *)((unsigned char *)fb_info->fill_buf + fb_info->mem_elmt_size), fb_info->fill_buf, fb_info->mem_elmt_size, (nelmts - 1)); /* Reset the entire background buffer, if necessary */ if(H5T_path_bkg(fb_info->mem_to_dset_tpath)) diff --git a/src/H5Dint.c b/src/H5Dint.c index cf8b9c3..8095378 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -66,7 +66,7 @@ static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space static herr_t H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id); static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id); -static herr_t H5D__init_storage(H5D_t *dataset, hbool_t full_overwrite, +static herr_t H5D__init_storage(const H5D_t *dataset, hbool_t full_overwrite, hsize_t old_dim[], hid_t dxpl_id); @@ -1596,7 +1596,7 @@ H5D_typeof(const H5D_t *dset) *------------------------------------------------------------------------- */ herr_t -H5D__alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_alloc, +H5D__alloc_storage(const H5D_t *dset, hid_t dxpl_id, H5D_time_alloc_t time_alloc, hbool_t full_overwrite, hsize_t old_dim[]) { H5F_t *f = dset->oloc.file; /* The dataset's file pointer */ @@ -1759,7 +1759,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[], +H5D__init_storage(const H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[], hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2375,7 +2375,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__mark(H5D_t *dataset, hid_t UNUSED dxpl_id, unsigned flags) +H5D__mark(const H5D_t *dataset, hid_t UNUSED dxpl_id, unsigned flags) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Dio.c b/src/H5Dio.c index f412310..9062096 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -63,20 +63,20 @@ static herr_t H5D__read_mdset(hid_t file_id, hid_t dxpl_id, size_t count, H5D_rw static herr_t H5D__write_mdset(hid_t file_id, hid_t dxpl_id, size_t count, H5D_rw_multi_t *info); static herr_t H5D__pre_write_mdset(hid_t file_id, hid_t dxpl_id, size_t count, H5D_rw_multi_t *info); -/* Setup/teardown routines for single-dset and multi-dset */ +/* Setup/teardown routines */ static herr_t H5D__ioinfo_init(H5D_t *dset, #ifndef H5_HAVE_PARALLEL const #endif /* H5_HAVE_PARALLEL */ - H5D_dxpl_cache_t *dxpl_cache, + H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, const H5D_type_info_t *type_info, H5D_storage_t *store, H5D_io_info_t *io_info); static herr_t H5D__ioinfo_init_mdset(H5D_t *dset, #ifndef H5_HAVE_PARALLEL const #endif /* H5_HAVE_PARALLEL */ - H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, - H5D_dset_info_t *dset_info, H5D_storage_t *store, H5D_io_info_md_t *io_info_md); + H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, H5D_dset_info_t *dset_info, + H5D_storage_t *store, H5D_io_info_md_t *io_info_md); static herr_t H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, hid_t mem_type_id, hbool_t do_write, H5D_type_info_t *type_info); @@ -725,14 +725,15 @@ H5D__pre_write(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") + /* Retrieve the 'direct write' flag */ if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, &direct_write) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting flag for direct chunk write") /* Direct chunk write */ if(direct_write) { - uint32_t direct_filters = 0; + uint32_t direct_filters; hsize_t *direct_offset; - size_t direct_datasize = 0; + uint32_t direct_datasize; int ndims = 0; hsize_t dims[H5O_LAYOUT_NDIMS]; hsize_t internal_offset[H5O_LAYOUT_NDIMS]; @@ -741,12 +742,11 @@ H5D__pre_write(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if(H5D_CHUNKED != dset->shared->layout.type) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset") + /* Retrieve parameters for direct chunk write */ if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME, &direct_filters) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting filter info for direct chunk write") - if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME, &direct_offset) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting offset info for direct chunk write") - if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME, &direct_datasize) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting data size for direct chunk write") @@ -755,7 +755,7 @@ H5D__pre_write(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if((ndims = H5S_get_simple_extent_dims(dset->shared->space, dims, NULL)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve dataspace extent dims") - for(i=0; i<ndims; i++) { + for(i = 0; i < ndims; i++) { /* Make sure the offset doesn't exceed the dataset's dimensions */ if(direct_offset[i] > dims[i]) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset exceeds dimensions of dataset") @@ -765,15 +765,16 @@ H5D__pre_write(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset doesn't fall on chunks's boundary") internal_offset[i] = direct_offset[i]; - } - + } /* end for */ + /* Terminate the offset with a zero */ internal_offset[ndims] = 0; /* write raw data */ if(H5D__chunk_direct_write(dset, dxpl_id, direct_filters, internal_offset, direct_datasize, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write chunk directly") - } else { /* Non direct write */ + } /* end if */ + else { /* Normal write */ const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; char fake_char; @@ -818,8 +819,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__pre_write() */ - - /*------------------------------------------------------------------------- * Function: H5D__read @@ -925,7 +924,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* Attempt to construct projected dataspace for memory dataspace */ if(H5S_select_construct_projection(mem_space, &projected_mem_space, - (unsigned)H5S_GET_EXTENT_NDIMS(file_space), buf, &adj_buf, type_info.dst_type_size) < 0) + (unsigned)H5S_GET_EXTENT_NDIMS(file_space), buf, (const void **)&adj_buf, type_info.dst_type_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to construct projected memory dataspace") HDassert(projected_mem_space); HDassert(adj_buf); @@ -1226,7 +1225,7 @@ H5D__read_mdset(hid_t file_id, hid_t dxpl_id, size_t count, H5D_rw_multi_t *info /* Attempt to construct projected dataspace for memory dataspace */ if(H5S_select_construct_projection(mem_space, &(projected_mem_space[i]), - (unsigned)H5S_GET_EXTENT_NDIMS(file_space), info[i].u.rbuf, &adj_buf, (hsize_t) dset_info_array[i].type_info.dst_type_size) < 0) + (unsigned)H5S_GET_EXTENT_NDIMS(file_space), info[i].u.rbuf, (const void **)&adj_buf, (hsize_t) dset_info_array[i].type_info.dst_type_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to construct projected memory dataspace") HDassert(projected_mem_space[i]); HDassert(adj_buf); @@ -1518,7 +1517,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* Attempt to construct projected dataspace for memory dataspace */ if(H5S_select_construct_projection(mem_space, &projected_mem_space, - (unsigned)H5S_GET_EXTENT_NDIMS(file_space), buf, &adj_buf, type_info.src_type_size) < 0) + (unsigned)H5S_GET_EXTENT_NDIMS(file_space), buf, (const void **)&adj_buf, type_info.src_type_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to construct projected memory dataspace") HDassert(projected_mem_space); HDassert(adj_buf); @@ -1817,7 +1816,7 @@ H5D__write_mdset(hid_t file_id, hid_t dxpl_id, size_t count, H5D_rw_multi_t *inf /* Attempt to construct projected dataspace for memory dataspace */ if(H5S_select_construct_projection(mem_space, &(projected_mem_space[i]), - (unsigned)H5S_GET_EXTENT_NDIMS(file_space), info[i].u.wbuf, &adj_buf, (hsize_t) dset_info_array[i].type_info.src_type_size) < 0) + (unsigned)H5S_GET_EXTENT_NDIMS(file_space), info[i].u.wbuf, (const void **)&adj_buf, (hsize_t) dset_info_array[i].type_info.src_type_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to construct projected memory dataspace") HDassert(projected_mem_space[i]); HDassert(adj_buf); @@ -1996,7 +1995,7 @@ H5D__ioinfo_init(H5D_t *dset, #ifndef H5_HAVE_PARALLEL const #endif /* H5_HAVE_PARALLEL */ - H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, + H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, const H5D_type_info_t *type_info, H5D_storage_t *store, H5D_io_info_t *io_info) { FUNC_ENTER_STATIC_NOERR diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index bbd2228..9ea6194 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -43,7 +43,7 @@ #include "H5Oprivate.h" /* Object headers */ #include "H5Pprivate.h" /* Property lists */ #include "H5Sprivate.h" /* Dataspaces */ -#include "H5Vprivate.h" /* Vector */ +#include "H5VMprivate.h" /* Vector */ #ifdef H5_HAVE_PARALLEL @@ -164,42 +164,30 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, /* Optimized MPI types flag must be set and it must be collective IO */ /* (Don't allow parallel I/O for the MPI-posix driver, since it doesn't do real collective I/O) */ if(!(H5S_mpi_opt_types_g && io_info->dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE - && !IS_H5FD_MPIPOSIX(io_info->dset->oloc.file))) { + && !IS_H5FD_MPIPOSIX(io_info->dset->oloc.file))) local_cause |= H5D_MPIO_SET_MPIPOSIX; - } /* end if */ /* Don't allow collective operations if datatype conversions need to happen */ - if(!type_info->is_conv_noop) { + if(!type_info->is_conv_noop) local_cause |= H5D_MPIO_DATATYPE_CONVERSION; - } /* end if */ /* Don't allow collective operations if data transform operations should occur */ - if(!type_info->is_xform_noop) { + if(!type_info->is_xform_noop) local_cause |= H5D_MPIO_DATA_TRANSFORMS; - } /* end if */ /* Check whether these are both simple or scalar dataspaces */ if(!((H5S_SIMPLE == H5S_GET_EXTENT_TYPE(mem_space) || H5S_SCALAR == H5S_GET_EXTENT_TYPE(mem_space)) - && (H5S_SIMPLE == H5S_GET_EXTENT_TYPE(file_space) || H5S_SCALAR == H5S_GET_EXTENT_TYPE(file_space)))) { + && (H5S_SIMPLE == H5S_GET_EXTENT_TYPE(file_space) || H5S_SCALAR == H5S_GET_EXTENT_TYPE(file_space)))) local_cause |= H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES; - } /* end if */ - - /* Can't currently handle point selections */ - if(H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(mem_space) - || H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(file_space)) { - local_cause |= H5D_MPIO_POINT_SELECTIONS; - } /* end if */ /* Dataset storage must be contiguous or chunked */ if(!(io_info->dset->shared->layout.type == H5D_CONTIGUOUS || - io_info->dset->shared->layout.type == H5D_CHUNKED)) { + io_info->dset->shared->layout.type == H5D_CHUNKED)) local_cause |= H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET; - } /* end if */ /* check if external-file storage is used */ - if (io_info->dset->shared->dcpl_cache.efl.nused > 0) { + if(io_info->dset->shared->dcpl_cache.efl.nused > 0) local_cause |= H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET; - } /* The handling of memory space is different for chunking and contiguous * storage. For contiguous storage, mem_space and file_space won't change @@ -209,11 +197,9 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, */ /* Don't allow collective operations if filters need to be applied */ - if(io_info->dset->shared->layout.type == H5D_CHUNKED) { - if(io_info->dset->shared->dcpl_cache.pline.nused > 0) { - local_cause |= H5D_MPIO_FILTERS; - } /* end if */ - } /* end if */ + if(io_info->dset->shared->layout.type == H5D_CHUNKED && + io_info->dset->shared->dcpl_cache.pline.nused > 0) + local_cause |= H5D_MPIO_FILTERS; /* Form consensus opinion among all processes about whether to perform * collective I/O @@ -223,7 +209,6 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, ret_value = global_cause > 0 ? FALSE : TRUE; - done: /* Write the local value of no-collective-cause to the DXPL. */ if(H5P_set(dx_plist, H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, &local_cause) < 0) @@ -236,7 +221,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D__mpio_opt_possible() */ - + /*------------------------------------------------------------------------- * Function: H5D__mpio_opt_possible_mdset * @@ -296,42 +281,30 @@ H5D__mpio_opt_possible_mdset(const size_t count, H5D_io_info_md_t *io_info_md, H /* Optimized MPI types flag must be set and it must be collective IO */ /* (Don't allow parallel I/O for the MPI-posix driver, since it doesn't do real collective I/O) */ if(!(H5S_mpi_opt_types_g && io_info_md->dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE - && !IS_H5FD_MPIPOSIX(dset->oloc.file))) { + && !IS_H5FD_MPIPOSIX(dset->oloc.file))) local_cause |= H5D_MPIO_SET_MPIPOSIX; - } /* end if */ /* Don't allow collective operations if datatype conversions need to happen */ - if(!type_info.is_conv_noop) { + if(!type_info.is_conv_noop) local_cause |= H5D_MPIO_DATATYPE_CONVERSION; - } /* end if */ /* Don't allow collective operations if data transform operations should occur */ - if(!type_info.is_xform_noop) { + if(!type_info.is_xform_noop) local_cause |= H5D_MPIO_DATA_TRANSFORMS; - } /* end if */ /* Check whether these are both simple or scalar dataspaces */ if(!((H5S_SIMPLE == H5S_GET_EXTENT_TYPE(mem_space) || H5S_SCALAR == H5S_GET_EXTENT_TYPE(mem_space)) - && (H5S_SIMPLE == H5S_GET_EXTENT_TYPE(file_space) || H5S_SCALAR == H5S_GET_EXTENT_TYPE(file_space)))) { + && (H5S_SIMPLE == H5S_GET_EXTENT_TYPE(file_space) || H5S_SCALAR == H5S_GET_EXTENT_TYPE(file_space)))) local_cause |= H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES; - } /* end if */ - - /* Can't currently handle point selections */ - if(H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(mem_space) - || H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(file_space)) { - local_cause |= H5D_MPIO_POINT_SELECTIONS; - } /* end if */ /* Dataset storage must be contiguous or chunked */ if(!(dset->shared->layout.type == H5D_CONTIGUOUS || - dset->shared->layout.type == H5D_CHUNKED)) { + dset->shared->layout.type == H5D_CHUNKED)) local_cause |= H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET; - } /* end if */ /* check if external-file storage is used */ - if (dset->shared->dcpl_cache.efl.nused > 0) { + if (dset->shared->dcpl_cache.efl.nused > 0) local_cause |= H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET; - } /* The handling of memory space is different for chunking and contiguous * storage. For contiguous storage, mem_space and file_space won't change @@ -341,11 +314,9 @@ H5D__mpio_opt_possible_mdset(const size_t count, H5D_io_info_md_t *io_info_md, H */ /* Don't allow collective operations if filters need to be applied */ - if(dset->shared->layout.type == H5D_CHUNKED) { - if(dset->shared->dcpl_cache.pline.nused > 0) { + if(dset->shared->layout.type == H5D_CHUNKED && + dset->shared->dcpl_cache.pline.nused > 0) local_cause |= H5D_MPIO_FILTERS; - } /* end if */ - } /* end if */ } /* end for loop */ /* Form consensus opinion among all processes about whether to perform @@ -368,7 +339,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D__mpio_opt_possible_mdset() */ - /*------------------------------------------------------------------------- * Function: H5D__mpio_select_read_mdset @@ -393,12 +363,13 @@ H5D__mpio_select_read_mdset(const H5D_io_info_md_t *io_info_md, hsize_t mpi_buf_ /* all dsets are in the same file, so just get it from the first dset */ const H5F_t *file = io_info_md->dsets_info[0].dset->oloc.file; void *rbuf = NULL; - /* memory addr from a piece with lowest file addr */ - rbuf = io_info_md->base_maddr_r; herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE + /* memory addr from a piece with lowest file addr */ + rbuf = io_info_md->base_maddr_r; + /*OKAY: CAST DISCARDS CONST QUALIFIER*/ H5_CHECK_OVERFLOW(mpi_buf_count, hsize_t, size_t); if(H5F_block_read(file, H5FD_MEM_DRAW, io_info_md->store_faddr, (size_t)mpi_buf_count, io_info_md->dxpl_id, rbuf) < 0) @@ -431,12 +402,13 @@ H5D__mpio_select_write_mdset(const H5D_io_info_md_t *io_info_md, hsize_t mpi_buf /* all dsets are in the same file, so just get it from the first dset */ const H5F_t *file = io_info_md->dsets_info[0].dset->oloc.file; const void *wbuf = NULL; - /* memory addr from a piece with lowest file addr */ - wbuf = io_info_md->base_maddr_w; herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE + /* memory addr from a piece with lowest file addr */ + wbuf = io_info_md->base_maddr_w; + /*OKAY: CAST DISCARDS CONST QUALIFIER*/ H5_CHECK_OVERFLOW(mpi_buf_count, hsize_t, size_t); if(H5F_block_write(file, H5FD_MEM_DRAW, io_info_md->store_faddr, (size_t)mpi_buf_count, io_info_md->dxpl_id, wbuf) < 0) @@ -476,9 +448,6 @@ H5D__piece_mdset_io(const hid_t file_id, const size_t count, H5D_io_info_md_t *i H5P_genplist_t *dx_plist; /* Pointer to DXPL */ H5FD_mpio_chunk_opt_t chunk_opt_mode; int io_option = H5D_ONE_LINK_CHUNK_IO; -#ifdef H5_HAVE_INSTRUMENTED_LIBRARY - htri_t temp_not_link_io = FALSE; -#endif herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -497,18 +466,20 @@ H5D__piece_mdset_io(const hid_t file_id, const size_t count, H5D_io_info_md_t *i io_option = H5D_ONE_LINK_CHUNK_IO; /*no opt*/ #ifdef H5_HAVE_INSTRUMENTED_LIBRARY - htri_t check_prop; - int new_value; - - /*** Test collective chunk user-input optimization APIs. ***/ - check_prop = H5Pexist(io_info_md->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME); - if(check_prop > 0) { - if(H5D_ONE_LINK_CHUNK_IO == io_option) { - new_value = 0; - if(H5Pset(io_info_md->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, &new_value) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") + { + htri_t check_prop; + int new_value; + + /*** Test collective chunk user-input optimization APIs. ***/ + check_prop = H5Pexist(io_info_md->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME); + if(check_prop > 0) { + if(H5D_ONE_LINK_CHUNK_IO == io_option) { + new_value = 0; + if(H5Pset(io_info_md->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, &new_value) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") + } /* end if */ } /* end if */ - } /* end if */ + } /* end block */ #endif /* step 2: Go ahead to do IO.*/ @@ -553,7 +524,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__mdset_collective_read() */ - /*------------------------------------------------------------------------- * Function: H5D__mdset_collective_write @@ -710,18 +680,63 @@ if(H5DEBUG(D)) /* Obtain MPI derived datatype from all individual pieces */ /* Iterate over selected pieces for this process */ while(piece_node) { + hsize_t *permute_map = NULL; /* array that holds the mapping from the old, + out-of-order displacements to the in-order + displacements of the MPI datatypes of the + point selection of the file space */ + hbool_t is_permuted = FALSE; + if(NULL == (piece_info = (H5D_piece_info_t *)H5SL_item(piece_node))) HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL,"couldn't get piece info from skipped list") - - /* Disk MPI derived datatype */ + + /* Obtain disk and memory MPI derived datatype */ + /* NOTE: The permute_map array can be allocated within H5S_mpio_space_type + * and will be fed into the next call to H5S_mpio_space_type + * where it will be freed. + */ if(H5S_mpio_space_type(piece_info->fspace, - piece_info->dset_info->type_info.src_type_size, &chunk_ftype[u], &chunk_mpi_file_counts[u], &(chunk_mft_is_derived_array[u])) < 0) + piece_info->dset_info->type_info.src_type_size, + &chunk_ftype[u], /* OUT: datatype created */ + &chunk_mpi_file_counts[u], /* OUT */ + &(chunk_mft_is_derived_array[u]), /* OUT */ + TRUE, /* this is a file space, + so permute the + datatype if the point + selections are out of + order */ + &permute_map,/* OUT: a map to indicate the + permutation of points + selected in case they + are out of order */ + &is_permuted /* OUT */) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI file type") - /* Buffer MPI derived datatype */ + /* Sanity check */ + if(is_permuted) + HDassert(permute_map); if(H5S_mpio_space_type(piece_info->mspace, - piece_info->dset_info->type_info.dst_type_size, &chunk_mtype[u], &chunk_mpi_mem_counts[u], &(chunk_mbt_is_derived_array[u])) < 0) + piece_info->dset_info->type_info.dst_type_size, + &chunk_mtype[u], + &chunk_mpi_mem_counts[u], + &(chunk_mbt_is_derived_array[u]), + FALSE, /* this is a memory + space, so if the file + space is not + permuted, there is no + need to permute the + datatype if the point + selections are out of + order*/ + &permute_map, /* IN: the permutation map + generated by the + file_space selection + and applied to the + memory selection */ + &is_permuted /* IN */) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI buf type") + /* Sanity check */ + if(is_permuted) + HDassert(!permute_map); /* Piece address relative to the first piece addr * Assign piece address to MPI displacement @@ -812,8 +827,7 @@ if(H5DEBUG(D)) /* Perform final collective I/O operation */ if(H5D__final_collective_io_mdset(io_info_md, mpi_buf_count, &chunk_final_ftype, &chunk_final_mtype) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish MPI-IO") - } - + } done: #ifdef H5D_DEBUG @@ -847,7 +861,6 @@ if(H5DEBUG(D)) FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__all_piece_collective_io */ - /*------------------------------------------------------------------------- * Function: H5D__final_collective_io_mdset diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index b69a0ef..532c31d 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -207,7 +207,7 @@ typedef enum H5D_io_op_type_t { } H5D_io_op_type_t; typedef struct H5D_io_info_t { - H5D_t *dset; /* Pointer to dataset being operated on */ + const H5D_t *dset; /* Pointer to dataset being operated on */ #ifndef H5_HAVE_PARALLEL const #endif /* H5_HAVE_PARALLEL */ @@ -642,7 +642,7 @@ H5_DLL H5D_t *H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t dapl_id, hid_t dxpl_id); H5_DLL herr_t H5D__get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id); -H5_DLL herr_t H5D__alloc_storage(H5D_t *dset, hid_t dxpl_id, H5D_time_alloc_t time_alloc, +H5_DLL herr_t H5D__alloc_storage(const H5D_t *dset, hid_t dxpl_id, H5D_time_alloc_t time_alloc, hbool_t full_overwrite, hsize_t old_dim[]); H5_DLL herr_t H5D__get_storage_size(H5D_t *dset, hid_t dxpl_id, hsize_t *storage_size); H5_DLL haddr_t H5D__get_offset(const H5D_t *dset); @@ -655,7 +655,7 @@ H5_DLL herr_t H5D__check_filters(H5D_t *dataset); H5_DLL herr_t H5D__set_extent(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id); H5_DLL herr_t H5D__get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache); H5_DLL herr_t H5D__flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id); -H5_DLL herr_t H5D__mark(H5D_t *dataset, hid_t dxpl_id, unsigned flags); +H5_DLL herr_t H5D__mark(const H5D_t *dataset, hid_t dxpl_id, unsigned flags); H5_DLL herr_t H5D__flush_real(H5D_t *dataset, hid_t dxpl_id); /* Internal I/O routines */ @@ -697,7 +697,7 @@ H5_DLL herr_t H5D__layout_oh_write(H5D_t *dataset, hid_t dxpl_id, H5O_t *oh, H5_DLL herr_t H5D__contig_alloc(H5F_t *f, hid_t dxpl_id, H5O_storage_contig_t *storage); H5_DLL hbool_t H5D__contig_is_space_alloc(const H5O_storage_t *storage); -H5_DLL herr_t H5D__contig_fill(H5D_t *dset, hid_t dxpl_id); +H5_DLL herr_t H5D__contig_fill(const H5D_t *dset, hid_t dxpl_id); H5_DLL herr_t H5D__contig_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm); @@ -714,7 +714,7 @@ H5_DLL herr_t H5D__contig_delete(H5F_t *f, hid_t dxpl_id, /* Functions that operate on chunked dataset storage */ H5_DLL htri_t H5D__chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, hbool_t write_op); -H5_DLL herr_t H5D__chunk_create(H5D_t *dset /*in,out*/, hid_t dxpl_id); +H5_DLL herr_t H5D__chunk_create(const H5D_t *dset /*in,out*/, hid_t dxpl_id); H5_DLL herr_t H5D__chunk_set_info(const H5D_t *dset); H5_DLL herr_t H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id); @@ -727,7 +727,7 @@ H5_DLL herr_t H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, hbool_t dirty, void *chunk, uint32_t naccessed); H5_DLL herr_t H5D__chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes); -H5_DLL herr_t H5D__chunk_allocate(H5D_t *dset, hid_t dxpl_id, +H5_DLL herr_t H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, hsize_t old_dim[]); H5_DLL herr_t H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim); @@ -745,12 +745,14 @@ H5_DLL herr_t H5D__chunk_dump_index(H5D_t *dset, hid_t dxpl_id, FILE *stream); H5_DLL herr_t H5D__chunk_dest(H5F_t *f, hid_t dxpl_id, H5D_t *dset); H5_DLL herr_t H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *store); +H5_DLL herr_t H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, + hsize_t *offset, uint32_t data_size, const void *buf); #ifdef H5D_CHUNK_DEBUG H5_DLL herr_t H5D__chunk_stats(const H5D_t *dset, hbool_t headers); #endif /* H5D_CHUNK_DEBUG */ /* Functions that operate on compact dataset storage */ -H5_DLL herr_t H5D__compact_fill(H5D_t *dset, hid_t dxpl_id); +H5_DLL herr_t H5D__compact_fill(const H5D_t *dset, hid_t dxpl_id); H5_DLL herr_t H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, H5F_t *f_dst, H5O_storage_compact_t *storage_dst, H5T_t *src_dtype, H5O_copy_t *cpy_info, hid_t dxpl_id); diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 8b3496e..74ad9e4 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -170,8 +170,5 @@ H5_DLL herr_t H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_ad H5_DLL herr_t H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int fwidth, unsigned ndims); -H5_DLL herr_t H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, - hsize_t *offset, size_t data_size, const void *buf); - #endif /* _H5Dprivate_H */ @@ -48,7 +48,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5EApkg.h" /* Extensible Arrays */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5Vprivate.h" /* Vector functions */ +#include "H5VMprivate.h" /* Vector functions */ /****************/ @@ -560,13 +560,13 @@ if(sblock->dblk_npages) HDfprintf(stderr, "%s: sblock->addr = %a\n", FUNC, sblock->addr); HDfprintf(stderr, "%s: sblock->dblk_addrs[%Zu] = %a\n", FUNC, dblk_idx, sblock->dblk_addrs[dblk_idx]); HDfprintf(stderr, "%s: H5EA_DBLOCK_PREFIX_SIZE(sblock) = %u\n", FUNC, (unsigned)H5EA_DBLOCK_PREFIX_SIZE(sblock)); -HDfprintf(stderr, "%s: sblock->page_init[%Zu] = %t\n", FUNC, page_init_idx, H5V_bit_get(sblock->page_init, page_init_idx)); +HDfprintf(stderr, "%s: sblock->page_init[%Zu] = %t\n", FUNC, page_init_idx, H5VM_bit_get(sblock->page_init, page_init_idx)); HDfprintf(stderr, "%s: page_idx = %Zu, elmt_idx = %Hu, dblk_page_addr = %a\n", FUNC, page_idx, elmt_idx, dblk_page_addr); HDfprintf(stderr, "%s: sblock->dblk_page_size = %Zu\n", FUNC, sblock->dblk_page_size); #endif /* QAK */ /* Check if page has been initialized yet */ - if(!H5V_bit_get(sblock->page_init, page_init_idx)) { + if(!H5VM_bit_get(sblock->page_init, page_init_idx)) { /* Check if we are allowed to create the thing */ if(H5AC_WRITE == thing_acc) { /* Create the data block page */ @@ -574,7 +574,7 @@ HDfprintf(stderr, "%s: sblock->dblk_page_size = %Zu\n", FUNC, sblock->dblk_page_ H5E_THROW(H5E_CANTCREATE, "unable to create data block page") /* Mark data block page as initialized in super block */ - H5V_bit_set(sblock->page_init, page_init_idx, TRUE); + H5VM_bit_set(sblock->page_init, page_init_idx, TRUE); sblock_cache_flags |= H5AC__DIRTIED_FLAG; } /* end if */ else diff --git a/src/H5EAcache.c b/src/H5EAcache.c index a178536..1d40283 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -43,7 +43,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5EApkg.h" /* Extensible Arrays */ #include "H5MFprivate.h" /* File memory management */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ #include "H5WBprivate.h" /* Wrapped Buffers */ diff --git a/src/H5EAdblkpage.c b/src/H5EAdblkpage.c index eba7470..3c2da7c 100644 --- a/src/H5EAdblkpage.c +++ b/src/H5EAdblkpage.c @@ -43,7 +43,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5EApkg.h" /* Extensible Arrays */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ diff --git a/src/H5EAdblock.c b/src/H5EAdblock.c index 640f353..dd1e7b0 100644 --- a/src/H5EAdblock.c +++ b/src/H5EAdblock.c @@ -44,7 +44,7 @@ #include "H5EApkg.h" /* Extensible Arrays */ #include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File memory management */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ @@ -276,7 +276,7 @@ HDfprintf(stderr, "%s: after adjusting for index block elements, idx = %Hu\n", F #ifdef QAK HDfprintf(stderr, "%s: hdr->cparam.data_blk_min_elmts = %u\n", FUNC, (unsigned)hdr->cparam.data_blk_min_elmts); #endif /* QAK */ - sblk_idx = H5V_log2_gen((uint64_t)((idx / hdr->cparam.data_blk_min_elmts) + 1)); + sblk_idx = H5VM_log2_gen((uint64_t)((idx / hdr->cparam.data_blk_min_elmts) + 1)); #ifdef QAK HDfprintf(stderr, "%s: sblk_idx = %u\n", FUNC, sblk_idx); HDfprintf(stderr, "%s: hdr->sblk_info[%u] = {%Hu, %Zu, %Hu, %Hu}\n", FUNC, sblk_idx, hdr->sblk_info[sblk_idx].ndblks, hdr->sblk_info[sblk_idx].dblk_nelmts, hdr->sblk_info[sblk_idx].start_idx, hdr->sblk_info[sblk_idx].start_dblk); diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index 08d2fb9..d5f3538 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -43,7 +43,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5EApkg.h" /* Extensible Arrays */ #include "H5MFprivate.h" /* File memory management */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ @@ -201,7 +201,7 @@ H5EA__hdr_init(H5EA_hdr_t *hdr, void *ctx_udata)) HDassert(hdr->cparam.sup_blk_min_data_ptrs); /* Compute general information */ - hdr->nsblks = 1 + (hdr->cparam.max_nelmts_bits - H5V_log2_of2(hdr->cparam.data_blk_min_elmts)); + hdr->nsblks = 1 + (hdr->cparam.max_nelmts_bits - H5VM_log2_of2(hdr->cparam.data_blk_min_elmts)); hdr->dblk_page_nelmts = (size_t)1 << hdr->cparam.max_dblk_page_nelmts_bits; hdr->arr_off_size = (unsigned char)H5EA_SIZEOF_OFFSET_BITS(hdr->cparam.max_nelmts_bits); #ifdef QAK @@ -270,7 +270,7 @@ H5EA__hdr_alloc_elmts(H5EA_hdr_t *hdr, size_t nelmts)) /* Compute the index of the element buffer factory */ H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t); - idx = H5V_log2_of2((uint32_t)nelmts) - H5V_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); + idx = H5VM_log2_of2((uint32_t)nelmts) - H5VM_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); #ifdef QAK HDfprintf(stderr, "%s: nelmts = %Zu, hdr->data_blk_min_elmts = %u, idx = %u\n", FUNC, nelmts, (unsigned)hdr->data_blk_min_elmts, idx); #endif /* QAK */ @@ -340,7 +340,7 @@ H5EA__hdr_free_elmts(H5EA_hdr_t *hdr, size_t nelmts, void *elmts)) /* Compute the index of the element buffer factory */ H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t); - idx = H5V_log2_of2((uint32_t)nelmts) - H5V_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); + idx = H5VM_log2_of2((uint32_t)nelmts) - H5VM_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); #ifdef QAK HDfprintf(stderr, "%s: nelmts = %Zu, hdr->data_blk_min_elmts = %u, idx = %u\n", FUNC, nelmts, (unsigned)hdr->data_blk_min_elmts, idx); #endif /* QAK */ diff --git a/src/H5EAiblock.c b/src/H5EAiblock.c index e18947a..3c2894a 100644 --- a/src/H5EAiblock.c +++ b/src/H5EAiblock.c @@ -44,7 +44,7 @@ #include "H5EApkg.h" /* Extensible Arrays */ #include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File memory management */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ @@ -219,7 +219,7 @@ HDfprintf(stderr, "%s: iblock->size = %Zu\n", FUNC, iblock->size); haddr_t tmp_addr = HADDR_UNDEF; /* Address value to fill data block addresses with */ /* Set all the data block addresses to "undefined" address value */ - H5V_array_fill(iblock->dblk_addrs, &tmp_addr, sizeof(haddr_t), iblock->ndblk_addrs); + H5VM_array_fill(iblock->dblk_addrs, &tmp_addr, sizeof(haddr_t), iblock->ndblk_addrs); } /* end if */ /* Reset any super block addresses in the index block */ @@ -227,7 +227,7 @@ HDfprintf(stderr, "%s: iblock->size = %Zu\n", FUNC, iblock->size); haddr_t tmp_addr = HADDR_UNDEF; /* Address value to fill super block addresses with */ /* Set all the super block addresses to "undefined" address value */ - H5V_array_fill(iblock->sblk_addrs, &tmp_addr, sizeof(haddr_t), iblock->nsblk_addrs); + H5VM_array_fill(iblock->sblk_addrs, &tmp_addr, sizeof(haddr_t), iblock->nsblk_addrs); } /* end if */ /* Cache the new extensible array index block */ diff --git a/src/H5EApkg.h b/src/H5EApkg.h index af560b5..fc15e72 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -148,7 +148,7 @@ #define H5EA_SIZEOF_OFFSET_BITS(b) (((b) + 7) / 8) /* Compute the first super block index that will hold a certain # of data block pointers */ -#define H5EA_SBLK_FIRST_IDX(m) (2 * H5V_log2_of2((uint32_t)m)) +#define H5EA_SBLK_FIRST_IDX(m) (2 * H5VM_log2_of2((uint32_t)m)) /****************************/ /* Package Private Typedefs */ diff --git a/src/H5EAsblock.c b/src/H5EAsblock.c index ba1c40f..1cc8bd9 100644 --- a/src/H5EAsblock.c +++ b/src/H5EAsblock.c @@ -44,7 +44,7 @@ #include "H5EApkg.h" /* Extensible Arrays */ #include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File memory management */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ @@ -229,7 +229,7 @@ HDfprintf(stderr, "%s: sblock->block_off = %Hu\n", FUNC, sblock->block_off); sblock->addr = sblock_addr; /* Reset data block addresses to "undefined" address value */ - H5V_array_fill(sblock->dblk_addrs, &tmp_addr, sizeof(haddr_t), sblock->ndblks); + H5VM_array_fill(sblock->dblk_addrs, &tmp_addr, sizeof(haddr_t), sblock->ndblks); /* Cache the new extensible array super block */ if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_EARRAY_SBLOCK, sblock_addr, sblock, H5AC__NO_FLAGS_SET) < 0) diff --git a/src/H5EAtest.c b/src/H5EAtest.c index 0153a1e..94303c3 100644 --- a/src/H5EAtest.c +++ b/src/H5EAtest.c @@ -40,7 +40,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5EApkg.h" /* Extensible Arrays */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5Vprivate.h" /* Vector functions */ +#include "H5VMprivate.h" /* Vector functions */ /****************/ @@ -210,7 +210,7 @@ H5EA__test_fill(void *nat_blk, size_t nelmts)) HDassert(nat_blk); HDassert(nelmts); - H5V_array_fill(nat_blk, &fill_val, sizeof(uint64_t), nelmts); + H5VM_array_fill(nat_blk, &fill_val, sizeof(uint64_t), nelmts); END_FUNC(STATIC) /* end H5EA__test_fill() */ @@ -43,7 +43,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FApkg.h" /* Fixed Arrays */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5Vprivate.h" /* Vector functions */ +#include "H5VMprivate.h" /* Vector functions */ /****************/ @@ -389,13 +389,13 @@ HDfprintf(stderr, "%s: fixed array data block address not defined!\n", FUNC, idx dblk_page_nelmts = dblock->dblk_page_nelmts; /* Check if the page has been created yet */ - if(!H5V_bit_get(dblock->dblk_page_init, page_idx)) { + if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { /* Create the data block page */ if(H5FA__dblk_page_create(hdr, dxpl_id, dblk_page_addr, dblk_page_nelmts) < 0) H5E_THROW(H5E_CANTCREATE, "unable to create data block page") /* Mark data block page as initialized in data block */ - H5V_bit_set(dblock->dblk_page_init, page_idx, TRUE); + H5VM_bit_set(dblock->dblk_page_init, page_idx, TRUE); dblock_cache_flags |= H5AC__DIRTIED_FLAG; } /* end if */ @@ -481,7 +481,7 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx); page_idx = (size_t)(idx / dblock->dblk_page_nelmts); /* Check if the page is defined yet */ - if(!H5V_bit_get(dblock->dblk_page_init, page_idx)) { + if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { /* Call the class's 'fill' callback */ if((hdr->cparam.cls->fill)(elmt, (size_t)1) < 0) H5E_THROW(H5E_CANTSET, "can't set element to class's fill value") diff --git a/src/H5FAcache.c b/src/H5FAcache.c index 14df4c8..cb156db 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -41,7 +41,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FApkg.h" /* Fixed Arrays */ #include "H5MFprivate.h" /* File memory management */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ #include "H5WBprivate.h" /* Wrapped Buffers */ diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c index 9bb90af..eb5e32e 100644 --- a/src/H5FAdbg.c +++ b/src/H5FAdbg.c @@ -41,7 +41,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FApkg.h" /* Fixed Arrays */ #include "H5Oprivate.h" /* Object Header */ -#include "H5Vprivate.h" /* Vector functions */ +#include "H5VMprivate.h" /* Vector functions */ /****************/ @@ -233,7 +233,7 @@ H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde /* Read and print each page's elements in the data block */ for(page_idx = 0; page_idx < dblock->npages; page_idx++) { - if(!H5V_bit_get(dblock->dblk_page_init, page_idx)) { + if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { HDfprintf(stream, "%*s%-*s %Hu %s\n", indent, "", fwidth, "Page %Zu:", page_idx, "empty"); diff --git a/src/H5FAtest.c b/src/H5FAtest.c index 1828fa4..298c89d 100644 --- a/src/H5FAtest.c +++ b/src/H5FAtest.c @@ -40,7 +40,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FApkg.h" /* Fixed Arrays */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5Vprivate.h" /* Vector functions */ +#include "H5VMprivate.h" /* Vector functions */ /****************/ @@ -206,7 +206,7 @@ H5FA__test_fill(void *nat_blk, size_t nelmts)) HDassert(nat_blk); HDassert(nelmts); - H5V_array_fill(nat_blk, &fill_val, sizeof(uint64_t), nelmts); + H5VM_array_fill(nat_blk, &fill_val, sizeof(uint64_t), nelmts); END_FUNC(STATIC) /* end H5FA__test_fill() */ diff --git a/src/H5FScache.c b/src/H5FScache.c index e441398..e03a0a4 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -38,7 +38,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FSpkg.h" /* File free space */ #include "H5MFprivate.h" /* File memory management */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ #include "H5WBprivate.h" /* Wrapped Buffers */ /****************/ @@ -612,7 +612,7 @@ H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata unsigned sect_cnt_size; /* The size of the section size counts */ /* Compute the size of the section counts */ - sect_cnt_size = H5V_limit_enc_size((uint64_t)udata->fspace->serial_sect_count); + sect_cnt_size = H5VM_limit_enc_size((uint64_t)udata->fspace->serial_sect_count); /* Reset the section count, the "add" routine will update it */ old_tot_sect_count = udata->fspace->tot_sect_count; @@ -862,7 +862,7 @@ H5FS_cache_sinfo_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H /* Set up user data for iterator */ udata.sinfo = sinfo; udata.p = &p; - udata.sect_cnt_size = H5V_limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count); + udata.sect_cnt_size = H5VM_limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count); /* Iterate over all the bins */ for(bin = 0; bin < sinfo->nbins; bin++) { diff --git a/src/H5FSsection.c b/src/H5FSsection.c index c0084b8..b06c9b8 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -35,7 +35,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FSpkg.h" /* File free space */ #include "H5MFprivate.h" /* File memory management */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ @@ -143,10 +143,10 @@ HDfprintf(stderr, "%s: fspace->addr = %a\n", FUNC, fspace->addr); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Set non-zero values */ - sinfo->nbins = H5V_log2_gen(fspace->max_sect_size); + sinfo->nbins = H5VM_log2_gen(fspace->max_sect_size); sinfo->sect_prefix_size = (size_t)H5FS_SINFO_PREFIX_SIZE(f); sinfo->sect_off_size = (fspace->max_sect_addr + 7) / 8; - sinfo->sect_len_size = H5V_limit_enc_size((uint64_t)fspace->max_sect_size); + sinfo->sect_len_size = H5VM_limit_enc_size((uint64_t)fspace->max_sect_size); #ifdef H5FS_SINFO_DEBUG HDfprintf(stderr, "%s: fspace->max_sect_size = %Hu\n", FUNC, fspace->max_sect_size); HDfprintf(stderr, "%s: fspace->max_sect_addr = %u\n", FUNC, fspace->max_sect_addr); @@ -499,7 +499,7 @@ HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS_sect_ser HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS_sect_serialize_size", fspace->sinfo->serial_size_count); HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", "H5FS_sect_serialize_size", fspace->serial_sect_count); #endif /* QAK */ - sect_buf_size += fspace->sinfo->serial_size_count * H5V_limit_enc_size((uint64_t)fspace->serial_sect_count); + sect_buf_size += fspace->sinfo->serial_size_count * H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count); /* Size for each differently sized serializable section */ sect_buf_size += fspace->sinfo->serial_size_count * fspace->sinfo->sect_len_size; @@ -765,7 +765,7 @@ H5FS_sect_unlink_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, HDassert(cls); /* Determine correct bin which holds items of at least the section's size */ - bin = H5V_log2_gen(sect->size); + bin = H5VM_log2_gen(sect->size); HDassert(bin < sinfo->nbins); if(sinfo->bins[bin].bin_list == NULL) HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "node's bin is empty?") @@ -966,7 +966,7 @@ HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a\n", FUNC, sect->size, s HDassert(sect->size); /* Determine correct bin which holds items of the section's size */ - bin = H5V_log2_gen(sect->size); + bin = H5VM_log2_gen(sect->size); HDassert(bin < sinfo->nbins); if(sinfo->bins[bin].bin_list == NULL) { if(NULL == (sinfo->bins[bin].bin_list = H5SL_create(H5SL_TYPE_HSIZE, NULL))) @@ -1687,7 +1687,7 @@ H5FS_sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node) HDassert(node); /* Determine correct bin which holds items of at least the section's size */ - bin = H5V_log2_gen(request); + bin = H5VM_log2_gen(request); HDassert(bin < fspace->sinfo->nbins); #ifdef QAK HDfprintf(stderr, "%s: fspace->sinfo->nbins = %u\n", FUNC, fspace->sinfo->nbins); @@ -2121,7 +2121,7 @@ HDfprintf(stderr, "%s: to_ghost = %u\n", FUNC, to_ghost); HDassert(fspace->sinfo->bins); /* Determine correct bin which holds items of at least the section's size */ - bin = H5V_log2_gen(sect->size); + bin = H5VM_log2_gen(sect->size); HDassert(bin < fspace->sinfo->nbins); HDassert(fspace->sinfo->bins[bin].bin_list); diff --git a/src/H5Faccum.c b/src/H5Faccum.c index e0ce292..037c085 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -40,7 +40,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ #include "H5FDprivate.h" /* File drivers */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ @@ -151,7 +151,7 @@ H5F_accum_read(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, size_t new_alloc_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_alloc_size = (size_t)1 << (1 + H5V_log2_gen((uint64_t)(new_size - 1))); + new_alloc_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(new_size - 1))); /* Reallocate the metadata accumulator buffer */ if(NULL == (f->shared->accum.buf = H5FL_BLK_REALLOC(meta_accum, f->shared->accum.buf, new_alloc_size))) @@ -295,7 +295,7 @@ H5F_accum_adjust(H5F_meta_accum_t *accum, H5FD_t *lf, hid_t dxpl_id, size_t new_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_size = (size_t)1 << (1 + H5V_log2_gen((uint64_t)((size + accum->size) - 1))); + new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)((size + accum->size) - 1))); /* Check for accumulator getting too big */ if(new_size > H5F_ACCUM_MAX_SIZE) { @@ -606,7 +606,7 @@ H5F_accum_write(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, size_t new_alloc_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_alloc_size = (size_t)1 << (1 + H5V_log2_gen((uint64_t)(size - 1))); + new_alloc_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1))); /* Reallocate the metadata accumulator buffer */ if(NULL == (f->shared->accum.buf = H5FL_BLK_REALLOC(meta_accum, f->shared->accum.buf, new_alloc_size))) @@ -649,7 +649,7 @@ HDmemset(f->shared->accum.buf + size, 0, (f->shared->accum.alloc_size - size)); size_t new_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_size = (size_t)1 << (1 + H5V_log2_gen((uint64_t)(size - 1))); + new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1))); /* Grow the metadata accumulator buffer */ if(NULL == (f->shared->accum.buf = H5FL_BLK_REALLOC(meta_accum, f->shared->accum.buf, new_size))) @@ -699,7 +699,7 @@ HDmemset(f->shared->accum.buf + clear_size, 0, (f->shared->accum.alloc_size - cl size_t new_size; /* New size of accumulator */ /* Adjust the buffer size to be a power of 2 that is large enough to hold data */ - new_size = (size_t)1 << (1 + H5V_log2_gen((uint64_t)(size - 1))); + new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1))); /* Reallocate the metadata accumulator buffer */ if(NULL == (f->shared->accum.buf = H5FL_BLK_REALLOC(meta_accum, f->shared->accum.buf, new_size))) diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index e9b6bc0..028f5b1 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -27,7 +27,7 @@ #include "H5FDpublic.h" /* File drivers */ /* Private headers needed by this file */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************************/ @@ -119,7 +119,7 @@ typedef struct H5F_blk_aggr_t H5F_blk_aggr_t; /* (Assumes that the high bits of the integer are zero) */ # define UINT64ENCODE_VARLEN(p, n) { \ uint64_t __n = (uint64_t)(n); \ - unsigned _s = H5V_limit_enc_size(__n); \ + unsigned _s = H5VM_limit_enc_size(__n); \ \ *(p)++ = (uint8_t)_s; \ UINT64ENCODE_VAR(p, __n, _s); \ diff --git a/src/H5HFcache.c b/src/H5HFcache.c index ddff0e0..030927d 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -40,7 +40,7 @@ #include "H5HFpkg.h" /* Fractal heaps */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ #include "H5WBprivate.h" /* Wrapped Buffers */ diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 5d68fd1..7d22ddd 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -39,7 +39,7 @@ #include "H5FLprivate.h" /* Free Lists */ #include "H5HFpkg.h" /* Fractal heaps */ #include "H5MMprivate.h" /* Memory management */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ /* Local Macros */ @@ -638,10 +638,10 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, unsigned first_row_bits; /* Number of bits used bit addresses in first row */ unsigned num_indirect_rows; /* Number of rows of blocks in each indirect block */ - first_row_bits = H5V_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + - H5V_log2_of2(hdr->man_dtable.cparam.width); + first_row_bits = H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + + H5VM_log2_of2(hdr->man_dtable.cparam.width); for(u = hdr->man_dtable.max_direct_rows; u < iblock->nrows; u++) { - num_indirect_rows = (H5V_log2_gen(hdr->man_dtable.row_block_size[u]) - first_row_bits) + 1; + num_indirect_rows = (H5VM_log2_gen(hdr->man_dtable.row_block_size[u]) - first_row_bits) + 1; HDsnprintf(temp_str, sizeof(temp_str), "Row #%u: (# of rows: %u)", (unsigned)u, num_indirect_rows); HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), temp_str); diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index afc7f25..dd36613 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -38,7 +38,7 @@ #include "H5Fprivate.h" /* File access */ #include "H5HFpkg.h" /* Fractal heaps */ #include "H5MFprivate.h" /* File memory management */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ /* Local Macros */ @@ -354,7 +354,7 @@ H5HF_man_dblock_new(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t request, if(request < hdr->man_dtable.cparam.start_block_size) min_dblock_size = hdr->man_dtable.cparam.start_block_size; else { - min_dblock_size = ((size_t)1) << (1 + H5V_log2_gen((uint64_t)request)); + min_dblock_size = ((size_t)1) << (1 + H5VM_log2_gen((uint64_t)request)); HDassert(min_dblock_size <= hdr->man_dtable.cparam.max_direct_size); } /* end else */ @@ -549,7 +549,7 @@ H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off, unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting parent indirect block */ /* Compute # of rows in child indirect block */ - nrows = (H5V_log2_gen(hdr->man_dtable.row_block_size[row]) - hdr->man_dtable.first_row_bits) + 1; + nrows = (H5VM_log2_gen(hdr->man_dtable.row_block_size[row]) - hdr->man_dtable.first_row_bits) + 1; HDassert(nrows < iblock->nrows); /* child must be smaller than parent */ /* Compute indirect block's entry */ diff --git a/src/H5HFdtable.c b/src/H5HFdtable.c index a7d95bc..607862a 100644 --- a/src/H5HFdtable.c +++ b/src/H5HFdtable.c @@ -37,7 +37,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5HFpkg.h" /* Fractal heaps */ #include "H5MMprivate.h" /* Memory management */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ /* Local Macros */ @@ -104,10 +104,10 @@ H5HF_dtable_init(H5HF_dtable_t *dtable) HDassert(dtable); /* Compute/cache some values */ - dtable->start_bits = H5V_log2_of2((uint32_t)dtable->cparam.start_block_size); - dtable->first_row_bits = dtable->start_bits + H5V_log2_of2(dtable->cparam.width); + dtable->start_bits = H5VM_log2_of2((uint32_t)dtable->cparam.start_block_size); + dtable->first_row_bits = dtable->start_bits + H5VM_log2_of2(dtable->cparam.width); dtable->max_root_rows = (dtable->cparam.max_index - dtable->first_row_bits) + 1; - dtable->max_direct_bits = H5V_log2_of2((uint32_t)dtable->cparam.max_direct_size); + dtable->max_direct_bits = H5VM_log2_of2((uint32_t)dtable->cparam.max_direct_size); dtable->max_direct_rows = (dtable->max_direct_bits - dtable->start_bits) + 2; dtable->num_id_first_row = dtable->cparam.start_block_size * dtable->cparam.width; dtable->max_dir_blk_off_size = H5HF_SIZEOF_OFFSET_LEN(dtable->cparam.max_direct_size); @@ -171,7 +171,7 @@ HDfprintf(stderr, "%s: off = %Hu\n", "H5HF_dtable_lookup", off); H5_ASSIGN_OVERFLOW(/* To: */ *col, /* From: */ (off / dtable->cparam.start_block_size), /* From: */ hsize_t, /* To: */ unsigned); } /* end if */ else { - unsigned high_bit = H5V_log2_gen(off); /* Determine the high bit in the offset */ + unsigned high_bit = H5VM_log2_gen(off); /* Determine the high bit in the offset */ hsize_t off_mask = ((hsize_t)1) << high_bit; /* Compute mask for determining column */ #ifdef QAK @@ -252,7 +252,7 @@ H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size) if(block_size == dtable->cparam.start_block_size) row = 0; else - row = (H5V_log2_of2((uint32_t)block_size) - H5V_log2_of2((uint32_t)dtable->cparam.start_block_size)) + 1; + row = (H5VM_log2_of2((uint32_t)block_size) - H5VM_log2_of2((uint32_t)dtable->cparam.start_block_size)) + 1; FUNC_LEAVE_NOAPI(row) } /* end H5HF_dtable_size_to_row() */ @@ -283,7 +283,7 @@ H5HF_dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size) */ HDassert(dtable); - rows = (H5V_log2_gen(size) - dtable->first_row_bits) + 1; + rows = (H5VM_log2_gen(size) - dtable->first_row_bits) + 1; FUNC_LEAVE_NOAPI(rows) } /* end H5HF_dtable_size_to_rows() */ diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index e4b89ba..d3c4473 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -37,7 +37,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5HFpkg.h" /* Fractal heaps */ #include "H5MFprivate.h" /* File memory management */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ /* Local Macros */ @@ -46,7 +46,7 @@ #ifndef NDEBUG /* Limit on the size of the max. direct block size */ /* (This is limited to 32-bits currently, because I think it's unlikely to - * need to be larger, the 32-bit limit for H5V_log2_of2(n), and + * need to be larger, the 32-bit limit for H5VM_log2_of2(n), and * some offsets/sizes are encoded with a maxiumum of 32-bits - QAK) */ #define H5HF_MAX_DIRECT_SIZE_LIMIT ((hsize_t)2 * 1024 * 1024 * 1024) @@ -224,7 +224,7 @@ H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr) /* Set the size of heap IDs */ hdr->heap_len_size = MIN(hdr->man_dtable.max_dir_blk_off_size, - H5V_limit_enc_size((uint64_t)hdr->max_man_size)); + H5VM_limit_enc_size((uint64_t)hdr->max_man_size)); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1089,7 +1089,7 @@ H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) unsigned child_entry; /* Entry of child indirect block */ /* Compute # of rows needed in child indirect block */ - child_rows_needed = (H5V_log2_of2((uint32_t)min_dblock_size) - H5V_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size)) + 2; + child_rows_needed = (H5VM_log2_of2((uint32_t)min_dblock_size) - H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size)) + 2; HDassert(child_rows_needed > child_nrows); child_entry = (next_row + (child_rows_needed - child_nrows)) * hdr->man_dtable.cparam.width; if(child_entry > (iblock->nrows * hdr->man_dtable.cparam.width)) diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index 342e228..c989bfc 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -38,7 +38,7 @@ #include "H5Fprivate.h" /* File access */ #include "H5HFpkg.h" /* Fractal heaps */ #include "H5MFprivate.h" /* File memory management */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ /* Local Macros */ @@ -409,7 +409,7 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si nrows = hdr->man_dtable.cparam.start_root_rows; - block_row_off = H5V_log2_of2((uint32_t)min_dblock_size) - H5V_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size); + block_row_off = H5VM_log2_of2((uint32_t)min_dblock_size) - H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size); if(block_row_off > 0) block_row_off++; /* Account for the pair of initial rows of the initial block size */ rows_needed = 1 + block_row_off; @@ -730,7 +730,7 @@ H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id) max_child_row = iblock->max_child / hdr->man_dtable.cparam.width; /* Compute new # of rows in root indirect block */ - new_nrows = 1 << (1 + H5V_log2_gen((uint64_t)max_child_row)); + new_nrows = 1 << (1 + H5VM_log2_gen((uint64_t)max_child_row)); /* Check if the indirect block is NOT currently allocated in temp. file space */ /* (temp. file space does not need to be freed) */ @@ -1662,10 +1662,10 @@ H5HF_man_iblock_size(H5F_t *f, hid_t dxpl_id, H5HF_hdr_t *hdr, haddr_t iblock_ad size_t u; /* Local index variable */ entry = hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width; - first_row_bits = H5V_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + - H5V_log2_of2(hdr->man_dtable.cparam.width); + first_row_bits = H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) + + H5VM_log2_of2(hdr->man_dtable.cparam.width); num_indirect_rows = - (H5V_log2_gen(hdr->man_dtable.row_block_size[hdr->man_dtable.max_direct_rows]) - first_row_bits) + 1; + (H5VM_log2_gen(hdr->man_dtable.row_block_size[hdr->man_dtable.max_direct_rows]) - first_row_bits) + 1; for(u = hdr->man_dtable.max_direct_rows; u < iblock->nrows; u++, num_indirect_rows++) { size_t v; /* Local index variable */ diff --git a/src/H5HFiter.c b/src/H5HFiter.c index 0f2f7a4..137d0ee 100644 --- a/src/H5HFiter.c +++ b/src/H5HFiter.c @@ -36,7 +36,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5HFpkg.h" /* Fractal heaps */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ /* Local Macros */ @@ -213,7 +213,7 @@ H5HF_man_iter_start_offset(H5HF_hdr_t *hdr, hid_t dxpl_id, /* Compute # of rows in context indirect block */ child_size = hdr->man_dtable.row_block_size[biter->curr->up->row]; - iblock_nrows = (H5V_log2_gen(child_size) - hdr->man_dtable.first_row_bits) + 1; + iblock_nrows = (H5VM_log2_gen(child_size) - hdr->man_dtable.first_row_bits) + 1; } /* end else */ /* Load indirect block for this context location */ diff --git a/src/H5HFman.c b/src/H5HFman.c index b43356f..58dab10 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -38,7 +38,7 @@ #include "H5HFpkg.h" /* Fractal heaps */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ /* Local Macros */ @@ -312,12 +312,14 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Decode the object offset within the heap & its length */ UINT64DECODE_VAR(id, obj_off, hdr->heap_off_size); UINT64DECODE_VAR(id, obj_len, hdr->heap_len_size); - HDassert(obj_off > 0); - HDassert(obj_len > 0); /* Check for bad offset or length */ + if(obj_off == 0) + HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "invalid fractal heap offset") if(obj_off > hdr->man_size) HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "fractal heap object offset too large") + if(obj_len == 0) + HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "invalid fractal heap object size") if(obj_len > hdr->man_dtable.cparam.max_direct_size) HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "fractal heap object size too large for direct block") if(obj_len > hdr->max_man_size) @@ -554,12 +556,14 @@ H5HF_man_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) /* Decode the object offset within the heap & it's length */ UINT64DECODE_VAR(id, obj_off, hdr->heap_off_size); UINT64DECODE_VAR(id, obj_len, hdr->heap_len_size); - HDassert(obj_off > 0); - HDassert(obj_len > 0); /* Check for bad offset or length */ + if(obj_off == 0) + HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "invalid fractal heap offset") if(obj_off > hdr->man_size) HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "fractal heap object offset too large") + if(obj_len == 0) + HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "invalid fractal heap object size") if(obj_len > hdr->man_dtable.cparam.max_direct_size) HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "fractal heap object size too large for direct block") if(obj_len > hdr->max_man_size) diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index 23b7c35..a17088b 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -136,7 +136,7 @@ /* Compute the # of bytes required to store an offset into a given buffer size */ #define H5HF_SIZEOF_OFFSET_BITS(b) (((b) + 7) / 8) -#define H5HF_SIZEOF_OFFSET_LEN(l) H5HF_SIZEOF_OFFSET_BITS(H5V_log2_of2((unsigned)(l))) +#define H5HF_SIZEOF_OFFSET_LEN(l) H5HF_SIZEOF_OFFSET_BITS(H5VM_log2_of2((unsigned)(l))) /* Heap ID bit flags */ /* Heap ID version (2 bits: 6-7) */ diff --git a/src/H5HFsection.c b/src/H5HFsection.c index 794d36c..d78114e 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -34,7 +34,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5HFpkg.h" /* Fractal heaps */ #include "H5MMprivate.h" /* Memory management */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ /* Local Macros */ diff --git a/src/H5HGdbg.c b/src/H5HGdbg.c index 74044cb..16d8c49 100644 --- a/src/H5HGdbg.c +++ b/src/H5HGdbg.c @@ -91,9 +91,8 @@ H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, unsigned u, nused, maxobj; unsigned j, k; H5HG_heap_t *h = NULL; - char buf[64]; uint8_t *p = NULL; - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -107,66 +106,69 @@ H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, if(NULL == (h = H5HG_protect(f, dxpl_id, addr, H5AC_READ))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap collection"); - fprintf(stream, "%*sGlobal Heap Collection...\n", indent, ""); - fprintf(stream, "%*s%-*s %d\n", indent, "", fwidth, + HDfprintf(stream, "%*sGlobal Heap Collection...\n", indent, ""); + HDfprintf(stream, "%*s%-*s %d\n", indent, "", fwidth, "Dirty:", (int)(h->cache_info.is_dirty)); - fprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, "Total collection size in file:", (unsigned long)(h->size)); - for (u=1, nused=0, maxobj=0; u<h->nused; u++) { - if (h->obj[u].begin) { + for(u = 1, nused = 0, maxobj = 0; u < h->nused; u++) + if(h->obj[u].begin) { nused++; - if (u>maxobj) maxobj = u; + if (u>maxobj) + maxobj = u; } - } - fprintf (stream, "%*s%-*s %u/%lu/", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %u/%lu/", indent, "", fwidth, "Objects defined/allocated/max:", - nused, (unsigned long)h->nalloc); + nused, + (unsigned long)h->nalloc); if(nused) - fprintf(stream, "%u\n", maxobj); + HDfprintf(stream, "%u\n", maxobj); else - fprintf(stream, "NA\n"); + HDfprintf(stream, "NA\n"); - fprintf (stream, "%*s%-*s %lu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, "Free space:", (unsigned long)(h->obj[0].size)); - for (u=1; u<h->nused; u++) { - if (h->obj[u].begin) { - sprintf (buf, "Object %u", u); - fprintf (stream, "%*s%s\n", indent, "", buf); - fprintf (stream, "%*s%-*s %lu\n", indent+3, "", MIN(fwidth-3, 0), + for(u = 1; u < h->nused; u++) + if(h->obj[u].begin) { + char buf[64]; + + HDsnprintf(buf, sizeof(buf), "Object %u", u); + HDfprintf(stream, "%*s%s\n", indent, "", buf); + HDfprintf(stream, "%*s%-*s %lu\n", indent + 3, "", MIN(fwidth - 3, 0), "Obffset in block:", (unsigned long)(h->obj[u].begin - h->chunk)); - fprintf (stream, "%*s%-*s %d\n", indent+3, "", MIN(fwidth-3, 0), + HDfprintf(stream, "%*s%-*s %d\n", indent + 3, "", MIN(fwidth - 3, 0), "Reference count:", h->obj[u].nrefs); - fprintf (stream, "%*s%-*s %lu/%lu\n", indent+3, "", - MIN(fwidth-3, 0), + HDfprintf(stream, "%*s%-*s %lu/%lu\n", indent + 3, "", + MIN(fwidth - 3, 0), "Size of object body:", (unsigned long)(h->obj[u].size), (unsigned long)H5HG_ALIGN(h->obj[u].size)); - p = h->obj[u].begin + H5HG_SIZEOF_OBJHDR (f); - for (j=0; j<h->obj[u].size; j+=16) { - fprintf (stream, "%*s%04u: ", indent+6, "", j); - for (k=0; k<16; k++) { - if (8==k) fprintf (stream, " "); - if (j+k<h->obj[u].size) { - fprintf (stream, "%02x ", p[j+k]); - } else { + p = h->obj[u].begin + H5HG_SIZEOF_OBJHDR(f); + for(j = 0; j < h->obj[u].size; j += 16) { + HDfprintf(stream, "%*s%04u: ", indent + 6, "", j); + for(k = 0; k < 16; k++) { + if(8 == k) + HDfprintf(stream, " "); + if(j + k < h->obj[u].size) + HDfprintf(stream, "%02x ", p[j + k]); + else HDfputs(" ", stream); - } } - for (k=0; k<16 && j+k<h->obj[u].size; k++) { - if (8==k) fprintf (stream, " "); - HDfputc(p[j+k]>' ' && p[j+k]<='~' ? p[j+k] : '.', stream); + for(k = 0; k < 16 && j + k < h->obj[u].size; k++) { + if(8 == k) + HDfprintf(stream, " "); + HDfputc(p[j + k]>' ' && p[j + k] <= '~' ? p[j + k] : '.', stream); } - fprintf (stream, "\n"); + HDfprintf(stream, "\n"); } } - } done: if (h && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, addr, h, H5AC__NO_FLAGS_SET) < 0) diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c index 29d5c82..4ac22b8 100644 --- a/src/H5HLdbg.c +++ b/src/H5HLdbg.c @@ -54,8 +54,8 @@ herr_t H5HL_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int fwidth) { H5HL_t *h = NULL; - int i, overlap, free_block; - H5HL_free_t *freelist = NULL; + int free_block; + H5HL_free_t *freelist; uint8_t *marker = NULL; size_t amount_free = 0; herr_t ret_value = SUCCEED; /* Return value */ @@ -72,8 +72,8 @@ H5HL_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int if(NULL == (h = (H5HL_t *)H5HL_protect(f, dxpl_id, addr, H5AC_READ))) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load heap") - fprintf(stream, "%*sLocal Heap...\n", indent, ""); - fprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, + HDfprintf(stream, "%*sLocal Heap...\n", indent, ""); + HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, "Header size (in bytes):", (unsigned long)h->prfx_size); HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, @@ -90,34 +90,36 @@ H5HL_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int if(NULL == (marker = (uint8_t *)H5MM_calloc(h->dblk_size))) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "memory allocation failed") - fprintf(stream, "%*sFree Blocks (offset, size):\n", indent, ""); - + HDfprintf(stream, "%*sFree Blocks (offset, size):\n", indent, ""); for(free_block = 0, freelist = h->freelist; freelist; freelist = freelist->next, free_block++) { char temp_str[32]; - sprintf(temp_str,"Block #%d:",free_block); + HDsnprintf(temp_str, sizeof(temp_str), "Block #%d:", free_block); HDfprintf(stream, "%*s%-*s %8Zu, %8Zu\n", indent+3, "", MAX(0,fwidth-9), temp_str, freelist->offset, freelist->size); if((freelist->offset + freelist->size) > h->dblk_size) - fprintf(stream, "***THAT FREE BLOCK IS OUT OF BOUNDS!\n"); + HDfprintf(stream, "***THAT FREE BLOCK IS OUT OF BOUNDS!\n"); else { - for(i = overlap = 0; i < (int)(freelist->size); i++) { + int overlap = 0; + size_t i; + + for(i = 0; i < freelist->size; i++) { if(marker[freelist->offset + i]) overlap++; marker[freelist->offset + i] = 1; } /* end for */ if(overlap) - fprintf(stream, "***THAT FREE BLOCK OVERLAPPED A PREVIOUS ONE!\n"); + HDfprintf(stream, "***THAT FREE BLOCK OVERLAPPED A PREVIOUS ONE!\n"); else amount_free += freelist->size; } /* end for */ } /* end for */ if(h->dblk_size) - fprintf(stream, "%*s%-*s %.2f%%\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %.2f%%\n", indent, "", fwidth, "Percent of heap used:", - (100.0 * (double)(h->dblk_size - amount_free) / (double)h->dblk_size)); + ((double)100.0f * (double)(h->dblk_size - amount_free) / (double)h->dblk_size)); /* * Print the data in a VMS-style octal dump. diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index a1245ba..a5302e0 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -208,6 +208,7 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, char *parent_group_name = NULL;/* Temporary pointer to group name */ char local_group_name[H5L_EXT_TRAVERSE_BUF_SIZE]; /* Local buffer to hold group name */ char *temp_file_name = NULL; /* Temporary pointer to file name */ + size_t temp_file_name_len; /* Length of temporary file name */ char *actual_file_name = NULL; /* Parent file's actual name */ H5P_genplist_t *fa_plist; /* File access property list pointer */ H5F_close_degree_t fc_degree = H5F_CLOSE_WEAK; /* File close degree for target file */ @@ -312,6 +313,7 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, /* Copy the file name to use */ if(NULL == (temp_file_name = H5MM_strdup(file_name))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + temp_file_name_len = HDstrlen(temp_file_name); /* target file_name is an absolute pathname: see RM for detailed description */ if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) { @@ -329,7 +331,8 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, ptr++; /* Copy into the temp. file name */ - HDstrncpy(temp_file_name, ptr, HDstrlen(ptr) + 1); + HDstrncpy(temp_file_name, ptr, temp_file_name_len); + temp_file_name[temp_file_name_len - 1] = '\0'; } /* end if */ } /* end if */ else if(H5_CHECK_ABS_DRIVE(file_name)) { @@ -339,7 +342,8 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, H5E_clear_stack(NULL); /* strip "<drive-letter>:" */ - HDstrncpy(temp_file_name, &file_name[2], (HDstrlen(file_name) - 2) + 1); + HDstrncpy(temp_file_name, &file_name[2], temp_file_name_len); + temp_file_name[temp_file_name_len - 1] = '\0'; } /* end if */ } /* end if */ @@ -579,9 +583,9 @@ H5Lcreate_external(const char *file_name, const char *obj_name, /* Encode the external link information */ p = (uint8_t *)ext_link_buf; *p++ = (H5L_EXT_VERSION << 4) | H5L_EXT_FLAGS_ALL; /* External link version & flags */ - HDstrncpy((char *)p, file_name, file_name_len); /* Name of file containing external link's object */ + HDstrncpy((char *)p, file_name, buf_size - 1); /* Name of file containing external link's object */ p += file_name_len; - HDstrncpy((char *)p, norm_obj_name, norm_obj_name_len); /* External link's object */ + HDstrncpy((char *)p, norm_obj_name, buf_size - (file_name_len + 1)); /* External link's object */ /* Create an external link */ if(H5L_create_ud(&link_loc, link_name, ext_link_buf, buf_size, H5L_TYPE_EXTERNAL, lcpl_id, lapl_id, H5AC_dxpl_id) < 0) @@ -39,7 +39,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ #include "H5MFpkg.h" /* File memory management */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ @@ -301,7 +301,7 @@ H5MF_alloc_create(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type) fs_create.client = H5FS_CLIENT_FILE_ID; fs_create.shrink_percent = H5MF_FSPACE_SHRINK; fs_create.expand_percent = H5MF_FSPACE_EXPAND; - fs_create.max_sect_addr = 1 + H5V_log2_gen((uint64_t)f->shared->maxaddr); + fs_create.max_sect_addr = 1 + H5VM_log2_gen((uint64_t)f->shared->maxaddr); fs_create.max_sect_size = f->shared->maxaddr; if(NULL == (f->shared->fs_man[type] = H5FS_create(f, dxpl_id, NULL, diff --git a/src/H5Oattr.c b/src/H5Oattr.c index b8e6b32..2269bd3 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -793,7 +793,7 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in { const H5A_t *mesg = (const H5A_t *)_mesg; const char *s; /* Temporary string pointer */ - char buf[256]; /* Temporary string buffer */ + char buf[128]; /* Temporary string buffer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -804,7 +804,7 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in HDassert(indent >= 0); HDassert(fwidth >= 0); - fprintf(stream, "%*s%-*s \"%s\"\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s \"%s\"\n", indent, "", fwidth, "Name:", mesg->shared->name); switch(mesg->shared->encoding) { @@ -830,17 +830,17 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in case H5T_CSET_RESERVED_13: case H5T_CSET_RESERVED_14: case H5T_CSET_RESERVED_15: - sprintf(buf, "H5T_CSET_RESERVED_%d", (int)(mesg->shared->encoding)); + HDsnprintf(buf, sizeof(buf), "H5T_CSET_RESERVED_%d", (int)(mesg->shared->encoding)); s = buf; break; case H5T_CSET_ERROR: default: - sprintf(buf, "Unknown character set: %d", (int)(mesg->shared->encoding)); + HDsnprintf(buf, sizeof(buf), "Unknown character set: %d", (int)(mesg->shared->encoding)); s = buf; break; } /* end switch */ - fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Character Set of Name:", s); HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, @@ -856,18 +856,18 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in "Creation Index:", (unsigned)mesg->shared->crt_idx); - fprintf(stream, "%*sDatatype...\n", indent, ""); - fprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX(0,fwidth-3), + HDfprintf(stream, "%*sDatatype...\n", indent, ""); + HDfprintf(stream, "%*s%-*s %lu\n", indent + 3, "", MAX(0,fwidth - 3), "Encoded Size:", (unsigned long)(mesg->shared->dt_size)); if((H5O_MSG_DTYPE->debug)(f, dxpl_id, mesg->shared->dt, stream, indent + 3, MAX(0, fwidth - 3)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to display datatype message info") - fprintf(stream, "%*sDataspace...\n", indent, ""); - fprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX(0, fwidth - 3), + HDfprintf(stream, "%*sDataspace...\n", indent, ""); + HDfprintf(stream, "%*s%-*s %lu\n", indent + 3, "", MAX(0, fwidth - 3), "Encoded Size:", (unsigned long)(mesg->shared->ds_size)); - if(H5S_debug(f, dxpl_id, mesg->shared->ds, stream, indent+3, MAX(0, fwidth - 3)) < 0) + if(H5S_debug(f, dxpl_id, mesg->shared->ds, stream, indent + 3, MAX(0, fwidth - 3)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to display dataspace message info") done: diff --git a/src/H5Odtype.c b/src/H5Odtype.c index b482115..cb6bf98 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -25,7 +25,7 @@ #include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ #include "H5Tpkg.h" /* Datatypes */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /* PRIVATE PROTOTYPES */ @@ -266,7 +266,7 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p unsigned j; /* Compute the # of bytes required to store a member offset */ - offset_nbytes = H5V_limit_enc_size((uint64_t)dt->shared->size); + offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size); /* * Compound datatypes... @@ -891,7 +891,7 @@ H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt) unsigned offset_nbytes; /* Size needed to encode member offsets */ /* Compute the # of bytes required to store a member offset */ - offset_nbytes = H5V_limit_enc_size((uint64_t)dt->shared->size); + offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size); /* * Compound datatypes... @@ -1262,7 +1262,7 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg) unsigned offset_nbytes; /* Size needed to encode member offsets */ /* Compute the # of bytes required to store a member offset */ - offset_nbytes = H5V_limit_enc_size((uint64_t)dt->shared->size); + offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size); /* Compute the total size needed to encode compound datatype */ for(u = 0; u < dt->shared->u.compnd.nmembs; u++) { diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 487b6f4..c6db7c3 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -545,7 +545,6 @@ H5O_efl_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * s int indent, int fwidth) { const H5O_efl_t *mesg = (const H5O_efl_t *) _mesg; - char buf[64]; size_t u; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -565,8 +564,10 @@ H5O_efl_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * s mesg->nused, mesg->nalloc); for(u = 0; u < mesg->nused; u++) { - sprintf (buf, "File %u", (unsigned)u); - HDfprintf (stream, "%*s%s:\n", indent, "", buf); + char buf[64]; + + HDsnprintf(buf, sizeof(buf), "File %u", (unsigned)u); + HDfprintf(stream, "%*s%s:\n", indent, "", buf); HDfprintf(stream, "%*s%-*s \"%s\"\n", indent+3, "", MAX (fwidth-3, 0), "Name:", @@ -576,11 +577,11 @@ H5O_efl_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * s "Name offset:", (unsigned long)(mesg->slot[u].name_offset)); - HDfprintf (stream, "%*s%-*s %lu\n", indent+3, "", MAX (fwidth-3, 0), + HDfprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX (fwidth-3, 0), "Offset of data in file:", (unsigned long)(mesg->slot[u].offset)); - HDfprintf (stream, "%*s%-*s %lu\n", indent+3, "", MAX (fwidth-3, 0), + HDfprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX (fwidth-3, 0), "Bytes reserved for data:", (unsigned long)(mesg->slot[u].size)); } /* end for */ diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 66c1757..e029da3 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -668,7 +668,7 @@ H5P__fill_value_enc(const void *value, void **_pp, size_t *size) /* Encode the size of a size_t */ enc_value = (uint64_t)dt_size; - enc_size = H5V_limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); /* Encode the size */ @@ -697,7 +697,7 @@ H5P__fill_value_enc(const void *value, void **_pp, size_t *size) if(H5T_encode(fill->type, NULL, &dt_size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode datatype") enc_value = (uint64_t)dt_size; - enc_size = H5V_limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); } *size += (1 + enc_size); *size += dt_size; @@ -873,7 +873,7 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) if(NULL != *pp) { /* Encode number of slots used */ enc_value = (uint64_t)efl->nused; - enc_size = H5V_limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -883,7 +883,7 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) /* Calculate length of slot name and encode it */ len = HDstrlen(efl->slot[u].name) + 1; enc_value = (uint64_t)len; - enc_size = H5V_limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -894,14 +894,14 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) /* Encode offset */ enc_value = (uint64_t)efl->slot[u].offset; - enc_size = H5V_limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); /* encode size */ enc_value = (uint64_t)efl->slot[u].size; - enc_size = H5V_limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -909,13 +909,13 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) } /* end if */ /* Calculate size needed for encoding */ - *size += (1 + H5V_limit_enc_size((uint64_t)efl->nused)); + *size += (1 + H5VM_limit_enc_size((uint64_t)efl->nused)); for(u = 0; u < efl->nused; u++) { len = HDstrlen(efl->slot[u].name) + 1; - *size += (1 + H5V_limit_enc_size((uint64_t)len)); + *size += (1 + H5VM_limit_enc_size((uint64_t)len)); *size += len; - *size += (1 + H5V_limit_enc_size((uint64_t)efl->slot[u].offset)); - *size += (1 + H5V_limit_enc_size((uint64_t)efl->slot[u].size)); + *size += (1 + H5VM_limit_enc_size((uint64_t)efl->slot[u].offset)); + *size += (1 + H5VM_limit_enc_size((uint64_t)efl->slot[u].size)); } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 552ea63..472700a 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -165,7 +165,7 @@ #define H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_DEF 0 #define H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_SIZE sizeof(hsize_t *) #define H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_DEF NULL -#define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_SIZE sizeof(size_t) +#define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_SIZE sizeof(uint32_t) #define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_DEF 0 /******************/ @@ -267,7 +267,7 @@ static const void *H5D_def_xfer_xform_g = H5D_XFER_XFORM_DEF; /* Defaul static const hbool_t H5D_def_direct_chunk_flag_g = H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_DEF; /* Default value for the flag of direct chunk write */ static const uint32_t H5D_def_direct_chunk_filters_g = H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_DEF; /* Default value for the filters of direct chunk write */ static const hsize_t *H5D_def_direct_chunk_offset_g = H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_DEF; /* Default value for the offset of direct chunk write */ -static const size_t H5D_def_direct_chunk_datasize_g = H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_DEF; /* Default value for the datasize of direct chunk write */ +static const uint32_t H5D_def_direct_chunk_datasize_g = H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_DEF; /* Default value for the datasize of direct chunk write */ /*------------------------------------------------------------------------- @@ -681,7 +681,7 @@ H5P__dxfr_xform_enc(const void *value, void **_pp, size_t *size) /* encode the length of the prefix */ enc_value = (uint64_t)len; - enc_size = H5V_limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -698,7 +698,7 @@ H5P__dxfr_xform_enc(const void *value, void **_pp, size_t *size) } /* end if */ /* Size of encoded data transform */ - *size += (1 + H5V_limit_enc_size((uint64_t)len)); + *size += (1 + H5VM_limit_enc_size((uint64_t)len)); if(NULL != pexp) *size += len; @@ -1493,8 +1493,9 @@ H5Pset_btree_ratios(hid_t plist_id, double left, double middle, H5TRACE4("e", "iddd", plist_id, left, middle, right); /* Check arguments */ - if(left < 0.0 || left > 1.0 || middle < 0.0 || middle > 1.0 || - right < 0.0 || right > 1.0) + if(left < (double)0.0f || left > (double)1.0f + || middle < (double)0.0f || middle > (double)1.0f + || right < (double)0.0f || right > (double)1.0f) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "split ratio must satisfy 0.0<=X<=1.0") /* Get the plist structure */ diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c index ff148b0..0c70c6c 100644 --- a/src/H5Pencdec.c +++ b/src/H5Pencdec.c @@ -118,7 +118,7 @@ H5P__encode_size_t(const void *value, void **_pp, size_t *size) { uint64_t enc_value = (uint64_t)*(const size_t *)value; /* Property value to encode */ uint8_t **pp = (uint8_t **)_pp; - unsigned enc_size = H5V_limit_enc_size(enc_value); /* Size of encoded property */ + unsigned enc_size = H5VM_limit_enc_size(enc_value); /* Size of encoded property */ FUNC_ENTER_PACKAGE_NOERR @@ -159,7 +159,7 @@ herr_t H5P__encode_hsize_t(const void *value, void **_pp, size_t *size) { uint64_t enc_value = (uint64_t)*(const hsize_t *)value; /* Property value to encode */ - unsigned enc_size = H5V_limit_enc_size(enc_value); /* Size of encoded property */ + unsigned enc_size = H5VM_limit_enc_size(enc_value); /* Size of encoded property */ uint8_t **pp = (uint8_t **)_pp; FUNC_ENTER_PACKAGE_NOERR diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 6955a60..a4c09e5 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -2606,7 +2606,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_UNSIGNED(*pp, config->set_initial_size); enc_value = (uint64_t)config->initial_size; - enc_size = H5V_limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -2614,13 +2614,13 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_DOUBLE(*pp, config->min_clean_fraction); enc_value = (uint64_t)config->max_size; - enc_size = H5V_limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); enc_value = (uint64_t)config->min_size; - enc_size = H5V_limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -2638,7 +2638,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_UNSIGNED(*pp, config->apply_max_increment); enc_value = (uint64_t)config->max_increment; - enc_size = H5V_limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -2660,7 +2660,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) H5_ENCODE_UNSIGNED(*pp, config->apply_max_decrement); enc_value = (uint64_t)config->max_decrement; - enc_size = H5V_limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -2681,15 +2681,15 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) /* Compute encoded size of variably-encoded values */ enc_value = (uint64_t)config->initial_size; - *size += 1 + H5V_limit_enc_size(enc_value); + *size += 1 + H5VM_limit_enc_size(enc_value); enc_value = (uint64_t)config->max_size; - *size += 1 + H5V_limit_enc_size(enc_value); + *size += 1 + H5VM_limit_enc_size(enc_value); enc_value = (uint64_t)config->min_size; - *size += 1 + H5V_limit_enc_size(enc_value); + *size += 1 + H5VM_limit_enc_size(enc_value); enc_value = (uint64_t)config->max_increment; - *size += 1 + H5V_limit_enc_size(enc_value); + *size += 1 + H5VM_limit_enc_size(enc_value); enc_value = (uint64_t)config->max_decrement; - *size += 1 + H5V_limit_enc_size(enc_value); + *size += 1 + H5VM_limit_enc_size(enc_value); /* Compute encoded size of fixed-size values */ *size += (5 + (sizeof(unsigned) * 8) + (sizeof(double) * 8) + diff --git a/src/H5Plapl.c b/src/H5Plapl.c index aa02546..676b574 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -514,7 +514,7 @@ H5P_lacc_elink_pref_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(elink_pref); enc_value = (uint64_t)len; - enc_size = H5V_limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); if(NULL != *pp) { diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index 32f6a1b..df4ebb6 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -1495,7 +1495,7 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* encode nused value */ enc_value = (uint64_t)pline->nused; - enc_size = H5V_limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1525,7 +1525,7 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* encode cd_nelmts */ enc_value = (uint64_t)pline->filter[u].cd_nelmts; - enc_size = H5V_limit_enc_size(enc_value); + enc_size = H5VM_limit_enc_size(enc_value); HDassert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1538,12 +1538,12 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* calculate size required for encoding */ *size += 1; - *size += (1 + H5V_limit_enc_size((uint64_t)pline->nused)); + *size += (1 + H5VM_limit_enc_size((uint64_t)pline->nused)); for(u = 0; u < pline->nused; u++) { *size += (sizeof(int32_t) + sizeof(unsigned) + 1); if(NULL != pline->filter[u].name) *size += H5Z_COMMON_NAME_LEN; - *size += (1 + H5V_limit_enc_size((uint64_t)pline->filter[u].cd_nelmts)); + *size += (1 + H5VM_limit_enc_size((uint64_t)pline->filter[u].cd_nelmts)); *size += pline->filter[u].cd_nelmts * sizeof(unsigned); } /* end for */ @@ -894,7 +894,6 @@ H5R_get_name(H5F_t *f, hid_t lapl_id, hid_t dxpl_id, hid_t id, H5R_type_t ref_ty /* Check args */ HDassert(f); HDassert(_ref); - HDassert(name); /* Initialize the object location */ H5O_loc_reset(&oloc); @@ -965,8 +964,10 @@ done: object that the dataset is located within. H5R_type_t ref_type; IN: Type of reference void *ref; IN: Reference to query. - char *name; OUT: Buffer to place name of object referenced - size_t size; IN: Size of name buffer + char *name; OUT: Buffer to place name of object referenced. If NULL + then this call will return the size in bytes of name. + size_t size; IN: Size of name buffer (user needs to include NULL terminator + when passing in the size) RETURNS Non-negative length of the path on success, Negative on failure @@ -978,6 +979,12 @@ done: This may not be the only path to that object. EXAMPLES REVISION LOG + M. Scot Breitenfeld + 22 January 2014 + Changed the behavior for the returned value of the function when name is NULL. + If name is NULL then size is ignored and the function returns the size + of the name buffer (not including the NULL terminator), it still returns + negative on failure. --------------------------------------------------------------------------*/ ssize_t H5Rget_name(hid_t id, H5R_type_t ref_type, const void *_ref, char *name, diff --git a/src/H5Sall.c b/src/H5Sall.c index 19d1efc..24caad2 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -27,7 +27,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* ID Functions */ #include "H5Spkg.h" /* Dataspace functions */ -#include "H5Vprivate.h" /* Vector functions */ +#include "H5VMprivate.h" /* Vector functions */ /* Static function prototypes */ @@ -162,7 +162,7 @@ H5S_all_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords) HDassert (coords); /* Calculate the coordinates for the current iterator offset */ - if(H5V_array_calc(iter->u.all.elmt_offset,iter->rank,iter->dims,coords)<0) + if(H5VM_array_calc(iter->u.all.elmt_offset,iter->rank,iter->dims,coords)<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve coordinates"); done: diff --git a/src/H5Shyper.c b/src/H5Shyper.c index f8d87e4..c97c9b6 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -28,7 +28,7 @@ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* ID Functions */ #include "H5Spkg.h" /* Dataspace functions */ -#include "H5Vprivate.h" /* Vector functions */ +#include "H5VMprivate.h" /* Vector functions */ /* Local datatypes */ @@ -464,7 +464,7 @@ H5S_hyper_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords) HDassert(v >= 0); /* Compute the coords for the flattened dimensions */ - H5V_array_calc(iter->u.hyp.off[v], (unsigned)((begin - u) + 1), &(iter->dims[u]), &(coords[u])); + H5VM_array_calc(iter->u.hyp.off[v], (unsigned)((begin - u) + 1), &(iter->dims[u]), &(coords[u])); /* Continue to faster dimension in both indices */ u--; @@ -4102,7 +4102,7 @@ H5S_hyper_project_scalar(const H5S_t *space, hsize_t *offset) } /* end else */ /* Calculate offset of selection in projected buffer */ - *offset = H5V_array_offset(space->extent.rank, space->extent.size, block); + *offset = H5VM_array_offset(space->extent.rank, space->extent.size, block); done: FUNC_LEAVE_NOAPI(ret_value) @@ -4294,7 +4294,7 @@ H5S_hyper_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *off HDmemset(block, 0, sizeof(block)); for(u = 0; u < (base_space->extent.rank - new_space->extent.rank); u++) block[u] = opt_diminfo[u].start; - *offset = H5V_array_offset(base_space->extent.rank, base_space->extent.size, block); + *offset = H5VM_array_offset(base_space->extent.rank, base_space->extent.size, block); /* Set the correct dimensions for the base & new spaces */ base_space_dim = base_space->extent.rank - new_space->extent.rank; @@ -4377,7 +4377,7 @@ H5S_hyper_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *off } /* end while */ /* Compute the offset for the down-projection */ - *offset = H5V_array_offset(base_space->extent.rank, base_space->extent.size, block); + *offset = H5VM_array_offset(base_space->extent.rank, base_space->extent.size, block); /* Project the base space's selection down in less dimensions */ if(H5S_hyper_project_simple_lower(base_space, new_space) < 0) diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 868a00f..284e16f 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -35,7 +35,7 @@ #include "H5Oprivate.h" /* Object headers */ #include "H5Pprivate.h" /* Property lists */ #include "H5Spkg.h" /* Dataspaces */ -#include "H5Vprivate.h" /* Vector and array functions */ +#include "H5VMprivate.h" /* Vector and array functions */ #ifdef H5_HAVE_PARALLEL @@ -43,6 +43,14 @@ static herr_t H5S_mpio_all_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int *count, hbool_t *is_derived_type); static herr_t H5S_mpio_none_type(MPI_Datatype *new_type, int *count, hbool_t *is_derived_type); +static herr_t H5S_mpio_create_point_datatype(size_t elmt_size, hsize_t num_points, + MPI_Aint *disp, MPI_Datatype *new_type); +static herr_t H5S_mpio_point_type(const H5S_t *space, size_t elmt_size, + MPI_Datatype *new_type, int *count, hbool_t *is_derived_type, + hbool_t do_permute, hsize_t **permute_map, hbool_t *is_permuted); +static herr_t H5S_mpio_permute_type(const H5S_t *space, size_t elmt_size, + hsize_t **permute_map, MPI_Datatype *new_type, int *count, + hbool_t *is_derived_type); static herr_t H5S_mpio_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int *count, hbool_t *is_derived_type); static herr_t H5S_mpio_span_hyper_type(const H5S_t *space, size_t elmt_size, @@ -131,6 +139,335 @@ H5S_mpio_none_type(MPI_Datatype *new_type, int *count, hbool_t *is_derived_type) /*------------------------------------------------------------------------- + * Function: H5S_mpio_create_point_datatype + * + * Purpose: Create a derived datatype for point selections. + * + * Return: non-negative on success, negative on failure. + * + * Outputs: *new_type the MPI type corresponding to the selection + * + * Programmer: Mohamad Chaarawi + * + *------------------------------------------------------------------------- + */ +static herr_t +H5S_mpio_create_point_datatype (size_t elmt_size, hsize_t num_points, + MPI_Aint *disp, MPI_Datatype *new_type) +{ + MPI_Datatype elmt_type; /* MPI datatype for individual element */ + hbool_t elmt_type_created = FALSE; /* Whether the element MPI datatype was created */ + int mpi_code; /* MPI error code */ + int *blocks = NULL; /* Array of block sizes for MPI hindexed create call */ + hsize_t u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Create an MPI datatype for an element */ + if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)elmt_size, MPI_BYTE, &elmt_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + elmt_type_created = TRUE; + + /* Allocate block sizes for MPI datatype call */ + if(NULL == (blocks = (int *)H5MM_malloc(sizeof(int) * num_points))) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of blocks") + + /* Would be nice to have Create_Hindexed_block to avoid this array of all ones */ + for(u = 0; u < num_points; u++) + blocks[u] = 1; + + /* Create an MPI datatype for the whole point selection */ + if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)num_points, blocks, disp, elmt_type, new_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_indexed_block failed", mpi_code) + + /* Commit MPI datatype for later use */ + if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(new_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) + +done: + if(elmt_type_created) + MPI_Type_free(&elmt_type); + if(blocks) + H5MM_free(blocks); + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5S_mpio_create_point_datatype() */ + + +/*------------------------------------------------------------------------- + * Function: H5S_mpio_point_type + * + * Purpose: Translate an HDF5 "point" selection into an MPI type. + * Create a permutation array to handle out-of-order point selections. + * + * Return: non-negative on success, negative on failure. + * + * Outputs: *new_type the MPI type corresponding to the selection + * *count how many objects of the new_type in selection + * (useful if this is the buffer type for xfer) + * *is_derived_type 0 if MPI primitive type, 1 if derived + * *permute_map the permutation of the displacements to create + * the MPI_Datatype + * *is_permuted 0 if the displacements are permuted, 1 if not + * + * Programmer: Mohamad Chaarawi + * + *------------------------------------------------------------------------- + */ +static herr_t +H5S_mpio_point_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, + int *count, hbool_t *is_derived_type, hbool_t do_permute, hsize_t **permute, + hbool_t *is_permuted) +{ + MPI_Aint *disp = NULL; /* Datatype displacement for each point*/ + H5S_pnt_node_t *curr = NULL; /* Current point being operated on in from the selection */ + hssize_t snum_points; /* Signed number of elements in selection */ + hsize_t num_points; /* Sumber of points in the selection */ + hsize_t u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Check args */ + HDassert(space); + + /* Get the total number of points selected */ + if((snum_points = (hssize_t)H5S_GET_SELECT_NPOINTS(space)) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOUNT, FAIL, "can't get number of elements selected") + num_points = (hsize_t)snum_points; + + /* Allocate array for element displacements */ + if(NULL == (disp = (MPI_Aint *)H5MM_malloc(sizeof(MPI_Aint) * num_points))) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of displacements") + + /* Allocate array for element permutation - returned to caller */ + if(do_permute) + if(NULL == (*permute = (hsize_t *)H5MM_malloc(sizeof(hsize_t) * num_points))) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate permutation array") + + /* Iterate through list of elements */ + curr = space->select.sel_info.pnt_lst->head; + for(u = 0 ; u < num_points ; u++) { + /* calculate the displacement of the current point */ + disp[u] = H5VM_array_offset(space->extent.rank, space->extent.size, curr->pnt); + disp[u] *= elmt_size; + + /* This is a File Space used to set the file view, so adjust the displacements + * to have them monotonically non-decreasing. + * Generate the permutation array by indicating at each point being selected, + * the position it will shifted in the new displacement. Example: + * Suppose 4 points with corresponding are selected + * Pt 1: disp=6 ; Pt 2: disp=3 ; Pt 3: disp=0 ; Pt 4: disp=4 + * The permute map to sort the displacements in order will be: + * point 1: map[0] = L, indicating that this point is not moved (1st point selected) + * point 2: map[1] = 0, indicating that this point is moved to the first position, + * since disp_pt1(6) > disp_pt2(3) + * point 3: map[2] = 0, move to position 0, bec it has the lowest disp between + * the points selected so far. + * point 4: map[3] = 2, move the 2nd position since point 1 has a higher disp, + * but points 2 and 3 have lower displacements. + */ + if(do_permute) { + if(u > 0 && disp[u] < disp[u - 1]) { + unsigned s = 0, l = u, m = u / 2; + + *is_permuted = TRUE; + do { + if(disp[u] > disp[m]) + s = m + 1; + else if(disp[u] < disp[m]) + l = m; + else + break; + m = s + ((l - s) / 2); + } while(s < l); + + if(m < u) { + MPI_Aint temp; + + temp = disp[u]; + HDmemmove(disp + m + 1, disp + m, (u - m) * sizeof(MPI_Aint)); + disp[m] = temp; + } /* end if */ + (*permute)[u] = m; + } /* end if */ + else + (*permute)[u] = num_points; + } /* end if */ + /* this is a memory space, and no permutation is necessary to create + the derived datatype */ + else { + ;/* do nothing */ + } /* end else */ + + /* get the next point */ + curr = curr->next; + } /* end for */ + + /* Create the MPI datatype for the set of element displacements */ + if(H5S_mpio_create_point_datatype(elmt_size, num_points, disp, new_type) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create an MPI Datatype from point selection") + + /* Set values about MPI datatype created */ + *count = 1; + *is_derived_type = TRUE; + +done: + if(NULL != disp) + H5MM_free(disp); + + /* Release the permutation buffer, if it wasn't used */ + if(!(*is_permuted) && (*permute)) { + H5MM_free(*permute); + *permute = NULL; + } /* end if */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5S_mpio_point_type() */ + + +/*------------------------------------------------------------------------- + * Function: H5S_mpio_permute_type + * + * Purpose: Translate an HDF5 "all/hyper/point" selection into an MPI type, + * while applying the permutation map. This function is called if + * the file space selection is permuted due to out-of-order point + * selection and so the memory datatype has to be permuted using the + * permutation map created by the file selection. + * + * Note: This routine is called from H5S_mpio_space_type(), which is + * called first for the file dataspace and creates + * + * Return: non-negative on success, negative on failure. + * + * Outputs: *new_type the MPI type corresponding to the selection + * *count how many objects of the new_type in selection + * (useful if this is the buffer type for xfer) + * *is_derived_type 0 if MPI primitive type, 1 if derived + * + * Programmer: Mohamad Chaarawi + * + *------------------------------------------------------------------------- + */ +static herr_t +H5S_mpio_permute_type(const H5S_t *space, size_t elmt_size, hsize_t **permute, + MPI_Datatype *new_type, int *count, hbool_t *is_derived_type) +{ + MPI_Aint *disp = NULL; /* Datatype displacement for each point*/ + H5S_sel_iter_t sel_iter; /* Selection iteration info */ + hbool_t sel_iter_init = FALSE; /* Selection iteration info has been initialized */ + hsize_t off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */ + size_t len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */ + hssize_t snum_points; /* Signed number of elements in selection */ + hsize_t num_points; /* Number of points in the selection */ + size_t max_elem; /* Maximum number of elements allowed in sequences */ + hsize_t u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Check args */ + HDassert(space); + + /* Get the total number of points selected */ + if((snum_points = (hssize_t)H5S_GET_SELECT_NPOINTS(space)) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOUNT, FAIL, "can't get number of elements selected") + num_points = (hsize_t)snum_points; + + /* Allocate array to store point displacements */ + if(NULL == (disp = (MPI_Aint *)H5MM_malloc(sizeof(MPI_Aint) * num_points))) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of displacements") + + /* Initialize selection iterator */ + if(H5S_select_iter_init(&sel_iter, space, elmt_size) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator") + sel_iter_init = TRUE; /* Selection iteration info has been initialized */ + + /* Set the number of elements to iterate over */ + H5_ASSIGN_OVERFLOW(max_elem, num_points, hsize_t, size_t); + + /* Loop, while elements left in selection */ + u = 0; + while(max_elem > 0) { + hsize_t off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */ + size_t len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */ + size_t nelem; /* Number of elements used in sequences */ + size_t nseq; /* Number of sequences generated */ + size_t curr_seq; /* Current sequence being worked on */ + + /* Get the sequences of bytes */ + if(H5S_SELECT_GET_SEQ_LIST(space, 0, &sel_iter, (size_t)H5D_IO_VECTOR_SIZE, max_elem, &nseq, &nelem, off, len) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "sequence length generation failed") + + /* Loop, while sequences left to process */ + for(curr_seq = 0; curr_seq < nseq; curr_seq++) { + hsize_t curr_off; /* Current offset within sequence */ + size_t curr_len; /* Length of bytes left to process in sequence */ + + /* Get the current offset */ + curr_off = off[curr_seq]; + + /* Get the number of bytes in sequence */ + curr_len = len[curr_seq]; + + /* Loop, while bytes left in sequence */ + while(curr_len > 0) { + /* Set the displacement of the current point */ + disp[u] = curr_off; + + /* This is a memory displacement, so for each point selected, + * apply the map that was generated by the file selection */ + if((*permute)[u] != num_points) { + MPI_Aint temp = disp[u]; + + HDmemmove(disp + (*permute)[u] + 1, disp + (*permute)[u], + (u - (*permute)[u]) * sizeof(MPI_Aint)); + disp[(*permute)[u]] = temp; + } /* end if */ + + /* Advance to next element */ + u++; + + /* Increment offset in dataspace */ + curr_off += elmt_size; + + /* Decrement number of bytes left in sequence */ + curr_len -= elmt_size; + } /* end while */ + } /* end for */ + + /* Decrement number of elements left to process */ + max_elem -= nelem; + } /* end while */ + + /* Create the MPI datatype for the set of element displacements */ + if(H5S_mpio_create_point_datatype(elmt_size, num_points, disp, new_type) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create an MPI Datatype from point selection") + + /* Set values about MPI datatype created */ + *count = 1; + *is_derived_type = TRUE; + +done: + /* Release selection iterator */ + if(sel_iter_init) + if(H5S_SELECT_ITER_RELEASE(&sel_iter) < 0) + HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release selection iterator") + + /* Free memory */ + if(disp) + H5MM_free(disp); + if(*permute) { + H5MM_free(*permute); + *permute = NULL; + } /* end if */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5S_mpio_permute_type() */ + + +/*------------------------------------------------------------------------- * Function: H5S_mpio_hyper_type * * Purpose: Translate an HDF5 hyperslab selection into an MPI type. @@ -453,7 +790,7 @@ H5S_mpio_span_hyper_type(const H5S_t *space, size_t elmt_size, elmt_type_is_derived = TRUE; /* Compute 'down' sizes for each dimension */ - if(H5V_array_down(space->extent.rank, space->extent.size, down) < 0) + if(H5VM_array_down(space->extent.rank, space->extent.size, down) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGETSIZE, FAIL, "couldn't compute 'down' dimension sizes") /* Obtain derived data type */ @@ -478,7 +815,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5S_obtain datatype + * Function: H5S_obtain_datatype * * Purpose: Obtain an MPI derived datatype based on span-tree * implementation @@ -673,8 +1010,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5S_mpio_space_type(const H5S_t *space, size_t elmt_size, - MPI_Datatype *new_type, int *count, hbool_t *is_derived_type) +H5S_mpio_space_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, + int *count, hbool_t *is_derived_type, hbool_t do_permute, hsize_t **permute_map, + hbool_t *is_permuted) { herr_t ret_value = SUCCEED; /* Return value */ @@ -684,44 +1022,75 @@ H5S_mpio_space_type(const H5S_t *space, size_t elmt_size, HDassert(space); HDassert(elmt_size); - /* Creat MPI type based on the kind of selection */ + /* Create MPI type based on the kind of selection */ switch(H5S_GET_EXTENT_TYPE(space)) { case H5S_NULL: case H5S_SCALAR: case H5S_SIMPLE: - switch(H5S_GET_SELECT_TYPE(space)) { - case H5S_SEL_NONE: - if(H5S_mpio_none_type(new_type, count, is_derived_type) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert 'none' selection to MPI type") - break; - - case H5S_SEL_ALL: - if(H5S_mpio_all_type(space, elmt_size, new_type, count, is_derived_type) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert 'all' selection to MPI type") - break; - - case H5S_SEL_POINTS: - /* not yet implemented */ - ret_value = FAIL; - break; - - case H5S_SEL_HYPERSLABS: - if((H5S_SELECT_IS_REGULAR(space) == TRUE)) { - if(H5S_mpio_hyper_type(space, elmt_size, new_type, count, is_derived_type) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert regular 'hyperslab' selection to MPI type") - } /* end if */ - else { - if(H5S_mpio_span_hyper_type(space, elmt_size, new_type, count, is_derived_type) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert irregular 'hyperslab' selection to MPI type") - } /* end else */ - break; - - case H5S_SEL_ERROR: - case H5S_SEL_N: - default: - HDassert("unknown selection type" && 0); - break; - } /* end switch */ + /* If the file space has been permuted previously due to + * out-of-order point selection, then permute this selection which + * should be a memory selection to match the file space permutation. + */ + if(TRUE == *is_permuted) { + switch(H5S_GET_SELECT_TYPE(space)) { + case H5S_SEL_NONE: + if(H5S_mpio_none_type(new_type, count, is_derived_type) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't convert 'none' selection to MPI type") + break; + + case H5S_SEL_ALL: + case H5S_SEL_POINTS: + case H5S_SEL_HYPERSLABS: + /* Sanity check */ + HDassert(!do_permute); + + if(H5S_mpio_permute_type(space, elmt_size, permute_map, new_type, count, is_derived_type) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't convert 'all' selection to MPI type") + break; + + case H5S_SEL_ERROR: + case H5S_SEL_N: + default: + HDassert("unknown selection type" && 0); + break; + } /* end switch */ + } /* end if */ + /* the file space is not permuted, so do a regular selection */ + else { + switch(H5S_GET_SELECT_TYPE(space)) { + case H5S_SEL_NONE: + if(H5S_mpio_none_type(new_type, count, is_derived_type) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert 'none' selection to MPI type") + break; + + case H5S_SEL_ALL: + if(H5S_mpio_all_type(space, elmt_size, new_type, count, is_derived_type) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert 'all' selection to MPI type") + break; + + case H5S_SEL_POINTS: + if(H5S_mpio_point_type(space, elmt_size, new_type, count, is_derived_type, do_permute, permute_map, is_permuted) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't convert 'point' selection to MPI type") + break; + + case H5S_SEL_HYPERSLABS: + if((H5S_SELECT_IS_REGULAR(space) == TRUE)) { + if(H5S_mpio_hyper_type(space, elmt_size, new_type, count, is_derived_type) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert regular 'hyperslab' selection to MPI type") + } /* end if */ + else { + if(H5S_mpio_span_hyper_type(space, elmt_size, new_type, count, is_derived_type) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert irregular 'hyperslab' selection to MPI type") + } /* end else */ + break; + + case H5S_SEL_ERROR: + case H5S_SEL_N: + default: + HDassert("unknown selection type" && 0); + break; + } /* end switch */ + } /* end else */ break; case H5S_NO_CLASS: diff --git a/src/H5Snone.c b/src/H5Snone.c index 021dd61..3c5eccc 100644 --- a/src/H5Snone.c +++ b/src/H5Snone.c @@ -27,7 +27,7 @@ #include "H5Eprivate.h" #include "H5Iprivate.h" #include "H5Spkg.h" -#include "H5Vprivate.h" +#include "H5VMprivate.h" #include "H5Dprivate.h" /* Static function prototypes */ diff --git a/src/H5Spoint.c b/src/H5Spoint.c index b758a92..70842df 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -29,7 +29,7 @@ #include "H5Iprivate.h" /* ID Functions */ #include "H5MMprivate.h" /* Memory Management functions */ #include "H5Spkg.h" /* Dataspace functions */ -#include "H5Vprivate.h" /* Vector functions */ +#include "H5VMprivate.h" /* Vector functions */ /* Static function prototypes */ @@ -1383,7 +1383,7 @@ H5S_point_project_scalar(const H5S_t *space, hsize_t *offset) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "point selection of one element has more than one node!") /* Calculate offset of selection in projected buffer */ - *offset = H5V_array_offset(space->extent.rank, space->extent.size, node->pnt); + *offset = H5VM_array_offset(space->extent.rank, space->extent.size, node->pnt); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1437,7 +1437,7 @@ H5S_point_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *off /* Calculate offset of selection in projected buffer */ HDmemset(block, 0, sizeof(block)); HDmemcpy(block, base_space->select.sel_info.pnt_lst->head->pnt, sizeof(hsize_t) * rank_diff); - *offset = H5V_array_offset(base_space->extent.rank, base_space->extent.size, block); + *offset = H5VM_array_offset(base_space->extent.rank, base_space->extent.size, block); /* Iterate through base space's point nodes, copying the point information */ base_node = base_space->select.sel_info.pnt_lst->head; diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index 0e67af1..be8a28f 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -272,12 +272,13 @@ H5_DLL herr_t H5S_select_iter_release(H5S_sel_iter_t *sel_iter); /* (Defined in H5S.c) */ H5_DLLVAR hbool_t H5S_mpi_opt_types_g; -H5_DLL herr_t -H5S_mpio_space_type( const H5S_t *space, size_t elmt_size, - /* out: */ - MPI_Datatype *new_type, - int *count, - hbool_t *is_derived_type ); +H5_DLL herr_t H5S_mpio_space_type(const H5S_t *space, size_t elmt_size, + /* out: */ MPI_Datatype *new_type, + int *count, + hbool_t *is_derived_type, + hbool_t do_permute, + hsize_t **permute_map, + hbool_t * is_permuted); #endif /* H5_HAVE_PARALLEL */ #endif /* _H5Sprivate_H */ diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 1eb0cbc..2cb4b38 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -29,13 +29,13 @@ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Spkg.h" /* Dataspaces */ -#include "H5Vprivate.h" /* Vector and array functions */ +#include "H5VMprivate.h" /* Vector and array functions */ #include "H5WBprivate.h" /* Wrapped Buffers */ /* Local functions */ #ifdef LATER -static herr_t H5S_select_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end); -static htri_t H5S_select_iter_has_next_block (const H5S_sel_iter_t *iter); +static herr_t H5S_select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end); +static htri_t H5S_select_iter_has_next_block(const H5S_sel_iter_t *iter); static herr_t H5S_select_iter_next_block(H5S_sel_iter_t *iter); #endif /* LATER */ @@ -922,7 +922,7 @@ H5S_select_iter_init(H5S_sel_iter_t *sel_iter, const H5S_t *space, size_t elmt_s REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5S_select_iter_coords (const H5S_sel_iter_t *sel_iter, hsize_t *coords) +H5S_select_iter_coords(const H5S_sel_iter_t *sel_iter, hsize_t *coords) { herr_t ret_value; /* return value */ @@ -964,7 +964,7 @@ H5S_select_iter_coords (const H5S_sel_iter_t *sel_iter, hsize_t *coords) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_select_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) +H5S_select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) { herr_t ret_value; /* return value */ @@ -1004,7 +1004,7 @@ H5S_select_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) REVISION LOG --------------------------------------------------------------------------*/ hsize_t -H5S_select_iter_nelmts (const H5S_sel_iter_t *sel_iter) +H5S_select_iter_nelmts(const H5S_sel_iter_t *sel_iter) { hsize_t ret_value; /* return value */ @@ -1043,7 +1043,7 @@ H5S_select_iter_nelmts (const H5S_sel_iter_t *sel_iter) REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_select_iter_has_next_block (const H5S_sel_iter_t *iter) +H5S_select_iter_has_next_block(const H5S_sel_iter_t *iter) { herr_t ret_value; /* return value */ @@ -1217,24 +1217,13 @@ H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t H5T_t *dt; /* Datatype structure */ H5S_sel_iter_t iter; /* Selection iteration info */ hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */ - uint8_t *loc; /* Current element location in buffer */ - hsize_t coords[H5O_LAYOUT_NDIMS]; /* Coordinates of element in dataspace */ hssize_t nelmts; /* Number of elements in selection */ hsize_t space_size[H5O_LAYOUT_NDIMS]; /* Dataspace size */ - hsize_t off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */ - hsize_t curr_off; /* Current offset within sequence */ - hsize_t tmp_off; /* Temporary offset within sequence */ - size_t len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */ - size_t curr_len; /* Length of bytes left to process in sequence */ - size_t nseq; /* Number of sequences generated */ - size_t curr_seq; /* Current sequnce being worked on */ - size_t nelem; /* Number of elements used in sequences */ size_t max_elem; /* Maximum number of elements allowed in sequences */ size_t elmt_size; /* Datatype size */ unsigned ndims; /* Number of dimensions in dataspace */ - int i; /* Local Index variable */ - herr_t user_ret=0; /* User's return value */ - herr_t ret_value=SUCCEED; /* Return value */ + herr_t user_ret = 0; /* User's return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1274,12 +1263,21 @@ H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t /* Loop, while elements left in selection */ while(max_elem > 0 && user_ret == 0) { + hsize_t off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */ + size_t len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */ + size_t nelem; /* Number of elements used in sequences */ + size_t nseq; /* Number of sequences generated */ + size_t curr_seq; /* Current sequence being worked on */ + /* Get the sequences of bytes */ if(H5S_SELECT_GET_SEQ_LIST(space, 0, &iter, (size_t)H5D_IO_VECTOR_SIZE, max_elem, &nseq, &nelem, off, len) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "sequence length generation failed") /* Loop, while sequences left to process */ - for(curr_seq=0; curr_seq<nseq && user_ret==0; curr_seq++) { + for(curr_seq = 0; curr_seq < nseq && user_ret == 0; curr_seq++) { + hsize_t curr_off; /* Current offset within sequence */ + size_t curr_len; /* Length of bytes left to process in sequence */ + /* Get the current offset */ curr_off = off[curr_seq]; @@ -1288,6 +1286,11 @@ H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t /* Loop, while bytes left in sequence */ while(curr_len > 0 && user_ret == 0) { + hsize_t coords[H5O_LAYOUT_NDIMS]; /* Coordinates of element in dataspace */ + hsize_t tmp_off; /* Temporary offset within sequence */ + uint8_t *loc; /* Current element location in buffer */ + int i; /* Local Index variable */ + /* Compute the coordinate from the offset */ for(i = (int)ndims, tmp_off = curr_off; i >= 0; i--) { coords[i] = tmp_off % space_size[i]; @@ -1298,22 +1301,22 @@ H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t loc = (unsigned char *)buf + curr_off; /* Call user's callback routine */ - user_ret=(*op)(loc,type_id,ndims,coords,operator_data); + user_ret = (*op)(loc, type_id, ndims, coords, operator_data); /* Increment offset in dataspace */ - curr_off+=elmt_size; + curr_off += elmt_size; /* Decrement number of bytes left in sequence */ - curr_len-=elmt_size; + curr_len -= elmt_size; } /* end while */ } /* end for */ /* Decrement number of elements left to process */ - max_elem-=nelem; + max_elem -= nelem; } /* end while */ /* Set return value */ - ret_value=user_ret; + ret_value = user_ret; done: /* Release selection iterator */ @@ -1872,8 +1875,8 @@ H5S_select_construct_projection(const H5S_t *base_space, H5S_t **new_space_ptr, * and set the remaining dimensions to 1 */ rank_diff = new_space_rank - base_space_rank; - H5V_array_fill(new_space_dims, &tmp_dim_size, sizeof(tmp_dim_size), rank_diff); - H5V_array_fill(new_space_maxdims, &tmp_dim_size, sizeof(tmp_dim_size), rank_diff); + H5VM_array_fill(new_space_dims, &tmp_dim_size, sizeof(tmp_dim_size), rank_diff); + H5VM_array_fill(new_space_maxdims, &tmp_dim_size, sizeof(tmp_dim_size), rank_diff); HDmemcpy(&new_space_dims[rank_diff], base_space_dims, sizeof(new_space_dims[0]) * base_space_rank); HDmemcpy(&new_space_maxdims[rank_diff], base_space_maxdims, sizeof(new_space_maxdims[0]) * base_space_rank); } /* end if */ @@ -2038,7 +2041,7 @@ H5S_select_fill(const void *fill, size_t fill_size, const H5S_t *space, void *_b /* Fill each sequence in memory with fill value */ HDassert((len[curr_seq] % fill_size) == 0); - H5V_array_fill(buf, fill, fill_size, (len[curr_seq] / fill_size)); + H5VM_array_fill(buf, fill, fill_size, (len[curr_seq] / fill_size)); } /* end for */ /* Decrement number of elements left to process */ @@ -22,34 +22,34 @@ #include "H5private.h" #include "H5Eprivate.h" #include "H5Oprivate.h" -#include "H5Vprivate.h" +#include "H5VMprivate.h" /* Local typedefs */ -typedef struct H5V_memcpy_ud_t { +typedef struct H5VM_memcpy_ud_t { unsigned char *dst; /* Pointer to destination buffer */ const unsigned char *src; /* Pointer to source buffer */ -} H5V_memcpy_ud_t; +} H5VM_memcpy_ud_t; /* Local macros */ -#define H5V_HYPER_NDIMS H5O_LAYOUT_NDIMS +#define H5VM_HYPER_NDIMS H5O_LAYOUT_NDIMS /* Local prototypes */ static void -H5V_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, +H5VM_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, const hsize_t *size, hsize_t *stride1); static void -H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, +H5VM_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, const hsize_t *size, hsize_t *stride1, hsize_t *stride2); #ifdef LATER static void -H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size, +H5VM_stride_copy2(hsize_t nelmts, hsize_t elmt_size, unsigned dst_n, const hsize_t *dst_size, const ssize_t *dst_stride, void *_dst, unsigned src_n, const hsize_t *src_size, const ssize_t *src_stride, const void *_src); #endif /* LATER */ /*------------------------------------------------------------------------- - * Function: H5V_stride_optimize1 + * Function: H5VM_stride_optimize1 * * Purpose: Given a stride vector which references elements of the * specified size, optimize the dimensionality, the stride @@ -69,7 +69,7 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size, *------------------------------------------------------------------------- */ static void -H5V_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, +H5VM_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, const hsize_t *size, hsize_t *stride1) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -78,7 +78,7 @@ H5V_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, * This has to be true because if we optimize the dimensionality down to * zero we still must make one reference. */ - HDassert(1 == H5V_vector_reduce_product(0, NULL)); + HDassert(1 == H5VM_vector_reduce_product(0, NULL)); /* * Combine adjacent memory accesses @@ -95,7 +95,7 @@ H5V_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, /*------------------------------------------------------------------------- - * Function: H5V_stride_optimize2 + * Function: H5VM_stride_optimize2 * * Purpose: Given two stride vectors which reference elements of the * specified size, optimize the dimensionality, the stride @@ -118,7 +118,7 @@ H5V_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, *------------------------------------------------------------------------- */ static void -H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, +H5VM_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, const hsize_t *size, hsize_t *stride1, hsize_t *stride2) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -127,7 +127,7 @@ H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, * This has to be true because if we optimize the dimensionality down to * zero we still must make one reference. */ - HDassert(1 == H5V_vector_reduce_product(0, NULL)); + HDassert(1 == H5VM_vector_reduce_product(0, NULL)); HDassert(*elmt_size>0); /* @@ -224,7 +224,7 @@ H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, /*------------------------------------------------------------------------- - * Function: H5V_hyper_stride + * Function: H5VM_hyper_stride * * Purpose: Given a description of a hyperslab, this function returns * (through STRIDE[]) the byte strides appropriate for accessing @@ -256,7 +256,7 @@ H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, *------------------------------------------------------------------------- */ hsize_t -H5V_hyper_stride(unsigned n, const hsize_t *size, +H5VM_hyper_stride(unsigned n, const hsize_t *size, const hsize_t *total_size, const hsize_t *offset, hsize_t *stride/*out*/) { @@ -267,7 +267,7 @@ H5V_hyper_stride(unsigned n, const hsize_t *size, FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(n <= H5V_HYPER_NDIMS); + HDassert(n <= H5VM_HYPER_NDIMS); HDassert(size); HDassert(total_size); HDassert(stride); @@ -333,7 +333,7 @@ H5V_hyper_stride(unsigned n, const hsize_t *size, /*------------------------------------------------------------------------- - * Function: H5V_hyper_eq + * Function: H5VM_hyper_eq * * Purpose: Determines whether two hyperslabs are equal. This function * assumes that both hyperslabs are relative to the same array, @@ -356,7 +356,7 @@ H5V_hyper_stride(unsigned n, const hsize_t *size, *------------------------------------------------------------------------- */ htri_t -H5V_hyper_eq(unsigned n, +H5VM_hyper_eq(unsigned n, const hsize_t *offset1, const hsize_t *size1, const hsize_t *offset2, const hsize_t *size2) { @@ -386,7 +386,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5V_hyper_disjointp + * Function: H5VM_hyper_disjointp * * Purpose: Determines if two hyperslabs are disjoint. * @@ -404,7 +404,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5V_hyper_disjointp(unsigned n, +H5VM_hyper_disjointp(unsigned n, const hsize_t *offset1, const uint32_t *size1, const hsize_t *offset2, const uint32_t *size2) { @@ -432,11 +432,11 @@ H5V_hyper_disjointp(unsigned n, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5V_hyper_disjointp() */ +} /* end H5VM_hyper_disjointp() */ /*------------------------------------------------------------------------- - * Function: H5V_hyper_fill + * Function: H5VM_hyper_fill * * Purpose: Similar to memset() except it operates on hyperslabs... * @@ -457,13 +457,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5V_hyper_fill(unsigned n, const hsize_t *_size, +H5VM_hyper_fill(unsigned n, const hsize_t *_size, const hsize_t *total_size, const hsize_t *offset, void *_dst, unsigned fill_value) { uint8_t *dst = (uint8_t*)_dst; /*cast for ptr arithmetic */ - hsize_t size[H5V_HYPER_NDIMS]; /*a modifiable copy of _size */ - hsize_t dst_stride[H5V_HYPER_NDIMS]; /*destination stride info */ + hsize_t size[H5VM_HYPER_NDIMS]; /*a modifiable copy of _size */ + hsize_t dst_stride[H5VM_HYPER_NDIMS]; /*destination stride info */ hsize_t dst_start; /*byte offset to start of stride*/ hsize_t elmt_size = 1; /*bytes per element */ herr_t ret_value; /*function return status */ @@ -474,7 +474,7 @@ H5V_hyper_fill(unsigned n, const hsize_t *_size, FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - HDassert(n > 0 && n <= H5V_HYPER_NDIMS); + HDassert(n > 0 && n <= H5VM_HYPER_NDIMS); HDassert(_size); HDassert(total_size); HDassert(dst); @@ -486,14 +486,14 @@ H5V_hyper_fill(unsigned n, const hsize_t *_size, #endif /* Copy the size vector so we can modify it */ - H5V_vector_cpy(n, size, _size); + H5VM_vector_cpy(n, size, _size); /* Compute an optimal destination stride vector */ - dst_start = H5V_hyper_stride(n, size, total_size, offset, dst_stride); - H5V_stride_optimize1(&n, &elmt_size, size, dst_stride); + dst_start = H5VM_hyper_stride(n, size, total_size, offset, dst_stride); + H5VM_stride_optimize1(&n, &elmt_size, size, dst_stride); /* Copy */ - ret_value = H5V_stride_fill(n, elmt_size, size, dst_stride, dst+dst_start, + ret_value = H5VM_stride_fill(n, elmt_size, size, dst_stride, dst+dst_start, fill_value); FUNC_LEAVE_NOAPI(ret_value) @@ -501,7 +501,7 @@ H5V_hyper_fill(unsigned n, const hsize_t *_size, /*------------------------------------------------------------------------- - * Function: H5V_hyper_copy + * Function: H5VM_hyper_copy * * Purpose: Copies a hyperslab from the source to the destination. * @@ -535,7 +535,7 @@ H5V_hyper_fill(unsigned n, const hsize_t *_size, *------------------------------------------------------------------------- */ herr_t -H5V_hyper_copy(unsigned n, const hsize_t *_size, +H5VM_hyper_copy(unsigned n, const hsize_t *_size, /*destination*/ const hsize_t *dst_size, const hsize_t *dst_offset, @@ -547,9 +547,9 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, { const uint8_t *src = (const uint8_t*)_src; /*cast for ptr arithmtc */ uint8_t *dst = (uint8_t*) _dst; /*cast for ptr arithmtc */ - hsize_t size[H5V_HYPER_NDIMS]; /*a modifiable _size */ - hsize_t src_stride[H5V_HYPER_NDIMS]; /*source stride info */ - hsize_t dst_stride[H5V_HYPER_NDIMS]; /*dest stride info */ + hsize_t size[H5VM_HYPER_NDIMS]; /*a modifiable _size */ + hsize_t src_stride[H5VM_HYPER_NDIMS]; /*source stride info */ + hsize_t dst_stride[H5VM_HYPER_NDIMS]; /*dest stride info */ hsize_t dst_start, src_start; /*offset to start at */ hsize_t elmt_size = 1; /*element size in bytes */ herr_t ret_value; /*return status */ @@ -560,7 +560,7 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - HDassert(n > 0 && n <= H5V_HYPER_NDIMS); + HDassert(n > 0 && n <= H5VM_HYPER_NDIMS); HDassert(_size); HDassert(dst_size); HDassert(src_size); @@ -575,14 +575,14 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, #endif /* Copy the size vector so we can modify it */ - H5V_vector_cpy(n, size, _size); + H5VM_vector_cpy(n, size, _size); /* Compute stride vectors for source and destination */ #ifdef NO_INLINED_CODE - dst_start = H5V_hyper_stride(n, size, dst_size, dst_offset, dst_stride); - src_start = H5V_hyper_stride(n, size, src_size, src_offset, src_stride); + dst_start = H5VM_hyper_stride(n, size, dst_size, dst_offset, dst_stride); + src_start = H5VM_hyper_stride(n, size, src_size, src_offset, src_stride); #else /* NO_INLINED_CODE */ - /* in-line version of two calls to H5V_hyper_stride() */ + /* in-line version of two calls to H5VM_hyper_stride() */ { hsize_t dst_acc; /*accumulator */ hsize_t src_acc; /*accumulator */ @@ -675,10 +675,10 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, #endif /* NO_INLINED_CODE */ /* Optimize the strides as a pair */ - H5V_stride_optimize2(&n, &elmt_size, size, dst_stride, src_stride); + H5VM_stride_optimize2(&n, &elmt_size, size, dst_stride, src_stride); /* Perform the copy in terms of stride */ - ret_value = H5V_stride_copy(n, elmt_size, size, + ret_value = H5VM_stride_copy(n, elmt_size, size, dst_stride, dst+dst_start, src_stride, src+src_start); FUNC_LEAVE_NOAPI(ret_value) @@ -686,7 +686,7 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, /*------------------------------------------------------------------------- - * Function: H5V_stride_fill + * Function: H5VM_stride_fill * * Purpose: Fills all bytes of a hyperslab with the same value using * memset(). @@ -701,11 +701,11 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, *------------------------------------------------------------------------- */ herr_t -H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, +H5VM_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, const hsize_t *stride, void *_dst, unsigned fill_value) { uint8_t *dst = (uint8_t*)_dst; /*cast for ptr arithmetic */ - hsize_t idx[H5V_HYPER_NDIMS]; /*1-origin indices */ + hsize_t idx[H5VM_HYPER_NDIMS]; /*1-origin indices */ hsize_t nelmts; /*number of elements to fill */ hsize_t i; /*counter */ int j; /*counter */ @@ -715,8 +715,8 @@ H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, HDassert(elmt_size < SIZET_MAX); - H5V_vector_cpy(n, idx, size); - nelmts = H5V_vector_reduce_product(n, size); + H5VM_vector_cpy(n, idx, size); + nelmts = H5VM_vector_reduce_product(n, size); for (i=0; i<nelmts; i++) { /* Copy an element */ H5_CHECK_OVERFLOW(elmt_size,hsize_t,size_t); @@ -740,7 +740,7 @@ H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, /*------------------------------------------------------------------------- - * Function: H5V_stride_copy + * Function: H5VM_stride_copy * * Purpose: Uses DST_STRIDE and SRC_STRIDE to advance through the arrays * DST and SRC while copying bytes from SRC to DST. This @@ -749,7 +749,7 @@ H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, * outside the hyperslab defined by the strides. * * Note: If the src_stride is all zero and elmt_size is one, then it's - * probably more efficient to use H5V_stride_fill() instead. + * probably more efficient to use H5VM_stride_fill() instead. * * Return: Non-negative on success/Negative on failure * @@ -761,13 +761,13 @@ H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, *------------------------------------------------------------------------- */ herr_t -H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size, +H5VM_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size, const hsize_t *dst_stride, void *_dst, const hsize_t *src_stride, const void *_src) { uint8_t *dst = (uint8_t*)_dst; /*cast for ptr arithmetic*/ const uint8_t *src = (const uint8_t*) _src; /*cast for ptr arithmetic*/ - hsize_t idx[H5V_HYPER_NDIMS]; /*1-origin indices */ + hsize_t idx[H5VM_HYPER_NDIMS]; /*1-origin indices */ hsize_t nelmts; /*num elements to copy */ hsize_t i; /*counter */ int j; /*counters */ @@ -778,8 +778,8 @@ H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size, HDassert(elmt_size<SIZET_MAX); if (n) { - H5V_vector_cpy(n, idx, size); - nelmts = H5V_vector_reduce_product(n, size); + H5VM_vector_cpy(n, idx, size); + nelmts = H5VM_vector_reduce_product(n, size); for (i=0; i<nelmts; i++) { /* Copy an element */ @@ -809,7 +809,7 @@ H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size, /*------------------------------------------------------------------------- - * Function: H5V_stride_copy_s + * Function: H5VM_stride_copy_s * * Purpose: Uses DST_STRIDE and SRC_STRIDE to advance through the arrays * DST and SRC while copying bytes from SRC to DST. This @@ -818,7 +818,7 @@ H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size, * outside the hyperslab defined by the strides. * * Note: If the src_stride is all zero and elmt_size is one, then it's - * probably more efficient to use H5V_stride_fill() instead. + * probably more efficient to use H5VM_stride_fill() instead. * * Return: Non-negative on success/Negative on failure * @@ -830,13 +830,13 @@ H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size, *------------------------------------------------------------------------- */ herr_t -H5V_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, +H5VM_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, const hssize_t *dst_stride, void *_dst, const hssize_t *src_stride, const void *_src) { uint8_t *dst = (uint8_t*)_dst; /*cast for ptr arithmetic*/ const uint8_t *src = (const uint8_t*) _src; /*cast for ptr arithmetic*/ - hsize_t idx[H5V_HYPER_NDIMS]; /*1-origin indices */ + hsize_t idx[H5VM_HYPER_NDIMS]; /*1-origin indices */ hsize_t nelmts; /*num elements to copy */ hsize_t i; /*counter */ int j; /*counters */ @@ -847,8 +847,8 @@ H5V_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, HDassert(elmt_size<SIZET_MAX); if (n) { - H5V_vector_cpy(n, idx, size); - nelmts = H5V_vector_reduce_product(n, size); + H5VM_vector_cpy(n, idx, size); + nelmts = H5VM_vector_reduce_product(n, size); for (i=0; i<nelmts; i++) { /* Copy an element */ @@ -879,9 +879,9 @@ H5V_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, #ifdef LATER /*------------------------------------------------------------------------- - * Function: H5V_stride_copy2 + * Function: H5VM_stride_copy2 * - * Purpose: Similar to H5V_stride_copy() except the source and + * Purpose: Similar to H5VM_stride_copy() except the source and * destination each have their own dimensionality and size and * we copy exactly NELMTS elements each of size ELMT_SIZE. The * size counters wrap if NELMTS is more than a size counter. @@ -896,7 +896,7 @@ H5V_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, *------------------------------------------------------------------------- */ static void -H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size, +H5VM_stride_copy2(hsize_t nelmts, hsize_t elmt_size, /* destination */ unsigned dst_n, const hsize_t *dst_size, @@ -910,8 +910,8 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size, { uint8_t *dst = (uint8_t *) _dst; const uint8_t *src = (const uint8_t *) _src; - hsize_t dst_idx[H5V_HYPER_NDIMS]; - hsize_t src_idx[H5V_HYPER_NDIMS]; + hsize_t dst_idx[H5VM_HYPER_NDIMS]; + hsize_t src_idx[H5VM_HYPER_NDIMS]; hsize_t i; /* Local index variable */ int j; /* Local index variable */ hbool_t carry; @@ -922,8 +922,8 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size, HDassert(dst_n>0); HDassert(src_n>0); - H5V_vector_cpy(dst_n, dst_idx, dst_size); - H5V_vector_cpy(src_n, src_idx, src_size); + H5VM_vector_cpy(dst_n, dst_idx, dst_size); + H5VM_vector_cpy(src_n, src_idx, src_size); for (i=0; i<nelmts; i++) { @@ -958,7 +958,7 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size, /*------------------------------------------------------------------------- - * Function: H5V_array_fill + * Function: H5VM_array_fill * * Purpose: Fills all bytes of an array with the same value using * memset(). Increases amount copied by power of two until the @@ -974,7 +974,7 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size, *------------------------------------------------------------------------- */ herr_t -H5V_array_fill(void *_dst, const void *src, size_t size, size_t count) +H5VM_array_fill(void *_dst, const void *src, size_t size, size_t count) { size_t copy_size; /* size of the buffer to copy */ size_t copy_items; /* number of items currently copying*/ @@ -1010,11 +1010,11 @@ H5V_array_fill(void *_dst, const void *src, size_t size, size_t count) HDmemcpy(dst, _dst, items_left * size); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5V_array_fill() */ +} /* H5VM_array_fill() */ /*------------------------------------------------------------------------- - * Function: H5V_array_down + * Function: H5VM_array_down * * Purpose: Given a set of dimension sizes, calculate the size of each * "down" slice. This is the size of the dimensions for all the @@ -1031,14 +1031,14 @@ H5V_array_fill(void *_dst, const void *src, size_t size, size_t count) *------------------------------------------------------------------------- */ herr_t -H5V_array_down(unsigned n, const hsize_t *total_size, hsize_t *down) +H5VM_array_down(unsigned n, const hsize_t *total_size, hsize_t *down) { hsize_t acc; /*accumulator */ int i; /*counter */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(n <= H5V_HYPER_NDIMS); + HDassert(n <= H5VM_HYPER_NDIMS); HDassert(total_size); HDassert(down); @@ -1050,11 +1050,11 @@ H5V_array_down(unsigned n, const hsize_t *total_size, hsize_t *down) } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5V_array_down() */ +} /* end H5VM_array_down() */ /*------------------------------------------------------------------------- - * Function: H5V_array_offset_pre + * Function: H5VM_array_offset_pre * * Purpose: Given a coordinate description of a location in an array, this * function returns the byte offset of the coordinate. @@ -1077,14 +1077,14 @@ H5V_array_down(unsigned n, const hsize_t *total_size, hsize_t *down) *------------------------------------------------------------------------- */ hsize_t -H5V_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset) +H5VM_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset) { int i; /*counter */ hsize_t ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(n <= H5V_HYPER_NDIMS); + HDassert(n <= H5VM_HYPER_NDIMS); HDassert(acc); HDassert(offset); @@ -1093,11 +1093,11 @@ H5V_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset) ret_value += acc[i] * offset[i]; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5V_array_offset_pre() */ +} /* end H5VM_array_offset_pre() */ /*------------------------------------------------------------------------- - * Function: H5V_array_offset + * Function: H5VM_array_offset * * Purpose: Given a coordinate description of a location in an array, this * function returns the byte offset of the coordinate. @@ -1117,31 +1117,31 @@ H5V_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset) *------------------------------------------------------------------------- */ hsize_t -H5V_array_offset(unsigned n, const hsize_t *total_size, const hsize_t *offset) +H5VM_array_offset(unsigned n, const hsize_t *total_size, const hsize_t *offset) { - hsize_t acc_arr[H5V_HYPER_NDIMS]; /* Accumulated size of down dimensions */ + hsize_t acc_arr[H5VM_HYPER_NDIMS]; /* Accumulated size of down dimensions */ hsize_t ret_value; /* Return value */ FUNC_ENTER_NOAPI((HDabort(), 0)) /*lint !e527 Don't worry about unreachable statement */ - HDassert(n <= H5V_HYPER_NDIMS); + HDassert(n <= H5VM_HYPER_NDIMS); HDassert(total_size); HDassert(offset); /* Build the sizes of each dimension in the array */ - if(H5V_array_down(n,total_size,acc_arr)<0) + if(H5VM_array_down(n,total_size,acc_arr)<0) HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, UFAIL, "can't compute down sizes") /* Set return value */ - ret_value=H5V_array_offset_pre(n,acc_arr,offset); + ret_value=H5VM_array_offset_pre(n,acc_arr,offset); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5V_array_offset() */ +} /* end H5VM_array_offset() */ /*------------------------------------------------------------------------- - * Function: H5V_array_calc_pre + * Function: H5VM_array_calc_pre * * Purpose: Given a linear offset in an array, the dimensions of that * array and the pre-computed 'down' (accumulator) sizes, this @@ -1159,7 +1159,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5V_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down, +H5VM_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down, hsize_t *coords) { unsigned u; /* Local index variable */ @@ -1167,7 +1167,7 @@ H5V_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down, FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(n <= H5V_HYPER_NDIMS); + HDassert(n <= H5VM_HYPER_NDIMS); HDassert(coords); /* Compute the coordinates from the offset */ @@ -1177,11 +1177,11 @@ H5V_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down, } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5V_array_calc_pre() */ +} /* end H5VM_array_calc_pre() */ /*------------------------------------------------------------------------- - * Function: H5V_array_calc + * Function: H5VM_array_calc * * Purpose: Given a linear offset in an array and the dimensions of that * array, this function computes the coordinates of that offset @@ -1201,33 +1201,33 @@ H5V_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down, *------------------------------------------------------------------------- */ herr_t -H5V_array_calc(hsize_t offset, unsigned n, const hsize_t *total_size, hsize_t *coords) +H5VM_array_calc(hsize_t offset, unsigned n, const hsize_t *total_size, hsize_t *coords) { - hsize_t idx[H5V_HYPER_NDIMS]; /* Size of each dimension in bytes */ + hsize_t idx[H5VM_HYPER_NDIMS]; /* Size of each dimension in bytes */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(n <= H5V_HYPER_NDIMS); + HDassert(n <= H5VM_HYPER_NDIMS); HDassert(total_size); HDassert(coords); /* Build the sizes of each dimension in the array */ - if(H5V_array_down(n, total_size, idx) < 0) + if(H5VM_array_down(n, total_size, idx) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, FAIL, "can't compute down sizes") /* Compute the coordinates from the offset */ - if(H5V_array_calc_pre(offset, n, idx, coords) < 0) + if(H5VM_array_calc_pre(offset, n, idx, coords) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, FAIL, "can't compute coordinates") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5V_array_calc() */ +} /* end H5VM_array_calc() */ /*------------------------------------------------------------------------- - * Function: H5V_chunk_index + * Function: H5VM_chunk_index * * Purpose: Given a coordinate offset (COORD), the size of each chunk * (CHUNK), the number of chunks in each dimension (NCHUNKS) @@ -1269,16 +1269,16 @@ done: *------------------------------------------------------------------------- */ herr_t -H5V_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, +H5VM_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, const hsize_t *down_nchunks, hsize_t *chunk_idx) { - hsize_t scaled_coord[H5V_HYPER_NDIMS]; /* Scaled, coordinates, in terms of chunks */ + hsize_t scaled_coord[H5VM_HYPER_NDIMS]; /* Scaled, coordinates, in terms of chunks */ unsigned u; /* Local index variable */ FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(ndims <= H5V_HYPER_NDIMS); + HDassert(ndims <= H5VM_HYPER_NDIMS); HDassert(coord); HDassert(chunk); HDassert(chunk_idx); @@ -1288,14 +1288,14 @@ H5V_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, scaled_coord[u]=coord[u]/chunk[u]; /* Compute the chunk index */ - *chunk_idx=H5V_array_offset_pre(ndims,down_nchunks,scaled_coord); /*lint !e772 scaled_coord will always be initialized */ + *chunk_idx=H5VM_array_offset_pre(ndims,down_nchunks,scaled_coord); /*lint !e772 scaled_coord will always be initialized */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5V_chunk_index() */ +} /* end H5VM_chunk_index() */ /*------------------------------------------------------------------------- - * Function: H5V_opvv + * Function: H5VM_opvv * * Purpose: Perform an operation on a source & destination sequences * of offset/length pairs. Each set of sequnces has an array @@ -1307,7 +1307,7 @@ H5V_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, * source or destination sequence runs out of information. * * Note: The algorithm in this routine is [basically] the same as for - * H5V_memcpyvv(). Changes should be made to both! + * H5VM_memcpyvv(). Changes should be made to both! * * Return: Non-negative # of bytes operated on, on success/Negative on failure * @@ -1317,11 +1317,11 @@ H5V_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, *------------------------------------------------------------------------- */ ssize_t -H5V_opvv(size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[], +H5VM_opvv(size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[], hsize_t dst_off_arr[], size_t src_max_nseq, size_t *src_curr_seq, size_t src_len_arr[], hsize_t src_off_arr[], - H5V_opvv_func_t op, void *op_data) + H5VM_opvv_func_t op, void *op_data) { hsize_t *max_dst_off_ptr, *max_src_off_ptr; /* Pointers to max. source and destination offset locations */ hsize_t *dst_off_ptr, *src_off_ptr; /* Pointers to source and destination offset arrays */ @@ -1497,11 +1497,11 @@ finished: done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5V_opvv() */ +} /* end H5VM_opvv() */ /*------------------------------------------------------------------------- - * Function: H5V_memcpyvv + * Function: H5VM_memcpyvv * * Purpose: Given source and destination buffers in memory (SRC & DST) * copy sequences of from the source buffer into the destination @@ -1514,7 +1514,7 @@ done: * source or destination buffer runs out of sequence information. * * Note: The algorithm in this routine is [basically] the same as for - * H5V_opvv(). Changes should be made to both! + * H5VM_opvv(). Changes should be made to both! * * Return: Non-negative # of bytes copied on success/Negative on failure * @@ -1524,7 +1524,7 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5V_memcpyvv(void *_dst, +H5VM_memcpyvv(void *_dst, size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[], hsize_t dst_off_arr[], const void *_src, size_t src_max_nseq, size_t *src_curr_seq, size_t src_len_arr[], hsize_t src_off_arr[]) @@ -1708,5 +1708,5 @@ finished: *src_curr_seq = (size_t)(src_off_ptr - src_off_arr); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5V_memcpyvv() */ +} /* end H5VM_memcpyvv() */ diff --git a/src/H5Vprivate.h b/src/H5VMprivate.h index 5ce26a0..4706b5f 100644 --- a/src/H5Vprivate.h +++ b/src/H5VMprivate.h @@ -17,93 +17,93 @@ * Programmer: Robb Matzke <matzke@llnl.gov> * Friday, October 10, 1997 */ -#ifndef H5Vprivate_H -#define H5Vprivate_H +#ifndef H5VMprivate_H +#define H5VMprivate_H /* Private headers needed by this file */ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ /* Vector-Vector sequence operation callback */ -typedef herr_t (*H5V_opvv_func_t)(hsize_t dst_off, hsize_t src_off, +typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off, size_t len, void *udata); /* Vector comparison functions like Fortran66 comparison operators */ -#define H5V_vector_eq_s(N,V1,V2) (H5V_vector_cmp_s (N, V1, V2)==0) -#define H5V_vector_lt_s(N,V1,V2) (H5V_vector_cmp_s (N, V1, V2)<0) -#define H5V_vector_gt_s(N,V1,V2) (H5V_vector_cmp_s (N, V1, V2)>0) -#define H5V_vector_le_s(N,V1,V2) (H5V_vector_cmp_s (N, V1, V2)<=0) -#define H5V_vector_ge_s(N,V1,V2) (H5V_vector_cmp_s (N, V1, V2)>=0) -#define H5V_vector_eq_u(N,V1,V2) (H5V_vector_cmp_u (N, V1, V2)==0) -#define H5V_vector_lt_u(N,V1,V2) (H5V_vector_cmp_u (N, V1, V2)<0) -#define H5V_vector_gt_u(N,V1,V2) (H5V_vector_cmp_u (N, V1, V2)>0) -#define H5V_vector_le_u(N,V1,V2) (H5V_vector_cmp_u (N, V1, V2)<=0) -#define H5V_vector_ge_u(N,V1,V2) (H5V_vector_cmp_u (N, V1, V2)>=0) +#define H5VM_vector_eq_s(N,V1,V2) (H5VM_vector_cmp_s (N, V1, V2)==0) +#define H5VM_vector_lt_s(N,V1,V2) (H5VM_vector_cmp_s (N, V1, V2)<0) +#define H5VM_vector_gt_s(N,V1,V2) (H5VM_vector_cmp_s (N, V1, V2)>0) +#define H5VM_vector_le_s(N,V1,V2) (H5VM_vector_cmp_s (N, V1, V2)<=0) +#define H5VM_vector_ge_s(N,V1,V2) (H5VM_vector_cmp_s (N, V1, V2)>=0) +#define H5VM_vector_eq_u(N,V1,V2) (H5VM_vector_cmp_u (N, V1, V2)==0) +#define H5VM_vector_lt_u(N,V1,V2) (H5VM_vector_cmp_u (N, V1, V2)<0) +#define H5VM_vector_gt_u(N,V1,V2) (H5VM_vector_cmp_u (N, V1, V2)>0) +#define H5VM_vector_le_u(N,V1,V2) (H5VM_vector_cmp_u (N, V1, V2)<=0) +#define H5VM_vector_ge_u(N,V1,V2) (H5VM_vector_cmp_u (N, V1, V2)>=0) /* Other functions */ -#define H5V_vector_cpy(N,DST,SRC) { \ +#define H5VM_vector_cpy(N,DST,SRC) { \ HDassert(sizeof(*(DST))==sizeof(*(SRC))); \ if (SRC) HDmemcpy (DST, SRC, (N)*sizeof(*(DST))); \ else HDmemset (DST, 0, (N)*sizeof(*(DST))); \ } -#define H5V_vector_zero(N,DST) HDmemset(DST,0,(N)*sizeof(*(DST))) +#define H5VM_vector_zero(N,DST) HDmemset(DST,0,(N)*sizeof(*(DST))) /* A null pointer is equivalent to a zero vector */ -#define H5V_ZERO NULL +#define H5VM_ZERO NULL -H5_DLL hsize_t H5V_hyper_stride(unsigned n, const hsize_t *size, +H5_DLL hsize_t H5VM_hyper_stride(unsigned n, const hsize_t *size, const hsize_t *total_size, const hsize_t *offset, hsize_t *stride); -H5_DLL htri_t H5V_hyper_disjointp(unsigned n, const hsize_t *offset1, +H5_DLL htri_t H5VM_hyper_disjointp(unsigned n, const hsize_t *offset1, const uint32_t *size1, const hsize_t *offset2, const uint32_t *size2); -H5_DLL htri_t H5V_hyper_eq(unsigned n, const hsize_t *offset1, +H5_DLL htri_t H5VM_hyper_eq(unsigned n, const hsize_t *offset1, const hsize_t *size1, const hsize_t *offset2, const hsize_t *size2); -H5_DLL herr_t H5V_hyper_fill(unsigned n, const hsize_t *_size, +H5_DLL herr_t H5VM_hyper_fill(unsigned n, const hsize_t *_size, const hsize_t *total_size, const hsize_t *offset, void *_dst, unsigned fill_value); -H5_DLL herr_t H5V_hyper_copy(unsigned n, const hsize_t *size, +H5_DLL herr_t H5VM_hyper_copy(unsigned n, const hsize_t *size, const hsize_t *dst_total_size, const hsize_t *dst_offset, void *_dst, const hsize_t *src_total_size, const hsize_t *src_offset, const void *_src); -H5_DLL herr_t H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, +H5_DLL herr_t H5VM_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, const hsize_t *stride, void *_dst, unsigned fill_value); -H5_DLL herr_t H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *_size, +H5_DLL herr_t H5VM_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *_size, const hsize_t *dst_stride, void *_dst, const hsize_t *src_stride, const void *_src); -H5_DLL herr_t H5V_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *_size, +H5_DLL herr_t H5VM_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *_size, const hssize_t *dst_stride, void *_dst, const hssize_t *src_stride, const void *_src); -H5_DLL herr_t H5V_array_fill(void *_dst, const void *src, size_t size, +H5_DLL herr_t H5VM_array_fill(void *_dst, const void *src, size_t size, size_t count); -H5_DLL herr_t H5V_array_down(unsigned n, const hsize_t *total_size, +H5_DLL herr_t H5VM_array_down(unsigned n, const hsize_t *total_size, hsize_t *down); -H5_DLL hsize_t H5V_array_offset_pre(unsigned n, +H5_DLL hsize_t H5VM_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset); -H5_DLL hsize_t H5V_array_offset(unsigned n, const hsize_t *total_size, +H5_DLL hsize_t H5VM_array_offset(unsigned n, const hsize_t *total_size, const hsize_t *offset); -H5_DLL herr_t H5V_array_calc(hsize_t offset, unsigned n, +H5_DLL herr_t H5VM_array_calc(hsize_t offset, unsigned n, const hsize_t *total_size, hsize_t *coords); -H5_DLL herr_t H5V_chunk_index(unsigned ndims, const hsize_t *coord, +H5_DLL herr_t H5VM_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, const hsize_t *down_nchunks, hsize_t *chunk_idx); -H5_DLL ssize_t H5V_opvv(size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[], +H5_DLL ssize_t H5VM_opvv(size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[], hsize_t dst_off_arr[], size_t src_max_nseq, size_t *src_curr_seq, size_t src_len_arr[], hsize_t src_off_arr[], - H5V_opvv_func_t op, void *op_data); -H5_DLL ssize_t H5V_memcpyvv(void *_dst, + H5VM_opvv_func_t op, void *op_data); +H5_DLL ssize_t H5VM_memcpyvv(void *_dst, size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[], hsize_t dst_off_arr[], const void *_src, size_t src_max_nseq, size_t *src_curr_seq, size_t src_len_arr[], hsize_t src_off_arr[]); /*------------------------------------------------------------------------- - * Function: H5V_vector_reduce_product + * Function: H5VM_vector_reduce_product * * Purpose: Product reduction of a vector. Vector elements and return * value are size_t because we usually want the number of @@ -122,7 +122,7 @@ H5_DLL ssize_t H5V_memcpyvv(void *_dst, *------------------------------------------------------------------------- */ static H5_inline hsize_t UNUSED -H5V_vector_reduce_product(unsigned n, const hsize_t *v) +H5VM_vector_reduce_product(unsigned n, const hsize_t *v) { hsize_t ret_value = 1; @@ -137,7 +137,7 @@ done: } /*------------------------------------------------------------------------- - * Function: H5V_vector_zerop_u + * Function: H5VM_vector_zerop_u * * Purpose: Determines if all elements of a vector are zero. * @@ -154,7 +154,7 @@ done: *------------------------------------------------------------------------- */ static H5_inline htri_t UNUSED -H5V_vector_zerop_u(int n, const hsize_t *v) +H5VM_vector_zerop_u(int n, const hsize_t *v) { htri_t ret_value=TRUE; /* Return value */ @@ -172,7 +172,7 @@ done: } /*------------------------------------------------------------------------- - * Function: H5V_vector_zerop_s + * Function: H5VM_vector_zerop_s * * Purpose: Determines if all elements of a vector are zero. * @@ -189,7 +189,7 @@ done: *------------------------------------------------------------------------- */ static H5_inline htri_t UNUSED -H5V_vector_zerop_s(int n, const hssize_t *v) +H5VM_vector_zerop_s(int n, const hssize_t *v) { htri_t ret_value=TRUE; /* Return value */ @@ -207,7 +207,7 @@ done: } /*------------------------------------------------------------------------- - * Function: H5V_vector_cmp_u + * Function: H5VM_vector_cmp_u * * Purpose: Compares two vectors of the same size and determines if V1 is * lexicographically less than, equal, or greater than V2. @@ -226,7 +226,7 @@ done: *------------------------------------------------------------------------- */ static H5_inline int UNUSED -H5V_vector_cmp_u (unsigned n, const hsize_t *v1, const hsize_t *v2) +H5VM_vector_cmp_u (unsigned n, const hsize_t *v1, const hsize_t *v2) { int ret_value=0; /* Return value */ @@ -249,7 +249,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5V_vector_cmp_s + * Function: H5VM_vector_cmp_s * * Purpose: Compares two vectors of the same size and determines if V1 is * lexicographically less than, equal, or greater than V2. @@ -268,7 +268,7 @@ done: *------------------------------------------------------------------------- */ static H5_inline int UNUSED -H5V_vector_cmp_s (unsigned n, const hssize_t *v1, const hssize_t *v2) +H5VM_vector_cmp_s (unsigned n, const hssize_t *v1, const hssize_t *v2) { int ret_value=0; /* Return value */ @@ -291,7 +291,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5V_vector_inc + * Function: H5VM_vector_inc * * Purpose: Increments V1 by V2 * @@ -305,7 +305,7 @@ done: *------------------------------------------------------------------------- */ static H5_inline void UNUSED -H5V_vector_inc(int n, hsize_t *v1, const hsize_t *v2) +H5VM_vector_inc(int n, hsize_t *v1, const hsize_t *v2) { while (n--) *v1++ += *v2++; } @@ -333,7 +333,7 @@ static const unsigned char LogTable256[] = /*------------------------------------------------------------------------- - * Function: H5V_log2_gen + * Function: H5VM_log2_gen * * Purpose: Determines the log base two of a number (i.e. log2(n)). * (i.e. the highest bit set in a number) @@ -352,7 +352,7 @@ static const unsigned char LogTable256[] = *------------------------------------------------------------------------- */ static H5_inline unsigned UNUSED -H5V_log2_gen(uint64_t n) +H5VM_log2_gen(uint64_t n) { unsigned r; /* r will be log2(n) */ register unsigned int t, tt, ttt; /* temporaries */ @@ -379,7 +379,7 @@ H5V_log2_gen(uint64_t n) #endif /* H5_BAD_LOG2_CODE_GENERATED */ return(r); -} /* H5V_log2_gen() */ +} /* H5VM_log2_gen() */ /* Lookup table for specialized log2(n) of power of two routine */ @@ -391,7 +391,7 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = /*------------------------------------------------------------------------- - * Function: H5V_log2_of2 + * Function: H5VM_log2_of2 * * Purpose: Determines the log base two of a number (i.e. log2(n)). * (i.e. the highest bit set in a number) @@ -409,17 +409,17 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = *------------------------------------------------------------------------- */ static H5_inline unsigned UNUSED -H5V_log2_of2(uint32_t n) +H5VM_log2_of2(uint32_t n) { #ifndef NDEBUG HDassert(POWER_OF_TWO(n)); #endif /* NDEBUG */ return(MultiplyDeBruijnBitPosition[(n * (uint32_t)0x077CB531UL) >> 27]); -} /* H5V_log2_of2() */ +} /* H5VM_log2_of2() */ /*------------------------------------------------------------------------- - * Function: H5V_limit_enc_size + * Function: H5VM_limit_enc_size * * Purpose: Determine the # of bytes needed to encode values within a * range from 0 to a given limit @@ -432,17 +432,17 @@ H5V_log2_of2(uint32_t n) *------------------------------------------------------------------------- */ static H5_inline unsigned UNUSED -H5V_limit_enc_size(uint64_t limit) +H5VM_limit_enc_size(uint64_t limit) { - return (H5V_log2_gen(limit) / 8) + 1; -} /* end H5V_limit_enc_size() */ + return (H5VM_log2_gen(limit) / 8) + 1; +} /* end H5VM_limit_enc_size() */ -static const unsigned char H5V_bit_set_g[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; -static const unsigned char H5V_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE}; +static const unsigned char H5VM_bit_set_g[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; +static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE}; /*------------------------------------------------------------------------- - * Function: H5V_bit_get + * Function: H5VM_bit_get * * Purpose: Determine the value of the n'th bit in a buffer. * @@ -461,15 +461,15 @@ static const unsigned char H5V_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0 *------------------------------------------------------------------------- */ static H5_inline hbool_t UNUSED -H5V_bit_get(const unsigned char *buf, size_t offset) +H5VM_bit_get(const unsigned char *buf, size_t offset) { /* Test the appropriate bit in the buffer */ - return (hbool_t)((buf[offset / 8] & (H5V_bit_set_g[offset % 8])) ? TRUE : FALSE); -} /* end H5V_bit_get() */ + return (hbool_t)((buf[offset / 8] & (H5VM_bit_set_g[offset % 8])) ? TRUE : FALSE); +} /* end H5VM_bit_get() */ /*------------------------------------------------------------------------- - * Function: H5V_bit_set + * Function: H5VM_bit_set * * Purpose: Set/reset the n'th bit in a buffer. * @@ -488,14 +488,14 @@ H5V_bit_get(const unsigned char *buf, size_t offset) *------------------------------------------------------------------------- */ static H5_inline void UNUSED -H5V_bit_set(unsigned char *buf, size_t offset, hbool_t val) +H5VM_bit_set(unsigned char *buf, size_t offset, hbool_t val) { /* Set/reset the appropriate bit in the buffer */ if(val) - buf[offset / 8] |= H5V_bit_set_g[offset % 8]; + buf[offset / 8] |= H5VM_bit_set_g[offset % 8]; else - buf[offset / 8] &= H5V_bit_clear_g[offset % 8]; -} /* end H5V_bit_set() */ + buf[offset / 8] &= H5VM_bit_clear_g[offset % 8]; +} /* end H5VM_bit_set() */ -#endif /* H5Vprivate_H */ +#endif /* H5VMprivate_H */ @@ -664,7 +664,13 @@ H5Zfilter_avail(H5Z_filter_t id) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") if((ret_value = H5Z_filter_avail(id)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") + else if(ret_value == FALSE) { + const H5Z_class2_t *filter_info; + + if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) + ret_value = TRUE; + } /* end if */ done: FUNC_LEAVE_API(ret_value) @@ -1324,22 +1330,20 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, */ if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { hbool_t issue_error = FALSE; - - /* Check for "no plugins" indicated" */ - const H5Z_class2_t *filter_info; - - /* Try loading the filter */ - if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { - /* Register the filter we loaded */ - if(H5Z_register(filter_info) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") - - /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ - if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) - issue_error = TRUE; - } /* end if */ - else - issue_error = TRUE; + const H5Z_class2_t *filter_info; + + /* Try loading the filter */ + if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { + /* Register the filter we loaded */ + if(H5Z_register(filter_info) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") + + /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ + if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) + issue_error = TRUE; + } /* end if */ + else + issue_error = TRUE; /* Check for error */ if(issue_error) { diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index f9e7186..1b8c096 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -20,7 +20,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ -#include "H5Vprivate.h" /* H5V_array_fill */ +#include "H5VMprivate.h" /* H5VM_array_fill */ #include "H5Zpkg.h" /* Data filters */ @@ -292,7 +292,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); #define H5Z_XFORM_DO_OP5(TYPE, SIZE) \ { \ TYPE val = ((tree->type == H5Z_XFORM_INTEGER) ? (TYPE)tree->value.int_val : (TYPE)tree->value.float_val); \ - H5V_array_fill(array, &val, sizeof(TYPE), (SIZE)); \ + H5VM_array_fill(array, &val, sizeof(TYPE), (SIZE)); \ } /* The difference of this macro from H5Z_XFORM_DO_OP3 is that it handles the operations when the left operand is empty, like -x or +x. diff --git a/src/H5detect.c b/src/H5detect.c index 0f8d051..aed7514 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -332,7 +332,7 @@ precision (detected_t *d) if(_v1 != _v2) \ _pad_mask[_i] |= _byte_mask; \ _buf1[_i] ^= _byte_mask; \ - } /* enf for */ \ + } /* end for */ \ \ /* Byte Order */ \ for(_i = 0, _v1 = 0.0, _v2 = 1.0; _i < (int)sizeof(TYPE); _i++) { \ diff --git a/src/H5private.h b/src/H5private.h index 0e6ff1e..26ccf57 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -439,8 +439,8 @@ /* * Maximum & minimum values for our typedefs. */ -#define HSIZET_MAX ((hsize_t)ULLONG_MAX) -#define HSSIZET_MAX ((hssize_t)LLONG_MAX) +#define HSIZET_MAX ((hsize_t)ULLONG_MAX) +#define HSSIZET_MAX ((hssize_t)LLONG_MAX) #define HSSIZET_MIN (~(HSSIZET_MAX)) /* diff --git a/src/H5public.h b/src/H5public.h index 0138d01..544f7be 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 170 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 175 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.170" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.175" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/H5system.c b/src/H5system.c index 614b8b9..437a004 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -200,20 +200,28 @@ HDfprintf(FILE *stream, const char *fmt, ...) case 'H': if(sizeof(hsize_t) < sizeof(long)) modifier[0] = '\0'; - else if(sizeof(hsize_t) == sizeof(long)) - HDstrncpy(modifier, "l", (size_t)2); - else - HDstrncpy(modifier, H5_PRINTF_LL_WIDTH, HDstrlen(H5_PRINTF_LL_WIDTH) + 1); + else if(sizeof(hsize_t) == sizeof(long)) { + HDstrncpy(modifier, "l", sizeof(modifier)); + modifier[sizeof(modifier) - 1] = '\0'; + } /* end if */ + else { + HDstrncpy(modifier, H5_PRINTF_LL_WIDTH, sizeof(modifier)); + modifier[sizeof(modifier) - 1] = '\0'; + } /* end else */ break; case 'Z': case 'z': if(sizeof(size_t) < sizeof(long)) modifier[0] = '\0'; - else if(sizeof(size_t) == sizeof(long)) - HDstrncpy(modifier, "l", (size_t)2); - else - HDstrncpy(modifier, H5_PRINTF_LL_WIDTH, HDstrlen(H5_PRINTF_LL_WIDTH) + 1); + else if(sizeof(size_t) == sizeof(long)) { + HDstrncpy(modifier, "l", sizeof(modifier)); + modifier[sizeof(modifier) - 1] = '\0'; + } /* end if */ + else { + HDstrncpy(modifier, H5_PRINTF_LL_WIDTH, sizeof(modifier)); + modifier[sizeof(modifier) - 1] = '\0'; + } /* end else */ break; default: diff --git a/src/Makefile.am b/src/Makefile.am index f63a36e..6525211 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -104,7 +104,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5Tfloat.c H5Tinit.c H5Tnative.c H5Toffset.c H5Toh.c \ H5Topaque.c \ H5Torder.c \ - H5Tpad.c H5Tprecis.c H5Tstrpad.c H5Tvisit.c H5Tvlen.c H5TS.c H5V.c H5WB.c H5Z.c \ + H5Tpad.c H5Tprecis.c H5Tstrpad.c H5Tvisit.c H5Tvlen.c H5TS.c H5VM.c H5WB.c H5Z.c \ H5Zdeflate.c H5Zfletcher32.c H5Znbit.c H5Zshuffle.c H5Zszip.c \ H5Zscaleoffset.c H5Ztrans.c diff --git a/src/Makefile.in b/src/Makefile.in index 9032f02..5e9edab 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -169,7 +169,7 @@ am_libhdf5_la_OBJECTS = H5.lo H5checksum.lo H5dbg.lo H5system.lo \ H5Tfields.lo H5Tfixed.lo H5Tfloat.lo H5Tinit.lo H5Tnative.lo \ H5Toffset.lo H5Toh.lo H5Topaque.lo H5Torder.lo H5Tpad.lo \ H5Tprecis.lo H5Tstrpad.lo H5Tvisit.lo H5Tvlen.lo H5TS.lo \ - H5V.lo H5WB.lo H5Z.lo H5Zdeflate.lo H5Zfletcher32.lo \ + H5VM.lo H5WB.lo H5Z.lo H5Zdeflate.lo H5Zfletcher32.lo \ H5Znbit.lo H5Zshuffle.lo H5Zszip.lo H5Zscaleoffset.lo \ H5Ztrans.lo libhdf5_la_OBJECTS = $(am_libhdf5_la_OBJECTS) @@ -520,7 +520,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 160 +LT_VERS_REVISION = 165 LT_VERS_AGE = 0 # Our main target, the HDF5 library @@ -599,7 +599,7 @@ libhdf5_la_SOURCES = H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5Tfloat.c H5Tinit.c H5Tnative.c H5Toffset.c H5Toh.c \ H5Topaque.c \ H5Torder.c \ - H5Tpad.c H5Tprecis.c H5Tstrpad.c H5Tvisit.c H5Tvlen.c H5TS.c H5V.c H5WB.c H5Z.c \ + H5Tpad.c H5Tprecis.c H5Tstrpad.c H5Tvisit.c H5Tvlen.c H5TS.c H5VM.c H5WB.c H5Z.c \ H5Zdeflate.c H5Zfletcher32.c H5Znbit.c H5Zshuffle.c H5Zszip.c \ H5Zscaleoffset.c H5Ztrans.c @@ -998,7 +998,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Tvisit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Tvlen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5UC.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5V.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VM.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5WB.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Z.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Zdeflate.Plo@am__quote@ diff --git a/src/hdf5.lnt b/src/hdf5.lnt index 6865720..90af778 100644 --- a/src/hdf5.lnt +++ b/src/hdf5.lnt @@ -1,9 +1,9 @@ // Lint options shared by both PC-Lint for Windows and Flexelint for Linux // Turn off warnings about not using the inlined H5V* functions: --esym(528, H5V_vector_reduce_product, H5V_vector_inc) --esym(528, H5V_vector_cmp, H5V_vector_cmp_s, H5V_vector_cmp_u) --esym(528, H5V_vector_zerop_s, H5V_vector_zerop_u) +-esym(528, H5VM_vector_reduce_product, H5VM_vector_inc) +-esym(528, H5VM_vector_cmp, H5VM_vector_cmp_s, H5VM_vector_cmp_u) +-esym(528, H5VM_vector_zerop_s, H5VM_vector_zerop_u) // Suppress message about using 'goto' in a few functions -efunc(801,H5_term_library,H5_trace) @@ -34,7 +34,7 @@ -esym(534, H5I_clear_type, H5I_dec_type_ref) -esym(534, H5MM_xfree) -esym(534, H5UC_decr) --esym(534, H5V_array_fill) +-esym(534, H5VM_array_fill) // Turn off warnings about "Expression-like macro not parenthesized" for diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f41a5a1..b7f87b4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,47 +1,50 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TEST) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Generate the H5srcdir_str.h file containing user settings needed by compilation #----------------------------------------------------------------------------- -SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) -CONFIGURE_FILE (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) +set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) +configure_file (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) #----------------------------------------------------------------------------- # Define Test Library Sources #----------------------------------------------------------------------------- -SET (TEST_LIB_SRCS +set (TEST_LIB_SRCS ${HDF5_TEST_SOURCE_DIR}/h5test.c ${HDF5_TEST_SOURCE_DIR}/testframe.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c ) -SET (TEST_LIB_HEADERS +set (TEST_LIB_HEADERS ${HDF5_TEST_SOURCE_DIR}/h5test.h ) -ADD_LIBRARY (${HDF5_TEST_LIB_TARGET} ${LIB_TYPE} ${TEST_LIB_SRCS} ${TEST_LIB_HEADERS}) +add_library (${HDF5_TEST_LIB_TARGET} ${LIB_TYPE} ${TEST_LIB_SRCS} ${TEST_LIB_HEADERS}) TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} " " " ") -IF (MSVC) - TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} "ws2_32.lib") -ENDIF (MSVC) -IF (MINGW) - TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} "wsock32.lib") -ENDIF (MINGW) -TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) +if (MSVC) + target_link_libraries (${HDF5_TEST_LIB_TARGET} "ws2_32.lib") +endif (MSVC) +if (MINGW) + target_link_libraries (${HDF5_TEST_LIB_TARGET} "wsock32.lib") +endif (MINGW) +target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test) +set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES + FOLDER libraries/test + INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" +) #----------------------------------------------------------------------------- # If plugin library tests can be tested #----------------------------------------------------------------------------- -IF (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) # make plugins dir FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir1") FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir2") @@ -49,36 +52,36 @@ IF (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # Define Test Library Sources #----------------------------------------------------------------------------- - SET (TEST_PLUGIN_LIBS + set (TEST_PLUGIN_LIBS dynlib1 dynlib3 ) - SET (TEST2_PLUGIN_LIBS + set (TEST2_PLUGIN_LIBS dynlib2 ) - FOREACH (test_lib ${TEST_PLUGIN_LIBS}) - SET (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") - SET (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") - SET (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) - ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + foreach (test_lib ${TEST_PLUGIN_LIBS}) + set (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") + set (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") + set (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) + add_definitions (${HDF5_EXTRA_C_FLAGS}) INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - ADD_LIBRARY (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) + add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} " " " ") - TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + target_link_libraries (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS ( ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} ${LIB_TYPE} HDF5_TEST_PLUGIN_LIB_NAME_RELEASE HDF5_TEST_PLUGIN_LIB_NAME_DEBUG ) - SET_TARGET_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) + set_target_properties (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) #----------------------------------------------------------------------------- # Copy plugin library to a plugins folder #----------------------------------------------------------------------------- - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} @@ -86,30 +89,30 @@ IF (BUILD_SHARED_LIBS) "$<TARGET_FILE:${HDF5_TEST_PLUGIN_LIB_TARGET}>" "${CMAKE_BINARY_DIR}/testdir1/$<TARGET_FILE_NAME:${HDF5_TEST_PLUGIN_LIB_TARGET}>" ) - ENDFOREACH (test_lib ${TEST_PLUGIN_LIBS}) + endforeach (test_lib ${TEST_PLUGIN_LIBS}) - FOREACH (test_lib ${TEST2_PLUGIN_LIBS}) - SET (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") - SET (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") - SET (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) - ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + foreach (test_lib ${TEST2_PLUGIN_LIBS}) + set (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") + set (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") + set (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) + add_definitions (${HDF5_EXTRA_C_FLAGS}) INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - ADD_LIBRARY (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) + add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} " " " ") - TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + target_link_libraries (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS ( ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} ${LIB_TYPE} HDF5_TEST_PLUGIN_LIB_NAME_RELEASE HDF5_TEST_PLUGIN_LIB_NAME_DEBUG ) - SET_TARGET_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) + set_target_properties (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) #----------------------------------------------------------------------------- # Copy plugin library to a plugins folder #----------------------------------------------------------------------------- - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} @@ -117,10 +120,10 @@ IF (BUILD_SHARED_LIBS) "$<TARGET_FILE:${HDF5_TEST_PLUGIN_LIB_TARGET}>" "${CMAKE_BINARY_DIR}/testdir2/$<TARGET_FILE_NAME:${HDF5_TEST_PLUGIN_LIB_TARGET}>" ) - ENDFOREACH (test_lib ${TEST2_PLUGIN_LIBS}) -ENDIF (BUILD_SHARED_LIBS) + endforeach (test_lib ${TEST2_PLUGIN_LIBS}) +endif (BUILD_SHARED_LIBS) -SET (testhdf5_SRCS +set (testhdf5_SRCS ${HDF5_TEST_SOURCE_DIR}/testhdf5.c ${HDF5_TEST_SOURCE_DIR}/tarray.c ${HDF5_TEST_SOURCE_DIR}/tattr.c @@ -149,21 +152,21 @@ SET (testhdf5_SRCS ) #-- Adding test for testhdf5 -ADD_EXECUTABLE (testhdf5 ${testhdf5_SRCS}) +add_executable (testhdf5 ${testhdf5_SRCS}) TARGET_NAMING (testhdf5 ${LIB_TYPE}) TARGET_C_PROPERTIES (testhdf5 " " " ") -TARGET_LINK_LIBRARIES (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (testhdf5 PROPERTIES FOLDER test) +target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (testhdf5 PROPERTIES FOLDER test) MACRO (ADD_H5_EXE file) - ADD_EXECUTABLE (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) + add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} ${LIB_TYPE}) TARGET_C_PROPERTIES (${file} " " " ") - TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (${file} PROPERTIES FOLDER test) + target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (${file} PROPERTIES FOLDER test) ENDMACRO (ADD_H5_EXE file) -SET (H5_TESTS +set (H5_TESTS accum lheap ohdr @@ -178,6 +181,7 @@ SET (H5_TESTS bittests dt_arith dtypes + dsets cmpd_dset filter_fail extend @@ -220,9 +224,9 @@ SET (H5_TESTS unregister ) -FOREACH (test ${H5_TESTS}) +foreach (test ${H5_TESTS}) ADD_H5_EXE(${test}) -ENDFOREACH (test ${H5_TESTS}) +endforeach (test ${H5_TESTS}) ############################################################################## ############################################################################## @@ -231,28 +235,28 @@ ENDFOREACH (test ${H5_TESTS}) ############################################################################## #-- Adding test for cache -ADD_EXECUTABLE (cache ${HDF5_TEST_SOURCE_DIR}/cache.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) +add_executable (cache ${HDF5_TEST_SOURCE_DIR}/cache.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache ${LIB_TYPE}) TARGET_C_PROPERTIES (cache " " " ") -TARGET_LINK_LIBRARIES (cache ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (cache PROPERTIES FOLDER test) +target_link_libraries (cache ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (cache PROPERTIES FOLDER test) #-- Adding test for cache_api -ADD_EXECUTABLE (cache_api ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) +add_executable (cache_api ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache_api ${LIB_TYPE}) TARGET_C_PROPERTIES (cache_api " " " ") -TARGET_LINK_LIBRARIES (cache_api ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (cache_api PROPERTIES FOLDER test) +target_link_libraries (cache_api ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (cache_api PROPERTIES FOLDER test) #-- Adding test for cache_tagging -ADD_EXECUTABLE (cache_tagging ${HDF5_TEST_SOURCE_DIR}/cache_tagging.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) +add_executable (cache_tagging ${HDF5_TEST_SOURCE_DIR}/cache_tagging.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache_tagging ${LIB_TYPE}) TARGET_C_PROPERTIES (cache_tagging " " " ") -TARGET_LINK_LIBRARIES (cache_tagging ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (cache_tagging PROPERTIES FOLDER test) +target_link_libraries (cache_tagging ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (cache_tagging PROPERTIES FOLDER test) #-- Adding test for ttsafe -ADD_EXECUTABLE (ttsafe +add_executable (ttsafe ${HDF5_TEST_SOURCE_DIR}/ttsafe.c ${HDF5_TEST_SOURCE_DIR}/ttsafe_dcreate.c ${HDF5_TEST_SOURCE_DIR}/ttsafe_error.c @@ -261,53 +265,53 @@ ADD_EXECUTABLE (ttsafe ) TARGET_NAMING (ttsafe ${LIB_TYPE}) TARGET_C_PROPERTIES (ttsafe " " " ") -TARGET_LINK_LIBRARIES (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (ttsafe PROPERTIES FOLDER test) +target_link_libraries (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (ttsafe PROPERTIES FOLDER test) #-- Adding test for err_compat -IF (HDF5_ENABLE_DEPRECATED_SYMBOLS) - ADD_EXECUTABLE (err_compat ${HDF5_TEST_SOURCE_DIR}/err_compat.c) +if (HDF5_ENABLE_DEPRECATED_SYMBOLS) + add_executable (err_compat ${HDF5_TEST_SOURCE_DIR}/err_compat.c) TARGET_NAMING (err_compat ${LIB_TYPE}) TARGET_C_PROPERTIES (err_compat " " " ") - TARGET_LINK_LIBRARIES (err_compat ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (err_compat PROPERTIES FOLDER test) -ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS) + target_link_libraries (err_compat ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (err_compat PROPERTIES FOLDER test) +endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) #-- Adding test for error_test -ADD_EXECUTABLE (error_test ${HDF5_TEST_SOURCE_DIR}/error_test.c) +add_executable (error_test ${HDF5_TEST_SOURCE_DIR}/error_test.c) TARGET_NAMING (error_test ${LIB_TYPE}) TARGET_C_PROPERTIES (error_test " " " ") -TARGET_LINK_LIBRARIES (error_test ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (error_test PROPERTIES FOLDER test) +target_link_libraries (error_test ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (error_test PROPERTIES FOLDER test) #-- Adding test for links_env -ADD_EXECUTABLE (links_env ${HDF5_TEST_SOURCE_DIR}/links_env.c) +add_executable (links_env ${HDF5_TEST_SOURCE_DIR}/links_env.c) TARGET_NAMING (links_env ${LIB_TYPE}) TARGET_C_PROPERTIES (links_env " " " ") -TARGET_LINK_LIBRARIES (links_env ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (links_env PROPERTIES FOLDER test) +target_link_libraries (links_env ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (links_env PROPERTIES FOLDER test) #-- Adding test for libinfo -SET (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) -FILE (WRITE ${GREP_RUNNER} +set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) +file (WRITE ${GREP_RUNNER} "FILE (STRINGS \${TEST_PROGRAM} TEST_RESULT REGEX \"SUMMARY OF THE HDF5 CONFIGURATION\") -IF (\${TEST_RESULT} STREQUAL \"0\") - MESSAGE (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\") -ELSE (\${TEST_RESULT} STREQUAL \"0\") - MESSAGE (STATUS \"COMMAND Result: \${TEST_RESULT}\") -ENDIF (\${TEST_RESULT} STREQUAL \"0\") +if (\${TEST_RESULT} STREQUAL \"0\") + message (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\") +else (\${TEST_RESULT} STREQUAL \"0\") + message (STATUS \"COMMAND Result: \${TEST_RESULT}\") +endif (\${TEST_RESULT} STREQUAL \"0\") " ) ############################################################################## ### P L U G I N T E S T S ############################################################################## -IF (BUILD_SHARED_LIBS) - ADD_EXECUTABLE (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c) +if (BUILD_SHARED_LIBS) + add_executable (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c) TARGET_NAMING (plugin ${LIB_TYPE}) TARGET_C_PROPERTIES (plugin " " " ") - TARGET_LINK_LIBRARIES (plugin ${HDF5_TEST_PLUGIN_LIB_TARGET}) - SET_TARGET_PROPERTIES (plugin PROPERTIES FOLDER test) -ENDIF (BUILD_SHARED_LIBS) + target_link_libraries (plugin ${HDF5_TEST_PLUGIN_LIB_TARGET}) + set_target_properties (plugin PROPERTIES FOLDER test) +endif (BUILD_SHARED_LIBS) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 58ef1e6..33fbff6 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -8,25 +8,25 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- -SET (HDF5_TEST_FILES +set (HDF5_TEST_FILES tnullspace.h5 ) -FOREACH (h5_tfile ${HDF5_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_tfile}") - #MESSAGE (STATUS " Copying ${h5_tfile}") - ADD_CUSTOM_COMMAND ( +foreach (h5_tfile ${HDF5_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/${h5_tfile}") + #message (STATUS " Copying ${h5_tfile}") + add_custom_command ( TARGET ${HDF5_TEST_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_tfile} ${dest} ) -ENDFOREACH (h5_tfile ${HDF5_TEST_FILES}) +endforeach (h5_tfile ${HDF5_TEST_FILES}) # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- -SET (HDF5_REFERENCE_FILES +set (HDF5_REFERENCE_FILES err_compat_1 err_compat_2 error_test_1 @@ -34,21 +34,21 @@ SET (HDF5_REFERENCE_FILES links_env.out ) -FOREACH (ref_file ${HDF5_REFERENCE_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${ref_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( +foreach (ref_file ${HDF5_REFERENCE_FILES}) + set (dest "${PROJECT_BINARY_DIR}/${ref_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET ${HDF5_TEST_LIB_TARGET} POST_BUILD - COMMAND ${XLATE_UTILITY} - ARGS ${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file} ${dest} -l3 + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file} ${dest} ) -ENDFOREACH (ref_file ${HDF5_REFERENCE_FILES}) +endforeach (ref_file ${HDF5_REFERENCE_FILES}) # -------------------------------------------------------------------- # Copy test files from test/testfiles/plist_files dir to test dir # -------------------------------------------------------------------- -SET (HDF5_REFERENCE_PLIST_FILES +set (HDF5_REFERENCE_PLIST_FILES acpl_be acpl_le dapl_be @@ -75,21 +75,21 @@ SET (HDF5_REFERENCE_PLIST_FILES strcpl_le ) -FOREACH (plistfile ${HDF5_REFERENCE_PLIST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${plistfile}") - #MESSAGE (STATUS " Copying ${plistfile} to ${dset}") - ADD_CUSTOM_COMMAND ( +foreach (plistfile ${HDF5_REFERENCE_PLIST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/${plistfile}") + #message (STATUS " Copying ${plistfile} to ${dset}") + add_custom_command ( TARGET ${HDF5_TEST_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile} ${dest} ) -ENDFOREACH (plistfile ${HDF5_REFERENCE_PLIST_FILES}) +endforeach (plistfile ${HDF5_REFERENCE_PLIST_FILES}) # -------------------------------------------------------------------- #-- Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- -SET (HDF5_REFERENCE_TEST_FILES +set (HDF5_REFERENCE_TEST_FILES be_data.h5 be_extlink1.h5 be_extlink2.h5 @@ -125,19 +125,19 @@ SET (HDF5_REFERENCE_TEST_FILES tsizeslheap.h5 ) -FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${HDF5_TEST_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file} to ${dest}") - ADD_CUSTOM_COMMAND ( +foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + set (dest "${HDF5_TEST_BINARY_DIR}/${h5_file}") + #message (STATUS " Copying ${h5_file} to ${dest}") + add_custom_command ( TARGET ${HDF5_TEST_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TEST_SOURCE_DIR}/${h5_file} ${dest} ) -ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) +endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) # Remove any output file left over from previous test run -ADD_TEST ( +add_test ( NAME h5test-clear-testhdf5-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -160,23 +160,23 @@ ADD_TEST ( tsohm_src.h5 ) -IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME testhdf5-base COMMAND $<TARGET_FILE:testhdf5> -x heap -x file -x select) - SET_TESTS_PROPERTIES(testhdf5-base PROPERTIES DEPENDS h5test-clear-testhdf5-objects) - SET_TESTS_PROPERTIES(testhdf5-base PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) - ADD_TEST (NAME testhdf5-heap COMMAND $<TARGET_FILE:testhdf5> -o heap) - SET_TESTS_PROPERTIES(testhdf5-heap PROPERTIES DEPENDS h5test-clear-testhdf5-objects) - SET_TESTS_PROPERTIES(testhdf5-heap PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) - ADD_TEST (NAME testhdf5-file COMMAND $<TARGET_FILE:testhdf5> -o file) - SET_TESTS_PROPERTIES(testhdf5-file PROPERTIES DEPENDS h5test-clear-testhdf5-objects) - SET_TESTS_PROPERTIES(testhdf5-file PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) - ADD_TEST (NAME testhdf5-select COMMAND $<TARGET_FILE:testhdf5> -o select) - SET_TESTS_PROPERTIES(testhdf5-select PROPERTIES DEPENDS h5test-clear-testhdf5-objects) - SET_TESTS_PROPERTIES(testhdf5-select PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) -ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME testhdf5 COMMAND $<TARGET_FILE:testhdf5>) - SET_TESTS_PROPERTIES(testhdf5 PROPERTIES DEPENDS h5test-clear-testhdf5-objects) -ENDIF (HDF5_ENABLE_USING_MEMCHECKER) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME testhdf5-base COMMAND $<TARGET_FILE:testhdf5> -x heap -x file -x select) + set_tests_properties (testhdf5-base PROPERTIES DEPENDS h5test-clear-testhdf5-objects) + set_tests_properties (testhdf5-base PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) + add_test (NAME testhdf5-heap COMMAND $<TARGET_FILE:testhdf5> -o heap) + set_tests_properties (testhdf5-heap PROPERTIES DEPENDS h5test-clear-testhdf5-objects) + set_tests_properties (testhdf5-heap PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) + add_test (NAME testhdf5-file COMMAND $<TARGET_FILE:testhdf5> -o file) + set_tests_properties (testhdf5-file PROPERTIES DEPENDS h5test-clear-testhdf5-objects) + set_tests_properties (testhdf5-file PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) + add_test (NAME testhdf5-select COMMAND $<TARGET_FILE:testhdf5> -o select) + set_tests_properties (testhdf5-select PROPERTIES DEPENDS h5test-clear-testhdf5-objects) + set_tests_properties (testhdf5-select PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) +else (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME testhdf5 COMMAND $<TARGET_FILE:testhdf5>) + set_tests_properties (testhdf5 PROPERTIES DEPENDS h5test-clear-testhdf5-objects) +endif (HDF5_ENABLE_USING_MEMCHECKER) ############################################################################## ############################################################################## @@ -185,7 +185,7 @@ ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ############################################################################## # Remove any output file left over from previous test run -ADD_TEST ( +add_test ( NAME h5test-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -248,12 +248,12 @@ ADD_TEST ( unregister_filter_2.h5 ) -FOREACH (test ${H5_TESTS}) - ADD_TEST (NAME ${test} COMMAND $<TARGET_FILE:${test}>) - SET_TESTS_PROPERTIES(${test} PROPERTIES DEPENDS h5test-clear-objects) -ENDFOREACH (test ${H5_TESTS}) +foreach (test ${H5_TESTS}) + add_test (NAME ${test} COMMAND $<TARGET_FILE:${test}>) + set_tests_properties (${test} PROPERTIES DEPENDS h5test-clear-objects) +endforeach (test ${H5_TESTS}) -SET_TESTS_PROPERTIES(flush2 PROPERTIES DEPENDS flush1) +set_tests_properties (flush2 PROPERTIES DEPENDS flush1) ############################################################################## ############################################################################## @@ -262,38 +262,38 @@ SET_TESTS_PROPERTIES(flush2 PROPERTIES DEPENDS flush1) ############################################################################## #-- Adding test for cache -ADD_TEST ( +add_test ( NAME h5test-clear-cache-objects COMMAND ${CMAKE_COMMAND} -E remove cache_test.h5 ) -ADD_TEST (NAME cache COMMAND $<TARGET_FILE:cache>) -SET_TESTS_PROPERTIES(cache PROPERTIES DEPENDS h5test-clear-cache-objects) +add_test (NAME cache COMMAND $<TARGET_FILE:cache>) +set_tests_properties (cache PROPERTIES DEPENDS h5test-clear-cache-objects) #-- Adding test for cache_api -ADD_TEST ( +add_test ( NAME h5test-clear-cache_api-objects COMMAND ${CMAKE_COMMAND} -E remove cache_api_test.h5 ) -ADD_TEST (NAME cache_api COMMAND $<TARGET_FILE:cache_api>) -SET_TESTS_PROPERTIES(cache_api PROPERTIES DEPENDS h5test-clear-cache_api-objects) +add_test (NAME cache_api COMMAND $<TARGET_FILE:cache_api>) +set_tests_properties (cache_api PROPERTIES DEPENDS h5test-clear-cache_api-objects) #-- Adding test for cache_tagging -ADD_TEST ( +add_test ( NAME h5test-clear-cache_tagging-objects COMMAND ${CMAKE_COMMAND} -E remove tagging_test.h5 tagging_ext_test.h5 ) -ADD_TEST (NAME cache_tagging COMMAND $<TARGET_FILE:cache_tagging>) -SET_TESTS_PROPERTIES(cache_tagging PROPERTIES DEPENDS h5test-clear-cache_tagging-objects) +add_test (NAME cache_tagging COMMAND $<TARGET_FILE:cache_tagging>) +set_tests_properties (cache_tagging PROPERTIES DEPENDS h5test-clear-cache_tagging-objects) #-- Adding test for ttsafe -ADD_TEST ( +add_test ( NAME h5test-clear-ttsafe-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -302,19 +302,19 @@ ADD_TEST ( ttsafe_cancel.h5 ttsafe_acreate.h5 ) -ADD_TEST (NAME ttsafe COMMAND $<TARGET_FILE:ttsafe>) -SET_TESTS_PROPERTIES(ttsafe PROPERTIES DEPENDS h5test-clear-ttsafe-objects) +add_test (NAME ttsafe COMMAND $<TARGET_FILE:ttsafe>) +set_tests_properties (ttsafe PROPERTIES DEPENDS h5test-clear-ttsafe-objects) #-- Adding test for err_compat -IF (HDF5_ENABLE_DEPRECATED_SYMBOLS) - ADD_TEST ( +if (HDF5_ENABLE_DEPRECATED_SYMBOLS) + add_test ( NAME h5test-clear-err_compat-objects COMMAND ${CMAKE_COMMAND} -E remove err_compat.txt err_compat.txt.err ) - ADD_TEST (NAME err_compat COMMAND "${CMAKE_COMMAND}" + add_test (NAME err_compat COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:err_compat>" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -324,18 +324,18 @@ IF (HDF5_ENABLE_DEPRECATED_SYMBOLS) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES(err_compat PROPERTIES DEPENDS h5test-clear-err_compat-objects) -ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS) + set_tests_properties (err_compat PROPERTIES DEPENDS h5test-clear-err_compat-objects) +endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) #-- Adding test for error_test -ADD_TEST ( +add_test ( NAME h5test-clear-error_test-objects COMMAND ${CMAKE_COMMAND} -E remove error_test.txt error_test.txt.err ) -ADD_TEST (NAME error_test COMMAND "${CMAKE_COMMAND}" +add_test (NAME error_test COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:error_test>" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -345,11 +345,11 @@ ADD_TEST (NAME error_test COMMAND "${CMAKE_COMMAND}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) -SET_TESTS_PROPERTIES(error_test PROPERTIES DEPENDS h5test-clear-error_test-objects) -SET_TESTS_PROPERTIES (error_test PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PRELOAD=::") +set_tests_properties (error_test PROPERTIES DEPENDS h5test-clear-error_test-objects) +set_tests_properties (error_test PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PRELOAD=::") #-- Adding test for links_env -ADD_TEST ( +add_test ( NAME h5test-clear-links_env-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -359,7 +359,7 @@ ADD_TEST ( extlinks_env1.h5 tmp/extlinks_env1.h5 ) -ADD_TEST (NAME links_env COMMAND "${CMAKE_COMMAND}" +add_test (NAME links_env COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:links_env>" -D "TEST_ARGS:STRING=" -D "TEST_ENV_VAR:STRING=HDF5_EXT_PREFIX" @@ -370,31 +370,31 @@ ADD_TEST (NAME links_env COMMAND "${CMAKE_COMMAND}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) -SET_TESTS_PROPERTIES(links_env PROPERTIES DEPENDS h5test-clear-links_env-objects) +set_tests_properties (links_env PROPERTIES DEPENDS h5test-clear-links_env-objects) #-- Adding test for libinfo -ADD_TEST (NAME testlibinfo COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$<TARGET_FILE:${HDF5_LIB_TARGET}>" -P "${GREP_RUNNER}") +add_test (NAME testlibinfo COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$<TARGET_FILE:${HDF5_LIB_TARGET}>" -P "${GREP_RUNNER}") ############################################################################## ### P L U G I N T E S T S ############################################################################## -IF (BUILD_SHARED_LIBS) - - IF (WIN32 AND NOT CYGWIN) - SET(CMAKE_SEP "\;") - ELSE (WIN32 AND NOT CYGWIN) - SET(CMAKE_SEP ":") - ENDIF(WIN32 AND NOT CYGWIN) - - ADD_TEST (NAME H5PLUGIN-plugin COMMAND $<TARGET_FILE:plugin>) - SET_TESTS_PROPERTIES (H5PLUGIN-plugin PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir1${CMAKE_SEP}${CMAKE_BINARY_DIR}/testdir2") -ELSE (BUILD_SHARED_LIBS) - MESSAGE (STATUS " **** Plugins libraries must be built as shared libraries **** ") - ADD_TEST ( +if (BUILD_SHARED_LIBS) + + if (WIN32 AND NOT CYGWIN) + set (CMAKE_SEP "\;") + else (WIN32 AND NOT CYGWIN) + set (CMAKE_SEP ":") + endif (WIN32 AND NOT CYGWIN) + + add_test (NAME H5PLUGIN-plugin COMMAND $<TARGET_FILE:plugin>) + set_tests_properties (H5PLUGIN-plugin PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir1${CMAKE_SEP}${CMAKE_BINARY_DIR}/testdir2") +else (BUILD_SHARED_LIBS) + message (STATUS " **** Plugins libraries must be built as shared libraries **** ") + add_test ( NAME H5PLUGIN-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP H5PLUGIN TESTING" ) -ENDIF (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS) ############################################################################## ############################################################################## @@ -402,9 +402,9 @@ ENDIF (BUILD_SHARED_LIBS) ############################################################################## ############################################################################## -IF (HDF5_TEST_VFD) +if (HDF5_TEST_VFD) - SET (VFD_LIST + set (VFD_LIST sec2 stdio core @@ -413,7 +413,7 @@ IF (HDF5_TEST_VFD) family ) - SET (H5_VFD_TESTS + set (H5_VFD_TESTS testhdf5 accum lheap @@ -429,6 +429,7 @@ IF (HDF5_TEST_VFD) bittests dt_arith dtypes + dsets cmpd_dset filter_fail extend @@ -468,13 +469,13 @@ IF (HDF5_TEST_VFD) unregister ) - IF (DIRECT_VFD) - SET (VFD_LIST ${VFD_LIST} direct) - ENDIF (DIRECT_VFD) + if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) + endif (DIRECT_VFD) MACRO (ADD_VFD_TEST vfdname resultcode) - FOREACH (test ${H5_VFD_TESTS}) - ADD_TEST ( + foreach (test ${H5_VFD_TESTS}) + add_test ( NAME VFD-${vfdname}-${test} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:${test}>" @@ -485,9 +486,9 @@ IF (HDF5_TEST_VFD) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" ) - ENDFOREACH (test ${H5_VFD_TESTS}) - IF (HDF5_TEST_FHEAP_VFD) - ADD_TEST ( + endforeach (test ${H5_VFD_TESTS}) + if (HDF5_TEST_FHEAP_VFD) + add_test ( NAME VFD-${vfdname}-fheap COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:fheap>" @@ -498,15 +499,15 @@ IF (HDF5_TEST_VFD) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" ) - ENDIF (HDF5_TEST_FHEAP_VFD) + endif (HDF5_TEST_FHEAP_VFD) ENDMACRO (ADD_VFD_TEST) # Run test with different Virtual File Driver - FOREACH (vfd ${VFD_LIST}) + foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - ENDFOREACH (vfd ${VFD_LIST}) + endforeach (vfd ${VFD_LIST}) -ENDIF (HDF5_TEST_VFD) +endif (HDF5_TEST_VFD) ############################################################################## ############################################################################## @@ -514,17 +515,17 @@ ENDIF (HDF5_TEST_VFD) ############################################################################## ############################################################################## -IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) +if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) MACRO (ADD_H5_GENERATOR genfile) - ADD_EXECUTABLE (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c) + add_executable (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c) TARGET_NAMING (${genfile} ${LIB_TYPE}) TARGET_C_PROPERTIES (${genfile} " " " ") - TARGET_LINK_LIBRARIES (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (${genfile} PROPERTIES FOLDER generator/test) + target_link_libraries (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (${genfile} PROPERTIES FOLDER generator/test) ENDMACRO (ADD_H5_GENERATOR genfile) # generator executables - SET (H5_GENERATORS + set (H5_GENERATORS gen_bad_ohdr gen_bogus gen_cross @@ -546,8 +547,8 @@ IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) gen_plist ) - FOREACH (gen ${H5_GENERATORS}) + foreach (gen ${H5_GENERATORS}) ADD_H5_GENERATOR (${gen}) - ENDFOREACH (gen ${H5_GENERATORS}) + endforeach (gen ${H5_GENERATORS}) -ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) +endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) diff --git a/test/earray.c b/test/earray.c index 132913b..2d0a399 100644 --- a/test/earray.c +++ b/test/earray.c @@ -28,7 +28,7 @@ /* Other private headers that this test requires */ #include "H5Iprivate.h" /* IDs */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /* Local macros */ @@ -250,7 +250,7 @@ init_tparam(earray_test_param_t *tparam, const H5EA_create_t *cparam) HDmemset(tparam, 0, sizeof(*tparam)); /* Compute general information */ - tparam->nsblks = 1 + (cparam->max_nelmts_bits - H5V_log2_of2(cparam->data_blk_min_elmts)); + tparam->nsblks = 1 + (cparam->max_nelmts_bits - H5VM_log2_of2(cparam->data_blk_min_elmts)); /* Allocate information for each super block */ tparam->sblk_info = (H5EA_sblk_info_t *)HDmalloc(sizeof(H5EA_sblk_info_t) * tparam->nsblks); @@ -940,7 +940,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t UNUSED *tpara /* Set invalid max. # of elements per data block page bits */ if(test_cparam.idx_blk_elmts > 0) { HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); - test_cparam.max_dblk_page_nelmts_bits = H5V_log2_gen((uint64_t)test_cparam.idx_blk_elmts) - 1; + test_cparam.max_dblk_page_nelmts_bits = H5VM_log2_gen((uint64_t)test_cparam.idx_blk_elmts) - 1; H5E_BEGIN_TRY { ea = H5EA_create(f, H5P_DATASET_XFER_DEFAULT, &test_cparam, NULL); } H5E_END_TRY; @@ -1743,7 +1743,7 @@ eiter_fw_state(void *_eiter, const H5EA_create_t *cparam, /* Compute super block index for element index */ /* (same eqn. as in H5EA__dblock_sblk_idx()) */ - sblk_idx = H5V_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + sblk_idx = H5VM_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); #ifdef QAK HDfprintf(stderr, "idx = %Hu, tparam->sblk_info[%u] = {%Zu, %Zu, %Hu, %Hu}\n", idx, sblk_idx, tparam->sblk_info[sblk_idx].ndblks, tparam->sblk_info[sblk_idx].dblk_nelmts, tparam->sblk_info[sblk_idx].start_idx, tparam->sblk_info[sblk_idx].start_dblk); #endif /* QAK */ @@ -1849,10 +1849,10 @@ eiter_rv_init(const H5EA_create_t *cparam, const earray_test_param_t *tparam, eiter->idx = cnt - 1; eiter->max = cnt - 1; if(cnt > cparam->idx_blk_elmts) { - eiter->max_sblk_idx = H5V_log2_gen((uint64_t)(((eiter->max - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + eiter->max_sblk_idx = H5VM_log2_gen((uint64_t)(((eiter->max - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); eiter->max_nelmts = EA_NELMTS(cparam, tparam, eiter->max, eiter->max_sblk_idx); eiter->max_ndata_blks = EA_NDATA_BLKS(cparam, tparam, eiter->max, eiter->max_sblk_idx); - eiter->idx_blk_nsblks = 2 * H5V_log2_of2((uint32_t)cparam->sup_blk_min_data_ptrs); + eiter->idx_blk_nsblks = 2 * H5VM_log2_of2((uint32_t)cparam->sup_blk_min_data_ptrs); } /* end if */ else { eiter->max_sblk_idx = (hsize_t)0; @@ -1970,14 +1970,14 @@ eiter_rv_state(void *_eiter, const H5EA_create_t *cparam, hsize_t tmp_idx; /* Temporary index in superblock */ hsize_t dblk_idx; /* Index of data block within superblock */ - idx_sblk_idx = H5V_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + idx_sblk_idx = H5VM_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); tmp_idx = idx - (cparam->idx_blk_elmts + tparam->sblk_info[idx_sblk_idx].start_idx); dblk_idx = tmp_idx / tparam->sblk_info[idx_sblk_idx].dblk_nelmts; if(dblk_idx > 0) loc_idx = idx - tparam->sblk_info[idx_sblk_idx].dblk_nelmts; else loc_idx = cparam->idx_blk_elmts + tparam->sblk_info[idx_sblk_idx].start_idx - 1; - loc_sblk_idx = H5V_log2_gen((uint64_t)(((loc_idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + loc_sblk_idx = H5VM_log2_gen((uint64_t)(((loc_idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); } /* end else */ #ifdef QAK HDfprintf(stderr, "idx = %Hu, loc_idx = %Hu, eiter->max_sblk_idx = %u, idx_sblk_idx = %u, loc_sblk_idx = %u\n", idx, loc_idx, eiter->max_sblk_idx, idx_sblk_idx, loc_sblk_idx); @@ -2715,7 +2715,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Compute super block index for element index */ /* (same eqn. as in H5EA__dblock_sblk_idx()) */ - sblk_idx = H5V_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); + sblk_idx = H5VM_log2_gen((uint64_t)(((idx - cparam->idx_blk_elmts) / cparam->data_blk_min_elmts) + 1)); state.nelmts = (hsize_t)cparam->idx_blk_elmts + tparam->sblk_info[sblk_idx].dblk_nelmts; state.ndata_blks = (hsize_t)1; state.nsuper_blks = (hsize_t)1; diff --git a/test/farray.c b/test/farray.c index 2844a5d..7a79aaa 100644 --- a/test/farray.c +++ b/test/farray.c @@ -28,7 +28,7 @@ /* Other private headers that this test requires */ #include "H5Iprivate.h" /* IDs */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /* Local macros */ diff --git a/test/fheap.c b/test/fheap.c index e4aa137..96b0673 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -29,7 +29,7 @@ /* Other private headers that this test requires */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ -#include "H5Vprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /* Max. testfile name length */ #define FHEAP_FILENAME_LEN 1024 @@ -1574,7 +1574,7 @@ fill_all_2nd_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size, width = DTABLE_WIDTH(fh); /* Loop over rows of 2nd level deep indirect blocks */ - for(u = 0; u < (H5V_log2_of2(width) + 1); u++) + for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) if(fill_2nd_indirect_row(fh, dxpl, (u + 1), obj_size, state, keep_ids)) TEST_ERROR @@ -1692,7 +1692,7 @@ fill_all_3rd_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size, width = DTABLE_WIDTH(fh); /* Loop over rows of 3rd level deep indirect blocks */ - for(u = 0; u < (H5V_log2_of2(width) + 1); u++) + for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) /* Fill row of 3rd level indirect blocks */ if(fill_3rd_indirect_row(fh, dxpl, (u + 1), obj_size, state, keep_ids)) TEST_ERROR @@ -1782,7 +1782,7 @@ fill_all_4th_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size, width = DTABLE_WIDTH(fh); /* Loop over rows of 4th level deep indirect blocks */ - for(u = 0; u < (H5V_log2_of2(width) + 1); u++) { + for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) { /* Fill row of 4th level indirect blocks */ if(fill_4th_indirect_row(fh, dxpl, (u + 1), obj_size, state, keep_ids)) TEST_ERROR diff --git a/test/freespace.c b/test/freespace.c index c0df4c8..14b0f9a 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -26,7 +26,7 @@ #define H5F_PACKAGE #include "H5Fpkg.h" #include "H5Iprivate.h" -#include "H5Vprivate.h" +#include "H5VMprivate.h" #define FILENAME_LEN 1024 diff --git a/test/getname.c b/test/getname.c index fbad220..31440d6 100644 --- a/test/getname.c +++ b/test/getname.c @@ -2524,6 +2524,14 @@ test_obj_ref(hid_t fapl) if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR if(!((HDstrcmp(buf, "/Dataset3") == 0) &&(i == 9))) TEST_ERROR *buf = '\0'; + + /* Check H5Rget_name returns the correct length of the name when name is NULL */ + i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], NULL, 0); + if(i != 9) TEST_ERROR + /* Make sure size parameter is ignored */ + i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], NULL, 200); + if(i != 9) TEST_ERROR + i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], (char*)buf, sizeof(buf)); if(!((HDstrcmp(buf, "/Dataset3") == 0) &&(i == 9))) TEST_ERROR PASSED() @@ -2761,7 +2769,12 @@ test_reg_ref(hid_t fapl) /* Get name of the dataset the first region reference points to using H5Rget_name */ TESTING("H5Rget_name to get name from region reference(hyperslab)"); *buf1 = '\0'; - name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], (char*)buf1, NAME_BUF_SIZE); + + /* Check H5Rget_name returns the correct length of the name when name is NULL */ + name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], NULL, 0); + if(name_size1 != 7) TEST_ERROR + + name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], (char*)buf1, NAME_BUF_SIZE ); if(!((HDstrcmp(buf1, "/MATRIX") == 0) &&(name_size1 == 7))) TEST_ERROR PASSED() diff --git a/test/h5test.c b/test/h5test.c index 30a3adf..f361c49 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -379,7 +379,7 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) /* Prepend the prefix value to the base name */ if (prefix && *prefix) { - if (isppdriver){ + if (isppdriver) { /* This is a parallel system */ char *subdir; @@ -406,9 +406,11 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) } } - if (!fullname[0]) + if (!fullname[0]) { /* We didn't append the prefix yet */ - HDstrncpy(fullname, prefix, MIN(HDstrlen(prefix), size)); + HDstrncpy(fullname, prefix, size); + fullname[size -1] = '\0'; + } if (HDstrlen(fullname) + HDstrlen(base_name) + 1 < size) { /* diff --git a/test/hyperslab.c b/test/hyperslab.c index fdeaffd..5e2c109 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -25,7 +25,7 @@ #include "h5test.h" #include "H5private.h" #include "H5Eprivate.h" -#include "H5Vprivate.h" +#include "H5VMprivate.h" #define TEST_SMALL 0x0001 #define TEST_MEDIUM 0x0002 @@ -137,7 +137,7 @@ print_ref(size_t nx, size_t ny, size_t nz) /*------------------------------------------------------------------------- * Function: test_fill * - * Purpose: Tests the H5V_hyper_fill() function. + * Purpose: Tests the H5VM_hyper_fill() function. * * Return: Success: SUCCEED * @@ -226,7 +226,7 @@ test_fill(size_t nx, size_t ny, size_t nz, ref_value += fill_value * dx * dy * dz; /* Fill the hyperslab with some value */ - H5V_hyper_fill(ndims, hs_size, dst_size, dst_offset, dst, fill_value); + H5VM_hyper_fill(ndims, hs_size, dst_size, dst_offset, dst, fill_value); /* * Sum the array and compare it to the @@ -285,7 +285,7 @@ error: /*------------------------------------------------------------------------- * Function: test_copy * - * Purpose: Tests H5V_hyper_copy(). + * Purpose: Tests H5VM_hyper_copy(). * * The NX, NY, and NZ arguments are the size for the source and * destination arrays. You may pass zero for NZ or for NY and @@ -466,7 +466,7 @@ test_copy(int mode, * Copy a hyperslab from the global array to the * local array. */ - H5V_hyper_copy(ndims, hs_size, dst_size, dst_offset, dst, src_size, src_offset, src); + H5VM_hyper_copy(ndims, hs_size, dst_size, dst_offset, dst, src_size, src_offset, src); /* * Sum the destination hyperslab. It should be @@ -569,7 +569,7 @@ error: /*------------------------------------------------------------------------- * Function: test_multifill * - * Purpose: Tests the H5V_stride_copy() function by using it to fill a + * Purpose: Tests the H5VM_stride_copy() function by using it to fill a * hyperslab by replicating a multi-byte sequence. This might * be useful to initialize an array of structs with a default * struct value, or to initialize an array of floating-point @@ -634,7 +634,7 @@ test_multifill(size_t nx) * Copy the fill value into each element */ size = nx; - H5V_stride_copy(1, (hsize_t)sizeof(double), &size, &dst_stride, + H5VM_stride_copy(1, (hsize_t)sizeof(double), &size, &dst_stride, &(dst[0].mid), &src_stride, &(fill.mid)); /* @@ -690,7 +690,7 @@ error: /*------------------------------------------------------------------------- * Function: test_endian * - * Purpose: Tests the H5V_stride_copy() function by using it to copy an + * Purpose: Tests the H5VM_stride_copy() function by using it to copy an * array of integers and swap the byte ordering from little * endian to big endian or vice versa depending on the hardware. * @@ -733,7 +733,7 @@ test_endian(size_t nx) size[1] = 4; /* Copy the array */ - H5V_stride_copy_s(2, (hsize_t)1, size, dst_stride, dst + 3, src_stride, src); + H5VM_stride_copy_s(2, (hsize_t)1, size, dst_stride, dst + 3, src_stride, src); /* Compare */ for(i = 0; i < nx; i++) { @@ -824,10 +824,10 @@ test_transpose(size_t nx, size_t ny) /* Copy and transpose */ if(nx == ny) - H5V_stride_copy(2, (hsize_t)sizeof(*src), size, dst_stride, dst, + H5VM_stride_copy(2, (hsize_t)sizeof(*src), size, dst_stride, dst, src_stride, src); else - H5V_stride_copy(2, (hsize_t)sizeof(*src), size, dst_stride, dst, + H5VM_stride_copy(2, (hsize_t)sizeof(*src), size, dst_stride, dst, src_stride, src); /* Check */ @@ -878,7 +878,7 @@ error: /*------------------------------------------------------------------------- * Function: test_sub_super * - * Purpose: Tests H5V_stride_copy() to reduce the resolution of an image + * Purpose: Tests H5VM_stride_copy() to reduce the resolution of an image * by copying half the pixels in the X and Y directions. Then * we use the small image and duplicate every pixel to result in * a 2x2 square. @@ -929,7 +929,7 @@ test_sub_super(size_t nx, size_t ny) dst_stride[1] = 1; /* Copy */ - H5V_stride_copy(2, (hsize_t)sizeof(uint8_t), size, dst_stride, half, + H5VM_stride_copy(2, (hsize_t)sizeof(uint8_t), size, dst_stride, half, src_stride, full); /* Check */ @@ -978,7 +978,7 @@ test_sub_super(size_t nx, size_t ny) dst_stride[3] = sizeof(uint8_t); /* Copy */ - H5V_stride_copy(4, (hsize_t)sizeof(uint8_t), size, dst_stride, twice, + H5VM_stride_copy(4, (hsize_t)sizeof(uint8_t), size, dst_stride, twice, src_stride, half); /* Check */ @@ -1038,7 +1038,7 @@ error: /*------------------------------------------------------------------------- * Function: test_array_fill * - * Purpose: Tests H5V_array_fill routine by copying a multibyte value + * Purpose: Tests H5VM_array_fill routine by copying a multibyte value * (an array of ints, in our case) into all the elements of an * array. * @@ -1072,7 +1072,7 @@ test_array_fill(size_t lo, size_t hi) /* Fill */ for(w = lo; w <= hi; w++) { - H5V_array_fill(dst, src, sizeof(src), w); + H5VM_array_fill(dst, src, sizeof(src), w); /* Check */ for(u = 0; u < w; u++) @@ -1099,7 +1099,7 @@ error: /*------------------------------------------------------------------------- * Function: test_array_offset_n_calc * - * Purpose: Tests H5V_array_offset and H5V_array_calc routines by comparing + * Purpose: Tests H5VM_array_offset and H5VM_array_calc routines by comparing * computed array offsets against calculated ones and then going * back to the coordinates from the offset and checking those. * @@ -1149,14 +1149,14 @@ test_array_offset_n_calc(size_t n, size_t x, size_t y, size_t z) coords[2] = (hssize_t)(HDrandom() % x); /* Get offset of coordinate */ - off = H5V_array_offset(ARRAY_OFFSET_NDIMS, dims, coords); + off = H5VM_array_offset(ARRAY_OFFSET_NDIMS, dims, coords); /* Check offset of coordinate */ if(a[off] != off) TEST_ERROR /* Get coordinates of offset */ - if(H5V_array_calc(off, ARRAY_OFFSET_NDIMS, dims, new_coords) < 0) + if(H5VM_array_calc(off, ARRAY_OFFSET_NDIMS, dims, new_coords) < 0) TEST_ERROR /* Check computed coordinates */ diff --git a/test/istore.c b/test/istore.c index f99e835..217dfc4 100644 --- a/test/istore.c +++ b/test/istore.c @@ -31,7 +31,7 @@ #include "H5Gprivate.h" #include "H5Oprivate.h" #include "H5Pprivate.h" -#include "H5Vprivate.h" +#include "H5VMprivate.h" const char *FILENAME[] = { "istore", @@ -308,7 +308,7 @@ test_extend(hid_t f, const char *prefix, if((fspace=H5Dget_space(dataset)) < 0) TEST_ERROR; for (ctr = 0; - H5V_vector_lt_u((unsigned)ndims, max_corner, whole_size); + H5VM_vector_lt_u((unsigned)ndims, max_corner, whole_size); ctr++) { /* Size and location */ @@ -388,9 +388,9 @@ test_extend(hid_t f, const char *prefix, if(H5Sclose(mspace) < 0) TEST_ERROR; /* Write to `whole' buffer for later checking */ - H5V_hyper_copy((unsigned)ndims, size, + H5VM_hyper_copy((unsigned)ndims, size, whole_size, offset, whole, /*dst*/ - size, H5V_ZERO, buf); /*src*/ + size, H5VM_ZERO, buf); /*src*/ /* Update max corner */ for (i=0; i<(size_t)ndims; i++) @@ -36,7 +36,7 @@ #include "H5FLprivate.h" #include "H5Iprivate.h" -#include "H5Vprivate.h" +#include "H5VMprivate.h" #define FILENAME_LEN 1024 diff --git a/test/testerror.sh.in b/test/testerror.sh.in index eb01fb1..7c03414 100644 --- a/test/testerror.sh.in +++ b/test/testerror.sh.in @@ -61,10 +61,6 @@ TEST() { # Run test. TESTING $TEST_ERR ( - echo "#############################" - echo "Expected output for $TEST_ERR" - echo "#############################" - # Skip the plugin for testing missing filter. $ENVCMD $RUNSERIAL $TEST_ERR_BIN ) >$actual 2>$actual_err diff --git a/test/testfiles/err_compat_1 b/test/testfiles/err_compat_1 index e2b37ab..d471e13 100644 --- a/test/testfiles/err_compat_1 +++ b/test/testfiles/err_compat_1 @@ -1,6 +1,3 @@ -############################# -Expected output for err_compat -############################# Testing error API H5Eset/get_auto Testing error API based on data I/O All error API tests passed. This program tests the Error API compatible with HDF5 version (number). There're supposed to be some error messages ********* Print error stack in HDF5 default way ********* diff --git a/test/testfiles/err_compat_2 b/test/testfiles/err_compat_2 index be6c40d..75e8769 100644 --- a/test/testfiles/err_compat_2 +++ b/test/testfiles/err_compat_2 @@ -1,4 +1 @@ -############################# -Expected output for err_compat -############################# Test skipped because backward compatbility with v1.6 is NOT configured in diff --git a/test/testfiles/error_test_1 b/test/testfiles/error_test_1 index 4f8f3fe..15d12b9 100644 --- a/test/testfiles/error_test_1 +++ b/test/testfiles/error_test_1 @@ -1,6 +1,3 @@ -############################# -Expected output for error_test -############################# This program tests the Error API. There're supposed to be some error messages ********* Print error stack in HDF5 default way ********* Second Test-DIAG: Error detected in Second Program (1.0) thread (IDs): diff --git a/test/testfiles/error_test_2 b/test/testfiles/error_test_2 index f9d7317..6852f6f 100644 --- a/test/testfiles/error_test_2 +++ b/test/testfiles/error_test_2 @@ -1,4 +1 @@ -############################# -Expected output for error_test -############################# Test skipped because backward compatbility with v1.6 is configured in diff --git a/test/testfiles/links_env.out b/test/testfiles/links_env.out index 3ca9b99..3f10fc6 100644 --- a/test/testfiles/links_env.out +++ b/test/testfiles/links_env.out @@ -1,6 +1,3 @@ -############################# -Expected output for links_env -############################# Testing external links via environment variable PASSED Testing external links via environment variable (w/new group format) PASSED All external Link (HDF5_EXT_PREFIX) tests passed. diff --git a/test/testhdf5.c b/test/testhdf5.c index f14c2c3..eade815 100644 --- a/test/testhdf5.c +++ b/test/testhdf5.c @@ -86,6 +86,11 @@ main(int argc, char *argv[]) if (GetTestCleanup() && !getenv("HDF5_NOCLEANUP")) TestCleanup(); - return (GetTestNumErrs()); + /* Exit failure if errors encountered; else exit success. */ + /* No need to print anything since PerformTests() already does. */ + if (GetTestNumErrs() > 0) + exit(EXIT_FAILURE); + else + exit(EXIT_SUCCESS); } /* end main() */ diff --git a/test/trefer.c b/test/trefer.c index 698e95a..8f8a28e 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -205,9 +205,9 @@ test_reference_params(void) name_size = H5Rget_name(-1, H5R_DATASET_REGION, &rbuf[0], NULL, 0); VERIFY(name_size, FAIL, "H5Rget_name loc_id"); name_size = H5Rget_name(fid1, H5R_DATASET_REGION, NULL, NULL, 0); - VERIFY(ret, FAIL, "H5Rget_name ref"); + VERIFY(name_size, FAIL, "H5Rget_name ref"); name_size = H5Rget_name(fid1, H5R_MAXTYPE, &rbuf[0], NULL, 0); - VERIFY(ret, FAIL, "H5Rget_name type"); + VERIFY(name_size, FAIL, "H5Rget_name type"); /* Test parameters to H5Rget_region */ ret = H5Rget_region(-1, H5R_OBJECT, &rbuf[0]); diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 30cdcda..6d4f4d4 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -1,10 +1,10 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TEST_PAR) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib ) @@ -12,7 +12,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib ) # Define Tests #----------------------------------------------------------------------------- -SET (testphdf5_SRCS +set (testphdf5_SRCS ${HDF5_TEST_PAR_SOURCE_DIR}/testphdf5.c ${HDF5_TEST_PAR_SOURCE_DIR}/t_dset.c ${HDF5_TEST_PAR_SOURCE_DIR}/t_file.c @@ -27,21 +27,21 @@ SET (testphdf5_SRCS ) #-- Adding test for testhdf5 -ADD_EXECUTABLE (testphdf5 ${testphdf5_SRCS}) +add_executable (testphdf5 ${testphdf5_SRCS}) TARGET_NAMING (testphdf5 ${LIB_TYPE}) TARGET_C_PROPERTIES (testphdf5 " " " ") -TARGET_LINK_LIBRARIES (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) -SET_TARGET_PROPERTIES (testphdf5 PROPERTIES FOLDER test/par) +target_link_libraries (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) +set_target_properties (testphdf5 PROPERTIES FOLDER test/par) MACRO (ADD_H5P_EXE file) - ADD_EXECUTABLE (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) + add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} ${LIB_TYPE}) TARGET_C_PROPERTIES (${file} " " " ") - TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) - SET_TARGET_PROPERTIES (${file} PROPERTIES FOLDER test/par) + target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) + set_target_properties (${file} PROPERTIES FOLDER test/par) ENDMACRO (ADD_H5P_EXE file) -SET (H5P_TESTS +set (H5P_TESTS t_mpi # t_posix_compliant t_cache @@ -50,12 +50,12 @@ SET (H5P_TESTS t_shapesame ) -FOREACH (testp ${H5P_TESTS}) +foreach (testp ${H5P_TESTS}) ADD_H5P_EXE(${testp}) -ENDFOREACH (testp ${H5P_TESTS}) +endforeach (testp ${H5P_TESTS}) -IF (NOT WIN32) +if (NOT WIN32) ADD_H5P_EXE(t_posix_compliant) -ENDIF (NOT WIN32) +endif (NOT WIN32) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake index bc8fc90..9e4f97b 100644 --- a/testpar/CMakeTests.cmake +++ b/testpar/CMakeTests.cmake @@ -5,21 +5,21 @@ ############################################################################## ############################################################################## -ADD_TEST (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:testphdf5>) +add_test (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:testphdf5>) -FOREACH (testp ${H5P_TESTS}) - ADD_TEST (NAME TEST_PAR_${testp} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:${testp}>) -ENDFOREACH (testp ${H5P_TESTS}) +foreach (testp ${H5P_TESTS}) + add_test (NAME TEST_PAR_${testp} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:${testp}>) +endforeach (testp ${H5P_TESTS}) SET_TESTS_PROPERTIES(TEST_PAR_t_pflush2 PROPERTIES DEPENDS TEST_PAR_t_pflush1) -IF (NOT WIN32) - ADD_TEST (NAME TEST_PAR_t_posix_compliant COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:t_posix_compliant>) -ENDIF (NOT WIN32) +if (NOT WIN32) + add_test (NAME TEST_PAR_t_posix_compliant COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:t_posix_compliant>) +endif (NOT WIN32) -IF (HDF5_TEST_VFD) +if (HDF5_TEST_VFD) - SET (VFD_LIST + set (VFD_LIST sec2 stdio core @@ -28,19 +28,19 @@ IF (HDF5_TEST_VFD) family ) - SET (H5P_VFD_TESTS + set (H5P_VFD_TESTS t_pflush1 t_pflush2 ) - IF (DIRECT_VFD) - SET (VFD_LIST ${VFD_LIST} direct) - ENDIF (DIRECT_VFD) + if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) + endif (DIRECT_VFD) MACRO (ADD_VFD_TEST vfdname resultcode) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - FOREACH (test ${H5P_VFD_TESTS}) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + foreach (test ${H5P_VFD_TESTS}) + add_test ( NAME VFD-${vfdname}-${test} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:${test}>" @@ -51,13 +51,13 @@ IF (HDF5_TEST_VFD) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" ) - ENDFOREACH (test ${H5P_VFD_TESTS}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endforeach (test ${H5P_VFD_TESTS}) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_VFD_TEST) # Run test with different Virtual File Driver - FOREACH (vfd ${VFD_LIST}) + foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - ENDFOREACH (vfd ${VFD_LIST}) + endforeach (vfd ${VFD_LIST}) -ENDIF (HDF5_TEST_VFD) +endif (HDF5_TEST_VFD) diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c index e2e583a..ac54f2b 100644 --- a/testpar/t_coll_chunk.c +++ b/testpar/t_coll_chunk.c @@ -16,6 +16,9 @@ #include "testphdf5.h" #include "H5Dprivate.h" +#define HYPER 1 +#define POINT 2 +#define ALL 3 /* some commonly used routines for collective chunk IO tests*/ @@ -23,14 +26,17 @@ static void ccslab_set(int mpi_rank,int mpi_size,hsize_t start[],hsize_t count[] hsize_t stride[],hsize_t block[],int mode); static void ccdataset_fill(hsize_t start[],hsize_t count[], - hsize_t stride[],hsize_t block[],DATATYPE*dataset); + hsize_t stride[],hsize_t block[],DATATYPE*dataset, + int mem_selection); static void ccdataset_print(hsize_t start[],hsize_t block[],DATATYPE*dataset); static int ccdataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], - hsize_t block[], DATATYPE *dataset, DATATYPE *original); + hsize_t block[], DATATYPE *dataset, DATATYPE *original, + int mem_selection); -static void coll_chunktest(const char* filename,int chunk_factor,int select_factor,int api_option); +static void coll_chunktest(const char* filename, int chunk_factor, int select_factor, + int api_option, int file_selection, int mem_selection, int mode); /*------------------------------------------------------------------------- @@ -73,7 +79,15 @@ coll_chunk1(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 1, BYROW_CONT, API_NONE); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, HYPER, IN_ORDER); } @@ -117,7 +131,15 @@ coll_chunk2(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, HYPER, IN_ORDER); } @@ -164,7 +186,15 @@ coll_chunk3(void) int mpi_size; MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, HYPER, IN_ORDER); } /*------------------------------------------------------------------------- @@ -208,7 +238,15 @@ coll_chunk4(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, POINT, HYPER, IN_ORDER); } /*------------------------------------------------------------------------- @@ -252,7 +290,15 @@ coll_chunk5(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, POINT, HYPER, IN_ORDER); } @@ -283,14 +329,16 @@ coll_chunk5(void) *------------------------------------------------------------------------- */ - static void coll_chunktest(const char* filename, int chunk_factor, int select_factor, - int api_option) + int api_option, + int file_selection, + int mem_selection, + int mode) { - hid_t file,dataset, file_dataspace; + hid_t file, dataset, file_dataspace, mem_dataspace; hid_t acc_plist,xfer_plist,crp_plist; hsize_t dims[RANK], chunk_dims[RANK]; @@ -310,6 +358,11 @@ coll_chunktest(const char* filename, MPI_Comm comm = MPI_COMM_WORLD; MPI_Info info = MPI_INFO_NULL; + size_t num_points; /* for point selection */ + hsize_t *coords = NULL; /* for point selection */ + hsize_t current_dims; /* for point selection */ + int i; + /* set up MPI parameters */ MPI_Comm_size(comm,&mpi_size); MPI_Comm_rank(comm,&mpi_rank); @@ -329,7 +382,6 @@ coll_chunktest(const char* filename, dims[0] = SPACE_DIM1*mpi_size; dims[1] = SPACE_DIM2; - /* allocate memory for data buffer */ data_array1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); @@ -337,9 +389,25 @@ coll_chunktest(const char* filename, /* set up dimensions of the slab this process accesses */ ccslab_set(mpi_rank, mpi_size, start, count, stride, block, select_factor); + /* set up the coords array selection */ + num_points = block[0] * block[1] * count[0] * count[1]; + coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); + VRFY((coords != NULL), "coords malloc succeeded"); + point_set(start, count, stride, block, num_points, coords, mode); + file_dataspace = H5Screate_simple(2, dims, NULL); VRFY((file_dataspace >= 0), "file dataspace created succeeded"); + if(ALL != mem_selection) { + mem_dataspace = H5Screate_simple(2, dims, NULL); + VRFY((mem_dataspace >= 0), "mem dataspace created succeeded"); + } + else { + current_dims = num_points; + mem_dataspace = H5Screate_simple (1, ¤t_dims, NULL); + VRFY((mem_dataspace >= 0), "mem_dataspace create succeeded"); + } + crp_plist = H5Pcreate(H5P_DATASET_CREATE); VRFY((crp_plist >= 0),""); @@ -347,25 +415,67 @@ coll_chunktest(const char* filename, chunk_dims[0] = dims[0]/chunk_factor; /* to decrease the testing time, maintain bigger chunk size */ - (chunk_factor == 1) ? (chunk_dims[1] = SPACE_DIM2) : (chunk_dims[1] = SPACE_DIM2/2); status = H5Pset_chunk(crp_plist, 2, chunk_dims); VRFY((status >= 0),"chunk creation property list succeeded"); dataset = H5Dcreate2(file, DSET_COLLECTIVE_CHUNK_NAME, H5T_NATIVE_INT, - file_dataspace, H5P_DEFAULT, crp_plist, H5P_DEFAULT); + file_dataspace, H5P_DEFAULT, crp_plist, H5P_DEFAULT); VRFY((dataset >= 0),"dataset created succeeded"); status = H5Pclose(crp_plist); VRFY((status >= 0), ""); /*put some trivial data in the data array */ - ccdataset_fill(start, stride, count,block, data_array1); + ccdataset_fill(start, stride, count,block, data_array1, mem_selection); + MESG("data_array initialized"); - status = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, - count, block); - VRFY((status >= 0),"hyperslab selection succeeded"); + switch (file_selection) { + case HYPER: + status = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((status >= 0),"hyperslab selection succeeded"); + break; + + case POINT: + if (num_points) { + status = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((status >= 0),"Element selection succeeded"); + } + else { + status = H5Sselect_none(file_dataspace); + VRFY((status >= 0),"none selection succeeded"); + } + break; + + case ALL: + status = H5Sselect_all(file_dataspace); + VRFY((status >= 0), "H5Sselect_all succeeded"); + break; + } + + switch (mem_selection) { + case HYPER: + status = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((status >= 0),"hyperslab selection succeeded"); + break; + + case POINT: + if (num_points) { + status = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((status >= 0),"Element selection succeeded"); + } + else { + status = H5Sselect_none(mem_dataspace); + VRFY((status >= 0),"none selection succeeded"); + } + break; + + case ALL: + status = H5Sselect_all(mem_dataspace); + VRFY((status >= 0), "H5Sselect_all succeeded"); + break; + } /* set up the collective transfer property list */ xfer_plist = H5Pcreate(H5P_DATASET_XFER); @@ -382,10 +492,10 @@ coll_chunktest(const char* filename, case API_LINK_HARD: status = H5Pset_dxpl_mpio_chunk_opt(xfer_plist,H5FD_MPIO_CHUNK_ONE_IO); VRFY((status>= 0),"collective chunk optimization succeeded"); - break; + break; default: - ; + ; } #ifdef H5_HAVE_INSTRUMENTED_LIBRARY @@ -396,8 +506,7 @@ coll_chunktest(const char* filename, status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); VRFY((status >= 0),"testing property list inserted succeeded"); - - break; + break; default: ; @@ -406,7 +515,7 @@ coll_chunktest(const char* filename, #endif /* write data collectively */ - status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, file_dataspace, + status = H5Dwrite(dataset, H5T_NATIVE_INT, mem_dataspace, file_dataspace, xfer_plist, data_array1); VRFY((status >= 0),"dataset write succeeded"); @@ -417,7 +526,7 @@ coll_chunktest(const char* filename, status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_LINK_HARD_NAME,&prop_value); VRFY((status >= 0),"testing property list get succeeded"); VRFY((prop_value == 0),"API to set LINK COLLECTIVE IO directly succeeded"); - break; + break; default: ; @@ -434,12 +543,15 @@ coll_chunktest(const char* filename, status = H5Sclose(file_dataspace); VRFY((status >= 0),""); + status = H5Sclose(mem_dataspace); + VRFY((status >= 0),""); + + status = H5Fclose(file); VRFY((status >= 0),""); if (data_array1) HDfree(data_array1); - /* Use collective read to verify the correctness of collective write. */ /* allocate memory for data buffer */ @@ -466,15 +578,68 @@ coll_chunktest(const char* filename, /* set up dimensions of the slab this process accesses */ ccslab_set(mpi_rank, mpi_size, start, count, stride, block, select_factor); - /* obtain the file dataspace*/ + /* obtain the file and mem dataspace*/ file_dataspace = H5Dget_space (dataset); VRFY((file_dataspace >= 0), ""); - status=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((status >= 0), ""); + if (ALL != mem_selection) { + mem_dataspace = H5Dget_space (dataset); + VRFY((mem_dataspace >= 0), ""); + } + else { + current_dims = num_points; + mem_dataspace = H5Screate_simple (1, ¤t_dims, NULL); + VRFY((mem_dataspace >= 0), "mem_dataspace create succeeded"); + } + + switch (file_selection) { + case HYPER: + status = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((status >= 0),"hyperslab selection succeeded"); + break; + + case POINT: + if (num_points) { + status = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((status >= 0),"Element selection succeeded"); + } + else { + status = H5Sselect_none(file_dataspace); + VRFY((status >= 0),"none selection succeeded"); + } + break; + + case ALL: + status = H5Sselect_all(file_dataspace); + VRFY((status >= 0), "H5Sselect_all succeeded"); + break; + } + + switch (mem_selection) { + case HYPER: + status = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((status >= 0),"hyperslab selection succeeded"); + break; + + case POINT: + if (num_points) { + status = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((status >= 0),"Element selection succeeded"); + } + else { + status = H5Sselect_none(mem_dataspace); + VRFY((status >= 0),"none selection succeeded"); + } + break; + + case ALL: + status = H5Sselect_all(mem_dataspace); + VRFY((status >= 0), "H5Sselect_all succeeded"); + break; + } /* fill dataset with test data */ - ccdataset_fill(start, stride,count,block, data_origin1); + ccdataset_fill(start, stride,count,block, data_origin1, mem_selection); xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0),""); @@ -485,13 +650,12 @@ coll_chunktest(const char* filename, VRFY((status>= 0),"set independent IO collectively succeeded"); } - - status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, file_dataspace, + status = H5Dread(dataset, H5T_NATIVE_INT, mem_dataspace, file_dataspace, xfer_plist, data_array1); VRFY((status >=0),"dataset read succeeded"); /* verify the read data with original expected data */ - status = ccdataset_vrfy(start, count, stride, block, data_array1, data_origin1); + status = ccdataset_vrfy(start, count, stride, block, data_array1, data_origin1, mem_selection); if (status) nerrors++; status = H5Pclose(xfer_plist); @@ -499,17 +663,23 @@ coll_chunktest(const char* filename, /* close dataset collectively */ status=H5Dclose(dataset); - VRFY((status >= 0), ""); + VRFY((status >= 0), "H5Dclose"); /* release all IDs created */ - H5Sclose(file_dataspace); + status = H5Sclose(file_dataspace); + VRFY((status >= 0),"H5Sclose"); + + status = H5Sclose(mem_dataspace); + VRFY((status >= 0),"H5Sclose"); /* close the file collectively */ - H5Fclose(file); + status = H5Fclose(file); + VRFY((status >= 0),"H5Fclose"); /* release data buffers */ - if (data_array1) HDfree(data_array1); - if (data_origin1) HDfree(data_origin1); + if(coords) HDfree(coords); + if(data_array1) HDfree(data_array1); + if(data_origin1) HDfree(data_origin1); } @@ -628,12 +798,12 @@ ccdataset_fill(hsize_t start[], hsize_t stride[], hsize_t count[], hsize_t block[], - DATATYPE * dataset) + DATATYPE * dataset, + int mem_selection) { DATATYPE *dataptr = dataset; DATATYPE *tmptr; - hsize_t i,j,k1,k2; - + hsize_t i,j,k1,k2,k=0; /* put some trivial data in the data_array */ tmptr = dataptr; @@ -645,10 +815,16 @@ ccdataset_fill(hsize_t start[], for(k2 = 0; k2 < count[1]; k2++) { for(j = 0;j < block[1]; j++) { - dataptr = tmptr + ((start[0]+k1*stride[0]+i)*SPACE_DIM2+ - start[1]+k2*stride[1]+j); + if (ALL != mem_selection) { + dataptr = tmptr + ((start[0]+k1*stride[0]+i)*SPACE_DIM2+ + start[1]+k2*stride[1]+j); + } + else { + dataptr = tmptr + k; + k++; + } - *dataptr = (DATATYPE)(k1+k2+i+j); + *dataptr = (DATATYPE)(k1+k2+i+j); } } } @@ -695,9 +871,10 @@ ccdataset_vrfy(hsize_t start[], hsize_t stride[], hsize_t block[], DATATYPE *dataset, - DATATYPE *original) + DATATYPE *original, + int mem_selection) { - hsize_t i, j,k1,k2; + hsize_t i, j,k1,k2,k=0; int vrfyerrs; DATATYPE *dataptr,*oriptr; @@ -715,26 +892,31 @@ ccdataset_vrfy(hsize_t start[], vrfyerrs = 0; - for (k1 = 0; k1 < count[0];k1++) { - for(i = 0;i < block[0];i++) { - for(k2 = 0; k2<count[1];k2++) { - for(j=0;j<block[1];j++) { - - dataptr = dataset + ((start[0]+k1*stride[0]+i)*SPACE_DIM2+ - start[1]+k2*stride[1]+j); - oriptr = original + ((start[0]+k1*stride[0]+i)*SPACE_DIM2+ - start[1]+k2*stride[1]+j); - - if (*dataptr != *oriptr){ - if (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){ - printf("Dataset Verify failed at [%lu][%lu]: expect %d, got %d\n", - (unsigned long)i, (unsigned long)j, - *(original), *(dataset)); - } - } - } - } - } + for (k1=0;k1<count[0];k1++) { + for(i=0;i<block[0];i++) { + for(k2=0; k2<count[1];k2++) { + for(j=0;j<block[1];j++) { + if (ALL != mem_selection) { + dataptr = dataset + ((start[0]+k1*stride[0]+i)*SPACE_DIM2+ + start[1]+k2*stride[1]+j); + oriptr = original + ((start[0]+k1*stride[0]+i)*SPACE_DIM2+ + start[1]+k2*stride[1]+j); + } + else { + dataptr = dataset + k; + oriptr = original + k; + k++; + } + if (*dataptr != *oriptr){ + if (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){ + printf("Dataset Verify failed at [%lu][%lu]: expect %d, got %d\n", + (unsigned long)i, (unsigned long)j, + *(original), *(dataset)); + } + } + } + } + } } if (vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED) printf("[more errors ...]\n"); diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 4932a64..985c4f7 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -118,6 +118,54 @@ if(VERBOSE_MED){ } } +/* + * Setup the coordinates for point selection. + */ +void point_set(hsize_t start[], + hsize_t count[], + hsize_t stride[], + hsize_t block[], + size_t num_points, + hsize_t coords[], + int order) +{ + hsize_t i,j, k = 0, m ,n, s1 ,s2; + + HDcompile_assert(RANK == 2); + + if(OUT_OF_ORDER == order) + k = (num_points * RANK) - 1; + else if(IN_ORDER == order) + k = 0; + + s1 = start[0]; + s2 = start[1]; + + for(i = 0 ; i < count[0]; i++) + for(j = 0 ; j < count[1]; j++) + for(m = 0 ; m < block[0]; m++) + for(n = 0 ; n < block[1]; n++) + if(OUT_OF_ORDER == order) { + coords[k--] = s2 + (stride[1] * j) + n; + coords[k--] = s1 + (stride[0] * i) + m; + } + else if(IN_ORDER == order) { + coords[k++] = s1 + stride[0] * i + m; + coords[k++] = s2 + stride[1] * j + n; + } + + if(VERBOSE_MED) { + printf("start[]=(%lu, %lu), count[]=(%lu, %lu), stride[]=(%lu, %lu), block[]=(%lu, %lu), total datapoints=%lu\n", + (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1], + (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1], + (unsigned long)(block[0] * block[1] * count[0] * count[1])); + k = 0; + for(i = 0; i < num_points ; i++) { + printf("(%d, %d)\n", (int)coords[k], (int)coords[k + 1]); + k += 2; + } + } +} /* * Fill the dataset with trivial data for testing. @@ -501,7 +549,8 @@ dataset_writeAll(void) hid_t sid; /* Dataspace ID */ hid_t file_dataspace; /* File dataspace ID */ hid_t mem_dataspace; /* memory dataspace ID */ - hid_t dataset1, dataset2, dataset3, dataset4; /* Dataset ID */ + hid_t dataset1, dataset2, dataset3, dataset4; /* Dataset ID */ + hid_t dataset5, dataset6, dataset7; /* Dataset ID */ hid_t datatype; /* Datatype ID */ hbool_t use_gpfs = FALSE; /* Use GPFS hints */ hsize_t dims[RANK]; /* dataset dim sizes */ @@ -512,6 +561,11 @@ dataset_writeAll(void) hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */ hsize_t block[RANK]; /* for hyperslab setting */ + size_t num_points; /* for point selection */ + hsize_t *coords = NULL; /* for point selection */ + hsize_t current_dims; /* for point selection */ + int i; + herr_t ret; /* Generic return value */ int mpi_size, mpi_rank; @@ -526,6 +580,11 @@ dataset_writeAll(void) MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); + /* set up the coords array selection */ + num_points = dim1; + coords = (hsize_t *)HDmalloc(dim1 * RANK * sizeof(hsize_t)); + VRFY((coords != NULL), "coords malloc succeeded"); + /* allocate memory for data buffer */ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); @@ -573,6 +632,13 @@ dataset_writeAll(void) dataset3 = H5Dcreate2(fid, DATASETNAME3, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VRFY((dataset3 >= 0), "H5Dcreate2 succeeded"); + dataset5 = H5Dcreate2(fid, DATASETNAME7, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset5 >= 0), "H5Dcreate2 succeeded"); + dataset6 = H5Dcreate2(fid, DATASETNAME8, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset6 >= 0), "H5Dcreate2 succeeded"); + dataset7 = H5Dcreate2(fid, DATASETNAME9, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset7 >= 0), "H5Dcreate2 succeeded"); + /* release 2-D space ID created */ H5Sclose(sid); @@ -827,8 +893,6 @@ dataset_writeAll(void) VRFY((ret>= 0),"set independent IO collectively succeeded"); } - - /* write data collectively */ MESG("writeAll with scalar dataspace"); ret = H5Dwrite(dataset4, H5T_NATIVE_INT, mem_dataspace, file_dataspace, @@ -846,6 +910,137 @@ dataset_writeAll(void) H5Sclose(mem_dataspace); H5Pclose(xfer_plist); + + if(data_array1) free(data_array1); + data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + + block[0] = 1; + block[1] = dim1; + stride[0] = 1; + stride[1] = dim1; + count[0] = 1; + count[1] = 1; + start[0] = dim0/mpi_size * mpi_rank; + start[1] = 0; + + dataset_fill(start, block, data_array1); + MESG("data_array initialized"); + if(VERBOSE_MED){ + MESG("data_array created"); + dataset_print(start, block, data_array1); + } + + /* Dataset5: point selection in File - Hyperslab selection in Memory*/ + /* create a file dataspace independently */ + point_set (start, count, stride, block, num_points, coords, OUT_OF_ORDER); + file_dataspace = H5Dget_space (dataset5); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + start[0] = 0; + start[1] = 0; + mem_dataspace = H5Dget_space (dataset5); + VRFY((mem_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* write data collectively */ + ret = H5Dwrite(dataset5, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((ret >= 0), "H5Dwrite dataset5 succeeded"); + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + + /* Dataset6: point selection in File - Point selection in Memory*/ + /* create a file dataspace independently */ + start[0] = dim0/mpi_size * mpi_rank; + start[1] = 0; + point_set (start, count, stride, block, num_points, coords, OUT_OF_ORDER); + file_dataspace = H5Dget_space (dataset6); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + start[0] = 0; + start[1] = 0; + point_set (start, count, stride, block, num_points, coords, IN_ORDER); + mem_dataspace = H5Dget_space (dataset6); + VRFY((mem_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* write data collectively */ + ret = H5Dwrite(dataset6, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((ret >= 0), "H5Dwrite dataset6 succeeded"); + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + + /* Dataset7: point selection in File - All selection in Memory*/ + /* create a file dataspace independently */ + start[0] = dim0/mpi_size * mpi_rank; + start[1] = 0; + point_set (start, count, stride, block, num_points, coords, IN_ORDER); + file_dataspace = H5Dget_space (dataset7); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + current_dims = num_points; + mem_dataspace = H5Screate_simple (1, ¤t_dims, NULL); + VRFY((mem_dataspace >= 0), "mem_dataspace create succeeded"); + + ret = H5Sselect_all(mem_dataspace); + VRFY((ret >= 0), "H5Sselect_all succeeded"); + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* write data collectively */ + ret = H5Dwrite(dataset7, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((ret >= 0), "H5Dwrite dataset7 succeeded"); + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + /* * All writes completed. Close datasets collectively */ @@ -856,12 +1051,19 @@ dataset_writeAll(void) ret = H5Dclose(dataset3); VRFY((ret >= 0), "H5Dclose3 succeeded"); ret = H5Dclose(dataset4); - VRFY((ret >= 0), "H5Dclose3 succeeded"); + VRFY((ret >= 0), "H5Dclose4 succeeded"); + ret = H5Dclose(dataset5); + VRFY((ret >= 0), "H5Dclose5 succeeded"); + ret = H5Dclose(dataset6); + VRFY((ret >= 0), "H5Dclose6 succeeded"); + ret = H5Dclose(dataset7); + VRFY((ret >= 0), "H5Dclose7 succeeded"); /* close the file collectively */ H5Fclose(fid); /* release data buffers */ + if(coords) HDfree(coords); if(data_array1) HDfree(data_array1); } @@ -882,7 +1084,7 @@ dataset_readAll(void) hid_t xfer_plist; /* Dataset transfer properties list */ hid_t file_dataspace; /* File dataspace ID */ hid_t mem_dataspace; /* memory dataspace ID */ - hid_t dataset1, dataset2; /* Dataset ID */ + hid_t dataset1, dataset2, dataset5, dataset6, dataset7; /* Dataset ID */ hbool_t use_gpfs = FALSE; /* Use GPFS hints */ DATATYPE *data_array1 = NULL; /* data buffer */ DATATYPE *data_origin1 = NULL; /* expected data buffer */ @@ -892,6 +1094,11 @@ dataset_readAll(void) hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */ hsize_t block[RANK]; /* for hyperslab setting */ + size_t num_points; /* for point selection */ + hsize_t *coords = NULL; /* for point selection */ + hsize_t current_dims; /* for point selection */ + int i,j,k; + herr_t ret; /* Generic return value */ int mpi_size, mpi_rank; @@ -906,6 +1113,11 @@ dataset_readAll(void) MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); + /* set up the coords array selection */ + num_points = dim1; + coords = (hsize_t *)HDmalloc(dim0 * dim1 * RANK * sizeof(hsize_t)); + VRFY((coords != NULL), "coords malloc succeeded"); + /* allocate memory for data buffer */ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); @@ -939,6 +1151,14 @@ dataset_readAll(void) dataset2 = H5Dopen2(fid, DATASETNAME2, H5P_DEFAULT); VRFY((dataset2 >= 0), "H5Dopen2 2 succeeded"); + /* open another dataset collectively */ + dataset5 = H5Dopen2(fid, DATASETNAME7, H5P_DEFAULT); + VRFY((dataset5 >= 0), "H5Dopen2 5 succeeded"); + dataset6 = H5Dopen2(fid, DATASETNAME8, H5P_DEFAULT); + VRFY((dataset6 >= 0), "H5Dopen2 6 succeeded"); + dataset7 = H5Dopen2(fid, DATASETNAME9, H5P_DEFAULT); + VRFY((dataset7 >= 0), "H5Dopen2 7 succeeded"); + /* * Set up dimensions of the slab this process accesses. */ @@ -1077,6 +1297,162 @@ dataset_readAll(void) H5Sclose(mem_dataspace); H5Pclose(xfer_plist); + if(data_array1) free(data_array1); + if(data_origin1) free(data_origin1); + data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + data_origin1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); + + block[0] = 1; + block[1] = dim1; + stride[0] = 1; + stride[1] = dim1; + count[0] = 1; + count[1] = 1; + start[0] = dim0/mpi_size * mpi_rank; + start[1] = 0; + + dataset_fill(start, block, data_origin1); + MESG("data_array initialized"); + if(VERBOSE_MED){ + MESG("data_array created"); + dataset_print(start, block, data_origin1); + } + + /* Dataset5: point selection in memory - Hyperslab selection in file*/ + /* create a file dataspace independently */ + file_dataspace = H5Dget_space (dataset5); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + + start[0] = 0; + start[1] = 0; + point_set (start, count, stride, block, num_points, coords, OUT_OF_ORDER); + mem_dataspace = H5Dget_space (dataset5); + VRFY((mem_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* read data collectively */ + ret = H5Dread(dataset5, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((ret >= 0), "H5Dread dataset5 succeeded"); + + + ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); + if(ret) nerrors++; + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + + + if(data_array1) free(data_array1); + data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + + /* Dataset6: point selection in File - Point selection in Memory*/ + /* create a file dataspace independently */ + start[0] = dim0/mpi_size * mpi_rank; + start[1] = 0; + point_set (start, count, stride, block, num_points, coords, IN_ORDER); + file_dataspace = H5Dget_space (dataset6); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + start[0] = 0; + start[1] = 0; + point_set (start, count, stride, block, num_points, coords, OUT_OF_ORDER); + mem_dataspace = H5Dget_space (dataset6); + VRFY((mem_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* read data collectively */ + ret = H5Dread(dataset6, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((ret >= 0), "H5Dread dataset6 succeeded"); + + ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); + if(ret) nerrors++; + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + + if(data_array1) free(data_array1); + data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + + /* Dataset7: point selection in memory - All selection in file*/ + /* create a file dataspace independently */ + file_dataspace = H5Dget_space (dataset7); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_all(file_dataspace); + VRFY((ret >= 0), "H5Sselect_all succeeded"); + + num_points = dim0 * dim1; + k=0; + for (i=0 ; i<dim0; i++) { + for (j=0 ; j<dim1; j++) { + coords[k++] = i; + coords[k++] = j; + } + } + mem_dataspace = H5Dget_space (dataset7); + VRFY((mem_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* read data collectively */ + ret = H5Dread(dataset7, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((ret >= 0), "H5Dread dataset7 succeeded"); + + start[0] = dim0/mpi_size * mpi_rank; + start[1] = 0; + ret = dataset_vrfy(start, count, stride, block, data_array1+(dim0/mpi_size * dim1 * mpi_rank), data_origin1); + if(ret) nerrors++; + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); /* * All reads completed. Close datasets collectively @@ -1085,11 +1461,18 @@ dataset_readAll(void) VRFY((ret >= 0), "H5Dclose1 succeeded"); ret = H5Dclose(dataset2); VRFY((ret >= 0), "H5Dclose2 succeeded"); + ret = H5Dclose(dataset5); + VRFY((ret >= 0), "H5Dclose5 succeeded"); + ret = H5Dclose(dataset6); + VRFY((ret >= 0), "H5Dclose6 succeeded"); + ret = H5Dclose(dataset7); + VRFY((ret >= 0), "H5Dclose7 succeeded"); /* close the file collectively */ H5Fclose(fid); /* release data buffers */ + if(coords) HDfree(coords); if(data_array1) HDfree(data_array1); if(data_origin1) HDfree(data_origin1); } @@ -2713,7 +3096,6 @@ test_actual_io_mode(int selection_mode) { ret = H5Sselect_hyperslab(mem_space, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); - /* Get the number of elements in the selection */ length = dim0 * dim1; @@ -2768,7 +3150,6 @@ test_actual_io_mode(int selection_mode) { VRFY((actual_chunk_opt_mode_read == actual_chunk_opt_mode_write), "reading and writing are the same for actual_chunk_opt_mode"); - /* Test values */ if(actual_chunk_opt_mode_expected != (unsigned) -1 && actual_io_mode_expected != (unsigned) -1) { sprintf(message, "Actual Chunk Opt Mode has the correct value for %s.\n",test_name); @@ -2859,12 +3240,12 @@ actual_io_mode_tests(void) { int mpi_rank = -1; MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); MPI_Comm_size(MPI_COMM_WORLD, &mpi_rank); - + test_actual_io_mode(TEST_ACTUAL_IO_NO_COLLECTIVE); - + test_actual_io_mode(TEST_ACTUAL_IO_LINK_CHUNK); test_actual_io_mode(TEST_ACTUAL_IO_CONTIGUOUS); - + test_actual_io_mode(TEST_ACTUAL_IO_RESET); return; } @@ -2904,9 +3285,6 @@ actual_io_mode_tests(void) { * TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES: * Test for NULL dataspace as the cause of breaking collective I/O. * - * TEST_POINT_SELECTIONS: - * Test for selecting elements of dataspce as the cause of breaking collective I/O. - * * TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT: * Test for Compact layout as the cause of breaking collective I/O. * @@ -2945,8 +3323,8 @@ test_no_collective_cause_mode(int selection_mode) int length; int * buffer; int i; - MPI_Comm mpi_comm = MPI_COMM_NULL; - MPI_Info mpi_info = MPI_INFO_NULL; + MPI_Comm mpi_comm; + MPI_Info mpi_info; hid_t fid = -1; hid_t sid = -1; hid_t dataset = -1; @@ -2973,7 +3351,7 @@ test_no_collective_cause_mode(int selection_mode) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Barrier(MPI_COMM_WORLD); - + HDassert(mpi_size >= 1); mpi_comm = MPI_COMM_WORLD; @@ -3078,12 +3456,6 @@ test_no_collective_cause_mode(int selection_mode) no_collective_cause_global_expected |= H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES; } - if (selection_mode & TEST_POINT_SELECTIONS ) { - test_name = "Broken Collective I/O - Point Selection"; - no_collective_cause_local_expected |= H5D_MPIO_POINT_SELECTIONS; - no_collective_cause_global_expected |= H5D_MPIO_POINT_SELECTIONS; - } - if (selection_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT || selection_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL) { test_name = "Broken Collective I/O - No CONTI or CHUNKED Dataset"; @@ -3142,17 +3514,6 @@ test_no_collective_cause_mode(int selection_mode) VRFY((mem_space >= 0), "mem_space created"); } - if (selection_mode & TEST_POINT_SELECTIONS) { - coord[0][0] = 0; coord[0][1] = 0; - coord[1][0] = 1; coord[1][1] = 1; - ret = H5Sselect_elements (file_space, H5S_SELECT_SET, NELM, (const hsize_t *)coord); - VRFY((ret >= 0), "H5Sselect_elements succeeded"); - - ret = H5Sselect_elements (mem_space, H5S_SELECT_SET, NELM, (const hsize_t *)coord); - VRFY((ret >= 0), "H5Sselect_elements succeeded"); - } - - /* Get the number of elements in the selection */ length = dim0 * dim1; @@ -3268,7 +3629,7 @@ test_no_collective_cause_mode(int selection_mode) * have the correct values. * * NOTE: - * This is a temprary function. + * This is a temporary function. * test_no_collective_cause_mode(TEST_FILTERS) will replace this when * H5Dcreate and H5write support for mpio and filter feature. * @@ -3510,11 +3871,6 @@ test_no_collective_cause_mode_filter(int selection_mode) void no_collective_cause_tests(void) { - int mpi_size = -1; - int mpi_rank = -1; - MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - MPI_Comm_size(MPI_COMM_WORLD, &mpi_rank); - /* * Test individual cause */ @@ -3524,7 +3880,6 @@ no_collective_cause_tests(void) test_no_collective_cause_mode (TEST_DATA_TRANSFORMS); test_no_collective_cause_mode (TEST_SET_MPIPOSIX); test_no_collective_cause_mode (TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES); - test_no_collective_cause_mode (TEST_POINT_SELECTIONS); test_no_collective_cause_mode (TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT); test_no_collective_cause_mode (TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL); #ifdef H5_HAVE_FILTER_FLETCHER32 @@ -3540,7 +3895,7 @@ no_collective_cause_tests(void) */ test_no_collective_cause_mode (TEST_SET_MPIPOSIX | TEST_DATATYPE_CONVERSION); test_no_collective_cause_mode (TEST_DATATYPE_CONVERSION | TEST_DATA_TRANSFORMS); - test_no_collective_cause_mode (TEST_DATATYPE_CONVERSION | TEST_DATA_TRANSFORMS | TEST_POINT_SELECTIONS); + test_no_collective_cause_mode (TEST_SET_MPIPOSIX | TEST_DATATYPE_CONVERSION | TEST_DATA_TRANSFORMS); return; } diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index 8fc739e..516cc2f 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -1779,12 +1779,9 @@ void rr_obj_hdr_flush_confusion(void) */ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - if (mpi_size < 3){ - HDfprintf(stdout, "%s needs at least 3 processes to run. Terminated.\n", - fcn_name); - nerrors++; - return; - } + + HDassert(mpi_size > 2); + is_reader = mpi_rank % 2; mrc = MPI_Comm_split(MPI_COMM_WORLD, is_reader, mpi_rank, &comm); VRFY((mrc==MPI_SUCCESS), "MPI_Comm_split"); diff --git a/testpar/t_pmulti_dset.c b/testpar/t_pmulti_dset.c index 1c19a5a..87e15c4 100644 --- a/testpar/t_pmulti_dset.c +++ b/testpar/t_pmulti_dset.c @@ -114,7 +114,7 @@ test_pmdset(size_t niter, unsigned flags) unsigned op_data_incr; size_t i, j, k, l, m, n, o; - if(mpi_rank == 1) + if(mpi_rank == 0) TESTING("random I/O"); /* Calculate maximum number of datasets */ @@ -351,8 +351,9 @@ test_pmdset(size_t niter, unsigned flags) } /* end for */ /* Update dataset usage array if writing */ - for(m = 0; m < npoints; m++) - dset_usagei[k][points[2 * m]][points[(2 * m) + 1]] = (unsigned char)1; + if(!do_read) + for(m = 0; m < npoints; m++) + dset_usagei[k][points[2 * m]][points[(2 * m) + 1]] = (unsigned char)1; /* Select points in file if this is the current process */ @@ -471,7 +472,7 @@ test_pmdset(size_t niter, unsigned flags) free(efbuf); efbuf = NULL; - if(mpi_rank == 1) + if(mpi_rank == 0) PASSED(); return 0; @@ -552,14 +553,14 @@ main(int argc, char *argv[]) for(i = 0; i <= MDSET_ALL_FLAGS; i++) { /* Print flag configuration */ - if(mpi_rank == 1) { + if(mpi_rank == 0) { puts("\nConfiguration:"); printf(" Layout: %s\n", (i & MDSET_FLAG_CHUNK) ? "Chunked" : "Contiguous"); printf(" Shape same: %s\n", (i & MDSET_FLAG_SHAPESAME) ? "Yes" : "No"); printf(" I/O type: %s\n", (i & MDSET_FLAG_MDSET) ? "Multi" : "Single"); printf(" MPI I/O type: %s\n", (i & MDSET_FLAG_COLLECTIVE) ? "Collective" : "Independent"); } /* end if */ - + nerrors += test_pmdset(100, i); } /* end for */ diff --git a/testpar/t_prop.c b/testpar/t_prop.c index 39a7c2d..a37b35a 100644 --- a/testpar/t_prop.c +++ b/testpar/t_prop.c @@ -28,6 +28,7 @@ test_encode_decode(hid_t orig_pl, int mpi_rank, int recv_proc) hid_t pl; /* Decoded property list */ void *buf = NULL; size_t buf_size = 0; + int casted_size; herr_t ret; /* Generic return value */ if(mpi_rank == 0) { @@ -40,13 +41,17 @@ test_encode_decode(hid_t orig_pl, int mpi_rank, int recv_proc) ret = H5Pencode(orig_pl, buf, &buf_size); VRFY((ret >= 0), "H5Pencode succeeded"); - MPI_Isend(&buf_size, 1, MPI_INT, recv_proc, 123, MPI_COMM_WORLD, &req[0]); - MPI_Isend(buf, (int)buf_size, MPI_BYTE, recv_proc, 124, MPI_COMM_WORLD, &req[1]); + /* this is a temp fix to send this size_t */ + casted_size = (int)buf_size; + + MPI_Isend(&casted_size, 1, MPI_INT, recv_proc, 123, MPI_COMM_WORLD, &req[0]); + MPI_Isend(buf, casted_size, MPI_BYTE, recv_proc, 124, MPI_COMM_WORLD, &req[1]); } /* end if */ if(mpi_rank == recv_proc) { - MPI_Recv(&buf_size, 1, MPI_INT, 0, 123, MPI_COMM_WORLD, &status); + MPI_Recv(&casted_size, 1, MPI_INT, 0, 123, MPI_COMM_WORLD, &status); + buf_size = casted_size; buf = (uint8_t *)HDmalloc(buf_size); - MPI_Recv(buf, (int)buf_size, MPI_BYTE, 0, 124, MPI_COMM_WORLD, &status); + MPI_Recv(buf, casted_size, MPI_BYTE, 0, 124, MPI_COMM_WORLD, &status); pl = H5Pdecode(buf); VRFY((pl >= 0), "H5Pdecode succeeded"); @@ -68,8 +73,6 @@ test_encode_decode(hid_t orig_pl, int mpi_rank, int recv_proc) return(0); } - - void test_plist_ed(void) { diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index c08ae0e..71e2594 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -342,7 +342,7 @@ int main(int argc, char **argv) * calls. By then, MPI calls may not work. */ if (H5dont_atexit() < 0){ - printf("Failed to turn off atexit processing. Continue.\n", mpi_rank); + printf("Failed to turn off atexit processing. Continue.\n"); }; H5open(); h5_show_hostname(); @@ -469,11 +469,17 @@ int main(int argc, char **argv) "I/O mode confusion test -- hangs quickly on failure", &io_mode_confusion_params); - rr_obj_flush_confusion_params.name = PARATESTFILE; - rr_obj_flush_confusion_params.count = 0; /* value not used */ - AddTest("rrobjflushconf", rr_obj_hdr_flush_confusion, NULL, - "round robin object header flush confusion test", - &rr_obj_flush_confusion_params); + if((mpi_size < 3) && MAINPROCESS) { + printf("rr_obj_hdr_flush_confusion test needs at least 3 processes.\n"); + printf("rr_obj_hdr_flush_confusion test will be skipped \n"); + } + if(mpi_size > 2) { + rr_obj_flush_confusion_params.name = PARATESTFILE; + rr_obj_flush_confusion_params.count = 0; /* value not used */ + AddTest("rrobjflushconf", rr_obj_hdr_flush_confusion, NULL, + "round robin object header flush confusion test", + &rr_obj_flush_confusion_params); + } AddTest("tldsc", lower_dim_size_comp_test, NULL, diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h index cff8609..0a911f8 100644 --- a/testpar/testphdf5.h +++ b/testpar/testphdf5.h @@ -43,6 +43,13 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD, API_IND_HARD}; #define DATASETNAME4 "Data4" #define DATASETNAME5 "Data5" #define DATASETNAME6 "Data6" +#define DATASETNAME7 "Data7" +#define DATASETNAME8 "Data8" +#define DATASETNAME9 "Data9" + +/* point selection order */ +#define IN_ORDER 1 +#define OUT_OF_ORDER 2 /* Hyperslab layout styles */ #define BYROW 1 /* divide into slabs of rows */ @@ -173,13 +180,12 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD, API_IND_HARD}; #define TEST_DATA_TRANSFORMS 0x008 #define TEST_SET_MPIPOSIX 0x010 #define TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES 0x020 -#define TEST_POINT_SELECTIONS 0x040 -#define TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT 0x080 -#define TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL 0x100 -#define TEST_FILTERS 0x200 +#define TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT 0x040 +#define TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL 0x080 +#define TEST_FILTERS 0x100 /* TEST_FILTERS will take place of this after supporting mpio + filter for * H5Dcreate and H5Dwrite */ -#define TEST_FILTERS_READ 0x400 +#define TEST_FILTERS_READ 0x200 /* Don't erase these lines, they are put here for debugging purposes */ /* @@ -288,5 +294,6 @@ hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type, hbool_ MPI_Offset h5_mpi_get_file_size(const char *filename, MPI_Comm comm, MPI_Info info); int dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], DATATYPE *dataset, DATATYPE *original); - +void point_set (hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], + size_t num_points, hsize_t coords[], int order); #endif /* PHDF5TEST_H */ diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 3bb4a1f..a9a7232 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,10 +1,10 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Setup include Directories @@ -14,9 +14,9 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) # -------------------------------------------------------------------- # If testing was NOT enabled, then we need to build the tools library # -------------------------------------------------------------------- -IF (NOT BUILD_TESTING) +if (NOT BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/lib) -ENDIF (NOT BUILD_TESTING) +endif (NOT BUILD_TESTING) #-- Add the h5diff and test executables ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5diff) diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index 6faf332..e5a1a9f 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS_H5COPY) #----------------------------------------------------------------------------- @@ -9,27 +9,27 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5copy and test executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) +add_executable (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) TARGET_NAMING (h5copy ${LIB_TYPE}) TARGET_C_PROPERTIES (h5copy " " " ") -TARGET_LINK_LIBRARIES (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5copy PROPERTIES FOLDER tools) +target_link_libraries (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5copy PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5copy) +set (H5_DEP_EXECUTABLES h5copy) -IF (BUILD_TESTING) - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c) +if (BUILD_TESTING) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c) TARGET_NAMING (h5copygentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5copygentest " " " ") - TARGET_LINK_LIBRARIES (h5copygentest ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5copygentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5copygentest ${HDF5_LIB_TARGET}) + set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools) - #ADD_TEST (NAME h5copygentest COMMAND $<TARGET_FILE:h5copygentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + #add_test (NAME h5copygentest COMMAND $<TARGET_FILE:h5copygentest>) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -43,7 +43,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5copy ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5copy RUNTIME DESTINATION diff --git a/tools/h5copy/CMakeTests.cmake b/tools/h5copy/CMakeTests.cmake index a4cce03..34976fe 100644 --- a/tools/h5copy/CMakeTests.cmake +++ b/tools/h5copy/CMakeTests.cmake @@ -8,30 +8,30 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES + set (LIST_HDF5_TEST_FILES ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_src.h5 ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_trg.h5 ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_ref.h5 ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copytst.h5 ) - SET (LIST_OTHER_TEST_FILES + set (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out ) FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${listfiles}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #MESSAGE (STATUS " Copying ${listfiles}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #message (STATUS " Copying ${listfiles}") + add_custom_command ( TARGET h5copy POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${listfiles} ${dest} ) - ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) ############################################################################## ############################################################################## @@ -43,157 +43,157 @@ # Perform h5copy according to passing parmeters # MACRO (ADD_H5_F_TEST testname resultcode infile fparam vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5COPY_F-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5COPY_F-${testname} COMMAND $<TARGET_FILE:h5copy> -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS H5COPY_F-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5COPY_F-${testname} PROPERTIES DEPENDS H5COPY_F-${testname}-clear-objects) + endif (HDF5_ENABLE_USING_MEMCHECKER) # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") - ADD_TEST ( + if (NOT ${resultcode} STREQUAL "2") + add_test ( NAME H5COPY_F-${testname}-DIFF COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) - IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") + if (${resultcode} STREQUAL "1") + set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_F_TEST) MACRO (ADD_H5_TEST testname resultcode infile vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5COPY-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5COPY-${testname} COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) + endif (HDF5_ENABLE_USING_MEMCHECKER) # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") - ADD_TEST ( + if (NOT ${resultcode} STREQUAL "2") + add_test ( NAME H5COPY-${testname}-DIFF COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) - IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") + if (${resultcode} STREQUAL "1") + set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_TEST) MACRO (ADD_H5_TEST2 testname resultcode infile psparam pdparam vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5COPY-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5COPY-${testname}-prefill COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-${testname}-prefill PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5COPY-${testname}-prefill PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) + endif (HDF5_ENABLE_USING_MEMCHECKER) + + add_test ( NAME H5COPY-${testname} COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill) + set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill) # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") - ADD_TEST ( + if (NOT ${resultcode} STREQUAL "2") + add_test ( NAME H5COPY-${testname}-DIFF COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) - IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") + if (${resultcode} STREQUAL "1") + set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_TEST2) MACRO (ADD_H5_TEST_SAME testname resultcode pfile psparam pdparam vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5COPY_SAME-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5COPY_SAME-${testname}-prefill COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS H5COPY_SAME-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS H5COPY_SAME-${testname}-clear-objects) + endif (HDF5_ENABLE_USING_MEMCHECKER) + + add_test ( NAME H5COPY_SAME-${testname} COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${testname}.out.h5 -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - SET_TESTS_PROPERTIES (H5COPY_SAME-${testname} PROPERTIES DEPENDS H5COPY_SAME-${testname}-prefill) + set_tests_properties (H5COPY_SAME-${testname} PROPERTIES DEPENDS H5COPY_SAME-${testname}-prefill) # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") - ADD_TEST ( + if (NOT ${resultcode} STREQUAL "2") + add_test ( NAME H5COPY_SAME-${testname}-DIFF COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) - IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") + if (${resultcode} STREQUAL "1") + set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_TEST_SAME) # @@ -202,17 +202,17 @@ # MACRO (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5COPY-CMP-${testname} COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) - IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5COPY-CMP-${testname} COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) + if (${resultcode} STREQUAL "1") + set_tests_properties (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") + endif (${resultcode} STREQUAL "1") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5COPY-CMP-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -220,7 +220,7 @@ ./testfiles/${testname}.out.out ./testfiles/${testname}.out.out.err ) - ADD_TEST ( + add_test ( NAME H5COPY-CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5copy>" @@ -232,8 +232,8 @@ -D "TEST_MASK=true" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_CMP_TEST) ############################################################################## @@ -245,14 +245,14 @@ # -------------------------------------------------------------------- # test file names # -------------------------------------------------------------------- - SET (HDF_FILE1 h5copytst) - SET (HDF_FILE2 h5copy_ref) - SET (HDF_EXT_SRC_FILE h5copy_extlinks_src) - SET (HDF_EXT_TRG_FILE h5copy_extlinks_trg) + set (HDF_FILE1 h5copytst) + set (HDF_FILE2 h5copy_ref) + set (HDF_EXT_SRC_FILE h5copy_extlinks_src) + set (HDF_EXT_TRG_FILE h5copy_extlinks_trg) - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5COPY-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -291,12 +291,12 @@ h5copy_misc1.out.out h5copy_misc1.out.out.err ) - SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5COPY-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5COPY-clearall-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5COPY-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # "Test copying various forms of datasets" ADD_H5_TEST (simple 0 ${HDF_FILE1}.h5 -v -s simple -d simple) diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index d79c290..5620968 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS_H5DIFF) #----------------------------------------------------------------------------- @@ -9,45 +9,45 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5diff executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5diff +add_executable (h5diff ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_main.c ) TARGET_NAMING (h5diff ${LIB_TYPE}) TARGET_C_PROPERTIES (h5diff " " " ") -TARGET_LINK_LIBRARIES (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5diff PROPERTIES FOLDER tools) +target_link_libraries (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5diff PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5diff) +set (H5_DEP_EXECUTABLES h5diff) -IF (H5_HAVE_PARALLEL) - ADD_EXECUTABLE (ph5diff +if (H5_HAVE_PARALLEL) + add_executable (ph5diff ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/ph5diff_main.c ) TARGET_NAMING (ph5diff ${LIB_TYPE}) TARGET_C_PROPERTIES (ph5diff " " " ") - TARGET_LINK_LIBRARIES (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (ph5diff PROPERTIES FOLDER tools) -ENDIF (H5_HAVE_PARALLEL) + target_link_libraries (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (ph5diff PROPERTIES FOLDER tools) +endif (H5_HAVE_PARALLEL) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5diff and test executables # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5diffgentest ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diffgentest.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5diffgentest ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diffgentest.c) TARGET_NAMING (h5diffgentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5diffgentest " " " ") - TARGET_LINK_LIBRARIES (h5diffgentest ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5diffgentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5diffgentest ${HDF5_LIB_TARGET}) + set_target_properties (h5diffgentest PROPERTIES FOLDER generator/tools) - #ADD_TEST (NAME h5diffgentest COMMAND $<TARGET_FILE:h5diffgentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + #add_test (NAME h5diffgentest COMMAND $<TARGET_FILE:h5diffgentest>) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -61,7 +61,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5diff RUNTIME DESTINATION @@ -70,11 +70,11 @@ INSTALL ( toolsapplications ) -IF (H5_HAVE_PARALLEL) +if (H5_HAVE_PARALLEL) #INSTALL_PROGRAM_PDB (ph5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) - INSTALL ( + install ( TARGETS ph5diff RUNTIME DESTINATION @@ -82,4 +82,4 @@ IF (H5_HAVE_PARALLEL) COMPONENT toolsapplications ) -ENDIF (H5_HAVE_PARALLEL) +endif (H5_HAVE_PARALLEL) diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index cac4f84..8bae2ca 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -8,7 +8,7 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES + set (LIST_HDF5_TEST_FILES ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_basic1.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_basic2.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_types.h5 @@ -52,7 +52,7 @@ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/non_comparables2.h5 ) - SET (LIST_OTHER_TEST_FILES + set (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_10.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_100.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_101.txt @@ -239,50 +239,50 @@ # # copy test files from source to build dir # - FOREACH (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + foreach (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${h5_tstfiles}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #MESSAGE (STATUS " Copying ${fname}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #message (STATUS " Copying ${fname}") + add_custom_command ( TARGET h5diff POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${h5_tstfiles} ${dest} ) - ENDFOREACH (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) # # Overwrite system dependent files (Windows) # - IF (WIN32 AND NOT CYGWIN) - ADD_CUSTOM_COMMAND ( + if (WIN32 AND NOT CYGWIN) + add_custom_command ( TARGET h5diff POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_101w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_101.txt ) - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET h5diff POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_102w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_102.txt ) - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET h5diff POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_103w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_103.txt ) - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET h5diff POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_104w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_104.txt ) - ENDIF (WIN32 AND NOT CYGWIN) + endif (WIN32 AND NOT CYGWIN) ############################################################################## ############################################################################## @@ -292,22 +292,22 @@ MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DIFF-${resultfile} COMMAND $<TARGET_FILE:h5diff> ${ARGN}) - SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DIFF-${resultfile} COMMAND $<TARGET_FILE:h5diff> ${ARGN}) + set_tests_properties (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (NOT ${resultcode} STREQUAL "0") + set_tests_properties (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DIFF-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${resultfile}.out ./testfiles/${resultfile}.out.err ) - ADD_TEST ( + add_test ( NAME H5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5diff>" @@ -319,31 +319,31 @@ -D "TEST_APPEND=EXIT CODE:" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS "H5DIFF-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - IF (H5_HAVE_PARALLEL) + set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS "H5DIFF-${resultfile}-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) + if (H5_HAVE_PARALLEL) ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN}) - ENDIF (H5_HAVE_PARALLEL) + endif (H5_HAVE_PARALLEL) ENDMACRO (ADD_H5_TEST file) MACRO (ADD_PH5_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME PH5DIFF-${resultfile} COMMAND $<TARGET_FILE:ph5diff> ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN}) - SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PH5DIFF-${resultfile} COMMAND $<TARGET_FILE:ph5diff> ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN}) + set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (NOT ${resultcode} STREQUAL "0") + set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME PH5DIFF-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${resultfile}_p.out ./testfiles/${resultfile}_p.out.err ) - ADD_TEST ( + add_test ( NAME PH5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=${MPIEXEC};${MPIEXEC_PREFLAGS};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_POSTFLAGS};$<TARGET_FILE:ph5diff>" @@ -357,8 +357,8 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/prunTest.cmake" ) - SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS "PH5DIFF-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS "PH5DIFF-${resultfile}-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_PH5_TEST file) # ADD_H5_NO_OUTPUT_TEST @@ -366,30 +366,30 @@ # Don't use this if possible; this may be removed. MACRO (ADD_H5_NO_OUTPUT_TEST testname resultcode) # If using memchecker add tests without using scripts - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DIFF-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out ./testfiles/${testname}.out.err ) # if there was a previous test - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DIFF-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - - ADD_TEST (NAME H5DIFF-${testname} COMMAND $<TARGET_FILE:h5diff> ${ARGN}) - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES DEPENDS H5DIFF-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DIFF-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + + add_test (NAME H5DIFF-${testname} COMMAND $<TARGET_FILE:h5diff> ${ARGN}) + if (NOT ${resultcode} STREQUAL "0") + set_tests_properties (H5DIFF-${testname} PROPERTIES WILL_FAIL "true") + endif (NOT ${resultcode} STREQUAL "0") + + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DIFF-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DIFF-${testname} PROPERTIES DEPENDS H5DIFF-${testname}-clear-objects) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_NO_OUTPUT_TEST) ############################################################################## @@ -401,56 +401,56 @@ # -------------------------------------------------------------------- # test file names # -------------------------------------------------------------------- - SET (FILE1 h5diff_basic1.h5) - SET (FILE2 h5diff_basic2.h5) - SET (FILE3 h5diff_types.h5) - SET (FILE4 h5diff_dtypes.h5) - SET (FILE5 h5diff_attr1.h5) - SET (FILE6 h5diff_attr2.h5) - SET (FILE7 h5diff_dset1.h5) - SET (FILE8 h5diff_dset2.h5) - SET (FILE9 h5diff_hyper1.h5) - SET (FILE10 h5diff_hyper2.h5) - SET (FILE11 h5diff_empty.h5) - SET (FILE12 h5diff_links.h5) - SET (FILE13 h5diff_softlinks.h5) - SET (FILE14 h5diff_linked_softlink.h5) - SET (FILE15 h5diff_extlink_src.h5) - SET (FILE16 h5diff_extlink_trg.h5) - SET (FILE17 h5diff_ext2softlink_src.h5) - SET (FILE18 h5diff_ext2softlink_trg.h5) - SET (FILE19 h5diff_dset_zero_dim_size1.h5) - SET (FILE20 h5diff_dset_zero_dim_size2.h5) - SET (DANGLE_LINK_FILE1 h5diff_danglelinks1.h5) - SET (DANGLE_LINK_FILE2 h5diff_danglelinks2.h5) - SET (GRP_RECURSE_FILE1 h5diff_grp_recurse1.h5) - SET (GRP_RECURSE_FILE2 h5diff_grp_recurse2.h5) + set (FILE1 h5diff_basic1.h5) + set (FILE2 h5diff_basic2.h5) + set (FILE3 h5diff_types.h5) + set (FILE4 h5diff_dtypes.h5) + set (FILE5 h5diff_attr1.h5) + set (FILE6 h5diff_attr2.h5) + set (FILE7 h5diff_dset1.h5) + set (FILE8 h5diff_dset2.h5) + set (FILE9 h5diff_hyper1.h5) + set (FILE10 h5diff_hyper2.h5) + set (FILE11 h5diff_empty.h5) + set (FILE12 h5diff_links.h5) + set (FILE13 h5diff_softlinks.h5) + set (FILE14 h5diff_linked_softlink.h5) + set (FILE15 h5diff_extlink_src.h5) + set (FILE16 h5diff_extlink_trg.h5) + set (FILE17 h5diff_ext2softlink_src.h5) + set (FILE18 h5diff_ext2softlink_trg.h5) + set (FILE19 h5diff_dset_zero_dim_size1.h5) + set (FILE20 h5diff_dset_zero_dim_size2.h5) + set (DANGLE_LINK_FILE1 h5diff_danglelinks1.h5) + set (DANGLE_LINK_FILE2 h5diff_danglelinks2.h5) + set (GRP_RECURSE_FILE1 h5diff_grp_recurse1.h5) + set (GRP_RECURSE_FILE2 h5diff_grp_recurse2.h5) # group recursive - same structure via external links through files - SET (GRP_RECURSE1_EXT h5diff_grp_recurse_ext1.h5) - SET (GRP_RECURSE2_EXT1 h5diff_grp_recurse_ext2-1.h5) - SET (GRP_RECURSE2_EXT2 h5diff_grp_recurse_ext2-2.h5) - SET (GRP_RECURSE2_EXT3 h5diff_grp_recurse_ext2-3.h5) + set (GRP_RECURSE1_EXT h5diff_grp_recurse_ext1.h5) + set (GRP_RECURSE2_EXT1 h5diff_grp_recurse_ext2-1.h5) + set (GRP_RECURSE2_EXT2 h5diff_grp_recurse_ext2-2.h5) + set (GRP_RECURSE2_EXT3 h5diff_grp_recurse_ext2-3.h5) # same structure, same obj name with different value - SET (EXCLUDE_FILE1_1 h5diff_exclude1-1.h5) - SET (EXCLUDE_FILE1_2 h5diff_exclude1-2.h5) + set (EXCLUDE_FILE1_1 h5diff_exclude1-1.h5) + set (EXCLUDE_FILE1_2 h5diff_exclude1-2.h5) # different structure and obj names - SET (EXCLUDE_FILE2_1 h5diff_exclude2-1.h5) - SET (EXCLUDE_FILE2_2 h5diff_exclude2-2.h5) + set (EXCLUDE_FILE2_1 h5diff_exclude2-1.h5) + set (EXCLUDE_FILE2_2 h5diff_exclude2-2.h5) # Only one file contains unique objs. Common objs are same. - SET (EXCLUDE_FILE3_1 h5diff_exclude3-1.h5) - SET (EXCLUDE_FILE3_2 h5diff_exclude3-2.h5) + set (EXCLUDE_FILE3_1 h5diff_exclude3-1.h5) + set (EXCLUDE_FILE3_2 h5diff_exclude3-2.h5) # compound type with multiple vlen string types - SET (COMP_VL_STRS_FILE h5diff_comp_vl_strs.h5) + set (COMP_VL_STRS_FILE h5diff_comp_vl_strs.h5) # container types (array,vlen) with multiple nested compound types - SET (COMPS_ARRAY_VLEN_FILE1 compounds_array_vlen1.h5) - SET (COMPS_ARRAY_VLEN_FILE2 compounds_array_vlen2.h5) + set (COMPS_ARRAY_VLEN_FILE1 compounds_array_vlen1.h5) + set (COMPS_ARRAY_VLEN_FILE2 compounds_array_vlen2.h5) # attrs with verbose option level - SET (ATTR_VERBOSE_LEVEL_FILE1 h5diff_attr_v_level1.h5) - SET (ATTR_VERBOSE_LEVEL_FILE2 h5diff_attr_v_level2.h5) + set (ATTR_VERBOSE_LEVEL_FILE1 h5diff_attr_v_level1.h5) + set (ATTR_VERBOSE_LEVEL_FILE2 h5diff_attr_v_level2.h5) - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5DIFF-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -801,12 +801,12 @@ h5diff_90.out h5diff_90.out.err ) - SET_TESTS_PROPERTIES (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DIFF-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DIFF-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DIFF-clearall-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5DIFF-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # ############################################################################ # # Common usage @@ -1074,7 +1074,7 @@ ADD_H5_TEST (h5diff_90 0 -v ${FILE2} ${FILE2}) # 10. read by hyperslab, print indexes #if test -n "$pmode" -a "$mydomainname" = hdfgroup.uiuc.edu; then # # skip this test which sometimes hangs in some THG machines -# MESSAGE (STATUS "SKIP -v ${FILE9} ${FILE10}) +# message (STATUS "SKIP -v ${FILE9} ${FILE10}) #else # ADD_H5_TEST (h5diff_100 1 -v ${FILE9} ${FILE10}) #fi diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 30ff215..1a46586 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS_H5DUMP) #----------------------------------------------------------------------------- @@ -9,38 +9,38 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5dump executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5dump +add_executable (h5dump ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump.c ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump_ddl.c ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump_xml.c ) TARGET_NAMING (h5dump ${LIB_TYPE}) TARGET_C_PROPERTIES (h5dump " " " ") -TARGET_LINK_LIBRARIES (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5dump PROPERTIES FOLDER tools) +target_link_libraries (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5dump PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5dump) +set (H5_DEP_EXECUTABLES h5dump) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5dump test executable # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5dumpgentest ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5dumpgentest ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) TARGET_NAMING (h5dumpgentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5dumpgentest " " " ") - TARGET_LINK_LIBRARIES (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5dumpgentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools) - #ADD_TEST (NAME h5dumpgentest COMMAND $<TARGET_FILE:h5dumpgentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + #add_test (NAME h5dumpgentest COMMAND $<TARGET_FILE:h5dumpgentest>) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) - INCLUDE (CMakeTestsPBITS.cmake) + include (CMakeTestsPBITS.cmake) - INCLUDE (CMakeTestsXML.cmake) -ENDIF (BUILD_TESTING) + include (CMakeTestsXML.cmake) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -54,7 +54,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5dump ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5dump RUNTIME DESTINATION diff --git a/tools/h5dump/CMakeTests.cmake b/tools/h5dump/CMakeTests.cmake index 13c3d41..433faa3 100644 --- a/tools/h5dump/CMakeTests.cmake +++ b/tools/h5dump/CMakeTests.cmake @@ -8,7 +8,7 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- - SET (HDF5_REFERENCE_FILES + set (HDF5_REFERENCE_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/charsets.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/file_space.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/filter_fail.ddl @@ -173,7 +173,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/out3.h5import ${HDF5_TOOLS_SRC_DIR}/testfiles/zerodim.ddl ) - SET (HDF5_REFERENCE_EXP_FILES + set (HDF5_REFERENCE_EXP_FILES tall-6.exp tnoddlfile.exp trawdatafile.exp @@ -183,7 +183,7 @@ twithddl.exp twithddlfile.exp ) - SET (HDF5_REFERENCE_TEST_FILES + set (HDF5_REFERENCE_TEST_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/charsets.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/file_space.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/filter_fail.h5 @@ -280,7 +280,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvms.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/zerodim.h5 ) - SET (HDF5_ERROR_REFERENCE_TEST_FILES + set (HDF5_ERROR_REFERENCE_TEST_FILES ${PROJECT_SOURCE_DIR}/errfiles/filter_fail.err ${PROJECT_SOURCE_DIR}/errfiles/tall-1.err ${PROJECT_SOURCE_DIR}/errfiles/tall-2A.err @@ -312,77 +312,77 @@ # # copy test files from source dir to test dir # - FOREACH (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) + foreach (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${tst_h5_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") - #MESSAGE (STATUS " Copying ${tst_h5_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") + #message (STATUS " Copying ${tst_h5_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${tst_h5_file} ${dest} ) - ENDFOREACH (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) - FOREACH (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) - IF (WIN32 AND NOT CYGWIN) + foreach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) + if (WIN32 AND NOT CYGWIN) FILE (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file} TEST_STREAM) FILE (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file} "${TEST_STREAM}") - ELSE (WIN32 AND NOT CYGWIN) - ADD_CUSTOM_COMMAND ( + else (WIN32 AND NOT CYGWIN) + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file} ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file} ) - ENDIF (WIN32 AND NOT CYGWIN) - ENDFOREACH (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) + endif (WIN32 AND NOT CYGWIN) + endforeach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) - FOREACH (tst_other_file ${HDF5_REFERENCE_FILES}) + foreach (tst_other_file ${HDF5_REFERENCE_FILES}) GET_FILENAME_COMPONENT(fname "${tst_other_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") - #MESSAGE (STATUS " Copying ${tst_other_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") + #message (STATUS " Copying ${tst_other_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${tst_other_file} ${dest} ) - ENDFOREACH (tst_other_file ${HDF5_REFERENCE_FILES}) + endforeach (tst_other_file ${HDF5_REFERENCE_FILES}) - FOREACH (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) + foreach (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${tst_error_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") - #MESSAGE (STATUS " Copying ${tst_error_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") + #message (STATUS " Copying ${tst_error_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${tst_error_file} ${dest} ) - ENDFOREACH (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) + endforeach (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) # -------------------------------------------------------------------- # Special file handling # -------------------------------------------------------------------- - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/tbin1.ddl ${PROJECT_BINARY_DIR}/testfiles/std/tbin1LE.ddl ) - IF (WIN32 AND NOT CYGWIN) + if (WIN32 AND NOT CYGWIN) FILE (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp TEST_STREAM) FILE (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}") - ELSE (WIN32 AND NOT CYGWIN) - ADD_CUSTOM_COMMAND ( + else (WIN32 AND NOT CYGWIN) + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp ) - ENDIF (WIN32 AND NOT CYGWIN) + endif (WIN32 AND NOT CYGWIN) ############################################################################## ############################################################################## @@ -392,21 +392,21 @@ MACRO (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-${testname} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) - SET_TESTS_PROPERTIES (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-${testname}") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DUMP-${testname} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) + set_tests_properties (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5DUMP-${testname}") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-h5dump-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove h5dump-${testname}.out h5dump-${testname}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-h5dump-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-h5dump-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -417,42 +417,42 @@ -D "TEST_REFERENCE=h5dump-${testname}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-h5dump-${testname} PROPERTIES DEPENDS "H5DUMP-h5dump-${testname}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-h5dump-${testname} PROPERTIES DEPENDS "H5DUMP-h5dump-${testname}-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_HELP_TEST) MACRO (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-${skipresultfile}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile} ${ARGN}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") ADD_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) - ENDIF (${testtype} STREQUAL "SKIP") + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_SKIP_H5_TEST) MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + if (NOT ${resultcode} STREQUAL "0") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.bin ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -463,29 +463,29 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) MACRO (ADD_H5_TEST_N resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-N-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) - SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DUMP-N-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) + set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + if (NOT ${resultcode} STREQUAL "0") + set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-N-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}-N.bin ${resultfile}-N.out ${resultfile}-N.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-N-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-N-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -496,29 +496,29 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES DEPENDS "H5DUMP-N-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES DEPENDS "H5DUMP-N-${resultfile}-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST_N file) MACRO (ADD_H5_TEST_EXPORT resultfile targetfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN} ${resultfile}.txt ${targetfile}) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN} ${resultfile}.txt ${targetfile}) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + if (NOT ${resultcode} STREQUAL "0") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.txt ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -529,36 +529,36 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + add_test ( NAME H5DUMP-${resultfile}-output-cmp COMMAND ${CMAKE_COMMAND} -E compare_files ${resultfile}.txt ${resultfile}.exp ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST_EXPORT file) MACRO (ADD_H5_TEST_EXPORT_DDL resultfile targetfile resultcode ddlfile) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile}) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile}) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + if (NOT ${resultcode} STREQUAL "0") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${ddlfile}.txt ${resultfile}.txt ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -569,57 +569,57 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + add_test ( NAME H5DUMP-${resultfile}-output-cmp COMMAND ${CMAKE_COMMAND} -E compare_files ${resultfile}.txt ${resultfile}.exp ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) + add_test ( NAME H5DUMP-${resultfile}-output-cmp-ddl COMMAND ${CMAKE_COMMAND} -E compare_files ${ddlfile}.txt ${ddlfile}.exp ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES DEPENDS H5DUMP-${resultfile}-output-cmp) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES DEPENDS H5DUMP-${resultfile}-output-cmp) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST_EXPORT_DDL file) MACRO (ADD_H5_EXPORT_TEST resultfile targetfile resultcode) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-output-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.txt ) - SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-output-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-output-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN} ${resultfile}.txt ${targetfile} ) - SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}-clear-objects) - ADD_TEST ( + set_tests_properties (H5DUMP-output-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + set_tests_properties (H5DUMP-output-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}-clear-objects) + add_test ( NAME H5DUMP-output-cmp-${resultfile} COMMAND ${CMAKE_COMMAND} -E compare_files ${resultfile}.txt ${resultfile}.exp ) - SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_EXPORT_TEST file) MACRO (ADD_H5_MASK_TEST resultfile resultcode) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -631,19 +631,19 @@ -D "TEST_MASK_ERROR=true" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_MASK_TEST file) MACRO (ADD_H5ERR_MASK_TEST resultfile resultcode) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -656,19 +656,19 @@ -D "TEST_MASK_ERROR=true" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5ERR_MASK_TEST file) MACRO (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -683,20 +683,20 @@ -D "TEST_ENV_VALUE:STRING=${envval}" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5ERR_MASK_ENV_TEST) MACRO (ADD_H5_TEST_IMPORT conffile resultfile testfile resultcode) # If using memchecker add tests without using scripts - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-IMPORT-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${conffile}.out ${conffile}.out.err ${resultfile}.bin ${resultfile}.h5 ) - SET_TESTS_PROPERTIES (H5DUMP-IMPORT-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-IMPORT-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-IMPORT-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -707,14 +707,14 @@ -D "TEST_REFERENCE=${conffile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-IMPORT-${resultfile} PROPERTIES DEPENDS "H5DUMP-IMPORT-${resultfile}-clear-objects") - ADD_TEST (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND h5import ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5) - SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-${resultfile}) - ADD_TEST (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND h5diff ${testfile} ${resultfile}.h5 /integer /integer) - SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-h5import-${resultfile}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-IMPORT-${resultfile} PROPERTIES DEPENDS "H5DUMP-IMPORT-${resultfile}-clear-objects") + add_test (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND h5import ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5) + set_tests_properties (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + set_tests_properties (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-${resultfile}) + add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND h5diff ${testfile} ${resultfile}.h5 /integer /integer) + set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-h5import-${resultfile}) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST_IMPORT file) ############################################################################## @@ -723,9 +723,9 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5DUMP-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -1052,12 +1052,12 @@ zerodim.out zerodim.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DUMP-clearall-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5DUMP-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ADD_HELP_TEST(help 0 -h) @@ -1326,38 +1326,38 @@ # filters are defined. # detect whether the encoder is present. - IF (H5_HAVE_FILTER_DEFLATE) - SET (USE_FILTER_DEFLATE "true") - ENDIF (H5_HAVE_FILTER_DEFLATE) + if (H5_HAVE_FILTER_DEFLATE) + set (USE_FILTER_DEFLATE "true") + endif (H5_HAVE_FILTER_DEFLATE) - IF (H5_HAVE_FILTER_SZIP) - SET (USE_FILTER_SZIP "true") - ENDIF (H5_HAVE_FILTER_SZIP) + if (H5_HAVE_FILTER_SZIP) + set (USE_FILTER_SZIP "true") + endif (H5_HAVE_FILTER_SZIP) - IF (H5_HAVE_FILTER_SHUFFLE) - SET (USE_FILTER_SHUFFLE "true") - ENDIF (H5_HAVE_FILTER_SHUFFLE) + if (H5_HAVE_FILTER_SHUFFLE) + set (USE_FILTER_SHUFFLE "true") + endif (H5_HAVE_FILTER_SHUFFLE) - IF (H5_HAVE_FILTER_FLETCHER32) - SET (USE_FILTER_FLETCHER32 "true") - ENDIF (H5_HAVE_FILTER_FLETCHER32) + if (H5_HAVE_FILTER_FLETCHER32) + set (USE_FILTER_FLETCHER32 "true") + endif (H5_HAVE_FILTER_FLETCHER32) - IF (H5_HAVE_FILTER_NBIT) - SET (USE_FILTER_NBIT "true") - ENDIF (H5_HAVE_FILTER_NBIT) + if (H5_HAVE_FILTER_NBIT) + set (USE_FILTER_NBIT "true") + endif (H5_HAVE_FILTER_NBIT) - IF (H5_HAVE_FILTER_SCALEOFFSET) - SET (USE_FILTER_SCALEOFFSET "true") - ENDIF (H5_HAVE_FILTER_SCALEOFFSET) + if (H5_HAVE_FILTER_SCALEOFFSET) + set (USE_FILTER_SCALEOFFSET "true") + endif (H5_HAVE_FILTER_SCALEOFFSET) - IF (USE_FILTER_DEFLATE AND USE_FILTER_SHUFFLE AND USE_FILTER_FLETCHER32 AND USE_FILTER_NBIT AND USE_FILTER_SCALEOFFSET) + if (USE_FILTER_DEFLATE AND USE_FILTER_SHUFFLE AND USE_FILTER_FLETCHER32 AND USE_FILTER_NBIT AND USE_FILTER_SCALEOFFSET) # data read internal filters ADD_H5_TEST (treadintfilter 0 --enable-error-stack -d deflate -d shuffle -d fletcher32 -d nbit -d scaleoffset tfilters.h5) - IF (HDF5_ENABLE_SZIP_SUPPORT) + if (HDF5_ENABLE_SZIP_SUPPORT) # data read all filters ADD_H5_TEST (treadfilter 0 --enable-error-stack -d all -d szip tfilters.h5) - ENDIF (HDF5_ENABLE_SZIP_SUPPORT) - ENDIF (USE_FILTER_DEFLATE AND USE_FILTER_SHUFFLE AND USE_FILTER_FLETCHER32 AND USE_FILTER_NBIT AND USE_FILTER_SCALEOFFSET) + endif (HDF5_ENABLE_SZIP_SUPPORT) + endif (USE_FILTER_DEFLATE AND USE_FILTER_SHUFFLE AND USE_FILTER_FLETCHER32 AND USE_FILTER_NBIT AND USE_FILTER_SCALEOFFSET) # test for displaying objects with very long names ADD_H5_TEST (tlonglinks 0 --enable-error-stack tlonglinks.h5) @@ -1390,16 +1390,16 @@ # NATIVE default. the NATIVE test can be validated with h5import/h5diff ADD_H5_TEST_IMPORT (tbin1 out1D tbinary.h5 0 --enable-error-stack -d integer -b) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o tbin2.bin tbinary.h5) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) # the NATIVE test can be validated with h5import/h5diff ADD_H5_TEST_IMPORT (tbin3 out3D tbinary.h5 0 --enable-error-stack -d integer -b NATIVE) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o tbin4.bin tbinary.h5) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) # test for dataset region references ADD_H5_TEST (tdatareg 0 --enable-error-stack tdatareg.h5) diff --git a/tools/h5dump/CMakeTestsPBITS.cmake b/tools/h5dump/CMakeTestsPBITS.cmake index baa1705..a920198 100644 --- a/tools/h5dump/CMakeTestsPBITS.cmake +++ b/tools/h5dump/CMakeTestsPBITS.cmake @@ -9,7 +9,7 @@ # Packed Bits # -------------------------------------------------------------------- #-- Copy all the HDF5 files from the test directory into the source directory - SET (HDF5_REFERENCE_PBITS + set (HDF5_REFERENCE_PBITS ${HDF5_TOOLS_SRC_DIR}/testfiles/tnofilename-with-packed-bits.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsArray.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsCompound.ddl @@ -64,12 +64,12 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLong16.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLong16.ddl ) - SET (HDF5_REFERENCE_TEST_PBITS + set (HDF5_REFERENCE_TEST_PBITS ${HDF5_TOOLS_SRC_DIR}/testfiles/packedbits.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound.h5 ) - SET (HDF5_ERROR_REFERENCE_PBITS + set (HDF5_ERROR_REFERENCE_PBITS ${PROJECT_SOURCE_DIR}/errfiles/tnofilename-with-packed-bits.err ${PROJECT_SOURCE_DIR}/errfiles/tpbitsCharLengthExceeded.err ${PROJECT_SOURCE_DIR}/errfiles/tpbitsCharOffsetExceeded.err @@ -85,42 +85,42 @@ ${PROJECT_SOURCE_DIR}/errfiles/tpbitsOffsetNegative.err ) - FOREACH (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) + foreach (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) GET_FILENAME_COMPONENT(fname "${pbits_h5_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") - #MESSAGE (STATUS " Copying ${pbits_h5_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") + #message (STATUS " Copying ${pbits_h5_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${pbits_h5_file} ${dest} ) - ENDFOREACH (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) + endforeach (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) - FOREACH (ddl_pbits ${HDF5_REFERENCE_PBITS}) + foreach (ddl_pbits ${HDF5_REFERENCE_PBITS}) GET_FILENAME_COMPONENT(fname "${ddl_pbits}" NAME) - SET (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") - #MESSAGE (STATUS " Copying ${ddl_pbits}") - ADD_CUSTOM_COMMAND ( + set (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") + #message (STATUS " Copying ${ddl_pbits}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${ddl_pbits} ${ddldest} ) - ENDFOREACH (ddl_pbits ${HDF5_REFERENCE_PBITS}) + endforeach (ddl_pbits ${HDF5_REFERENCE_PBITS}) - FOREACH (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) + foreach (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) GET_FILENAME_COMPONENT(fname "${ddl_pbits}" NAME) - SET (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") - #MESSAGE (STATUS " Copying ${ddl_pbits}") - ADD_CUSTOM_COMMAND ( + set (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") + #message (STATUS " Copying ${ddl_pbits}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${ddl_pbits} ${ddldest} ) - ENDFOREACH (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) + endforeach (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) ############################################################################## ############################################################################## @@ -130,23 +130,23 @@ MACRO (ADD_H5_PBITS_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_pbits_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test}) - ENDIF (NOT "${last_pbits_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") + if (NOT ${resultcode} STREQUAL "0") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_pbits_test}" STREQUAL "") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test}) + endif (NOT "${last_pbits_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") + add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -157,8 +157,8 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_PBITS_TEST file) ############################################################################## @@ -167,9 +167,9 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5DUMP_PACKED_BITS-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -280,12 +280,12 @@ tpbitsUnsignedLongLong16.out tpbitsUnsignedLongLong16.out.err ) - SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") - IF (NOT "${last_pbits_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES DEPENDS ${last_pbits_test}) - ENDIF (NOT "${last_pbits_test}" STREQUAL "") - SET (last_pbits_test "H5DUMP_PACKED_BITS-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") + if (NOT "${last_pbits_test}" STREQUAL "") + set_tests_properties (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES DEPENDS ${last_pbits_test}) + endif (NOT "${last_pbits_test}" STREQUAL "") + set (last_pbits_test "H5DUMP_PACKED_BITS-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # test failure handling # Missing file name diff --git a/tools/h5dump/CMakeTestsXML.cmake b/tools/h5dump/CMakeTestsXML.cmake index 6c9cae1..ffc1cae 100644 --- a/tools/h5dump/CMakeTestsXML.cmake +++ b/tools/h5dump/CMakeTestsXML.cmake @@ -8,7 +8,7 @@ # # copy XML test files from source dir to test dir # - SET (HDF5_XML_REFERENCE_TEST_FILES + set (HDF5_XML_REFERENCE_TEST_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray2.h5 @@ -61,7 +61,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes5.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tvlstr.h5 ) - SET (HDF5_XML_REFERENCE_FILES + set (HDF5_XML_REFERENCE_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5.xml ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2A.h5.xml ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5.xml @@ -127,29 +127,29 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvlstr.h5.xml ) - FOREACH (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) + foreach (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${tst_xml_h5_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}") - #MESSAGE (STATUS " Copying ${tst_xml_h5_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}") + #message (STATUS " Copying ${tst_xml_h5_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${tst_xml_h5_file} ${dest} ) - ENDFOREACH (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) + endforeach (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) - FOREACH (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) + foreach (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) GET_FILENAME_COMPONENT(fname "${tst_xml_other_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}") - #MESSAGE (STATUS " Copying ${tst_xml_other_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}") + #message (STATUS " Copying ${tst_xml_other_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${tst_xml_other_file} ${dest} ) - ENDFOREACH (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) + endforeach (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) ############################################################################## ############################################################################## @@ -158,36 +158,36 @@ ############################################################################## MACRO (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-XML-${skipresultfile}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile}.xml --xml ${ARGN}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") ADD_XML_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) - ENDIF (${testtype} STREQUAL "SKIP") + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_XML_SKIP_H5_TEST) MACRO (ADD_XML_H5_TEST resultfile resultcode) - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-XML-${resultfile} COMMAND $<TARGET_FILE:h5dump> --xml ${ARGN}) - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_xml_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) - ENDIF (NOT "${last_xml_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DUMP-XML-${resultfile} COMMAND $<TARGET_FILE:h5dump> --xml ${ARGN}) + set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") + if (NOT ${resultcode} STREQUAL "0") + set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_xml_test}" STREQUAL "") + set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) + endif (NOT "${last_xml_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5DUMP-XML-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") - ADD_TEST ( + set_tests_properties (H5DUMP-XML-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") + add_test ( NAME H5DUMP-XML-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -198,8 +198,8 @@ -D "TEST_REFERENCE=${resultfile}.xml" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS "H5DUMP-XML-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS "H5DUMP-XML-${resultfile}-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_XML_H5_TEST file) ############################################################################## @@ -208,9 +208,9 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5DUMP-XML-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -343,12 +343,12 @@ tvlstr.h5.out tvlstr.h5.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") - IF (NOT "${last_xml_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES DEPENDS ${last_xml_test}) - ENDIF (NOT "${last_xml_test}" STREQUAL "") - SET (last_test "H5DUMP-XML-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-XML-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") + if (NOT "${last_xml_test}" STREQUAL "") + set_tests_properties (H5DUMP-XML-clearall-objects PROPERTIES DEPENDS ${last_xml_test}) + endif (NOT "${last_xml_test}" STREQUAL "") + set (last_test "H5DUMP-XML-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ########## test XML ADD_XML_H5_TEST (tall.h5 0 tall.h5) @@ -413,10 +413,10 @@ # The lone colon here confuses some systems (Cray X1). Skip # it if configure detects that this is a problem. - SET (TESTTYPE "TEST") - IF (NOT "H5_LONE_COLON") - SET (TESTTYPE "SKIP") - ENDIF (NOT "H5_LONE_COLON") + set (TESTTYPE "TEST") + if (NOT "H5_LONE_COLON") + set (TESTTYPE "SKIP") + endif (NOT "H5_LONE_COLON") ADD_XML_SKIP_H5_TEST (tempty-nons.h5 0 ${TESTTYPE} -X : tempty.h5) ADD_XML_H5_TEST (tempty-nons-2.h5 0 --xml-ns=: tempty.h5) diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index 03e1254..b94879c 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -644,6 +644,7 @@ xml_escape_the_name(const char *str) const char *cp; char *ncp; char *rcp; + size_t ncp_len; if (!str) return NULL; @@ -653,21 +654,16 @@ xml_escape_the_name(const char *str) extra = 0; for (i = 0; i < len; i++) { - if (*cp == '\"') { + if (*cp == '\"') extra += (HDstrlen(quote) - 1); - } - else if (*cp == '\'') { + else if (*cp == '\'') extra += (HDstrlen(apos) - 1); - } - else if (*cp == '<') { + else if (*cp == '<') extra += (HDstrlen(lt) - 1); - } - else if (*cp == '>') { + else if (*cp == '>') extra += (HDstrlen(gt) - 1); - } - else if (*cp == '&') { + else if (*cp == '&') extra += (HDstrlen(amp) - 1); - } cp++; } @@ -676,40 +672,43 @@ xml_escape_the_name(const char *str) return HDstrdup(str); cp = str; - rcp = ncp = (char *)HDmalloc(len + extra + 1); + ncp_len = len + extra + 1; + rcp = ncp = (char *)HDmalloc(ncp_len); if (!ncp) return NULL; /* ?? */ for (i = 0; i < len; i++) { + size_t esc_len; + + HDassert(ncp_len); if (*cp == '\'') { - HDstrncpy(ncp, apos, HDstrlen(apos)); - ncp += HDstrlen(apos); - cp++; + HDstrncpy(ncp, apos, ncp_len); + esc_len = HDstrlen(apos); } else if (*cp == '<') { - HDstrncpy(ncp, lt, HDstrlen(lt)); - ncp += HDstrlen(lt); - cp++; + HDstrncpy(ncp, lt, ncp_len); + esc_len = HDstrlen(lt); } else if (*cp == '>') { - HDstrncpy(ncp, gt, HDstrlen(gt)); - ncp += HDstrlen(gt); - cp++; + HDstrncpy(ncp, gt, ncp_len); + esc_len = HDstrlen(gt); } else if (*cp == '\"') { - HDstrncpy(ncp, quote, HDstrlen(quote)); - ncp += HDstrlen(quote); - cp++; + HDstrncpy(ncp, quote, ncp_len); + esc_len = HDstrlen(quote); } else if (*cp == '&') { - HDstrncpy(ncp, amp, HDstrlen(amp)); - ncp += HDstrlen(amp); - cp++; + HDstrncpy(ncp, amp, ncp_len); + esc_len = HDstrlen(amp); } else { - *ncp++ = *cp++; + *ncp = *cp; + esc_len = 1; } + ncp += esc_len; + ncp_len -= esc_len; + cp++; } *ncp = '\0'; @@ -739,6 +738,7 @@ xml_escape_the_string(const char *str, int slen) const char *cp; char *ncp; char *rcp; + size_t ncp_len; if (!str) return NULL; @@ -753,65 +753,65 @@ xml_escape_the_string(const char *str, int slen) extra = 0; for (i = 0; i < len; i++) { - if (*cp == '\\') { + if (*cp == '\\') extra++; - } - else if (*cp == '\"') { + else if (*cp == '\"') extra++; - } - else if (*cp == '\'') { + else if (*cp == '\'') extra += (HDstrlen(apos) - 1); - } - else if (*cp == '<') { + else if (*cp == '<') extra += (HDstrlen(lt) - 1); - } - else if (*cp == '>') { + else if (*cp == '>') extra += (HDstrlen(gt) - 1); - } - else if (*cp == '&') { + else if (*cp == '&') extra += (HDstrlen(amp) - 1); - } cp++; } cp = str; - rcp = ncp = (char *) HDcalloc((len + extra + 1), sizeof(char)); + ncp_len = len + extra + 1; + rcp = ncp = (char *) HDcalloc(ncp_len, sizeof(char)); if (ncp == NULL) return NULL; /* ?? */ for (i = 0; i < len; i++) { + size_t esc_len; + + HDassert(ncp_len); if (*cp == '\\') { *ncp++ = '\\'; - *ncp++ = *cp++; + *ncp = *cp; + esc_len = 1; } else if (*cp == '\"') { *ncp++ = '\\'; - *ncp++ = *cp++; + *ncp = *cp; + esc_len = 1; } else if (*cp == '\'') { - HDstrncpy(ncp, apos, HDstrlen(apos)); - ncp += HDstrlen(apos); - cp++; + HDstrncpy(ncp, apos, ncp_len); + esc_len = HDstrlen(apos); } else if (*cp == '<') { - HDstrncpy(ncp, lt, HDstrlen(lt)); - ncp += HDstrlen(lt); - cp++; + HDstrncpy(ncp, lt, ncp_len); + esc_len = HDstrlen(lt); } else if (*cp == '>') { - HDstrncpy(ncp, gt, HDstrlen(gt)); - ncp += HDstrlen(gt); - cp++; + HDstrncpy(ncp, gt, ncp_len); + esc_len = HDstrlen(gt); } else if (*cp == '&') { - HDstrncpy(ncp, amp, HDstrlen(amp)); - ncp += HDstrlen(amp); - cp++; + HDstrncpy(ncp, amp, ncp_len); + esc_len = HDstrlen(amp); } else { - *ncp++ = *cp++; + *ncp = *cp; + esc_len = 1; } + ncp += esc_len; + ncp_len -= esc_len; + cp++; } *ncp = '\0'; diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index 7caf44a..36a3a9e 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS_H5IMPORT) #----------------------------------------------------------------------------- @@ -9,28 +9,28 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5import executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5import ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5import.c) +add_executable (h5import ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5import.c) TARGET_NAMING (h5import ${LIB_TYPE}) TARGET_C_PROPERTIES (h5import " " " ") -TARGET_LINK_LIBRARIES (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -#SET_TARGET_PROPERTIES (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) -SET_TARGET_PROPERTIES (h5import PROPERTIES FOLDER tools) +target_link_libraries (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +#set_target_properties (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) +set_target_properties (h5import PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5import) +set (H5_DEP_EXECUTABLES h5import) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5import executables # -------------------------------------------------------------------- - ADD_EXECUTABLE (h5importtest ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5importtest.c) + add_executable (h5importtest ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5importtest.c) TARGET_NAMING (h5importtest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5importtest " " " ") - TARGET_LINK_LIBRARIES (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5importtest PROPERTIES FOLDER tools) + target_link_libraries (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5importtest PROPERTIES FOLDER tools) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -44,7 +44,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5import ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5import RUNTIME DESTINATION diff --git a/tools/h5import/CMakeTests.cmake b/tools/h5import/CMakeTests.cmake index 96cca87..2adbdde 100644 --- a/tools/h5import/CMakeTests.cmake +++ b/tools/h5import/CMakeTests.cmake @@ -5,7 +5,7 @@ ############################################################################## ############################################################################## - SET (HDF5_REFERENCE_CONF_FILES + set (HDF5_REFERENCE_CONF_FILES binfp64.conf binin8.conf binin8w.conf @@ -23,7 +23,7 @@ textpfe.conf txtstr.conf ) - SET (HDF5_REFERENCE_TXT_FILES + set (HDF5_REFERENCE_TXT_FILES txtfp32.txt txtfp64.txt txtuin16.txt @@ -42,7 +42,7 @@ dbinuin32.h5.txt dtxtstr.h5.txt ) - SET (HDF5_REFERENCE_TEST_FILES + set (HDF5_REFERENCE_TEST_FILES binfp64.h5 binin8.h5 binin8w.h5 @@ -62,38 +62,38 @@ ) FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (conf_file ${HDF5_REFERENCE_CONF_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${conf_file}") - #MESSAGE (STATUS " Copying ${conf_file}") - ADD_CUSTOM_COMMAND ( + foreach (conf_file ${HDF5_REFERENCE_CONF_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${conf_file}") + #message (STATUS " Copying ${conf_file}") + add_custom_command ( TARGET h5import POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${conf_file} ${dest} ) - ENDFOREACH (conf_file ${HDF5_REFERENCE_CONF_FILES}) + endforeach (conf_file ${HDF5_REFERENCE_CONF_FILES}) - FOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") - #MESSAGE (STATUS " Copying ${txt_file}") - ADD_CUSTOM_COMMAND ( + foreach (txt_file ${HDF5_REFERENCE_TXT_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") + #message (STATUS " Copying ${txt_file}") + add_custom_command ( TARGET h5import POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${txt_file} ${dest} ) - ENDFOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) + endforeach (txt_file ${HDF5_REFERENCE_TXT_FILES}) - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( + foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET h5import POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${h5_file} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) ############################################################################## ############################################################################## @@ -102,13 +102,13 @@ ############################################################################## MACRO (ADD_H5_TEST testname importfile conffile testfile) # If using memchecker skip macro based tests - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c ${conffile} -o ${testfile}) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-h5importtest) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c ${conffile} -o ${testfile}) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-h5importtest) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5IMPORT-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -118,12 +118,12 @@ ${testfile}.out ${testfile}.out.err ) - SET_TESTS_PROPERTIES (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) + set_tests_properties (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) - ADD_TEST (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c ${conffile} -o ${testfile}) - SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}-clear-objects) + add_test (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c ${conffile} -o ${testfile}) + set_tests_properties (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}-clear-objects) - ADD_TEST ( + add_test ( NAME H5IMPORT-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -135,8 +135,8 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-${testname}-H5DMP PROPERTIES DEPENDS H5IMPORT-${testname}) - ADD_TEST ( + set_tests_properties (H5IMPORT-${testname}-H5DMP PROPERTIES DEPENDS H5IMPORT-${testname}) + add_test ( NAME H5IMPORT-${testname}-H5DMP_CMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -148,14 +148,14 @@ -D "TEST_REFERENCE=${testfile}.new" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST testname importfile conffile testfile) MACRO (ADD_H5_DUMPTEST testname datasetname testfile) # If using memchecker skip tests - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5IMPORT-DUMP-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -168,10 +168,10 @@ d${testfile}.dff d${testfile}.dff.err ) - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) + set_tests_properties (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) - IF ("${ARGN}" STREQUAL "BINARY") - ADD_TEST ( + if ("${ARGN}" STREQUAL "BINARY") + add_test ( NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -182,8 +182,8 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - ELSE ("${ARGN}" STREQUAL "BINARY") - ADD_TEST ( + else ("${ARGN}" STREQUAL "BINARY") + add_test ( NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -194,10 +194,10 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - ENDIF ("${ARGN}" STREQUAL "BINARY") - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects") + endif ("${ARGN}" STREQUAL "BINARY") + set_tests_properties (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects") - ADD_TEST ( + add_test ( NAME H5IMPORT-DUMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5import>" @@ -208,9 +208,9 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname} PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-H5DMP") + set_tests_properties (H5IMPORT-DUMP-${testname} PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-H5DMP") - ADD_TEST ( + add_test ( NAME H5IMPORT-DUMP-${testname}-H5DFF COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5diff>" @@ -222,25 +222,25 @@ -D "TEST_REFERENCE=testfiles/d${testfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_DUMPTEST testname datasetname testfile) MACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5IMPORT-DUMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname} ${datasetname} ${testfile} --- DEFLATE filter not available" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) # -------------------------------------------------------------------- # Determine if filter is available for h5diff # -------------------------------------------------------------------- - IF (H5_HAVE_FILTER_DEFLATE) - SET (USE_FILTER_DEFLATE "true") - ENDIF (H5_HAVE_FILTER_DEFLATE) + if (H5_HAVE_FILTER_DEFLATE) + set (USE_FILTER_DEFLATE "true") + endif (H5_HAVE_FILTER_DEFLATE) ############################################################################## ############################################################################## @@ -248,9 +248,9 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5IMPORT-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -406,10 +406,10 @@ dtxtstr.h5.dff dtxtstr.h5.dff.err ) - SET (last_test "H5IMPORT-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set (last_test "H5IMPORT-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5IMPORT-h5importtest-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -421,13 +421,13 @@ binuin16.bin binuin32.bin ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5IMPORT-h5importtest-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5IMPORT-clear-objects") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5IMPORT-h5importtest-clear-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5IMPORT-clear-objects") - ADD_TEST (NAME H5IMPORT-h5importtest COMMAND $<TARGET_FILE:h5importtest>) - SET_TESTS_PROPERTIES (H5IMPORT-h5importtest PROPERTIES DEPENDS H5IMPORT-h5importtest-clear-objects) + add_test (NAME H5IMPORT-h5importtest COMMAND $<TARGET_FILE:h5importtest>) + set_tests_properties (H5IMPORT-h5importtest PROPERTIES DEPENDS H5IMPORT-h5importtest-clear-objects) # ----- TESTING "ASCII I32 rank 3 - Output BE " ; ADD_H5_TEST (ASCII_I32 testfiles/txtin32.txt testfiles/txtin32.conf txtin32.h5) @@ -452,19 +452,19 @@ # ----- TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " ADD_H5_TEST (BINARY_F64 binfp64.bin testfiles/binfp64.conf binfp64.h5) - IF (NOT USE_FILTER_DEFLATE) + if (NOT USE_FILTER_DEFLATE) ADD_H5_SKIP_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) - ELSE (NOT USE_FILTER_DEFLATE) + else (NOT USE_FILTER_DEFLATE) ADD_H5_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) - ENDIF (NOT USE_FILTER_DEFLATE) + endif (NOT USE_FILTER_DEFLATE) # ----- TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " ADD_H5_TEST (BINARY_I8 binin8.bin testfiles/binin8.conf binin8.h5) - IF (NOT USE_FILTER_DEFLATE) + if (NOT USE_FILTER_DEFLATE) ADD_H5_SKIP_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) - ELSE (NOT USE_FILTER_DEFLATE) + else (NOT USE_FILTER_DEFLATE) ADD_H5_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) - ENDIF (NOT USE_FILTER_DEFLATE) + endif (NOT USE_FILTER_DEFLATE) # ----- TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " ADD_H5_TEST (BINARY_I16 binin16.bin testfiles/binin16.conf binin16.h5) diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index 49d1b0c..b0d5ac8 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS_H5JAM) #----------------------------------------------------------------------------- @@ -9,54 +9,54 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5jam executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5jam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jam.c) +add_executable (h5jam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jam.c) TARGET_NAMING (h5jam ${LIB_TYPE}) TARGET_C_PROPERTIES (h5jam " " " ") -TARGET_LINK_LIBRARIES (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5jam PROPERTIES FOLDER tools) +target_link_libraries (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5jam PROPERTIES FOLDER tools) -ADD_EXECUTABLE (getub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/getub.c) +add_executable (getub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/getub.c) TARGET_NAMING (getub ${LIB_TYPE}) TARGET_C_PROPERTIES (getub " " " ") -TARGET_LINK_LIBRARIES (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (getub PROPERTIES FOLDER tools) +target_link_libraries (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (getub PROPERTIES FOLDER tools) -ADD_EXECUTABLE (tellub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/tellub.c) +add_executable (tellub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/tellub.c) TARGET_NAMING (tellub ${LIB_TYPE}) TARGET_C_PROPERTIES (tellub " " " ") -TARGET_LINK_LIBRARIES (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (tellub PROPERTIES FOLDER tools) +target_link_libraries (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (tellub PROPERTIES FOLDER tools) -ADD_EXECUTABLE (h5unjam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5unjam.c) +add_executable (h5unjam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5unjam.c) TARGET_NAMING (h5unjam ${LIB_TYPE}) TARGET_C_PROPERTIES (h5unjam " " " ") -TARGET_LINK_LIBRARIES (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5unjam PROPERTIES FOLDER tools) +target_link_libraries (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5unjam PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES +set (H5_DEP_EXECUTABLES h5jam getub tellub h5unjam ) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5jam test executables # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5jamgentest ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jamgentest.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5jamgentest ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jamgentest.c) TARGET_NAMING (h5jamgentest ${LIB_TYPE}) TARGET_C_PROPERTIES (testhdf5 " " " ") - TARGET_LINK_LIBRARIES (h5jamgentest ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5jamgentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5jamgentest ${HDF5_LIB_TARGET}) + set_target_properties (h5jamgentest PROPERTIES FOLDER generator/tools) - #ADD_TEST (NAME h5jamgentest COMMAND $<TARGET_FILE:h5jamgentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + #add_test (NAME h5jamgentest COMMAND $<TARGET_FILE:h5jamgentest>) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -70,7 +70,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5jam ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5jam h5unjam RUNTIME DESTINATION diff --git a/tools/h5jam/CMakeTests.cmake b/tools/h5jam/CMakeTests.cmake index 3816e85..4b71d7f 100644 --- a/tools/h5jam/CMakeTests.cmake +++ b/tools/h5jam/CMakeTests.cmake @@ -5,7 +5,7 @@ ############################################################################## ############################################################################## - SET (HDF5_REFERENCE_TXT_FILES + set (HDF5_REFERENCE_TXT_FILES u10.txt u511.txt u512.txt @@ -14,34 +14,34 @@ h5unjam-help.txt h5jam-ub-nohdf5.txt ) - SET (HDF5_REFERENCE_TEST_FILES + set (HDF5_REFERENCE_TEST_FILES tall.h5 twithub.h5 twithub513.h5 ) FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( + foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET h5jam POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${h5_file} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) - FOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") - #MESSAGE (STATUS " Copying ${txt_file}") - ADD_CUSTOM_COMMAND ( + foreach (txt_file ${HDF5_REFERENCE_TXT_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") + #message (STATUS " Copying ${txt_file}") + add_custom_command ( TARGET h5jam POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${txt_file} ${dest} ) - ENDFOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) + endforeach (txt_file ${HDF5_REFERENCE_TXT_FILES}) ############################################################################## ############################################################################## @@ -55,20 +55,20 @@ # MACRO (TEST_H5JAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5JAM-${expectfile} COMMAND $<TARGET_FILE:h5jam> ${ARGN}) - IF (NOT "${resultcode}" STREQUAL "0") - SET_TESTS_PROPERTIES (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT "${resultcode}" STREQUAL "0") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5JAM-${expectfile} COMMAND $<TARGET_FILE:h5jam> ${ARGN}) + if (NOT "${resultcode}" STREQUAL "0") + set_tests_properties (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true") + endif (NOT "${resultcode}" STREQUAL "0") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5JAM-${expectfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${expectfile}.out ${expectfile}.out.err ) - ADD_TEST ( + add_test ( NAME H5JAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5jam>" @@ -79,8 +79,8 @@ -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-${expectfile} PROPERTIES DEPENDS H5JAM-${expectfile}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5JAM-${expectfile} PROPERTIES DEPENDS H5JAM-${expectfile}-clear-objects) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (TEST_H5JAM_OUTPUT) # ============================================================ @@ -89,20 +89,20 @@ # MACRO (TEST_H5UNJAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5JAM-UNJAM-${expectfile} COMMAND $<TARGET_FILE:h5unjam> ${ARGN}) - IF (NOT "${resultcode}" STREQUAL "0") - SET_TESTS_PROPERTIES (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT "${resultcode}" STREQUAL "0") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5JAM-UNJAM-${expectfile} COMMAND $<TARGET_FILE:h5unjam> ${ARGN}) + if (NOT "${resultcode}" STREQUAL "0") + set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true") + endif (NOT "${resultcode}" STREQUAL "0") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5JAM-UNJAM-${expectfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${expectfile}.out ${expectfile}.out.err ) - ADD_TEST ( + add_test ( NAME H5JAM-UNJAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam>" @@ -113,14 +113,14 @@ -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-UNJAM-${expectfile} PROPERTIES DEPENDS H5JAM-UNJAM-${expectfile}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES DEPENDS H5JAM-UNJAM-${expectfile}-clear-objects) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (TEST_H5UNJAM_OUTPUT) MACRO (CHECKFILE testname testdepends expected actual) # If using memchecker add tests without using scripts - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5JAM-${testname}-CHECKFILE-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -129,8 +129,8 @@ ${actual}.out ${actual}.out.err ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-clear-objects PROPERTIES DEPENDS ${testdepends}) - ADD_TEST ( + set_tests_properties (H5JAM-${testname}-CHECKFILE-clear-objects PROPERTIES DEPENDS ${testdepends}) + add_test ( NAME H5JAM-${testname}-CHECKFILE-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -142,8 +142,8 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-clear-objects) - ADD_TEST ( + set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-clear-objects) + add_test ( NAME H5JAM-${testname}-CHECKFILE-H5DMP_CMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" @@ -155,43 +155,43 @@ -D "TEST_REFERENCE=${actual}.new" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-H5DMP_CMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-H5DMP) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP_CMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-H5DMP) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO(CHECKFILE testname testdepends expected actual) MACRO (UNJAMTEST testname setfile infile ufile chkfile outfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5JAM-${testname}-UNJAM-SETUP-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${infile} ) - ADD_TEST ( + add_test ( NAME H5JAM-${testname}-UNJAM-SETUP COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${setfile} ${PROJECT_BINARY_DIR}/${infile} ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-SETUP PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP-clear-objects) - ADD_TEST ( + set_tests_properties (H5JAM-${testname}-UNJAM-SETUP PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP-clear-objects) + add_test ( NAME H5JAM-${testname}-UNJAM-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP) - IF (NOT "${ufile}" STREQUAL "NONE") - ADD_TEST ( + set_tests_properties (H5JAM-${testname}-UNJAM-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP) + if (NOT "${ufile}" STREQUAL "NONE") + add_test ( NAME H5JAM-${testname}-UNJAM_D-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${ufile} ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) - ADD_TEST (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -u ${ufile} -o ${outfile}) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) - SET (compare_test ${ufile}) - ELSE (NOT "${ufile}" STREQUAL "NONE") - IF (NOT "${ARGN}" STREQUAL "--delete") - ADD_TEST ( + set_tests_properties (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) + add_test (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -u ${ufile} -o ${outfile}) + set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) + set (compare_test ${ufile}) + else (NOT "${ufile}" STREQUAL "NONE") + if (NOT "${ARGN}" STREQUAL "--delete") + add_test ( NAME H5JAM-${testname}-UNJAM_D-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${outfile}.ufile.txt ${outfile}.ufile.txt.err ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) - ADD_TEST ( + set_tests_properties (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) + add_test ( NAME H5JAM-${testname}-UNJAM COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam>" @@ -202,16 +202,16 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) - SET (compare_test "${outfile}.ufile.txt") - ELSE (NOT "${ARGN}" STREQUAL "--delete") - ADD_TEST (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -o ${outfile}) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) - SET (compare_test "") - ENDIF (NOT "${ARGN}" STREQUAL "--delete") - ENDIF (NOT "${ufile}" STREQUAL "NONE") - IF (NOT "${compare_test}" STREQUAL "") - ADD_TEST ( + set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) + set (compare_test "${outfile}.ufile.txt") + else (NOT "${ARGN}" STREQUAL "--delete") + add_test (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -o ${outfile}) + set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) + set (compare_test "") + endif (NOT "${ARGN}" STREQUAL "--delete") + endif (NOT "${ufile}" STREQUAL "NONE") + if (NOT "${compare_test}" STREQUAL "") + add_test ( NAME H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -219,8 +219,8 @@ ${infile}.cmp ${infile}-ub.cmp ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}-UNJAM") - ADD_TEST ( + set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}-UNJAM") + add_test ( NAME H5JAM-${testname}-UNJAM-CHECK_UB_1 COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:tellub>" @@ -233,10 +233,10 @@ -D "TEST_OFILE=" -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects) - ENDIF (NOT "${compare_test}" STREQUAL "") + set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects) + endif (NOT "${compare_test}" STREQUAL "") - ADD_TEST ( + add_test ( NAME H5JAM-${testname}-UNJAM-CHECK_NOUB COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:tellub>" @@ -249,33 +249,33 @@ -D "TEST_OFILE=NULL" -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) - IF (NOT "${compare_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1) - ELSE (NOT "${compare_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM) - ENDIF (NOT "${compare_test}" STREQUAL "") + if (NOT "${compare_test}" STREQUAL "") + set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1) + else (NOT "${compare_test}" STREQUAL "") + set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM) + endif (NOT "${compare_test}" STREQUAL "") CHECKFILE (${testname} "H5JAM-${testname}-UNJAM-CHECK_NOUB" ${chkfile} ${outfile}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO(UNJAMTEST testname infile ufile outfile) MACRO (JAMTEST testname jamfile infile chkfile outfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5JAM-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5JAM-${testname} COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN}) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5JAM-${testname} PROPERTIES DEPENDS H5JAM-${testname}-clear-objects) - SET (compare_test ${outfile}) - SET (compare_orig testfiles/${infile}) - IF ("${ARGN}" STREQUAL "--clobber") - SET (compare_orig "") - ENDIF ("${ARGN}" STREQUAL "--clobber") - - ADD_TEST ( + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5JAM-${testname} COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN}) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5JAM-${testname} PROPERTIES DEPENDS H5JAM-${testname}-clear-objects) + set (compare_test ${outfile}) + set (compare_orig testfiles/${infile}) + if ("${ARGN}" STREQUAL "--clobber") + set (compare_orig "") + endif ("${ARGN}" STREQUAL "--clobber") + + add_test ( NAME H5JAM-${testname}-CHECK_UB_1-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -283,8 +283,8 @@ ${compare_test}.cmp ${compare_test}-ub.cmp ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}") - ADD_TEST ( + set_tests_properties (H5JAM-${testname}-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}") + add_test ( NAME H5JAM-${testname}-CHECK_UB_1 COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:tellub>" @@ -297,40 +297,40 @@ -D "TEST_OFILE=${compare_orig}" -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-CHECK_UB_1-clear-objects) + set_tests_properties (H5JAM-${testname}-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-CHECK_UB_1-clear-objects) CHECKFILE (${testname} "H5JAM-${testname}-CHECK_UB_1" ${chkfile} ${outfile}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (JAMTEST testname jamfile infile outfile) MACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5JAM-${testname}_NONE-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${chkfile} ${chkfile}.cpy.h5 ) - ADD_TEST ( + add_test ( NAME H5JAM-${testname}_NONE-SETUP COMMAND ${CMAKE_COMMAND} -E copy_if_different testfiles/${setfile} ${chkfile} ) - SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-SETUP PROPERTIES DEPENDS H5JAM-${testname}_NONE-clear-objects) + set_tests_properties (H5JAM-${testname}_NONE-SETUP PROPERTIES DEPENDS H5JAM-${testname}_NONE-clear-objects) - ADD_TEST ( + add_test ( NAME H5JAM-${testname}_NONE_COPY COMMAND ${CMAKE_COMMAND} -E copy_if_different ${chkfile} ${chkfile}.cpy.h5 ) - SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE_COPY PROPERTIES DEPENDS H5JAM-${testname}_NONE-SETUP) + set_tests_properties (H5JAM-${testname}_NONE_COPY PROPERTIES DEPENDS H5JAM-${testname}_NONE-SETUP) - ADD_TEST (NAME H5JAM-${testname}_NONE COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i ${chkfile} ${ARGN}) - SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE PROPERTIES DEPENDS H5JAM-${testname}_NONE_COPY) + add_test (NAME H5JAM-${testname}_NONE COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i ${chkfile} ${ARGN}) + set_tests_properties (H5JAM-${testname}_NONE PROPERTIES DEPENDS H5JAM-${testname}_NONE_COPY) - SET (compare_test ${chkfile}) - SET (compare_orig ${chkfile}.cpy.h5) - IF ("${ARGN}" STREQUAL "--clobber") - SET (compare_orig "") - ENDIF ("${ARGN}" STREQUAL "--clobber") + set (compare_test ${chkfile}) + set (compare_orig ${chkfile}.cpy.h5) + if ("${ARGN}" STREQUAL "--clobber") + set (compare_orig "") + endif ("${ARGN}" STREQUAL "--clobber") - ADD_TEST ( + add_test ( NAME H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -338,8 +338,8 @@ ${compare_test}.cmp ${compare_test}-ub.cmp ) - SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}_NONE") - ADD_TEST ( + set_tests_properties (H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}_NONE") + add_test ( NAME H5JAM-${testname}_NONE-CHECK_UB_1 COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:tellub>" @@ -352,9 +352,9 @@ -D "TEST_OFILE=${compare_orig}" -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects) + set_tests_properties (H5JAM-${testname}_NONE-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects) CHECKFILE (${testname} "H5JAM-${testname}_NONE-CHECK_UB_1" ${infile} ${chkfile}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) ############################################################################## diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index eeaf1ea..5220087 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS_H5LS) #----------------------------------------------------------------------------- @@ -9,21 +9,21 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) #----------------------------------------------------------------------------- # Add the h5ls executable #----------------------------------------------------------------------------- -ADD_EXECUTABLE (h5ls ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c) +add_executable (h5ls ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c) TARGET_NAMING (h5ls ${LIB_TYPE}) TARGET_C_PROPERTIES (h5ls " " " ") -TARGET_LINK_LIBRARIES (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5ls PROPERTIES FOLDER tools) +target_link_libraries (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5ls PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES +set (H5_DEP_EXECUTABLES h5ls ) -IF (BUILD_TESTING) +if (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -37,7 +37,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5ls ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5ls RUNTIME DESTINATION diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake index 09f375d..eb68d79 100644 --- a/tools/h5ls/CMakeTests.cmake +++ b/tools/h5ls/CMakeTests.cmake @@ -8,7 +8,7 @@ # -------------------------------------------------------------------- # Copy all the test files from source directory to test directory # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES + set (LIST_HDF5_TEST_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr2.h5 @@ -33,7 +33,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.h5 ) - SET (LIST_OTHER_TEST_FILES + set (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/help-1.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/help-2.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/help-3.ls @@ -95,17 +95,17 @@ FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") # copy the list of test files - FOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${listfiles}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #MESSAGE (STATUS " Copying ${listfiles} to ${dest}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #message (STATUS " Copying ${listfiles} to ${dest}") + add_custom_command ( TARGET h5ls POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${listfiles} ${dest} ) - ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) ############################################################################## @@ -116,22 +116,22 @@ MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5LS-${resultfile} COMMAND $<TARGET_FILE:h5ls> ${ARGN}) - SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5LS-${resultfile} COMMAND $<TARGET_FILE:h5ls> ${ARGN}) + set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (${resultcode} STREQUAL "1") + set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") + endif (${resultcode} STREQUAL "1") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5LS-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${resultfile}.out ./testfiles/${resultfile}.out.err ) - ADD_TEST ( + add_test ( NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>" @@ -142,8 +142,8 @@ -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS "H5LS-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS "H5LS-${resultfile}-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) ############################################################################## @@ -152,9 +152,9 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5LS-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -265,11 +265,11 @@ tvldtypes2be.out tvldtypes2be.out.err ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5LS-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5LS-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5LS-clearall-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5LS-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # test the help syntax ADD_H5_TEST (help-1 0 -w80 -h) @@ -378,25 +378,25 @@ # test for attribute with region references wo verbose mode # ( HDFFV-7838, ) - IF (H5_WORDS_BIGENDIAN) + if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tattrreg_be 0 -w80 -v -d tattrreg.h5) - ELSE (H5_WORDS_BIGENDIAN) + else (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tattrreg_le 0 -w80 -v -d tattrreg.h5) - ENDIF (H5_WORDS_BIGENDIAN) + endif (H5_WORDS_BIGENDIAN) # test for non-existing file ADD_H5_TEST (nosuchfile 1 nosuchfile.h5) # test for variable length data types in verbose mode - IF (H5_WORDS_BIGENDIAN) + if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tvldtypes2be 0 -v tvldtypes1.h5) - ELSE (H5_WORDS_BIGENDIAN) + else (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tvldtypes2le 0 -v tvldtypes1.h5) - ENDIF (H5_WORDS_BIGENDIAN) + endif (H5_WORDS_BIGENDIAN) # test for dataset region references data types in verbose mode - IF (H5_WORDS_BIGENDIAN) + if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tdataregbe 0 -v tdatareg.h5) - ELSE (H5_WORDS_BIGENDIAN) + else (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tdataregle 0 -v tdatareg.h5) - ENDIF (H5_WORDS_BIGENDIAN) + endif (H5_WORDS_BIGENDIAN) diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 176fc2b..4625607 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -10,7 +10,7 @@ INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) # -------------------------------------------------------------------- # Add h5Repack executables # -------------------------------------------------------------------- -SET (REPACK_COMMON_SRCS +set (REPACK_COMMON_SRCS ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_copy.c ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_filters.c ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_opttable.c @@ -20,43 +20,43 @@ SET (REPACK_COMMON_SRCS ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack.c ) -ADD_EXECUTABLE (h5repack ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c) +add_executable (h5repack ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c) TARGET_NAMING (h5repack ${LIB_TYPE}) TARGET_C_PROPERTIES (h5repack " " " ") -TARGET_LINK_LIBRARIES (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5repack PROPERTIES FOLDER tools) +target_link_libraries (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5repack PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5repack) +set (H5_DEP_EXECUTABLES h5repack) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add h5Repack test executables # -------------------------------------------------------------------- - ADD_EXECUTABLE (testh5repack_detect_szip ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c) + add_executable (testh5repack_detect_szip ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c) TARGET_NAMING (testh5repack_detect_szip ${LIB_TYPE}) TARGET_C_PROPERTIES (testh5repack_detect_szip " " " ") - TARGET_LINK_LIBRARIES (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (testh5repack_detect_szip PROPERTIES FOLDER tools) + target_link_libraries (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (testh5repack_detect_szip PROPERTIES FOLDER tools) - ADD_EXECUTABLE (h5repacktest ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repacktst.c) + add_executable (h5repacktest ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repacktst.c) TARGET_NAMING (h5repacktest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5repacktest " " " ") - TARGET_LINK_LIBRARIES (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5repacktest PROPERTIES FOLDER tools) + target_link_libraries (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (h5repacktest PROPERTIES FOLDER tools) #----------------------------------------------------------------------------- # If plugin library tests can be tested #----------------------------------------------------------------------------- - IF (BUILD_SHARED_LIBS) - SET (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibadd") - SET (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") - SET (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) - ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + if (BUILD_SHARED_LIBS) + set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibadd") + set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") + set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) + add_definitions (${HDF5_EXTRA_C_FLAGS}) INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - ADD_LIBRARY (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SRC_DIR}/dynlib1.c) + add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SRC_DIR}/dynlib1.c) TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} " " " ") - TARGET_LINK_LIBRARIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS ( ${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} ${LIB_TYPE} @@ -69,7 +69,7 @@ IF (BUILD_TESTING) #----------------------------------------------------------------------------- # Copy plugin library to a plugins folder #----------------------------------------------------------------------------- - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} @@ -77,11 +77,11 @@ IF (BUILD_TESTING) "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>" "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>" ) - ENDIF (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -95,7 +95,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5repack ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5repack RUNTIME DESTINATION diff --git a/tools/h5repack/CMakeTests.cmake b/tools/h5repack/CMakeTests.cmake index 8690181..430defc 100644 --- a/tools/h5repack/CMakeTests.cmake +++ b/tools/h5repack/CMakeTests.cmake @@ -5,8 +5,8 @@ ############################################################################## ############################################################################## - IF (HDF5_TEST_VFD) - SET (VFD_LIST + if (HDF5_TEST_VFD) + set (VFD_LIST sec2 stdio core @@ -15,12 +15,12 @@ family ) - IF (DIRECT_VFD) - SET (VFD_LIST ${VFD_LIST} direct) - ENDIF (DIRECT_VFD) + if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) + endif (DIRECT_VFD) MACRO (ADD_VFD_TEST vfdname resultcode) - ADD_TEST ( + add_test ( NAME H5REPACK-VFD-${vfdname}-h5repacktest COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5repacktest>" @@ -31,17 +31,17 @@ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK-VFD-${vfdname}-h5repacktest") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5REPACK-VFD-${vfdname}-h5repacktest") ENDMACRO (ADD_VFD_TEST) - ENDIF (HDF5_TEST_VFD) + endif (HDF5_TEST_VFD) # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES + set (LIST_HDF5_TEST_FILES ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_attr.h5 ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_attr_refs.h5 ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_deflate.h5 @@ -79,7 +79,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00010.h5 ) - SET (LIST_OTHER_TEST_FILES + set (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack-help.txt ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_ext.bin ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/ublock.bin @@ -93,17 +93,17 @@ ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/plugin_none.h5repack_layout.UD.h5.tst ) - FOREACH (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + foreach (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${h5_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET h5repack POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${h5_file} ${dest} ) - ENDFOREACH (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) ############################################################################## ############################################################################## @@ -113,21 +113,21 @@ MACRO (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5REPACK-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN}) - SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK-${testname}") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5REPACK-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN}) + set_tests_properties (H5REPACK-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5REPACK-${testname}") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5REPACK-h5repack-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove h5repack-${testname}.out h5repack-${testname}.out.err ) - SET_TESTS_PROPERTIES (H5REPACK-h5repack-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - ADD_TEST ( + set_tests_properties (H5REPACK-h5repack-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + add_test ( NAME H5REPACK-h5repack-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5repack>" @@ -138,212 +138,212 @@ -D "TEST_REFERENCE=h5repack-${testname}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS "H5REPACK-h5repack-${testname}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS "H5REPACK-h5repack-${testname}-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_HELP_TEST) MACRO (ADD_H5_TEST_OLD testname testtype testfile) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5REPACK_OLD-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") - ADD_TEST ( + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") + add_test ( NAME H5REPACK_OLD-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_OLD-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST ( + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_OLD-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + add_test ( NAME H5REPACK_OLD-${testname}_DFF COMMAND $<TARGET_FILE:h5diff> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - SET_TESTS_PROPERTIES (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname}) - ENDIF (${testtype} STREQUAL "SKIP") + set_tests_properties (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname}) + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_TEST_OLD) MACRO (ADD_H5_TEST testname testtype testfile) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5REPACK-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") - ADD_TEST ( + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") + add_test ( NAME H5REPACK-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST ( + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + add_test ( NAME H5REPACK-${testname}_DFF COMMAND $<TARGET_FILE:h5diff> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - SET_TESTS_PROPERTIES (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname}) - ENDIF (${testtype} STREQUAL "SKIP") + set_tests_properties (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname}) + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_TEST) MACRO (ADD_H5_CMP_TEST testname testfilter testtype resultcode resultfile) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5REPACK_CMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5REPACK_CMP-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}) - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5REPACK_CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5repack>" - -D "TEST_ARGS:STRING=${ARGN};testfiles/${resultfile};testfiles/out-${testname}.${resultfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${resultfile}-${testname}.out" + -D "TEST_ARGS:STRING=${ARGN};${resultfile};out-${testname}.${resultfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}-${testname}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_FILTER:STRING=${testfilter}" - -D "TEST_REFERENCE=testfiles/${resultfile}.tst" + -D "TEST_REFERENCE=${resultfile}.tst" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ENDIF (${testtype} STREQUAL "SKIP") + endif (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_CMP_TEST) MACRO (ADD_H5_DMP_TEST testname testtype resultcode resultfile) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5REPACK_DMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") # If using memchecker add tests without using scripts - ADD_TEST ( + add_test ( NAME H5REPACK_DMP-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_DMP-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_DMP-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5REPACK_DMP-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" - -D "TEST_ARGS:STRING=-pH;./testfiles/out-${testname}.${resultfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${resultfile}-${testname}.out" + -D "TEST_ARGS:STRING=-pH;out-${testname}.${resultfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}-${testname}.out" -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=testfiles/${testname}.${resultfile}.ddl" + -D "TEST_REFERENCE=${testname}.${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5REPACK_DMP-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_DMP-${testname}") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDIF (${testtype} STREQUAL "SKIP") + set_tests_properties (H5REPACK_DMP-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_DMP-${testname}") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_DMP_TEST) MACRO (ADD_H5_VERIFY_TEST testname testtype resultcode testfile testdset testfilter) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST ( + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DFF COMMAND $<TARGET_FILE:h5diff> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}) - IF (${resultcode} STREQUAL "0") - ADD_TEST ( + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}) + if (${resultcode} STREQUAL "0") + add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" - -D "TEST_ARGS:STRING=-d;${testdset};-pH;testfiles/out-${testname}.${testfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${testfile}-${testname}-v.out" + -D "TEST_ARGS:STRING=-d;${testdset};-pH;out-${testname}.${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testfile}-${testname}-v.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_FILTER:STRING=${testfilter}" -D "TEST_REFERENCE=${testfilter}" -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" ) - SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) - ELSE (${resultcode} STREQUAL "0") - IF (${testfilter} STREQUAL "CHUNKED") - SET (nottestfilter "(CONTIGUOUS|COMPACT)") - ENDIF (${testfilter} STREQUAL "CHUNKED") - IF (${testfilter} STREQUAL "CONTIGUOUS") - SET (nottestfilter "(CHUNK|COMPACT)") - ENDIF (${testfilter} STREQUAL "CONTIGUOUS") - IF (${testfilter} STREQUAL "COMPACT") - SET (nottestfilter "(CONTIGUOUS|CHUNK)") - ENDIF (${testfilter} STREQUAL "COMPACT") - ADD_TEST ( + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) + else (${resultcode} STREQUAL "0") + if (${testfilter} STREQUAL "CHUNKED") + set (nottestfilter "(CONTIGUOUS|COMPACT)") + endif (${testfilter} STREQUAL "CHUNKED") + if (${testfilter} STREQUAL "CONTIGUOUS") + set (nottestfilter "(CHUNK|COMPACT)") + endif (${testfilter} STREQUAL "CONTIGUOUS") + if (${testfilter} STREQUAL "COMPACT") + set (nottestfilter "(CONTIGUOUS|CHUNK)") + endif (${testfilter} STREQUAL "COMPACT") + add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" - -D "TEST_ARGS:STRING=-pH;testfiles/out-${testname}.${testfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${testfile}-${testname}-v.out" + -D "TEST_ARGS:STRING=-pH;out-${testname}.${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testfile}-${testname}-v.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_FILTER:STRING=${nottestfilter}" -D "TEST_REFERENCE=${testfilter}" -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" ) - SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) - ENDIF (${resultcode} STREQUAL "0") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDIF (${testtype} STREQUAL "SKIP") + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) + endif (${resultcode} STREQUAL "0") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_VERIFY_TEST) MACRO (ADD_H5_TEST_META testname testfile) - ADD_TEST ( + add_test ( NAME H5REPACK_META-${testname}_N COMMAND $<TARGET_FILE:h5repack> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_META-${testname}_N PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST ( + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_META-${testname}_N PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + add_test ( NAME H5REPACK_META-${testname}_M COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5 ) - SET_TESTS_PROPERTIES (H5REPACK_META-${testname}_M PROPERTIES DEPENDS H5REPACK_META-${testname}_N) + set_tests_properties (H5REPACK_META-${testname}_M PROPERTIES DEPENDS H5REPACK_META-${testname}_N) - ADD_TEST (NAME H5REPACK_META-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5) - SET_TESTS_PROPERTIES (H5REPACK_META-${testname} PROPERTIES WILL_FAIL "true") - SET_TESTS_PROPERTIES (H5REPACK_META-${testname} PROPERTIES DEPENDS H5REPACK_META-${testname}_M) + add_test (NAME H5REPACK_META-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5) + set_tests_properties (H5REPACK_META-${testname} PROPERTIES WILL_FAIL "true") + set_tests_properties (H5REPACK_META-${testname} PROPERTIES DEPENDS H5REPACK_META-${testname}_M) ENDMACRO (ADD_H5_TEST_META) MACRO (ADD_H5_UD_TEST testname resultcode resultfile) - IF (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5REPACK_UD-${testname}-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -353,36 +353,36 @@ testfiles/${resultfile}-${testname}.out testfiles/${resultfile}-${testname}.out.err ) - ADD_TEST ( + add_test ( NAME H5REPACK_UD-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5repack>" - -D "TEST_ARGS:STRING=${ARGN};${PROJECT_BINARY_DIR}/testfiles/${resultfile};${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_ARGS:STRING=${ARGN};${resultfile};out-${testname}.${resultfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_EXPECT=${resultcode}" -D "TEST_FILTER:STRING=O?...ing file[^\n]+\n" - -D "TEST_OUTPUT=./testfiles/${testname}.${resultfile}.out" - -D "TEST_REFERENCE=testfiles/${testname}.${resultfile}.tst" + -D "TEST_OUTPUT=${testname}.${resultfile}.out" + -D "TEST_REFERENCE=${testname}.${resultfile}.tst" -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5REPACK_UD-${testname} PROPERTIES DEPENDS H5REPACK_UD-${testname}-clearall-objects) - ADD_TEST ( + set_tests_properties (H5REPACK_UD-${testname} PROPERTIES DEPENDS H5REPACK_UD-${testname}-clearall-objects) + add_test ( NAME H5REPACK_UD-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" - -D "TEST_ARGS:STRING=-pH;testfiles/out-${testname}.${resultfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${resultfile}-${testname}.out" + -D "TEST_ARGS:STRING=-pH;out-${testname}.${resultfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}-${testname}.out" -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=testfiles/${resultfile}-${testname}.ddl" + -D "TEST_REFERENCE=${resultfile}-${testname}.ddl" -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5REPACK_UD-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_UD-${testname}") - ENDIF (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5REPACK_UD-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_UD-${testname}") + endif (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_UD_TEST) ############################################################################## @@ -394,30 +394,30 @@ # -------------------------------------------------------------------- # test file names # -------------------------------------------------------------------- - SET (INFO_FILE testfiles/h5repack.info) - - SET (FILE0 h5repack_fill.h5) - SET (FILE1 h5repack_objs.h5) - SET (FILE2 h5repack_attr.h5) - SET (FILE3 h5repack_hlink.h5) - SET (FILE4 h5repack_layout.h5) - SET (FILE5 h5repack_early.h5) - SET (FILE7 h5repack_szip.h5) - SET (FILE8 h5repack_deflate.h5) - SET (FILE9 h5repack_shuffle.h5) - SET (FILE10 h5repack_fletcher.h5) - SET (FILE11 h5repack_filters.h5) - SET (FILE12 h5repack_nbit.h5) - SET (FILE13 h5repack_soffset.h5) - SET (FILE14 h5repack_layouto.h5 ) # A file with an older version of the layout message (copy of test/tlayouto.h5) - SET (FILE15 h5repack_named_dtypes.h5) - SET (FILE16 tfamily%05d.h5) # located in common testfiles folder - SET (FILE18 h5repack_layout2.h5) - SET (FILE_REF h5repack_refs.h5) - SET (FILE_ATTR_REF h5repack_attr_refs.h5) + set (INFO_FILE testfiles/h5repack.info) + + set (FILE0 h5repack_fill.h5) + set (FILE1 h5repack_objs.h5) + set (FILE2 h5repack_attr.h5) + set (FILE3 h5repack_hlink.h5) + set (FILE4 h5repack_layout.h5) + set (FILE5 h5repack_early.h5) + set (FILE7 h5repack_szip.h5) + set (FILE8 h5repack_deflate.h5) + set (FILE9 h5repack_shuffle.h5) + set (FILE10 h5repack_fletcher.h5) + set (FILE11 h5repack_filters.h5) + set (FILE12 h5repack_nbit.h5) + set (FILE13 h5repack_soffset.h5) + set (FILE14 h5repack_layouto.h5 ) # A file with an older version of the layout message (copy of test/tlayouto.h5) + set (FILE15 h5repack_named_dtypes.h5) + set (FILE16 tfamily%05d.h5) # located in common testfiles folder + set (FILE18 h5repack_layout2.h5) + set (FILE_REF h5repack_refs.h5) + set (FILE_ATTR_REF h5repack_attr_refs.h5) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5REPACK-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -597,30 +597,30 @@ h5repack_ext.bin ublock.bin ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") ADD_HELP_TEST(help 0 -h) - ADD_TEST (NAME H5REPACK-testh5repack_detect_szip COMMAND $<TARGET_FILE:testh5repack_detect_szip>) - IF (HDF5_ENABLE_SZIP_SUPPORT) - IF (HDF5_ENABLE_SZIP_ENCODING) - SET (passRegex "yes") - SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "yes") - ELSE (HDF5_ENABLE_SZIP_ENCODING) - SET (passRegex "no") - SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") - ENDIF (HDF5_ENABLE_SZIP_ENCODING) - ELSE (HDF5_ENABLE_SZIP_SUPPORT) - SET (passRegex "no") - SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") - ENDIF (HDF5_ENABLE_SZIP_SUPPORT) - SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS H5REPACK-clearall-objects) - - ADD_TEST (NAME H5REPACK-h5repacktest COMMAND $<TARGET_FILE:h5repacktest>) - SET_TESTS_PROPERTIES (H5REPACK-h5repacktest PROPERTIES DEPENDS H5REPACK-testh5repack_detect_szip) - SET (last_test "H5REPACK-h5repacktest") + add_test (NAME H5REPACK-testh5repack_detect_szip COMMAND $<TARGET_FILE:testh5repack_detect_szip>) + if (HDF5_ENABLE_SZIP_SUPPORT) + if (HDF5_ENABLE_SZIP_ENCODING) + set (passRegex "yes") + set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "yes") + else (HDF5_ENABLE_SZIP_ENCODING) + set (passRegex "no") + set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") + endif (HDF5_ENABLE_SZIP_ENCODING) + else (HDF5_ENABLE_SZIP_SUPPORT) + set (passRegex "no") + set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") + endif (HDF5_ENABLE_SZIP_SUPPORT) + set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS H5REPACK-clearall-objects) + + add_test (NAME H5REPACK-h5repacktest COMMAND $<TARGET_FILE:h5repacktest>) + set_tests_properties (H5REPACK-h5repacktest PROPERTIES DEPENDS H5REPACK-testh5repack_detect_szip) + set (last_test "H5REPACK-h5repacktest") # # The tests @@ -636,34 +636,34 @@ # filters are defined. # detect whether the encoder is present. - SET (USE_FILTER_SZIP_ENCODER "no") - IF (HDF5_ENABLE_SZIP_ENCODING) - SET (USE_FILTER_SZIP_ENCODER ${testh5repack_detect_szip}) - ENDIF (HDF5_ENABLE_SZIP_ENCODING) - - IF (H5_HAVE_FILTER_DEFLATE) - SET (USE_FILTER_DEFLATE "true") - ENDIF (H5_HAVE_FILTER_DEFLATE) - - IF (H5_HAVE_FILTER_SZIP) - SET (USE_FILTER_SZIP "true") - ENDIF (H5_HAVE_FILTER_SZIP) - - IF (H5_HAVE_FILTER_SHUFFLE) - SET (USE_FILTER_SHUFFLE "true") - ENDIF (H5_HAVE_FILTER_SHUFFLE) - - IF (H5_HAVE_FILTER_FLETCHER32) - SET (USE_FILTER_FLETCHER32 "true") - ENDIF (H5_HAVE_FILTER_FLETCHER32) - - IF (H5_HAVE_FILTER_NBIT) - SET (USE_FILTER_NBIT "true") - ENDIF (H5_HAVE_FILTER_NBIT) - - IF (H5_HAVE_FILTER_SCALEOFFSET) - SET (USE_FILTER_SCALEOFFSET "true") - ENDIF (H5_HAVE_FILTER_SCALEOFFSET) + set (USE_FILTER_SZIP_ENCODER "no") + if (HDF5_ENABLE_SZIP_ENCODING) + set (USE_FILTER_SZIP_ENCODER ${testh5repack_detect_szip}) + endif (HDF5_ENABLE_SZIP_ENCODING) + + if (H5_HAVE_FILTER_DEFLATE) + set (USE_FILTER_DEFLATE "true") + endif (H5_HAVE_FILTER_DEFLATE) + + if (H5_HAVE_FILTER_SZIP) + set (USE_FILTER_SZIP "true") + endif (H5_HAVE_FILTER_SZIP) + + if (H5_HAVE_FILTER_SHUFFLE) + set (USE_FILTER_SHUFFLE "true") + endif (H5_HAVE_FILTER_SHUFFLE) + + if (H5_HAVE_FILTER_FLETCHER32) + set (USE_FILTER_FLETCHER32 "true") + endif (H5_HAVE_FILTER_FLETCHER32) + + if (H5_HAVE_FILTER_NBIT) + set (USE_FILTER_NBIT "true") + endif (H5_HAVE_FILTER_NBIT) + + if (H5_HAVE_FILTER_SCALEOFFSET) + set (USE_FILTER_SCALEOFFSET "true") + endif (H5_HAVE_FILTER_SCALEOFFSET) # copy files (these files have no filters) ADD_H5_TEST (fill "TEST" ${FILE0}) @@ -676,83 +676,83 @@ # use $FILE4 to write some filters (this file has no filters) # gzip with individual object - SET (arg ${FILE4} -f dset1:GZIP=1 -l dset1:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -f dset1:GZIP=1 -l dset1:CHUNK=20x10) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (gzip_individual ${TESTTYPE} ${arg}) # gzip for all - SET (arg ${FILE4} -f GZIP=1) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -f GZIP=1) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (gzip_all ${TESTTYPE} ${arg}) # szip with individual object - SET (arg ${FILE4} -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (arg ${FILE4} -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) ADD_H5_TEST (szip_individual ${TESTTYPE} ${arg}) # szip for all - SET (arg ${FILE4} -f SZIP=8,NN) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (arg ${FILE4} -f SZIP=8,NN) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) ADD_H5_TEST (szip_all ${TESTTYPE} ${arg}) # shuffle with individual object - SET (arg ${FILE4} -f dset2:SHUF -l dset2:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SHUFFLE) + set (arg ${FILE4} -f dset2:SHUF -l dset2:CHUNK=20x10) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SHUFFLE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SHUFFLE) ADD_H5_TEST (shuffle_individual ${TESTTYPE} ${arg}) # shuffle for all - SET (arg ${FILE4} -f SHUF) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SHUFFLE) + set (arg ${FILE4} -f SHUF) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SHUFFLE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SHUFFLE) ADD_H5_TEST (shuffle_all ${TESTTYPE} ${arg}) # fletcher32 with individual object - SET (arg ${FILE4} -f dset2:FLET -l dset2:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32) + set (arg ${FILE4} -f dset2:FLET -l dset2:CHUNK=20x10) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_FLETCHER32) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_FLETCHER32) ADD_H5_TEST (fletcher_individual ${TESTTYPE} ${arg}) # fletcher32 for all - SET (arg ${FILE4} -f FLET) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32) + set (arg ${FILE4} -f FLET) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_FLETCHER32) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_FLETCHER32) ADD_H5_TEST (fletcher_all ${TESTTYPE} ${arg}) # all filters - SET (arg ${FILE4} -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) ADD_H5_TEST (all_filters ${TESTTYPE} ${arg}) # verbose gzip with individual object - SET (arg ${FILE11} -v -f /dset_deflate:GZIP=9) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE11} -v -f /dset_deflate:GZIP=9) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_CMP_TEST (gzip_verbose_filters "O?...ing file[^\n]+\n" ${TESTTYPE} 0 ${arg}) ########################################################### @@ -760,154 +760,154 @@ ########################################################### # szip copy - SET (arg ${FILE7}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (arg ${FILE7}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) ADD_H5_TEST (szip_copy ${TESTTYPE} ${arg}) # szip remove - SET (arg ${FILE7} --filter=dset_szip:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (arg ${FILE7} --filter=dset_szip:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) ADD_H5_TEST (szip_remove ${TESTTYPE} ${arg}) # deflate copy - SET (arg ${FILE8}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE8}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (deflate_copy ${TESTTYPE} ${arg}) # deflate remove - SET (arg ${FILE8} -f dset_deflate:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE8} -f dset_deflate:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (deflate_remove ${TESTTYPE} ${arg}) # shuffle copy - SET (arg ${FILE9}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SHUFFLE) + set (arg ${FILE9}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SHUFFLE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SHUFFLE) ADD_H5_TEST (shuffle_copy ${TESTTYPE} ${arg}) # shuffle remove - SET (arg ${FILE9} -f dset_shuffle:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SHUFFLE) + set (arg ${FILE9} -f dset_shuffle:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SHUFFLE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SHUFFLE) ADD_H5_TEST (shuffle_remove ${TESTTYPE} ${arg}) # fletcher32 copy - SET (arg ${FILE10}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32) + set (arg ${FILE10}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_FLETCHER32) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_FLETCHER32) ADD_H5_TEST (fletcher_copy ${TESTTYPE} ${arg}) # fletcher32 remove - SET (arg ${FILE10} -f dset_fletcher32:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32) + set (arg ${FILE10} -f dset_fletcher32:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_FLETCHER32) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_FLETCHER32) ADD_H5_TEST (fletcher_remove ${TESTTYPE} ${arg}) # nbit copy - SET (arg ${FILE12}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_NBIT) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_NBIT) + set (arg ${FILE12}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_NBIT) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_NBIT) ADD_H5_TEST (nbit_copy ${TESTTYPE} ${arg}) # nbit remove - SET (arg ${FILE12} -f dset_nbit:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_NBIT) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_NBIT) + set (arg ${FILE12} -f dset_nbit:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_NBIT) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_NBIT) ADD_H5_TEST (nbit_remove ${TESTTYPE} ${arg}) # nbit add - SET (arg ${FILE12} -f dset_int31:NBIT) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_NBIT) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_NBIT) + set (arg ${FILE12} -f dset_int31:NBIT) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_NBIT) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_NBIT) ADD_H5_TEST (nbit_add ${TESTTYPE} ${arg}) # scaleoffset copy - SET (arg ${FILE13}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SCALEOFFSET) + set (arg ${FILE13}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SCALEOFFSET) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SCALEOFFSET) ADD_H5_TEST (scale_copy ${TESTTYPE} ${arg}) # scaleoffset add - SET (arg ${FILE13} -f dset_none:SOFF=31,IN) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SCALEOFFSET) + set (arg ${FILE13} -f dset_none:SOFF=31,IN) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SCALEOFFSET) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SCALEOFFSET) ADD_H5_TEST (scale_add ${TESTTYPE} ${arg}) # scaleoffset remove - SET (arg ${FILE13} -f dset_scaleoffset:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SCALEOFFSET) + set (arg ${FILE13} -f dset_scaleoffset:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SCALEOFFSET) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SCALEOFFSET) ADD_H5_TEST (scale_remove ${TESTTYPE} ${arg}) # remove all filters - SET (arg ${FILE11} -f NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) + set (arg ${FILE11} -f NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) ADD_H5_TEST (remove_all ${TESTTYPE} ${arg}) #filter conversions - SET (arg ${FILE8} -f dset_deflate:SZIP=8,NN) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + set (arg ${FILE8} -f dset_deflate:SZIP=8,NN) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) ADD_H5_TEST (deflate_convert ${TESTTYPE} ${arg}) - SET (arg ${FILE7} -f dset_szip:GZIP=1) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) + set (arg ${FILE7} -f dset_szip:GZIP=1) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) ADD_H5_TEST (szip_convert ${TESTTYPE} ${arg}) #limit - SET (arg ${FILE4} -f GZIP=1 -m 1024) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -f GZIP=1 -m 1024) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_DMP_TEST (deflate_limit ${TESTTYPE} 0 ${arg}) #file - SET (arg ${FILE4} -e ${INFO_FILE}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -e ${INFO_FILE}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (deflate_file ${TESTTYPE} ${arg}) ######################################################### @@ -990,44 +990,44 @@ ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 CO ADD_H5_TEST (native_attr "TEST" ${FILE2} -n) # latest file format with long switches. use FILE4=h5repack_layout.h5 (no filters) - SET (arg --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype]) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype]) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_VERIFY_TEST (layout_long_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) # latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) - SET (arg -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_VERIFY_TEST (layout_short_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) # several global filters - SET (arg ${FILE4} --filter GZIP=1 --filter SHUF) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) + set (arg ${FILE4} --filter GZIP=1 --filter SHUF) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) ADD_H5_TEST (global_filters ${TESTTYPE} ${arg}) # syntax of -i infile -o outfile # latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) - SET (arg ${FILE4} -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) - SET (TESTTYPE "LEGACY") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) + set (TESTTYPE "LEGACY") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST_OLD (old_style_layout_short_switches ${TESTTYPE} ${arg}) # add a userblock to file - SET (arg ${FILE1} -u ${PROJECT_BINARY_DIR}/testfiles/ublock.bin -b 2048) + set (arg ${FILE1} -u ${PROJECT_BINARY_DIR}/testfiles/ublock.bin -b 2048) ADD_H5_TEST (add_userblock "TEST" ${arg}) # add alignment - SET (arg ${FILE1} -t 1 -a 1) + set (arg ${FILE1} -t 1 -a 1) ADD_H5_TEST (add_alignment "TEST" ${arg}) # Check repacking file with old version of layout message (should get upgraded @@ -1064,20 +1064,20 @@ ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 CO ############################################################################## ### P L U G I N T E S T S ############################################################################## -IF (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) ADD_H5_UD_TEST (plugin_test 0 h5repack_layout.h5 -v -f UD=257,1,9) -# ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE) -ELSE (BUILD_SHARED_LIBS) - MESSAGE (STATUS " **** Plugins libraries must be built as shared libraries **** ") - ADD_TEST ( + ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE) +else (BUILD_SHARED_LIBS) + message (STATUS " **** Plugins libraries must be built as shared libraries **** ") + add_test ( NAME H5REPACK-plugin COMMAND ${CMAKE_COMMAND} -E echo "SKIP H5PLUGIN TESTING" ) -ENDIF (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS) - IF (HDF5_TEST_VFD) + if (HDF5_TEST_VFD) # Run test with different Virtual File Driver - FOREACH (vfd ${VFD_LIST}) + foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - ENDFOREACH (vfd ${VFD_LIST}) - ENDIF (HDF5_TEST_VFD) + endforeach (vfd ${VFD_LIST}) + endif (HDF5_TEST_VFD) diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in index 045aebf..a4d12bd 100644 --- a/tools/h5repack/h5repack.sh.in +++ b/tools/h5repack/h5repack.sh.in @@ -70,7 +70,7 @@ SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles" SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles" SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles" -TESTDIR=./testfiles +TESTDIR=./testpack test -d $TESTDIR || mkdir $TESTDIR ###################################################################### @@ -209,6 +209,7 @@ DIFFTEST() { VERIFY h5diff output $@ ( + cd $TESTDIR $RUNSERIAL $H5DIFF_BIN -q "$@" ) RET=$? @@ -229,14 +230,15 @@ DIFFTEST() TOOLTEST() { echo $@ - infile=$TESTDIR/$2 - outfile=$TESTDIR/out-$1.$2 + infile=$2 + outfile=out-$1.$2 shift shift # Run test. TESTING $H5REPACK $@ ( + cd $TESTDIR $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile ) RET=$? @@ -254,11 +256,11 @@ TOOLTEST() # Verifying layouts of a dataset VERIFY_LAYOUT_DSET() { - layoutfile=$TESTDIR/layout-$1.$2 + layoutfile=layout-$1.$2 dset=$3 expectlayout=$4 - infile=$TESTDIR/$2 - outfile=$TESTDIR/out-$1.$2 + infile=$2 + outfile=out-$1.$2 shift shift shift @@ -266,6 +268,7 @@ VERIFY_LAYOUT_DSET() TESTING $H5REPACK $@ ( + cd $TESTDIR $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile ) RET=$? @@ -281,9 +284,10 @@ VERIFY_LAYOUT_DSET() # check the layout from a dataset VERIFY "a dataset layout" ( + cd $TESTDIR $RUNSERIAL $H5DUMP_BIN -d $dset -pH $outfile > $layoutfile ) - $GREP $expectlayout $layoutfile > /dev/null + $GREP $expectlayout $TESTDIR/$layoutfile > /dev/null if [ $? -eq 0 ]; then echo " PASSED" else @@ -301,8 +305,8 @@ VERIFY_LAYOUT_DSET() VERIFY_LAYOUT_ALL() { infile=$2 - outfile=$TESTDIR/out-$1.$2 - layoutfile=$TESTDIR/layout-$1.$2 + outfile=out-$1.$2 + layoutfile=layout-$1.$2 expectlayout=$3 shift shift @@ -310,6 +314,7 @@ VERIFY_LAYOUT_ALL() TESTING $H5REPACK $@ ( + cd $TESTDIR $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile ) RET=$? @@ -327,6 +332,7 @@ VERIFY_LAYOUT_ALL() # check if the other layouts still exsit VERIFY "layouts" ( + cd $TESTDIR echo # if CONTIGUOUS if [ $expectlayout = "CONTIGUOUS" ]; then @@ -401,14 +407,15 @@ VERIFY_LAYOUT_ALL() # TOOLTEST0() { - infile=$TESTDIR/$2 - outfile=$TESTDIR/out-$1.$2 + infile=$2 + outfile=out-$1.$2 shift shift # Run test. TESTING $H5REPACK $@ ( + cd $TESTDIR $RUNSERIAL $H5REPACK_BIN -i $infile -o $outfile "$@" ) RET=$? @@ -428,14 +435,15 @@ TOOLTEST0() # TOOLTEST1() { - infile=$TESTDIR/$2 - outfile=$TESTDIR/out-$1.$2 + infile=$2 + outfile=out-$1.$2 shift shift # Run test. TESTING $H5REPACK $@ ( + cd $TESTDIR $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile ) RET=$? @@ -458,14 +466,15 @@ TOOLTESTV() actual="$TESTDIR/`basename $2 .ddl`.out" actual_err="$TESTDIR/`basename $2 .ddl`.err" - infile=$TESTDIR/$2 - outfile=$TESTDIR/out-$1.$2 + infile=$2 + outfile=out-$1.$2 shift shift # Run test. TESTING $H5REPACK $@ ( + cd $TESTDIR $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile ) >$actual 2>$actual_err RET=$? @@ -500,8 +509,8 @@ TOOLTESTV() # TOOLTEST_DUMP() { - infile=$TESTDIR/$2 - outfile=$TESTDIR/out-$1.$2 + infile=$2 + outfile=out-$1.$2 expect="$TESTDIR/$1.$2.ddl" actual="$TESTDIR/out-$1.$2.out" actual_err="$TESTDIR/out-$1.$2.err" @@ -512,6 +521,7 @@ TOOLTEST_DUMP() # Run test. TESTING $H5REPACK $@ ( + cd $TESTDIR $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile ) >$actual 2>$actual_err RET=$? @@ -522,6 +532,7 @@ TOOLTEST_DUMP() echo " PASSED" VERIFY h5dump output $@ ( + cd $TESTDIR $RUNSERIAL $H5DUMP_BIN -pH $outfile ) >$actual 2>$actual_err cat $actual_err >> $actual @@ -559,14 +570,15 @@ TOOLTEST_DUMP() # Verify the output file of second run is larger than the one of 1st run. TOOLTEST_META() { - infile=$TESTDIR/$2 - outfile=$TESTDIR/out-$1.$2 + infile=$2 + outfile=out-$1.$2 shift shift # Run test. TESTING $H5REPACK $@ ( + cd $TESTDIR $RUNSERIAL $H5REPACK_BIN $infile $outfile ) RET=$? @@ -578,12 +590,13 @@ TOOLTEST_META() DIFFTEST $infile $outfile fi # get the size of the first output file - size1=`wc -c $outfile | cut -d' ' -f1` + size1=`wc -c $TESTDIR/$outfile | cut -d' ' -f1` # 2nd run with metadata option # Run test. TESTING $H5REPACK $@ ( + cd $TESTDIR $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile ) RET=$? @@ -595,7 +608,7 @@ TOOLTEST_META() DIFFTEST $infile $outfile fi # get the size of the second output file - size2=`wc -c $outfile | cut -d' ' -f1` + size2=`wc -c $TESTDIR/$outfile | cut -d' ' -f1` # verify sizes. MESSAGE "Verify the sizes of both output files ($size1 vs $size2)" @@ -927,7 +940,7 @@ else fi #file -arg="h5repack_layout.h5 -e $TESTDIR/h5repack.info" +arg="h5repack_layout.h5 -e h5repack.info" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else @@ -1064,7 +1077,7 @@ else fi # add a userblock to file -arg="h5repack_objs.h5 -u $TESTDIR/ublock.bin -b 2048" +arg="h5repack_objs.h5 -u ublock.bin -b 2048" TOOLTEST add_userblock $arg # add alignment diff --git a/tools/h5repack/h5repack_plugin.sh.in b/tools/h5repack/h5repack_plugin.sh.in index df4b374..7502397 100644 --- a/tools/h5repack/h5repack_plugin.sh.in +++ b/tools/h5repack/h5repack_plugin.sh.in @@ -49,7 +49,7 @@ SRC_TOOLS="$srcdir/.." # testfiles source dirs for tools SRC_H5REPACK_TESTFILES="$SRC_TOOLS/h5repack/testfiles" -TESTDIR=testfiles +TESTDIR=testplug test -d $TESTDIR || mkdir $TESTDIR ###################################################################### @@ -66,6 +66,10 @@ $SRC_H5REPACK_TESTFILES/h5repack_layout.h5 $SRC_H5REPACK_TESTFILES/h5repack_layout.h5-plugin_test.ddl $SRC_H5REPACK_TESTFILES/plugin_test.h5repack_layout.h5.tst " +#$SRC_H5REPACK_TESTFILES/h5repack_layout.UD.h5 +#$SRC_H5REPACK_TESTFILES/h5repack_layout.UD.h5-plugin_none.ddl +#$SRC_H5REPACK_TESTFILES/plugin_none.h5repack_layout.UD.h5.tst +#" # # copy test files and expected output files from source dirs to test dir @@ -88,7 +92,7 @@ if [ $? != 0 ]; then fi # setup plugin path -ENVCMD="env HDF5_PLUGIN_PATH=${PLUGIN_LIBDIR}" +ENVCMD="env HDF5_PLUGIN_PATH=../${PLUGIN_LIBDIR}" COPY_TESTFILES_TO_TESTDIR() { @@ -171,8 +175,8 @@ STDOUT_FILTER() { TOOLTEST_DUMP() { echo $@ - infile=$TESTDIR/$2 - outfile=$TESTDIR/out-$1.$2 + infile=$2 + outfile=out-$1.$2 expect1="$TESTDIR/$1.$2.tst" actual1="$TESTDIR/$1.$2.out" actual1_err="$TESTDIR/$1.$2.err" @@ -186,35 +190,37 @@ TOOLTEST_DUMP() # Run test. TESTING $H5REPACK $@ ( - $ENVCMD $H5REPACK_BIN "$@" $infile $outfile + cd $TESTDIR + $ENVCMD $H5REPACK_BIN "$@" $infile $outfile ) >$actual1 2>$actual1_err RET=$? STDOUT_FILTER $actual1 cat $actual1_err >> $actual1 if [ $RET != 0 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - else - echo " PASSED" - if cmp -s $expect1 $actual1; then - echo " PASSED" - else echo "*FAILED*" - echo " Expected result (*.tst) differs from actual result (*.out)" nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && diff -c $expect1 $actual1 |sed 's/^/ /' - fi - VERIFY h5dump output -pH $outfile - ( + else + echo " PASSED" + if cmp -s $expect1 $actual1; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.tst) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && diff -c $expect1 $actual1 |sed 's/^/ /' + fi + VERIFY h5dump output -pH $outfile + ( + cd $TESTDIR $ENVCMD $H5DUMP_BIN -pH $outfile - ) >$actual2 2>$actual2_err - RET=$? - cat $actual2_err >> $actual2 + ) >$actual2 2>$actual2_err + RET=$? + cat $actual2_err >> $actual2 - if cmp -s $expect2 $actual2; then - echo " PASSED" - else - echo "*FAILED*" + if cmp -s $expect2 $actual2; then + echo " PASSED" + else + echo "*FAILED*" echo " Expected result (*.ddl) differs from actual result (*.out)" nerrors="`expr $nerrors + 1`" test yes = "$verbose" && diff -c $expect2 $actual2 |sed 's/^/ /' @@ -237,6 +243,9 @@ COPY_TESTFILES_TO_TESTDIR arg="h5repack_layout.h5 -v -f UD=257,1,9" TOOLTEST_DUMP plugin_test $arg +#arg="h5repack_layout.UD.h5 -v -f NONE" +#TOOLTEST_DUMP plugin_none $arg + # print results if test $nerrors -ne 0 ; then echo "$nerrors errors encountered" diff --git a/tools/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl b/tools/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl index d380201..b8e7e68 100644 --- a/tools/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl +++ b/tools/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl @@ -1,4 +1,4 @@ -HDF5 "./testfiles/out-deflate_limit.h5repack_layout.h5" { +HDF5 "out-deflate_limit.h5repack_layout.h5" { GROUP "/" { DATASET "dset1" { DATATYPE H5T_STD_I32LE diff --git a/tools/h5repack/testfiles/h5repack_layout.UD.h5-plugin_none.ddl b/tools/h5repack/testfiles/h5repack_layout.UD.h5-plugin_none.ddl index 0d85352..fb94c21 100644 --- a/tools/h5repack/testfiles/h5repack_layout.UD.h5-plugin_none.ddl +++ b/tools/h5repack/testfiles/h5repack_layout.UD.h5-plugin_none.ddl @@ -1,4 +1,4 @@ -HDF5 "testfiles/out-plugin_none.h5repack_layout.UD.h5" { +HDF5 "out-plugin_none.h5repack_layout.UD.h5" { GROUP "/" { DATASET "dset1" { DATATYPE H5T_STD_I32LE diff --git a/tools/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl b/tools/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl index a7ba967..7a3a01e 100644 --- a/tools/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl +++ b/tools/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl @@ -1,4 +1,4 @@ -HDF5 "testfiles/out-plugin_test.h5repack_layout.h5" { +HDF5 "out-plugin_test.h5repack_layout.h5" { GROUP "/" { DATASET "dset1" { DATATYPE H5T_STD_I32LE diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 6086fc2..82f0ffb 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS_H5STAT) #----------------------------------------------------------------------------- @@ -9,30 +9,30 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5stat executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5stat ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat.c) +add_executable (h5stat ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat.c) TARGET_NAMING (h5stat ${LIB_TYPE}) TARGET_C_PROPERTIES (h5stat " " " ") -TARGET_LINK_LIBRARIES (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5stat PROPERTIES FOLDER tools) +target_link_libraries (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5stat PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5stat) +set (H5_DEP_EXECUTABLES h5stat) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5stat test executables # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5stat_gentest ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat_gentest.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5stat_gentest ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat_gentest.c) TARGET_NAMING (h5stat_gentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5stat_gentest " " " ") - TARGET_LINK_LIBRARIES (h5stat_gentest ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5stat_gentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5stat_gentest ${HDF5_LIB_TARGET}) + set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools) - #ADD_TEST (NAME h5stat_gentest COMMAND $<TARGET_FILE:h5stat_gentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + #add_test (NAME h5stat_gentest COMMAND $<TARGET_FILE:h5stat_gentest>) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -46,7 +46,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5stat ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5stat RUNTIME DESTINATION diff --git a/tools/h5stat/CMakeTests.cmake b/tools/h5stat/CMakeTests.cmake index 0e4315f..b803dff 100644 --- a/tools/h5stat/CMakeTests.cmake +++ b/tools/h5stat/CMakeTests.cmake @@ -8,7 +8,7 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- - SET (HDF5_REFERENCE_FILES + set (HDF5_REFERENCE_FILES h5stat_help1.ddl h5stat_help2.ddl h5stat_notexist.ddl @@ -41,34 +41,34 @@ h5stat_numattrs3.ddl h5stat_numattrs4.ddl ) - SET (HDF5_REFERENCE_TEST_FILES + set (HDF5_REFERENCE_TEST_FILES h5stat_filters.h5 h5stat_tsohm.h5 h5stat_newgrat.h5 h5stat_threshold.h5 ) - FOREACH (ddl_file ${HDF5_REFERENCE_FILES}) - SET (ddldest "${PROJECT_BINARY_DIR}/${ddl_file}") - #MESSAGE (STATUS " Translating ${ddl_file}") - ADD_CUSTOM_COMMAND ( + foreach (ddl_file ${HDF5_REFERENCE_FILES}) + set (ddldest "${PROJECT_BINARY_DIR}/${ddl_file}") + #message (STATUS " Translating ${ddl_file}") + add_custom_command ( TARGET h5stat POST_BUILD - COMMAND ${XLATE_UTILITY} - ARGS ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${ddl_file} ${ddldest} -l3 + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${ddl_file} ${ddldest} ) - ENDFOREACH (ddl_file ${HDF5_REFERENCE_FILES}) + endforeach (ddl_file ${HDF5_REFERENCE_FILES}) - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( + foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/${h5_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET h5stat POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${h5_file} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) ############################################################################## ############################################################################## @@ -78,21 +78,21 @@ MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5STAT-${resultfile} COMMAND $<TARGET_FILE:h5stat> ${ARGN}) - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5STAT-${resultfile} COMMAND $<TARGET_FILE:h5stat> ${ARGN}) + if (NOT ${resultcode} STREQUAL "0") + set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5STAT-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - ADD_TEST ( + add_test ( NAME H5STAT-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5stat>" @@ -103,8 +103,8 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS "H5STAT-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS "H5STAT-${resultfile}-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) ############################################################################## @@ -113,9 +113,9 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5STAT-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -182,11 +182,11 @@ h5stat_numattrs4.out h5stat_numattrs4.out.err ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5STAT-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5STAT-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # Test for help flag ADD_H5_TEST (h5stat_help1 0 -h) diff --git a/tools/h5stat/testfiles/h5stat_dims1.ddl b/tools/h5stat/testfiles/h5stat_dims1.ddl index 182d31a..c285ea4 100644 --- a/tools/h5stat/testfiles/h5stat_dims1.ddl +++ b/tools/h5stat/testfiles/h5stat_dims1.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat -gd -m 5 h5stat_threshold.h5' -############################# Filename: h5stat_threshold.h5 Small groups (with 0 to 9 links): # of groups with 0 link(s): 1 diff --git a/tools/h5stat/testfiles/h5stat_dims2.ddl b/tools/h5stat/testfiles/h5stat_dims2.ddl index abf3f61..769749e 100644 --- a/tools/h5stat/testfiles/h5stat_dims2.ddl +++ b/tools/h5stat/testfiles/h5stat_dims2.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat -d --di=15 h5stat_threshold.h5' -############################# Filename: h5stat_threshold.h5 Dataset dimension information: Max. rank of datasets: 2 diff --git a/tools/h5stat/testfiles/h5stat_err1_dims.ddl b/tools/h5stat/testfiles/h5stat_err1_dims.ddl index 8f0686f..86d375b 100644 --- a/tools/h5stat/testfiles/h5stat_err1_dims.ddl +++ b/tools/h5stat/testfiles/h5stat_err1_dims.ddl @@ -1,4 +1 @@ -############################# -Expected output for 'h5stat -d --dims=-1 h5stat_threshold.h5' -############################# h5stat error: Invalid threshold for small datasets diff --git a/tools/h5stat/testfiles/h5stat_err1_links.ddl b/tools/h5stat/testfiles/h5stat_err1_links.ddl index 07987a2..d43207c 100644 --- a/tools/h5stat/testfiles/h5stat_err1_links.ddl +++ b/tools/h5stat/testfiles/h5stat_err1_links.ddl @@ -1,4 +1 @@ -############################# -Expected output for 'h5stat -l 0 h5stat_threshold.h5' -############################# h5stat error: Invalid threshold for small groups diff --git a/tools/h5stat/testfiles/h5stat_err1_numattrs.ddl b/tools/h5stat/testfiles/h5stat_err1_numattrs.ddl index 8eea546..01b6c18 100644 --- a/tools/h5stat/testfiles/h5stat_err1_numattrs.ddl +++ b/tools/h5stat/testfiles/h5stat_err1_numattrs.ddl @@ -1,4 +1 @@ -############################# -Expected output for 'h5stat -a -2 h5stat_threshold.h5' -############################# h5stat error: Invalid threshold for small # of attributes diff --git a/tools/h5stat/testfiles/h5stat_err2_numattrs.ddl b/tools/h5stat/testfiles/h5stat_err2_numattrs.ddl index a1ecb31..01b6c18 100644 --- a/tools/h5stat/testfiles/h5stat_err2_numattrs.ddl +++ b/tools/h5stat/testfiles/h5stat_err2_numattrs.ddl @@ -1,4 +1 @@ -############################# -Expected output for 'h5stat --numattrs h5stat_threshold.h5' -############################# h5stat error: Invalid threshold for small # of attributes diff --git a/tools/h5stat/testfiles/h5stat_filters-F.ddl b/tools/h5stat/testfiles/h5stat_filters-F.ddl index fba875a..d44445b 100644 --- a/tools/h5stat/testfiles/h5stat_filters-F.ddl +++ b/tools/h5stat/testfiles/h5stat_filters-F.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat -F h5stat_filters.h5' -############################# Filename: h5stat_filters.h5 File space information for file metadata (in bytes): Superblock: 96 diff --git a/tools/h5stat/testfiles/h5stat_filters-UD.ddl b/tools/h5stat/testfiles/h5stat_filters-UD.ddl index decfb81..4efafd1 100644 --- a/tools/h5stat/testfiles/h5stat_filters-UD.ddl +++ b/tools/h5stat/testfiles/h5stat_filters-UD.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat -D h5stat_filters.h5' -############################# Filename: h5stat_filters.h5 File space information for datasets' metadata (in bytes): Object headers (total/unused): 4136/1344 diff --git a/tools/h5stat/testfiles/h5stat_filters-UT.ddl b/tools/h5stat/testfiles/h5stat_filters-UT.ddl index 189eaa6..d8de31f 100644 --- a/tools/h5stat/testfiles/h5stat_filters-UT.ddl +++ b/tools/h5stat/testfiles/h5stat_filters-UT.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat -T h5stat_filters.h5' -############################# Filename: h5stat_filters.h5 Dataset datatype information: # of unique datatypes used by datasets: 2 diff --git a/tools/h5stat/testfiles/h5stat_filters-d.ddl b/tools/h5stat/testfiles/h5stat_filters-d.ddl index dae1f06..2e0bd64 100644 --- a/tools/h5stat/testfiles/h5stat_filters-d.ddl +++ b/tools/h5stat/testfiles/h5stat_filters-d.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat -d h5stat_filters.h5' -############################# Filename: h5stat_filters.h5 Dataset dimension information: Max. rank of datasets: 2 diff --git a/tools/h5stat/testfiles/h5stat_filters-dT.ddl b/tools/h5stat/testfiles/h5stat_filters-dT.ddl index 5c7a4ab..9ef3e82 100644 --- a/tools/h5stat/testfiles/h5stat_filters-dT.ddl +++ b/tools/h5stat/testfiles/h5stat_filters-dT.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat -dT h5stat_filters.h5' -############################# Filename: h5stat_filters.h5 Dataset dimension information: Max. rank of datasets: 2 diff --git a/tools/h5stat/testfiles/h5stat_filters-file.ddl b/tools/h5stat/testfiles/h5stat_filters-file.ddl index eddc898..5f7eff9 100644 --- a/tools/h5stat/testfiles/h5stat_filters-file.ddl +++ b/tools/h5stat/testfiles/h5stat_filters-file.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat -f h5stat_filters.h5' -############################# Filename: h5stat_filters.h5 File information # of unique groups: 1 diff --git a/tools/h5stat/testfiles/h5stat_filters-g.ddl b/tools/h5stat/testfiles/h5stat_filters-g.ddl index 6cb791c..290c82a 100644 --- a/tools/h5stat/testfiles/h5stat_filters-g.ddl +++ b/tools/h5stat/testfiles/h5stat_filters-g.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat -g h5stat_filters.h5' -############################# Filename: h5stat_filters.h5 Small groups (with 0 to 9 links): Total # of small groups: 0 diff --git a/tools/h5stat/testfiles/h5stat_filters.ddl b/tools/h5stat/testfiles/h5stat_filters.ddl index 0a6733d..24522cd 100644 --- a/tools/h5stat/testfiles/h5stat_filters.ddl +++ b/tools/h5stat/testfiles/h5stat_filters.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat h5stat_filters.h5' -############################# Filename: h5stat_filters.h5 File information # of unique groups: 1 diff --git a/tools/h5stat/testfiles/h5stat_help1.ddl b/tools/h5stat/testfiles/h5stat_help1.ddl index d79c99f..d2a8715 100644 --- a/tools/h5stat/testfiles/h5stat_help1.ddl +++ b/tools/h5stat/testfiles/h5stat_help1.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat -h' -############################# Usage: h5stat [OPTIONS] file OPTIONS diff --git a/tools/h5stat/testfiles/h5stat_help2.ddl b/tools/h5stat/testfiles/h5stat_help2.ddl index af48e3a..d2a8715 100644 --- a/tools/h5stat/testfiles/h5stat_help2.ddl +++ b/tools/h5stat/testfiles/h5stat_help2.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat --help' -############################# Usage: h5stat [OPTIONS] file OPTIONS diff --git a/tools/h5stat/testfiles/h5stat_links1.ddl b/tools/h5stat/testfiles/h5stat_links1.ddl index e77a788..c650f15 100644 --- a/tools/h5stat/testfiles/h5stat_links1.ddl +++ b/tools/h5stat/testfiles/h5stat_links1.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat -g -l 8 h5stat_threshold.h5' -############################# Filename: h5stat_threshold.h5 Small groups (with 0 to 7 links): # of groups with 0 link(s): 1 diff --git a/tools/h5stat/testfiles/h5stat_links2.ddl b/tools/h5stat/testfiles/h5stat_links2.ddl index 5207343..09bf937 100644 --- a/tools/h5stat/testfiles/h5stat_links2.ddl +++ b/tools/h5stat/testfiles/h5stat_links2.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat --links=8 h5stat_threshold.h5' -############################# Filename: h5stat_threshold.h5 File information # of unique groups: 4 diff --git a/tools/h5stat/testfiles/h5stat_links3.ddl b/tools/h5stat/testfiles/h5stat_links3.ddl index d0071d7..f80471a 100644 --- a/tools/h5stat/testfiles/h5stat_links3.ddl +++ b/tools/h5stat/testfiles/h5stat_links3.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat --links=20 -g h5stat_threshold.h5' -############################# Filename: h5stat_threshold.h5 Small groups (with 0 to 19 links): # of groups with 0 link(s): 1 diff --git a/tools/h5stat/testfiles/h5stat_links4.ddl b/tools/h5stat/testfiles/h5stat_links4.ddl index ca3911c..94feffd 100644 --- a/tools/h5stat/testfiles/h5stat_links4.ddl +++ b/tools/h5stat/testfiles/h5stat_links4.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat -g h5stat_newgrat.h5' -############################# Filename: h5stat_newgrat.h5 Small groups (with 0 to 9 links): # of groups with 0 link(s): 35000 diff --git a/tools/h5stat/testfiles/h5stat_links5.ddl b/tools/h5stat/testfiles/h5stat_links5.ddl index 44ec161..6f33bed 100644 --- a/tools/h5stat/testfiles/h5stat_links5.ddl +++ b/tools/h5stat/testfiles/h5stat_links5.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat -g -l 40000 h5stat_newgrat.h5' -############################# Filename: h5stat_newgrat.h5 Small groups (with 0 to 39999 links): # of groups with 0 link(s): 35000 diff --git a/tools/h5stat/testfiles/h5stat_newgrat-UA.ddl b/tools/h5stat/testfiles/h5stat_newgrat-UA.ddl index 18f91f3..a5ee7e8 100644 --- a/tools/h5stat/testfiles/h5stat_newgrat-UA.ddl +++ b/tools/h5stat/testfiles/h5stat_newgrat-UA.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat -A h5stat_newgrat.h5' -############################# Filename: h5stat_newgrat.h5 Small # of attributes (objects with 1 to 10 attributes): Total # of objects with small # of attributes: 0 diff --git a/tools/h5stat/testfiles/h5stat_newgrat-UG.ddl b/tools/h5stat/testfiles/h5stat_newgrat-UG.ddl index ecebdef..41195ac 100644 --- a/tools/h5stat/testfiles/h5stat_newgrat-UG.ddl +++ b/tools/h5stat/testfiles/h5stat_newgrat-UG.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat -G h5stat_newgrat.h5' -############################# Filename: h5stat_newgrat.h5 File space information for groups' metadata (in bytes): Object headers (total/unused): 5145147/3220092 diff --git a/tools/h5stat/testfiles/h5stat_newgrat.ddl b/tools/h5stat/testfiles/h5stat_newgrat.ddl index 7d4ef91..33d756b 100644 --- a/tools/h5stat/testfiles/h5stat_newgrat.ddl +++ b/tools/h5stat/testfiles/h5stat_newgrat.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat h5stat_newgrat.h5' -############################# Filename: h5stat_newgrat.h5 File information # of unique groups: 35001 diff --git a/tools/h5stat/testfiles/h5stat_nofile.ddl b/tools/h5stat/testfiles/h5stat_nofile.ddl index cf20995..d8a8b2c 100644 --- a/tools/h5stat/testfiles/h5stat_nofile.ddl +++ b/tools/h5stat/testfiles/h5stat_nofile.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat ' -############################# Usage: h5stat [OPTIONS] file OPTIONS diff --git a/tools/h5stat/testfiles/h5stat_notexist.ddl b/tools/h5stat/testfiles/h5stat_notexist.ddl index ac0fce4..cc25e43 100644 --- a/tools/h5stat/testfiles/h5stat_notexist.ddl +++ b/tools/h5stat/testfiles/h5stat_notexist.ddl @@ -1,5 +1,2 @@ -############################# -Expected output for 'h5stat notexist.h5' -############################# Filename: notexist.h5 h5stat error: unable to open file "notexist.h5" diff --git a/tools/h5stat/testfiles/h5stat_numattrs1.ddl b/tools/h5stat/testfiles/h5stat_numattrs1.ddl index 86cfcb0..fb5568d 100644 --- a/tools/h5stat/testfiles/h5stat_numattrs1.ddl +++ b/tools/h5stat/testfiles/h5stat_numattrs1.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat -AS -a 10 h5stat_threshold.h5' -############################# Filename: h5stat_threshold.h5 Small # of attributes (objects with 1 to 10 attributes): # of objects with 1 attributes: 2 diff --git a/tools/h5stat/testfiles/h5stat_numattrs2.ddl b/tools/h5stat/testfiles/h5stat_numattrs2.ddl index 5ee3adf..1313aec 100644 --- a/tools/h5stat/testfiles/h5stat_numattrs2.ddl +++ b/tools/h5stat/testfiles/h5stat_numattrs2.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat -a 1 h5stat_threshold.h5' -############################# Filename: h5stat_threshold.h5 File information # of unique groups: 4 diff --git a/tools/h5stat/testfiles/h5stat_numattrs3.ddl b/tools/h5stat/testfiles/h5stat_numattrs3.ddl index 515b76c..de8d6a3 100644 --- a/tools/h5stat/testfiles/h5stat_numattrs3.ddl +++ b/tools/h5stat/testfiles/h5stat_numattrs3.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat -A --numattrs=25 h5stat_threshold.h5' -############################# Filename: h5stat_threshold.h5 Small # of attributes (objects with 1 to 25 attributes): # of objects with 1 attributes: 2 diff --git a/tools/h5stat/testfiles/h5stat_numattrs4.ddl b/tools/h5stat/testfiles/h5stat_numattrs4.ddl index 515a4a9..2b0122a 100644 --- a/tools/h5stat/testfiles/h5stat_numattrs4.ddl +++ b/tools/h5stat/testfiles/h5stat_numattrs4.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat -A -a 100 h5stat_newgrat.h5' -############################# Filename: h5stat_newgrat.h5 Small # of attributes (objects with 1 to 100 attributes): # of objects with 100 attributes: 1 diff --git a/tools/h5stat/testfiles/h5stat_tsohm.ddl b/tools/h5stat/testfiles/h5stat_tsohm.ddl index 788421b..37de79b 100644 --- a/tools/h5stat/testfiles/h5stat_tsohm.ddl +++ b/tools/h5stat/testfiles/h5stat_tsohm.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5stat h5stat_tsohm.h5' -############################# Filename: h5stat_tsohm.h5 File information # of unique groups: 1 diff --git a/tools/h5stat/testh5stat.sh.in b/tools/h5stat/testh5stat.sh.in index 865093a..cb0446b 100644 --- a/tools/h5stat/testh5stat.sh.in +++ b/tools/h5stat/testh5stat.sh.in @@ -191,9 +191,6 @@ TOOLTEST() { # Run test. TESTING $STAT $@ ( - echo "#############################" - echo "Expected output for '$STAT $@'" - echo "#############################" cd $TESTDIR $RUNSERIAL $STAT_BIN $@ ) >$actual 2>$actual_err diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index 6649e48..83df182 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -1,16 +1,16 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS_LIB) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -SET (H5_TOOLS_LIB_SRCS +set (H5_TOOLS_LIB_SRCS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff.c ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff_array.c ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff_attr.c @@ -26,7 +26,7 @@ SET (H5_TOOLS_LIB_SRCS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5trav.c ) -SET (H5_TOOLS_LIB_HDRS +set (H5_TOOLS_LIB_HDRS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5trav.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_dump.h @@ -36,18 +36,18 @@ SET (H5_TOOLS_LIB_HDRS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff.h ) -ADD_LIBRARY (${HDF5_TOOLS_LIB_TARGET} ${LIB_TYPE} ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS}) +add_library (${HDF5_TOOLS_LIB_TARGET} ${LIB_TYPE} ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS}) TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") +target_link_libraries (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") H5_SET_LIB_OPTIONS ( ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} ${LIB_TYPE} HDF5_TOOLS_LIB_NAME_RELEASE HDF5_TOOLS_LIB_NAME_DEBUG ) -#SET_TARGET_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} PROPERTIES COMPILE_DEFINITIONS H5DIFF_DEBUG) -SET_TARGET_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools) +#set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES COMPILE_DEFINITIONS H5DIFF_DEBUG) +set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools) ############################################################################## ############################################################################## @@ -58,7 +58,7 @@ SET_TARGET_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tool #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -INSTALL ( +install ( FILES ${H5_TOOLS_LIB_HDRS} DESTINATION @@ -71,25 +71,26 @@ INSTALL ( # Because tools are installed into bin/tools we need to make sure the hdf5tools # library will be installed into the proper location. #----------------------------------------------------------------------------- -IF (APPLE) - OPTION (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF) - IF (HDF5_BUILD_WITH_INSTALL_NAME) +if (APPLE) + option (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF) + if (HDF5_BUILD_WITH_INSTALL_NAME) SET_TARGET_PROPERTIES(${HDF5_TOOLS_LIB_TARGET} PROPERTIES LINK_FLAGS "-current_version ${HDF5_PACKAGE_VERSION} -compatibility_version ${HDF5_PACKAGE_VERSION}" INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME} ) - ENDIF (HDF5_BUILD_WITH_INSTALL_NAME) -ENDIF (APPLE) + endif (HDF5_BUILD_WITH_INSTALL_NAME) +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) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) + INSTALL_TARGET_PDB (${HDF5_TOOLS_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} toolslibraries) + endif (BUILD_SHARED_LIBS) - INSTALL ( + install ( TARGETS ${HDF5_TOOLS_LIB_TARGET} EXPORT @@ -98,4 +99,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT toolslibraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolslibraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c index 2da21ef..3664a29 100644 --- a/tools/lib/h5tools_filters.c +++ b/tools/lib/h5tools_filters.c @@ -20,10 +20,10 @@ * print a warning message *------------------------------------------------------------------------- */ -static void print_warning(const char *dname, const char *fname) -{ - fprintf(stderr,"warning: dataset <%s> cannot be read, %s filter is not available\n", - dname,fname); +static void print_warning(const char *dname, const char *fname) { + fprintf(stderr, + "warning: dataset <%s> cannot be read, %s filter is not available\n", + dname, fname); } /*------------------------------------------------------------------------- @@ -46,109 +46,111 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr hid_t dcpl_id) /* dataset creation property list */ { - int nfilters; /* number of filters */ - H5Z_filter_t filtn; /* filter identification number */ - int i; /* index */ - - - /* get information about filters */ - if ((nfilters = H5Pget_nfilters(dcpl_id))<0) - return -1; - - /* if we do not have filters, we can read the dataset safely */ - if (!nfilters) - return 1; - - /* check availability of filters */ - for(i = 0; i < nfilters; i++) - { - if((filtn = H5Pget_filter2(dcpl_id, (unsigned)i, 0, 0, 0, (size_t)0, 0, NULL)) < 0) - return -1; - - switch(filtn) - { -/*------------------------------------------------------------------------- - * user defined filter - *------------------------------------------------------------------------- - */ - default: - if(name) - print_warning(name, "user defined"); - return 0; - -/*------------------------------------------------------------------------- - * H5Z_FILTER_DEFLATE 1 , deflation like gzip - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_DEFLATE: + int nfilters; /* number of filters */ + H5Z_filter_t filtn; /* filter identification number */ + int i; /* index */ + int udfilter_avail; /* index */ + + /* get information about filters */ + if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0) + return -1; + + /* if we do not have filters, we can read the dataset safely */ + if (!nfilters) + return 1; + + /* check availability of filters */ + for (i = 0; i < nfilters; i++) { + if ((filtn = H5Pget_filter2(dcpl_id, (unsigned) i, 0, 0, 0, (size_t) 0, 0, NULL)) < 0) + return -1; + + switch (filtn) { + /*------------------------------------------------------------------------- + * user defined filter + *------------------------------------------------------------------------- + */ + default: + if ((udfilter_avail = H5Zfilter_avail(filtn)) < 0) + return -1; + else if (udfilter_avail == 0) { + if (name) + print_warning(name, "user defined"); + return 0; + } + break; + + /*------------------------------------------------------------------------- + * H5Z_FILTER_DEFLATE 1 , deflation like gzip + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_DEFLATE: #ifndef H5_HAVE_FILTER_DEFLATE - if (name) - print_warning(name,"deflate"); - return 0; + if (name) + print_warning(name,"deflate"); + return 0; #endif - break; -/*------------------------------------------------------------------------- - * H5Z_FILTER_SZIP 4 , szip compression - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_SZIP: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_SZIP 4 , szip compression + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_SZIP: #ifndef H5_HAVE_FILTER_SZIP - if (name) - print_warning(name,"SZIP"); - return 0; + if (name) + print_warning(name,"SZIP"); + return 0; #endif - break; -/*------------------------------------------------------------------------- - * H5Z_FILTER_SHUFFLE 2 , shuffle the data - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_SHUFFLE: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_SHUFFLE 2 , shuffle the data + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_SHUFFLE: #ifndef H5_HAVE_FILTER_SHUFFLE - if (name) - print_warning(name,"shuffle"); - return 0; + if (name) + print_warning(name,"shuffle"); + return 0; #endif - break; -/*------------------------------------------------------------------------- - * H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_FLETCHER32: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_FLETCHER32: #ifndef H5_HAVE_FILTER_FLETCHER32 - if (name) - print_warning(name,"fletcher32"); - return 0; + if (name) + print_warning(name,"fletcher32"); + return 0; #endif - break; -/*------------------------------------------------------------------------- - * H5Z_FILTER_NBIT - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_NBIT: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_NBIT + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_NBIT: #ifndef H5_HAVE_FILTER_NBIT - if (name) - print_warning(name,"nbit"); - return 0; + if (name) + print_warning(name,"nbit"); + return 0; #endif - break; -/*------------------------------------------------------------------------- - * H5Z_FILTER_SCALEOFFSET - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_SCALEOFFSET: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_SCALEOFFSET + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_SCALEOFFSET: #ifndef H5_HAVE_FILTER_SCALEOFFSET - if (name) - print_warning(name,"scaleoffset"); - return 0; + if (name) + print_warning(name,"scaleoffset"); + return 0; #endif - break; - }/*switch*/ - }/*for*/ + break; + }/*switch*/ + }/*for*/ - return 1; + return 1; } - /*------------------------------------------------------------------------- * Function: h5tools_canwritef * @@ -164,71 +166,70 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr * *------------------------------------------------------------------------- */ -int h5tools_can_encode( H5Z_filter_t filtn) -{ - switch (filtn) - { - /* user defined filter */ - default: - return 0; +int h5tools_can_encode(H5Z_filter_t filtn) { + switch (filtn) { + /* user defined filter */ + default: + return 0; - case H5Z_FILTER_DEFLATE: + case H5Z_FILTER_DEFLATE: #ifndef H5_HAVE_FILTER_DEFLATE - return 0; + return 0; #endif - break; - case H5Z_FILTER_SZIP: + break; + case H5Z_FILTER_SZIP: #ifndef H5_HAVE_FILTER_SZIP - return 0; + return 0; #else - { - unsigned int filter_config_flags; - - if(H5Zget_filter_info(filtn, &filter_config_flags)<0) - return -1; - if ((filter_config_flags & - (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) == 0) { - /* filter present but neither encode nor decode is supported (???) */ - return -1; - } else if ((filter_config_flags & - (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) == - H5Z_FILTER_CONFIG_DECODE_ENABLED) { - /* decoder only: read but not write */ - return 0; - } else if ((filter_config_flags & - (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) == - H5Z_FILTER_CONFIG_ENCODE_ENABLED) { - /* encoder only: write but not read (???) */ - return -1; - } else if ((filter_config_flags & - (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) == - (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) { - return 1; - } - } + { + unsigned int filter_config_flags; + + if (H5Zget_filter_info(filtn, &filter_config_flags) < 0) + return -1; + if ((filter_config_flags + & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == 0) { + /* filter present but neither encode nor decode is supported (???) */ + return -1; + } + else if ((filter_config_flags + & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_DECODE_ENABLED) { + /* decoder only: read but not write */ + return 0; + } + else if ((filter_config_flags + & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_ENCODE_ENABLED) { + /* encoder only: write but not read (???) */ + return -1; + } + else if ((filter_config_flags + & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) + == (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) { + return 1; + } + } #endif - break; - case H5Z_FILTER_SHUFFLE: + break; + case H5Z_FILTER_SHUFFLE: #ifndef H5_HAVE_FILTER_SHUFFLE - return 0; + return 0; #endif - break; - case H5Z_FILTER_FLETCHER32: + break; + case H5Z_FILTER_FLETCHER32: #ifndef H5_HAVE_FILTER_FLETCHER32 - return 0; + return 0; #endif - break; - case H5Z_FILTER_NBIT: + break; + case H5Z_FILTER_NBIT: #ifndef H5_HAVE_FILTER_NBIT - return 0; + return 0; #endif - break; - case H5Z_FILTER_SCALEOFFSET: + break; + case H5Z_FILTER_SCALEOFFSET: #ifndef H5_HAVE_FILTER_SCALEOFFSET - return 0; + return 0; #endif - break; - }/*switch*/ + break; + }/*switch*/ - return 1; + return 1; } diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index a475ded..fca3096 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -49,7 +49,9 @@ typedef struct { } trav_print_udata_t; /* format for hsize_t */ +#ifdef H5TRAV_PRINT_SPACE #define HSIZE_T_FORMAT "%" H5_PRINTF_LL_WIDTH "u" +#endif /* H5TRAV_PRINT_SPACE */ /*------------------------------------------------------------------------- * local functions @@ -680,11 +682,11 @@ h5trav_getindext(const char *name, const trav_table_t *table) for(i = 0; i < table->nobjs; i++) { /* Check for object name having full path (with leading '/') */ if(HDstrcmp(name, table->objs[i].name) == 0) - return(i); + return((int)i); /* Check for object name without leading '/' */ if(HDstrcmp(name, table->objs[i].name + 1) == 0) - return(i); + return((int)i); /* search also in the list of links */ if(table->objs[i].nlinks) { @@ -693,11 +695,11 @@ h5trav_getindext(const char *name, const trav_table_t *table) for ( j=0; j<table->objs[i].nlinks; j++) { /* Check for object name having full path (with leading '/') */ if(HDstrcmp(name, table->objs[i].links[j].new_name) == 0) - return(i); + return((int)i); /* Check for object name without leading '/' */ if(HDstrcmp(name, table->objs[i].links[j].new_name + 1) == 0) - return(i); + return((int)i); } /* end for */ } /* end if */ } /* end for */ @@ -807,7 +809,7 @@ void trav_table_addflags(unsigned *flags, h5trav_type_t type, trav_table_t *table) { - unsigned int new_obj; + size_t new_obj; if(table->nobjs == table->size) { table->size = MAX(1, table->size * 2); @@ -995,6 +997,8 @@ trav_print_visit_obj(const char *path, const H5O_info_t *oinfo, printf(" %-10s %s", "datatype", path); break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: default: printf(" %-10s %s", "unknown object type", path); break; @@ -1005,7 +1009,7 @@ trav_print_visit_obj(const char *path, const H5O_info_t *oinfo, /* Finish printing line about object */ printf("\n"); if(trav_verbosity > 0) - H5Aiterate_by_name(print_udata->fid, path, trav_index_by, trav_index_order, NULL, trav_attr, path, H5P_DEFAULT); + H5Aiterate_by_name(print_udata->fid, path, trav_index_by, trav_index_order, NULL, trav_attr, (void *)path, H5P_DEFAULT); } else /* Print the link's original name */ @@ -1040,7 +1044,8 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) char *targbuf = (char*)HDmalloc(linfo->u.val_size + 1); HDassert(targbuf); - H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT); + if(H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0) + targbuf[0] = 0; printf(" %-10s %s -> %s\n", "link", path, targbuf); HDfree(targbuf); } /* end if */ @@ -1051,21 +1056,28 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) case H5L_TYPE_EXTERNAL: if(linfo->u.val_size > 0) { char *targbuf; - const char *filename; - const char *objname; + const char *filename = NULL; + const char *objname = NULL; targbuf = (char*)HDmalloc(linfo->u.val_size + 1); HDassert(targbuf); - H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT); - H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &objname); - printf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname); + if(H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0) + targbuf[0] = 0; + if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &objname) >= 0) + printf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname); HDfree(targbuf); } /* end if */ else printf(" %-10s %s ->\n", "ext link", path); break; + case H5L_TYPE_HARD: + /* Should be handled elsewhere */ + return(-1); + + case H5L_TYPE_ERROR: + case H5L_TYPE_MAX: default: printf(" %-10s %s -> ???\n", "unknown type of UD link", path); break; diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index 8e1003e..ed8c315 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS_MISC) #----------------------------------------------------------------------------- @@ -10,25 +10,25 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # Add the misc executables # -------------------------------------------------------------------- #-- Misc Executables -ADD_EXECUTABLE (h5debug ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5debug.c) +add_executable (h5debug ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5debug.c) TARGET_NAMING (h5debug ${LIB_TYPE}) TARGET_C_PROPERTIES (h5debug " " " ") -TARGET_LINK_LIBRARIES (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5debug PROPERTIES FOLDER tools) +target_link_libraries (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (h5debug PROPERTIES FOLDER tools) -ADD_EXECUTABLE (h5repart ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart.c) +add_executable (h5repart ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart.c) TARGET_NAMING (h5repart ${LIB_TYPE}) TARGET_C_PROPERTIES (h5repart " " " ") -TARGET_LINK_LIBRARIES (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5repart PROPERTIES FOLDER tools) +target_link_libraries (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (h5repart PROPERTIES FOLDER tools) -ADD_EXECUTABLE (h5mkgrp ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5mkgrp.c) +add_executable (h5mkgrp ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5mkgrp.c) TARGET_NAMING (h5mkgrp ${LIB_TYPE}) TARGET_C_PROPERTIES (h5mkgrp " " " ") -TARGET_LINK_LIBRARIES (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5mkgrp PROPERTIES FOLDER tools) +target_link_libraries (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5mkgrp PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES +set (H5_DEP_EXECUTABLES h5debug h5repart h5mkgrp @@ -37,31 +37,31 @@ SET (H5_DEP_EXECUTABLES #----------------------------------------------------------------------------- # Generate the h5cc file containing settings needed to compile programs #----------------------------------------------------------------------------- -#IF (NOT WIN32) -# CONFIGURE_FILE (${HDF5_TOOLS_MISC_SOURCE_DIR}/h5cc.in ${HDF5_BINARY_DIR}/h5cc @ONLY) -#ENDIF (NOT WIN32) +#if (NOT WIN32) +# configure_file (${HDF5_TOOLS_MISC_SOURCE_DIR}/h5cc.in ${HDF5_BINARY_DIR}/h5cc @ONLY) +#endif (NOT WIN32) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the misc test executables # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5repart_gentest ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart_gentest.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5repart_gentest ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart_gentest.c) TARGET_NAMING (h5repart_gentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5repart_gentest " " " ") - TARGET_LINK_LIBRARIES (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5repart_gentest PROPERTIES FOLDER generator/tools) - #ADD_TEST (NAME h5repart_gentest COMMAND $<TARGET_FILE:h5repart_gentest>) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + target_link_libraries (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5repart_gentest PROPERTIES FOLDER generator/tools) + #add_test (NAME h5repart_gentest COMMAND $<TARGET_FILE:h5repart_gentest>) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5repart_test ${HDF5_TOOLS_MISC_SOURCE_DIR}/repart_test.c) + add_executable (h5repart_test ${HDF5_TOOLS_MISC_SOURCE_DIR}/repart_test.c) TARGET_NAMING (h5repart_test ${LIB_TYPE}) TARGET_C_PROPERTIES (h5repart_test " " " ") - TARGET_LINK_LIBRARIES (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5repart_test PROPERTIES FOLDER tools) + target_link_libraries (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5repart_test PROPERTIES FOLDER tools) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -77,7 +77,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5repart ${HDF5_INSTALL_BIN_DIR} toolsapplications) #INSTALL_PROGRAM_PDB (h5mkgrp ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5debug h5repart h5mkgrp RUNTIME DESTINATION diff --git a/tools/misc/CMakeTests.cmake b/tools/misc/CMakeTests.cmake index cc9c5e2..a935c2b 100644 --- a/tools/misc/CMakeTests.cmake +++ b/tools/misc/CMakeTests.cmake @@ -8,7 +8,7 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- - SET (HDF5_REFERENCE_TEST_FILES + set (HDF5_REFERENCE_TEST_FILES family_file00000.h5 family_file00001.h5 family_file00002.h5 @@ -29,18 +29,18 @@ family_file00017.h5 ) - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( + foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/${h5_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET h5repart POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_file} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (HDF5_MKGRP_TEST_FILES + set (HDF5_MKGRP_TEST_FILES #h5mkgrp_help.txt #h5mkgrp_version h5mkgrp_single.ls @@ -60,24 +60,24 @@ # make test dir FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_mkgrp_file}") - #MESSAGE (STATUS " Copying ${h5_mkgrp_file}") - ADD_CUSTOM_COMMAND ( + foreach (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_mkgrp_file}") + #message (STATUS " Copying ${h5_mkgrp_file}") + add_custom_command ( TARGET h5mkgrp POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_mkgrp_file} ${dest} ) - ENDFOREACH (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) + endforeach (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET h5mkgrp POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/testfiles/h5mkgrp_help.txt ${PROJECT_BINARY_DIR}/testfiles/h5mkgrp_help.txt ) - CONFIGURE_FILE (${PROJECT_SOURCE_DIR}/testfiles/h5mkgrp_version.txt.in ${PROJECT_BINARY_DIR}/testfiles/h5mkgrp_version.txt @ONLY) + configure_file (${PROJECT_SOURCE_DIR}/testfiles/h5mkgrp_version.txt.in ${PROJECT_BINARY_DIR}/testfiles/h5mkgrp_version.txt @ONLY) ############################################################################## ############################################################################## @@ -86,8 +86,8 @@ ############################################################################## MACRO (ADD_H5_TEST resultfile resultcode resultoption) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5MKGRP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -95,21 +95,21 @@ ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5MKGRP-${resultfile} COMMAND $<TARGET_FILE:h5mkgrp> ${resultoption} ${resultfile}.h5 ${ARGN} ) - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}-clear-objects) - ADD_TEST ( + set_tests_properties (H5MKGRP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5MKGRP-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5MKGRP-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}-clear-objects) + add_test ( NAME H5MKGRP-${resultfile}-h5ls COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>" @@ -121,15 +121,15 @@ -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}-h5ls PROPERTIES DEPENDS H5MKGRP-${resultfile}) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5MKGRP-${resultfile}-h5ls PROPERTIES DEPENDS H5MKGRP-${resultfile}) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST resultfile resultcode resultoption) MACRO (ADD_H5_CMP resultfile resultcode) - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5MKGRP_CMP-${resultfile} COMMAND $<TARGET_FILE:h5mkgrp> ${ARGN}) - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5MKGRP_CMP-${resultfile} COMMAND $<TARGET_FILE:h5mkgrp> ${ARGN}) + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5MKGRP_CMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -137,8 +137,8 @@ ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5MKGRP_CMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - ADD_TEST ( + set_tests_properties (H5MKGRP_CMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + add_test ( NAME H5MKGRP_CMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5mkgrp>" @@ -149,8 +149,8 @@ -D "TEST_REFERENCE=${resultfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_CMP resultfile resultcode) ############################################################################## @@ -160,7 +160,7 @@ ############################################################################## # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5REPART-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -171,33 +171,33 @@ scd_family00003.h5 family_to_sec2.h5 ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPART-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPART-clearall-objects") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPART-clearall-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5REPART-clearall-objects") # repartition family member size to 20,000 bytes. - ADD_TEST (NAME H5REPART-h5repart_20K COMMAND $<TARGET_FILE:h5repart> -m 20000 family_file%05d.h5 fst_family%05d.h5) - SET_TESTS_PROPERTIES (H5REPART-h5repart_20K PROPERTIES DEPENDS H5REPART-clearall-objects) + add_test (NAME H5REPART-h5repart_20K COMMAND $<TARGET_FILE:h5repart> -m 20000 family_file%05d.h5 fst_family%05d.h5) + set_tests_properties (H5REPART-h5repart_20K PROPERTIES DEPENDS H5REPART-clearall-objects) # repartition family member size to 5 KB. - ADD_TEST (NAME H5REPART-h5repart_5K COMMAND $<TARGET_FILE:h5repart> -m 5k family_file%05d.h5 scd_family%05d.h5) - SET_TESTS_PROPERTIES (H5REPART-h5repart_5K PROPERTIES DEPENDS H5REPART-clearall-objects) + add_test (NAME H5REPART-h5repart_5K COMMAND $<TARGET_FILE:h5repart> -m 5k family_file%05d.h5 scd_family%05d.h5) + set_tests_properties (H5REPART-h5repart_5K PROPERTIES DEPENDS H5REPART-clearall-objects) # convert family file to sec2 file of 20,000 bytes - ADD_TEST (NAME H5REPART-h5repart_sec2 COMMAND $<TARGET_FILE:h5repart> -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5) - SET_TESTS_PROPERTIES (H5REPART-h5repart_sec2 PROPERTIES DEPENDS H5REPART-clearall-objects) + add_test (NAME H5REPART-h5repart_sec2 COMMAND $<TARGET_FILE:h5repart> -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5) + set_tests_properties (H5REPART-h5repart_sec2 PROPERTIES DEPENDS H5REPART-clearall-objects) # test the output files repartitioned above. - ADD_TEST (NAME H5REPART-h5repart_test COMMAND $<TARGET_FILE:h5repart_test>) - SET_TESTS_PROPERTIES (H5REPART-h5repart_test PROPERTIES DEPENDS H5REPART-clearall-objects DEPENDS H5REPART-h5repart_20K DEPENDS H5REPART-h5repart_5K DEPENDS H5REPART-h5repart_sec2) + add_test (NAME H5REPART-h5repart_test COMMAND $<TARGET_FILE:h5repart_test>) + set_tests_properties (H5REPART-h5repart_test PROPERTIES DEPENDS H5REPART-clearall-objects DEPENDS H5REPART-h5repart_20K DEPENDS H5REPART-h5repart_5K DEPENDS H5REPART-h5repart_sec2) - SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5repart_test ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( NAME H5MKGRP-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -242,12 +242,12 @@ h5mkgrp_nested_mult_lp.out h5mkgrp_nested_mult_lp.out.err ) - SET_TESTS_PROPERTIES (H5MKGRP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5MKGRP-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5MKGRP-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5MKGRP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5MKGRP-clearall-objects PROPERTIES DEPENDS ${last_test}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5MKGRP-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # Check that help & version is displayed properly ADD_H5_CMP (h5mkgrp_help 0 "-h") diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c index 9df49cf..617e614 100644 --- a/tools/misc/h5debug.c +++ b/tools/misc/h5debug.c @@ -248,7 +248,10 @@ main(int argc, char *argv[]) HDexit(1); } /* end if */ if(HDstrchr(argv[1], '%')) - H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT); + if(H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT) < 0) { + fprintf(stderr, "cannot set file access property list\n"); + HDexit(1); + } if((fid = H5Fopen(argv[1], H5F_ACC_RDONLY, fapl)) < 0) { HDfprintf(stderr, "cannot open file\n"); HDexit(1); diff --git a/tools/misc/testh5mkgrp.sh.in b/tools/misc/testh5mkgrp.sh.in index 85205a8..190e824 100644 --- a/tools/misc/testh5mkgrp.sh.in +++ b/tools/misc/testh5mkgrp.sh.in @@ -49,7 +49,7 @@ SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" # testfiles source dirs for tools SRC_H5MKGRP_TESTFILES="$SRC_TOOLS/misc/testfiles" -TESTDIR=./testfiles +TESTDIR=./testgrp test -d $TESTDIR || mkdir -p $TESTDIR ###################################################################### diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 1054953..798732f 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -511,7 +511,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.170" +#define H5_PACKAGE_STRING "HDF5 1.9.175" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -520,7 +520,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.170" +#define H5_PACKAGE_VERSION "1.9.175" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -683,7 +683,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.170" +#define H5_VERSION "1.9.175" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ |