From ae06433ab0ca13838c2762c8fad165a041d64c42 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 13 May 2010 11:01:50 -0500 Subject: [svn-r18793] Add files to support building library with CMake Tested: Local linux --- CMakeLists.txt | 567 +++++++++++++++ CTestConfig.cmake | 13 + ConfigureChecks.cmake | 797 +++++++++++++++++++++ MANIFEST | 60 ++ Resources/CMake/FindSZIP.cmake | 179 +++++ Resources/CheckTypeSize.cmake | 48 ++ Resources/ConversionTests.c | 422 +++++++++++ Resources/GetTimeOfDayTest.cpp | 15 + Resources/H5cxx_config.h.in | 5 + Resources/H5pubconf.h.in | 745 +++++++++++++++++++ Resources/HDF5Config.cmake.in | 32 + Resources/HDF5Macros.cmake | 122 ++++ Resources/HDF5Tests.c | 366 ++++++++++ Resources/hdf5_zlib.h.in | 1 + Resources/libhdf5.settings.cmake.in | 68 ++ Resources/runTest.cmake | 82 +++ Resources/xlatefile.c | 56 ++ c++/CMakeLists.txt | 46 ++ c++/examples/CMakeLists.txt | 27 + c++/src/CMakeLists.txt | 113 +++ c++/test/CMakeLists.txt | 47 ++ examples/CMakeLists.txt | 35 + fortran/CMakeLists.txt | 142 ++++ fortran/examples/CMakeLists.txt | 61 ++ fortran/src/CMakeLists.txt | 229 ++++++ fortran/test/CMakeLists.txt | 175 +++++ hl/CMakeLists.txt | 42 ++ hl/c++/CMakeLists.txt | 22 + hl/c++/examples/CMakeLists.txt | 31 + hl/c++/src/CMakeLists.txt | 44 ++ hl/c++/test/CMakeLists.txt | 33 + hl/examples/CMakeLists.txt | 36 + hl/fortran/CMakeLists.txt | 31 + hl/fortran/examples/CMakeLists.txt | 39 + hl/fortran/src/CMakeLists.txt | 103 +++ hl/fortran/src/H5IMcc.h | 2 +- hl/fortran/test/CMakeLists.txt | 70 ++ hl/src/CMakeLists.txt | 65 ++ hl/test/CMakeLists.txt | 67 ++ hl/tools/CMakeLists.txt | 55 ++ perform/CMakeLists.txt | 74 ++ release_docs/CMake_Windows.TXT | 95 +++ release_docs/INSTALL_Windows.txt | 122 ++-- release_docs/INSTALL_Windows_From_Command_Line.txt | 8 +- release_docs/INSTALL_Windows_Short_VS2008.TXT | 192 +++++ src/CMakeLists.txt | 722 +++++++++++++++++++ test/CMakeLists.txt | 253 +++++++ testpar/CMakeLists.txt | 46 ++ tools/CMakeLists.txt | 42 ++ tools/h5copy/CMakeLists.txt | 229 ++++++ tools/h5diff/CMakeLists.txt | 654 +++++++++++++++++ tools/h5diff/testfiles/h5diff_101w.txt | 10 + tools/h5diff/testfiles/h5diff_102w.txt | 10 + tools/h5dump/CMakeLists.txt | 611 ++++++++++++++++ tools/h5import/CMakeLists.txt | 39 + tools/h5jam/CMakeLists.txt | 58 ++ tools/h5ls/CMakeLists.txt | 168 +++++ tools/h5repack/CMakeLists.txt | 531 ++++++++++++++ tools/h5stat/CMakeLists.txt | 122 ++++ tools/lib/CMakeLists.txt | 68 ++ tools/misc/CMakeLists.txt | 100 +++ 61 files changed, 9190 insertions(+), 57 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 CTestConfig.cmake create mode 100644 ConfigureChecks.cmake create mode 100644 Resources/CMake/FindSZIP.cmake create mode 100644 Resources/CheckTypeSize.cmake create mode 100644 Resources/ConversionTests.c create mode 100644 Resources/GetTimeOfDayTest.cpp create mode 100644 Resources/H5cxx_config.h.in create mode 100644 Resources/H5pubconf.h.in create mode 100644 Resources/HDF5Config.cmake.in create mode 100644 Resources/HDF5Macros.cmake create mode 100644 Resources/HDF5Tests.c create mode 100644 Resources/hdf5_zlib.h.in create mode 100644 Resources/libhdf5.settings.cmake.in create mode 100644 Resources/runTest.cmake create mode 100644 Resources/xlatefile.c create mode 100644 c++/CMakeLists.txt create mode 100644 c++/examples/CMakeLists.txt create mode 100644 c++/src/CMakeLists.txt create mode 100644 c++/test/CMakeLists.txt create mode 100644 examples/CMakeLists.txt create mode 100644 fortran/CMakeLists.txt create mode 100644 fortran/examples/CMakeLists.txt create mode 100644 fortran/src/CMakeLists.txt create mode 100644 fortran/test/CMakeLists.txt create mode 100644 hl/CMakeLists.txt create mode 100644 hl/c++/CMakeLists.txt create mode 100644 hl/c++/examples/CMakeLists.txt create mode 100644 hl/c++/src/CMakeLists.txt create mode 100644 hl/c++/test/CMakeLists.txt create mode 100644 hl/examples/CMakeLists.txt create mode 100644 hl/fortran/CMakeLists.txt create mode 100644 hl/fortran/examples/CMakeLists.txt create mode 100644 hl/fortran/src/CMakeLists.txt create mode 100644 hl/fortran/test/CMakeLists.txt create mode 100644 hl/src/CMakeLists.txt create mode 100644 hl/test/CMakeLists.txt create mode 100644 hl/tools/CMakeLists.txt create mode 100644 perform/CMakeLists.txt create mode 100755 release_docs/CMake_Windows.TXT create mode 100755 release_docs/INSTALL_Windows_Short_VS2008.TXT create mode 100644 src/CMakeLists.txt create mode 100644 test/CMakeLists.txt create mode 100644 testpar/CMakeLists.txt create mode 100644 tools/CMakeLists.txt create mode 100644 tools/h5copy/CMakeLists.txt create mode 100644 tools/h5diff/CMakeLists.txt create mode 100755 tools/h5diff/testfiles/h5diff_101w.txt create mode 100755 tools/h5diff/testfiles/h5diff_102w.txt create mode 100644 tools/h5dump/CMakeLists.txt create mode 100644 tools/h5import/CMakeLists.txt create mode 100644 tools/h5jam/CMakeLists.txt create mode 100644 tools/h5ls/CMakeLists.txt create mode 100644 tools/h5repack/CMakeLists.txt create mode 100644 tools/h5stat/CMakeLists.txt create mode 100644 tools/lib/CMakeLists.txt create mode 100644 tools/misc/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..dc7e2fa --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,567 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5 C CXX) + +#----------------------------------------------------------------------------- +# Instructions for use : Normal Build +# +# For standard build of HDF5 libraries,tests and tools. +# Run cmake using the HDF5 source tree to generate a build tree. +# Enable/Disable options according to requirements and +# set CMAKE_INSTALL_PREFIX to the required install path. +# Make install can be used to install all components for system-wide use. +# +#----------------------------------------------------------------------------- +# Instructions for use : Sub-Project Build +# +# To include HDF5 as a sub-project within another project. +# Set HDF5_EXTERNALLY_CONFIGURED to 1 in the parent project and +# supply values for the following variables... +# +# 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 +# for export during install. +# +# HDF5_LIB_DEPENDENCIES : +# If the build of HDF5 libs is being customized, then rules for the +# dependencies of the HDF5 libs may be 'incomplete', add additional +# dependencies to this variable so that external projects pick them up +# +# HDF5_EXTERNAL_LIB_PREFIX : +# If the parent project needs to install hdf libraries, but avoid +# name conflicts with system versions, then a prefix may be added +# to ensure that the correct versions configured are used. +# +# Consider this example from the ParaView project, it builds its own zlib +# library and tells HDF5 to add it as a dependency - this ensures that +# 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) +# # Avoid duplicating names of installed libraries +# SET(HDF5_EXTERNAL_LIB_PREFIX "vtk") +# # Targets linking to the HDF5 libs need to know their names +# # if they are changed in the sub project, they should be here too +# SET(HDF5_LIB_NAME "vtkhdf5") +# SET(HDF5_HL_LIB_NAME "vtkhdf5_hl") +# SET(HDF5_LIBRARY "${HDF5_LIB_NAME};${HDF5_HL_LIB_NAME}") +# # Export configuration to this export variable +# 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) +# # Override the zlib header file +# IF(VTK_USE_SYSTEM_ZLIB) +# SET(H5_ZLIB_HEADER "zlib.h") +# ELSE(VTK_USE_SYSTEM_ZLIB) +# 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) +# ENDIF(VTK_USE_SYSTEM_ZLIB) +# ENDIF(HDF5_ENABLE_Z_LIB_SUPPORT) +# +# # Add the sub project +# ADD_SUBDIRECTORY(Utilities/hdf5-1.8) +# # Add the HDf5 dirs to our include path +# SET(HDF5_INCLUDE_DIR +# ${ParaView_SOURCE_DIR}/Utilities/hdf5-1.8/src +# ${ParaView_BINARY_DIR}/Utilities/hdf5-1.8 +# ${ParaView_SOURCE_DIR}/Utilities/hdf5-1.8/hl/src) +# +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Basic HDF5 stuff here +#----------------------------------------------------------------------------- +SET (HDF5_PACKAGE "hdf5") +SET (HDF5_PACKAGE_NAME "HDF5") +SET (HDF5_PACKAGE_VERSION 1.8.5) +SET (HDF5_PACKAGE_VERSION_MAJOR 1.8) +SET (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION}") +SET (HDF5_PACKAGE_TARNAME "hdf5") +SET (HDF5_PACKAGE_URL "htt://www.hdfgroup.org") +SET (HDF5_PACKAGE_BUGREPORT "help@hdfgroup.org") + +#----------------------------------------------------------------------------- +# 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 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}") + +#----------------------------------------------------------------------------- +# Define some CMake variables for use later in the project +#----------------------------------------------------------------------------- +SET (HDF5_RESOURCES_DIR ${HDF5_SOURCE_DIR}/Resources) +SET (HDF5_SRC_DIR ${HDF5_SOURCE_DIR}/src) +SET (HDF5_TEST_SOURCE_DIR ${HDF5_SOURCE_DIR}/test) +SET (HDF5_CPP_SOURCE_DIR ${HDF5_SOURCE_DIR}/c++) +SET (HDF5_CPP_TEST_DIR ${HDF5_CPP_SOURCE_DIR}/test) +SET (HDF5_HL_SOURCE_DIR ${HDF5_SOURCE_DIR}/hl) +SET (HDF5_TOOLS_SOURCE_DIR ${HDF5_SOURCE_DIR}/tools) +SET (HDF5_PERFORM_SOURCE_DIR ${HDF5_SOURCE_DIR}/perform) +SET (HDF5_F90_SOURCE_DIR ${HDF5_SOURCE_DIR}/fortran) + +#----------------------------------------------------------------------------- +# Include some macros for reusable code +#----------------------------------------------------------------------------- +INCLUDE (${HDF5_RESOURCES_DIR}/HDF5Macros.cmake) + +#----------------------------------------------------------------------------- +# Setup output Directories +#----------------------------------------------------------------------------- +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 + ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Libraries" + ) + SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY + ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all static libraries." + ) + SET (CMAKE_Fortran_MODULE_DIRECTORY + ${PROJECT_BINARY_DIR}/bin/fortran CACHE PATH "Single Directory for all fortran modules." + ) +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) + +#----------------------------------------------------------------------------- +# 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) + +#----------------------------------------------------------------------------- +# 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 "") + +#----------------------------------------------------------------------------- +# Run all the CMake configuration tests for our build environment +#----------------------------------------------------------------------------- +INCLUDE (${HDF5_SOURCE_DIR}/ConfigureChecks.cmake) + +#----------------------------------------------------------------------------- +# Option to use legacy naming for windows libs/programs, default is legacy +#----------------------------------------------------------------------------- +IF (WIN32) + OPTION (H5_LEGACY_NAMING "Use Legacy Names for Libraries and Programs" ON) +ENDIF (WIN32) + +#----------------------------------------------------------------------------- +# Option to Build Shared/Static libs, default is static +#----------------------------------------------------------------------------- +OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" OFF) +SET (LIB_TYPE STATIC) +IF (BUILD_SHARED_LIBS) + SET (LIB_TYPE SHARED) + SET (H5_BUILT_AS_DYNAMIC_LIB 1) + SET (LIBPOSTFIX "") + IF (MSVC) + SET (CMAKE_MFC_FLAG 0) + 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 "/MT") + STRING (REGEX REPLACE "/MT" "/MD" ${flag_var} "${${flag_var}}") + ENDIF (${flag_var} MATCHES "/MT") + ENDFOREACH (flag_var) + ENDIF (MSVC) +ELSE (BUILD_SHARED_LIBS) + IF (NOT WIN32) + # should this be a user setting : Everyone uses it anyway ? + ADD_DEFINITIONS(-DPIC) + ENDIF (NOT WIN32) + SET (LIBPOSTFIX "") + IF (MSVC) + SET (CMAKE_MFC_FLAG 0) + 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) + ENDIF (MSVC) +ENDIF (BUILD_SHARED_LIBS) + +#----------------------------------------------------------------------------- +# Set the target names of all the libraries +#----------------------------------------------------------------------------- +SET (HDF5_LIB_TARGET ${HDF5_LIB_NAME}${LIBPOSTFIX}) +SET (HDF5_TEST_LIB_TARGET ${HDF5_TEST_LIB_NAME}${LIBPOSTFIX}) +SET (HDF5_CPP_LIB_TARGET ${HDF5_CPP_LIB_NAME}${LIBPOSTFIX}) +SET (HDF5_HL_LIB_TARGET ${HDF5_HL_LIB_NAME}${LIBPOSTFIX}) +SET (HDF5_HL_CPP_LIB_TARGET ${HDF5_HL_CPP_LIB_NAME}${LIBPOSTFIX}) +SET (HDF5_TOOLS_LIB_TARGET ${HDF5_TOOLS_LIB_NAME}${LIBPOSTFIX}) +SET (HDF5_F90_LIB_TARGET ${HDF5_F90_LIB_NAME}${LIBPOSTFIX}) +SET (HDF5_F90_C_LIB_TARGET ${HDF5_F90_C_LIB_NAME}${LIBPOSTFIX}) +SET (HDF5_F90_TEST_LIB_TARGET ${HDF5_F90_TEST_LIB_NAME}${LIBPOSTFIX}) +SET (HDF5_F90_C_TEST_LIB_TARGET ${HDF5_F90_C_TEST_LIB_NAME}${LIBPOSTFIX}) +SET (HDF5_HL_F90_LIB_TARGET ${HDF5_HL_F90_LIB_NAME}${LIBPOSTFIX}) +SET (HDF5_HL_F90_C_LIB_TARGET ${HDF5_HL_F90_C_LIB_NAME}${LIBPOSTFIX}) + +#----------------------------------------------------------------------------- +# Include the main src and config directories +#----------------------------------------------------------------------------- +SET (HDF5_INCLUDE_DIRECTORIES + ${HDF5_SRC_DIR} + ${HDF5_SOURCE_DIR} + ${HDF5_BINARY_DIR} +) +INCLUDE_DIRECTORIES (${HDF5_INCLUDE_DIRECTORIES}) + +#----------------------------------------------------------------------------- +# When building utility executables that generate other (source) files : +# we make use of the following variables defined in the root CMakeLists. +# 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") + ADD_DEFINITIONS (-DBIND_TO_CURRENT_VCLIBS_VERSION=1) + ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS) +ENDIF (WIN32) + +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 ( + -DH5_DEBUG_API -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 + ) + #-- 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 (-UH5_DEBUG_API -DNDEBUG) +ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) + +#----------------------------------------------------------------------------- +# Compiler specific flags : Shouldn't there be compiler tests for these +#----------------------------------------------------------------------------- +IF (NOT WIN32) + SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common") +ENDIF (NOT WIN32) + +#----------------------------------------------------------------------------- +# Option to allow the user to 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") + ENDIF (MSVC) + IF(WIN32) + ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS) + ENDIF(WIN32) + # Borland uses -w- to suppress warnings. + 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") + ENDIF (NOT HDF5_WARNINGS_BLOCKED) +ENDIF (HDF5_DISABLE_COMPILER_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) + +#----------------------------------------------------------------------------- +# Option to Enable MPI Parallel +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF) +IF (HDF5_ENABLE_PARALLEL) + INCLUDE (FindMPI) + INCLUDE_DIRECTORIES (${MPI_INCLUDE_PATH}) + IF (MPI_FOUND) + SET (H5_HAVE_PARALLEL 1) + ENDIF (MPI_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_LIBRARY}) + IF (MPI_LINK_FLAGS) + SET (CMAKE_EXE_LINKER_FLAGS ${MPI_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}) + ENDIF (MPI_LINK_FLAGS) + IF (MPI_EXTRA_LIBRARY) + SET (LINK_LIBS ${LINK_LIBS} ${MPI_EXTRA_LIBRARY}) + ENDIF (MPI_EXTRA_LIBRARY) +ENDIF (H5_HAVE_PARALLEL) + +#----------------------------------------------------------------------------- +# Option to use 1.6.x API +#----------------------------------------------------------------------------- +OPTION (HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF) +SET (USE_16_API_DEFAULT 0) +IF (HDF5_USE_16_API_DEFAULT) + SET (H5_USE_16_API_DEFAULT 1) +ENDIF (HDF5_USE_16_API_DEFAULT) + +#----------------------------------------------------------------------------- +# 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) + ENDIF (HDF5_USE_FILTER_${FILTER}) + # MESSAGE (STATUS "Filter ${FILTER} is ${HDF5_USE_FILTER_${FILTER}}") +ENDMACRO (HDF5_SETUP_FILTERS) + +HDF5_SETUP_FILTERS (SHUFFLE) +HDF5_SETUP_FILTERS (FLETCHER32) +HDF5_SETUP_FILTERS (NBIT) +HDF5_SETUP_FILTERS (SCALEOFFSET) + +#----------------------------------------------------------------------------- +# 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) + FIND_PACKAGE (ZLIB REQUIRED) + 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") + ELSE (ZLIB_FOUND) + MESSAGE (FATAL " ZLib is Required for ZLib support in HDF5") + 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) + CONFIGURE_FILE (${HDF5_SOURCE_DIR}/Resources/hdf5_zlib.h.in ${HDF5_BINARY_DIR}/hdf5_zlib.h @ONLY) + SET (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES}) + INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS}) + MESSAGE (STATUS "Filter ZLIB is ON") +ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT) + +#----------------------------------------------------------------------------- +# Option for SzLib support +#----------------------------------------------------------------------------- +SET (CMAKE_MODULE_PATH ${HDF5_SOURCE_DIR}/Resources/CMake ${CMAKE_MODULE_PATH}) +OPTION (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF) +IF (HDF5_ENABLE_SZIP_SUPPORT) + FIND_PACKAGE (SZIP REQUIRED) + IF (SZIP_FOUND) + SET (H5_HAVE_FILTER_SZIP 1) + SET (H5_HAVE_SZLIB_H 1) + SET (H5_HAVE_LIBSZ 1) + SET (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES}) + INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) +# MESSAGE (STATUS "SZIP_INCLUDE_DIRS: ${SZIP_INCLUDE_DIRS}") +# MESSAGE (STATUS "SZIP_INCLUDE_DIR: ${SZIP_INCLUDE_DIR}") + MESSAGE (STATUS "Filter SZIP is ON") + OPTION (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF) + IF (HDF5_ENABLE_SZIP_ENCODING) + SET (H5_HAVE_SZIP_ENCODER 1) + ENDIF (HDF5_ENABLE_SZIP_ENCODING) + ELSE (SZIP_FOUND) + MESSAGE (FATAL_ERROR "SZIP is Required for SZIP support in HDF5") + ENDIF (SZIP_FOUND) +ENDIF (HDF5_ENABLE_SZIP_SUPPORT) + +#----------------------------------------------------------------------------- +# Option to use PACKED BITS SUPPORT +#----------------------------------------------------------------------------- +OPTION (HDF5_USE_H5DUMP_PACKED_BITS "Use the PACKED BITS feature in h5dump" OFF) +SET (H5_HAVE_H5DUMP_PACKED_BITS 0) +IF (HDF5_USE_H5DUMP_PACKED_BITS) + SET (H5_HAVE_H5DUMP_PACKED_BITS 1) +ENDIF (HDF5_USE_H5DUMP_PACKED_BITS) + +#----------------------------------------------------------------------------- +# Add the HDF5 Library Target to the build +#----------------------------------------------------------------------------- +ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src) + +#----------------------------------------------------------------------------- +# Build utility to copy and strip X lines of file +#----------------------------------------------------------------------------- +SET (XLATE_UTILITY "xlatefile") +ADD_EXECUTABLE(${XLATE_UTILITY} ${HDF5_SOURCE_DIR}/Resources/xlatefile.c) + +#----------------------------------------------------------------------------- +# Dashboard and Testing Settings +#----------------------------------------------------------------------------- +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) + ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/tools/lib ${PROJECT_BINARY_DIR}/tools/lib) + ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/test ${PROJECT_BINARY_DIR}/test) + ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/perform ${PROJECT_BINARY_DIR}/perform) + ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) + INCLUDE (${HDF5_SOURCE_DIR}/CTestConfig.cmake) +ENDIF (BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Option to build Fortran bindings/tests/examples +# Make sure this appears before the CONFIGURE_FILE step +# so that fortran name mangling is detected before writing H5pubconf.h +#----------------------------------------------------------------------------- +OPTION (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF) +IF (HDF5_BUILD_FORTRAN) + # 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 ## _") + ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/fortran ${PROJECT_BINARY_DIR}/fortran) +ELSE (HDF5_BUILD_FORTRAN) + SET (H5_FC_FUNC "H5_FC_FUNC(name,NAME) name ## _") + SET (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _") +ENDIF (HDF5_BUILD_FORTRAN) + +#----------------------------------------------------------------------------- +# Option to build 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) + +#----------------------------------------------------------------------------- +# Option to build HDF5 C++ Library +#----------------------------------------------------------------------------- +OPTION (HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF) +IF (HDF5_BUILD_CPP_LIB) + ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/c++ ${PROJECT_BINARY_DIR}/c++) +ENDIF (HDF5_BUILD_CPP_LIB) + +#----------------------------------------------------------------------------- +# Option to build HDF5 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) + +#----------------------------------------------------------------------------- +# Option to build High Level API's +#----------------------------------------------------------------------------- +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) + +#----------------------------------------------------------------------------- +# Generate the H5pubconf.h file containing user settings needed by compilation +#----------------------------------------------------------------------------- +CONFIGURE_FILE (${HDF5_SOURCE_DIR}/Resources/H5pubconf.h.in ${HDF5_BINARY_DIR}/H5pubconf.h @ONLY) + +#----------------------------------------------------------------------------- +# Add file(s) to CMake Install +#----------------------------------------------------------------------------- +INSTALL ( + FILES + ${PROJECT_BINARY_DIR}/H5pubconf.h + DESTINATION + include +) + +#----------------------------------------------------------------------------- +# Add Target(s) to CMake Install for import into other projects +#----------------------------------------------------------------------------- +INSTALL ( + EXPORT + ${HDF5_EXPORTED_TARGETS} + DESTINATION + lib + FILE + HDF5-config.cmake +) + +#----------------------------------------------------------------------------- +# Export all exported targets to the build tree for use by parent project +#----------------------------------------------------------------------------- +EXPORT ( + TARGETS + ${HDF5_LIBRARIES_TO_EXPORT} ${HDF5_LIB_DEPENDENCIES} + FILE + HDF5-config.cmake +) diff --git a/CTestConfig.cmake b/CTestConfig.cmake new file mode 100644 index 0000000..f2f45e1 --- /dev/null +++ b/CTestConfig.cmake @@ -0,0 +1,13 @@ +## This file should be placed in the root directory of your project. +## Then modify the CMakeLists.txt file in the root directory of your +## project to incorporate the testing dashboard. +## # The following are required to uses Dart and the Cdash dashboard +## ENABLE_TESTING() +## INCLUDE(CTest) +set(CTEST_PROJECT_NAME "HDF5 Trunk") +set(CTEST_NIGHTLY_START_TIME "20:00:00 CST") + +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "nei.hdfgroup.uiuc.edu") +set(CTEST_DROP_LOCATION "/cdash/submit.php?project=HDF5+Trunk") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake new file mode 100644 index 0000000..46f85bb --- /dev/null +++ b/ConfigureChecks.cmake @@ -0,0 +1,797 @@ +#----------------------------------------------------------------------------- +# 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/CheckFortranFunctionExists.cmake) + +MESSAGE (STATUS "Configure Checks that still need to be implemented") +MESSAGE (STATUS " GetConsoleScreenBufferInfo function for Windows") + +#----------------------------------------------------------------------------- +# Always SET this for now IF we are on an OS X box +#----------------------------------------------------------------------------- +IF (APPLE) + SET (H5_AC_APPLE_UNIVERSAL_BUILD 1) +ENDIF (APPLE) + +#----------------------------------------------------------------------------- +# 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 for --enable-instrument +#----------------------------------------------------------------------------- +IF (CMAKE_BUILD_TYPE MATCHES Debug) + SET (HDF5_Enable_Instrument ON) +ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) +OPTION (HDF5_Enable_Instrument "Instrument The library" HDF5_Enable_Instrument) +IF (HDF5_Enable_Instrument) + SET (H5_HAVE_INSTRUMENTED_LIBRARY 1) +ENDIF (HDF5_Enable_Instrument) + +#----------------------------------------------------------------------------- +# 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 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) + +# ---------------------------------------------------------------------- +# Decide whether the data accuracy has higher priority during data +# conversions. If not, some hard conversions will still be prefered even +# 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) + +# ---------------------------------------------------------------------- +# Decide whether the presence of user's exception handling functions is +# checked and data conversion exceptions are returned. This is mainly +# 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) + +SET (LINUX_LFS 0) +IF (CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.") + # Linux Specific flags + ADD_DEFINITIONS (-D_POSIX_SOURCE -D_BSD_SOURCE) + OPTION (HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) + IF (HDF5_ENABLE_LARGE_FILE) + SET (LARGEFILE 1) + ENDIF (HDF5_ENABLE_LARGE_FILE) +ENDIF (CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.") +SET (HDF5_EXTRA_FLAGS) +IF (LINUX_LFS) + SET (HDF5_EXTRA_FLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) + SET (CMAKE_REQUIRED_DEFINITIONS ${HDF5_EXTRA_FLAGS}) +ENDIF (LINUX_LFS) +ADD_DEFINITIONS (${HDF5_EXTRA_FLAGS}) + +#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}) +OPTION (HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON) + +SET (WINDOWS) +IF (WIN32) + IF (NOT UNIX) + SET (WINDOWS 1) + ENDIF (NOT UNIX) +ENDIF (WIN32) + +# TODO -------------------------------------------------------------------------- +# Should the Default Virtual File Driver be compiled? +# This is hard-coded now but option should added to match configure +# +IF (WINDOWS) + SET (H5_HAVE_WINDOWS 1) +# SET (H5_WINDOWS_USE_STDIO 0) + # ---------------------------------------------------------------------- + # 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) + SET (WINDOWS_MAX_BUF (1024 * 1024 * 1024)) + SET (H5_DEFAULT_VFD H5FD_WINDOWS) +ELSE (WINDOWS) + SET (H5_DEFAULT_VFD H5FD_SEC2) +ENDIF (WINDOWS) + +# ---------------------------------------------------------------------- +# 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) + +# so far we have no check for this +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 "") +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}) +ENDMACRO (CHECK_LIBRARY_EXISTS_CONCAT) + +#----------------------------------------------------------------------------- +# Check for the math library "m" +#----------------------------------------------------------------------------- +IF (WINDOWS) + SET (H5_HAVE_LIBM 1) +ELSE (WINDOWS) + CHECK_LIBRARY_EXISTS_CONCAT ("m" printf H5_HAVE_LIBM) +ENDIF (WINDOWS) +CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" printf H5_HAVE_LIBWS2_32) +CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" printf H5_HAVE_LIBWSOCK32) +#CHECK_LIBRARY_EXISTS_CONCAT ("dl" dlopen H5_HAVE_LIBDL) +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) + CHECK_LIBRARY_EXISTS_CONCAT ("nsl" gethostbyname H5_HAVE_LIBNSL) +ENDIF (NOT NOT_NEED_LIBNSL) + + +SET (USE_INCLUDES "") +#----------------------------------------------------------------------------- +# Check IF header file exists and add it to the list. +#----------------------------------------------------------------------------- +MACRO (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE) + CHECK_INCLUDE_FILES ("${USE_INCLUDES};${FILE}" ${VARIABLE}) + IF (${VARIABLE}) + SET (USE_INCLUDES ${USE_INCLUDES} ${FILE}) + ENDIF (${VARIABLE}) +ENDMACRO (CHECK_INCLUDE_FILE_CONCAT) + +#----------------------------------------------------------------------------- +# If we are on Windows we know some of the answers to these tests already +#----------------------------------------------------------------------------- +IF (WINDOWS) + SET (H5_HAVE_IO_H 1) + SET (H5_HAVE_SETJMP_H 1) + SET (H5_HAVE_STDDEF_H 1) + SET (H5_HAVE_SYS_STAT_H 1) + SET (H5_HAVE_SYS_TIMEB_H 1) + SET (H5_HAVE_SYS_TYPES_H 1) + SET (H5_HAVE_WINSOCK_H 1) +ENDIF (WINDOWS) + +#----------------------------------------------------------------------------- +# Check for the existence of certain header files +#----------------------------------------------------------------------------- +CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" H5_HAVE_GLOBUS_COMMON_H) +CHECK_INCLUDE_FILE_CONCAT ("io.h" H5_HAVE_IO_H) +CHECK_INCLUDE_FILE_CONCAT ("mfhdf.h" H5_HAVE_MFHDF_H) +CHECK_INCLUDE_FILE_CONCAT ("pdb.h" H5_HAVE_PDB_H) +CHECK_INCLUDE_FILE_CONCAT ("pthread.h" H5_HAVE_PTHREAD_H) +CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" H5_HAVE_SETJMP_H) +CHECK_INCLUDE_FILE_CONCAT ("srbclient.h" H5_HAVE_SRBCLIENT_H) +CHECK_INCLUDE_FILE_CONCAT ("stddef.h" H5_HAVE_STDDEF_H) +CHECK_INCLUDE_FILE_CONCAT ("stdint.h" H5_HAVE_STDINT_H) +CHECK_INCLUDE_FILE_CONCAT ("string.h" H5_HAVE_STRING_H) +CHECK_INCLUDE_FILE_CONCAT ("strings.h" H5_HAVE_STRINGS_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/ioctl.h" H5_HAVE_SYS_IOCTL_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" H5_HAVE_SYS_PROC_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/resource.h" H5_HAVE_SYS_RESOURCE_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/socket.h" H5_HAVE_SYS_SOCKET_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/stat.h" H5_HAVE_SYS_STAT_H) +IF (CMAKE_SYSTEM_NAME MATCHES "OSF") + CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" H5_HAVE_SYS_SYSINFO_H) +ELSE (CMAKE_SYSTEM_NAME MATCHES "OSF") + SET (H5_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE) +ENDIF (CMAKE_SYSTEM_NAME MATCHES "OSF") +CHECK_INCLUDE_FILE_CONCAT ("sys/time.h" H5_HAVE_SYS_TIME_H) +CHECK_INCLUDE_FILE_CONCAT ("time.h" H5_HAVE_TIME_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" H5_HAVE_SYS_TIMEB_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" H5_HAVE_SYS_TYPES_H) +CHECK_INCLUDE_FILE_CONCAT ("unistd.h" H5_HAVE_UNISTD_H) +CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" H5_HAVE_STDLIB_H) +CHECK_INCLUDE_FILE_CONCAT ("memory.h" H5_HAVE_MEMORY_H) +CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" H5_HAVE_DLFCN_H) +CHECK_INCLUDE_FILE_CONCAT ("features.h" H5_HAVE_FEATURES_H) +CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" H5_HAVE_INTTYPES_H) +CHECK_INCLUDE_FILE_CONCAT ("winsock.h" H5_HAVE_WINSOCK_H) +CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" H5_HAVE_NETINET_IN_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) + 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") + ENDIF (NOT H5_HAVE_STDINT_H_CXX) +ENDIF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) + +#----------------------------------------------------------------------------- +# 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}") + 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}) +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) + H5_CHECK_TYPE_SIZE (long H5_SIZEOF_LONG) +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) + +H5_CHECK_TYPE_SIZE (float H5_SIZEOF_FLOAT) +H5_CHECK_TYPE_SIZE (double H5_SIZEOF_DOUBLE) +H5_CHECK_TYPE_SIZE ("long double" H5_SIZEOF_LONG_DOUBLE) +H5_CHECK_TYPE_SIZE (int8_t H5_SIZEOF_INT8_T) +H5_CHECK_TYPE_SIZE (uint8_t H5_SIZEOF_UINT8_T) +H5_CHECK_TYPE_SIZE (int_least8_t H5_SIZEOF_INT_LEAST8_T) +H5_CHECK_TYPE_SIZE (uint_least8_t H5_SIZEOF_UINT_LEAST8_T) +H5_CHECK_TYPE_SIZE (int_fast8_t H5_SIZEOF_INT_FAST8_T) +H5_CHECK_TYPE_SIZE (uint_fast8_t H5_SIZEOF_UINT_FAST8_T) +H5_CHECK_TYPE_SIZE (int16_t H5_SIZEOF_INT16_T) +H5_CHECK_TYPE_SIZE (uint16_t H5_SIZEOF_UINT16_T) +H5_CHECK_TYPE_SIZE (int_least16_t H5_SIZEOF_INT_LEAST16_T) +H5_CHECK_TYPE_SIZE (uint_least16_t H5_SIZEOF_UINT_LEAST16_T) +H5_CHECK_TYPE_SIZE (int_fast16_t H5_SIZEOF_INT_FAST16_T) +H5_CHECK_TYPE_SIZE (uint_fast16_t H5_SIZEOF_UINT_FAST16_T) +H5_CHECK_TYPE_SIZE (int32_t H5_SIZEOF_INT32_T) +H5_CHECK_TYPE_SIZE (uint32_t H5_SIZEOF_UINT32_T) +H5_CHECK_TYPE_SIZE (int_least32_t H5_SIZEOF_INT_LEAST32_T) +H5_CHECK_TYPE_SIZE (uint_least32_t H5_SIZEOF_UINT_LEAST32_T) +H5_CHECK_TYPE_SIZE (int_fast32_t H5_SIZEOF_INT_FAST32_T) +H5_CHECK_TYPE_SIZE (uint_fast32_t H5_SIZEOF_UINT_FAST32_T) +H5_CHECK_TYPE_SIZE (int64_t H5_SIZEOF_INT64_T) +H5_CHECK_TYPE_SIZE (uint64_t H5_SIZEOF_UINT64_T) +H5_CHECK_TYPE_SIZE (int_least64_t H5_SIZEOF_INT_LEAST64_T) +H5_CHECK_TYPE_SIZE (uint_least64_t H5_SIZEOF_UINT_LEAST64_T) +H5_CHECK_TYPE_SIZE (int_fast64_t H5_SIZEOF_INT_FAST64_T) +H5_CHECK_TYPE_SIZE (uint_fast64_t H5_SIZEOF_UINT_FAST64_T) +IF (NOT APPLE) + H5_CHECK_TYPE_SIZE (size_t H5_SIZEOF_SIZE_T) + H5_CHECK_TYPE_SIZE (ssize_t H5_SIZEOF_SSIZE_T) + IF (NOT H5_SIZEOF_SSIZE_T) + SET (H5_SIZEOF_SSIZE_T 0) + ENDIF (NOT H5_SIZEOF_SSIZE_T) +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) + + +# For other tests to use the same libraries +SET (CMAKE_REQUIRED_LIBRARIES ${LINK_LIBS}) + +#----------------------------------------------------------------------------- +# Check for some functions that are used +IF (WINDOWS) + SET (H5_HAVE_STRDUP 1) + SET (H5_HAVE_SYSTEM 1) + SET (H5_HAVE_DIFFTIME 1) + SET (H5_HAVE_LONGJMP 1) + SET (H5_STDC_HEADERS 1) + SET (H5_HAVE_GETHOSTNAME 1) +ENDIF (WINDOWS) + +CHECK_FUNCTION_EXISTS (alarm H5_HAVE_ALARM) +CHECK_FUNCTION_EXISTS (fork H5_HAVE_FORK) +CHECK_FUNCTION_EXISTS (frexpf H5_HAVE_FREXPF) +CHECK_FUNCTION_EXISTS (frexpl H5_HAVE_FREXPL) + +CHECK_FUNCTION_EXISTS (gethostname H5_HAVE_GETHOSTNAME) +CHECK_FUNCTION_EXISTS (getpwuid H5_HAVE_GETPWUID) +CHECK_FUNCTION_EXISTS (getrusage H5_HAVE_GETRUSAGE) +CHECK_FUNCTION_EXISTS (lstat H5_HAVE_LSTAT) + +CHECK_FUNCTION_EXISTS (rand_r H5_HAVE_RAND_R) +CHECK_FUNCTION_EXISTS (random H5_HAVE_RANDOM) +CHECK_FUNCTION_EXISTS (setsysinfo H5_HAVE_SETSYSINFO) + +CHECK_FUNCTION_EXISTS (signal H5_HAVE_SIGNAL) +CHECK_FUNCTION_EXISTS (longjmp H5_HAVE_LONGJMP) +CHECK_FUNCTION_EXISTS (setjmp H5_HAVE_SETJMP) +CHECK_FUNCTION_EXISTS (siglongjmp H5_HAVE_SIGLONGJMP) +CHECK_FUNCTION_EXISTS (sigsetjmp H5_HAVE_SIGSETJMP) +CHECK_FUNCTION_EXISTS (sigaction H5_HAVE_SIGACTION) +CHECK_FUNCTION_EXISTS (sigprocmask H5_HAVE_SIGPROCMASK) + +CHECK_FUNCTION_EXISTS (snprintf H5_HAVE_SNPRINTF) +CHECK_FUNCTION_EXISTS (srandom H5_HAVE_SRANDOM) +CHECK_FUNCTION_EXISTS (strdup H5_HAVE_STRDUP) +CHECK_FUNCTION_EXISTS (symlink H5_HAVE_SYMLINK) +CHECK_FUNCTION_EXISTS (system H5_HAVE_SYSTEM) + +CHECK_FUNCTION_EXISTS (tmpfile H5_HAVE_TMPFILE) +CHECK_FUNCTION_EXISTS (vasprintf H5_HAVE_VASPRINTF) +CHECK_FUNCTION_EXISTS (waitpid H5_HAVE_WAITPID) + +CHECK_FUNCTION_EXISTS (vsnprintf H5_HAVE_VSNPRINTF) +CHECK_FUNCTION_EXISTS (ioctl H5_HAVE_IOCTL) +#CHECK_FUNCTION_EXISTS (gettimeofday H5_HAVE_GETTIMEOFDAY) +CHECK_FUNCTION_EXISTS (difftime H5_HAVE_DIFFTIME) +CHECK_FUNCTION_EXISTS (fseeko H5_HAVE_FSEEKO) +CHECK_FUNCTION_EXISTS (ftello H5_HAVE_FTELLO) +CHECK_FUNCTION_EXISTS (fstat64 H5_HAVE_FSTAT64) +CHECK_FUNCTION_EXISTS (stat64 H5_HAVE_STAT64) + +# MPI checks +SET (CMAKE_REQUIRED_INCLUDES "${MPI_INCLUDE_PATH}/mpi.h" ) +SET (CMAKE_REQUIRED_LIBRARIES "${MPI_LIBRARY}" ) +CHECK_FUNCTION_EXISTS (MPI_File_get_size H5_HAVE_MPI_GET_SIZE) + +# For Fortran+MPI +CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) +CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) + +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Since gettimeofday is not defined any where standard, lets look in all the +# usual places. On MSVC we are just going to use ::clock() +#----------------------------------------------------------------------------- +IF (NOT MSVC) + IF ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") + TRY_COMPILE (HAVE_TIME_GETTIMEOFDAY + ${CMAKE_BINARY_DIR} + ${HDF5_SOURCE_DIR}/Resources/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") + ENDIF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") + ENDIF ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") + + IF ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") + TRY_COMPILE (HAVE_SYS_TIME_GETTIMEOFDAY + ${CMAKE_BINARY_DIR} + ${HDF5_SOURCE_DIR}/Resources/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") + ENDIF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") + ENDIF ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") +ENDIF (NOT MSVC) + +IF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY AND NOT MSVC) + 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 AND NOT MSVC) + + +# Check for Symbols +CHECK_SYMBOL_EXISTS (tzname "time.h" H5_HAVE_DECL_TZNAME) + +#----------------------------------------------------------------------------- +# +#----------------------------------------------------------------------------- +IF (NOT WINDOWS) + CHECK_SYMBOL_EXISTS (TIOCGWINSZ "sys/ioctl.h" H5_HAVE_TIOCGWINSZ) + CHECK_SYMBOL_EXISTS (TIOCGETD "sys/ioctl.h" H5_HAVE_TIOCGETD) +ENDIF (NOT WINDOWS) + +#----------------------------------------------------------------------------- +# Check for the Stream VFD driver +#----------------------------------------------------------------------------- +IF (HDF5_STREAM_VFD) + CHECK_INCLUDE_FILE_CONCAT ("netdb.h" H5_HAVE_NETDB_H) + CHECK_INCLUDE_FILE_CONCAT ("netinet/tcp.h" H5_HAVE_NETINET_TCP_H) + CHECK_INCLUDE_FILE_CONCAT ("sys/filio.h" H5_HAVE_SYS_FILIO_H) + SET (H5_HAVE_STREAM 1) +ENDIF (HDF5_STREAM_VFD) + + +# For other other specific tests, use this MACRO. +MACRO (HDF5_FUNCTION_TEST OTHER_TEST) + IF ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") + 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 + H5_HAVE_SYS_TIME_H + H5_HAVE_UNISTD_H + H5_HAVE_SYS_TYPES_H + H5_HAVE_SYS_SOCKET_H + ) + IF ("${def}") + SET (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") + ENDIF ("${def}") + ENDFOREACH (def) + + IF (LINUX_LFS) + SET (MACRO_CHECK_FUNCTION_DEFINITIONS + "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" + ) + ENDIF (LINUX_LFS) + + # (STATUS "Performing ${OTHER_TEST}") + TRY_COMPILE (${OTHER_TEST} + ${CMAKE_BINARY_DIR} + ${HDF5_SOURCE_DIR}/Resources/HDF5Tests.c + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} + "${OTHER_TEST_ADD_LIBRARIES}" + OUTPUT_VARIABLE OUTPUT + ) + IF (${OTHER_TEST}) + SET (H5_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}") + MESSAGE (STATUS "Performing Other Test ${OTHER_TEST} - Success") + ELSE (${OTHER_TEST}) + MESSAGE (STATUS "Performing Other Test ${OTHER_TEST} - Failed") + SET (H5_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}") + FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Performing Other Test ${OTHER_TEST} failed with the following output:\n" + "${OUTPUT}\n" + ) + ENDIF (${OTHER_TEST}) + ENDIF ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") +ENDMACRO (HDF5_FUNCTION_TEST) + +#----------------------------------------------------------------------------- +# Check a bunch of other functions +#----------------------------------------------------------------------------- +IF (WINDOWS) + SET (H5_HAVE_TIMEZONE 1) + SET (H5_HAVE_FUNCTION 1) +ELSE (WINDOWS) + FOREACH (test + TIME_WITH_SYS_TIME + STDC_HEADERS + HAVE_TM_ZONE + HAVE_STRUCT_TM_TM_ZONE + HAVE_ATTRIBUTE + HAVE_FUNCTION + HAVE_TM_GMTOFF + HAVE_TIMEZONE + HAVE_STRUCT_TIMEZONE + HAVE_STAT_ST_BLOCKS + HAVE_FUNCTION + SYSTEM_SCOPE_THREADS + HAVE_SOCKLEN_T + DEV_T_IS_SCALAR + HAVE_OFF64_T + GETTIMEOFDAY_GIVES_TZ + VSNPRINTF_WORKS + HAVE_C99_FUNC + HAVE_C99_DESIGNATED_INITIALIZER + CXX_HAVE_OFFSETOF + ) + HDF5_FUNCTION_TEST (${test}) + ENDFOREACH (test) +ENDIF (WINDOWS) + +#----------------------------------------------------------------------------- +# Look for 64 bit file stream capability +#----------------------------------------------------------------------------- +IF (HAVE_OFF64_T) + CHECK_FUNCTION_EXISTS (lseek64 H5_HAVE_LSEEK64) + CHECK_FUNCTION_EXISTS (fseek64 H5_HAVE_FSEEK64) +ENDIF (HAVE_OFF64_T) + +#----------------------------------------------------------------------------- +# 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}) + 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__) + +#----------------------------------------------------------------------------- +# Check how to print a Long Long integer +#----------------------------------------------------------------------------- +SET (H5_H5_PRINTF_LL_WIDTH "H5_PRINTF_LL_WIDTH") +IF (H5_PRINTF_LL_WIDTH MATCHES "^H5_PRINTF_LL_WIDTH$") + 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_SOURCE_DIR}/Resources/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) + 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 + "Width for printf for type `long long' or `__int64', us. `ll" + ) + ENDIF (PRINT_LL_FOUND) +ENDIF (H5_PRINTF_LL_WIDTH MATCHES "^H5_PRINTF_LL_WIDTH$") + +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can handle converting +# denormalized floating-point values. +# (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) + +#----------------------------------------------------------------------------- +# Are we going to use HSIZE_T +#----------------------------------------------------------------------------- +IF (HDF5_ENABLE_HSIZET) + SET (H5_HAVE_LARGE_HSIZET 1) +ENDIF (HDF5_ENABLE_HSIZET) +IF (CYGWIN) + SET (H5_HAVE_LSEEK64 0) +ENDIF (CYGWIN) + +#----------------------------------------------------------------------------- +# Macro to determine the various conversion capabilities +#----------------------------------------------------------------------------- +MACRO (H5ConversionTests TEST msg) + IF ("${TEST}" MATCHES "^${TEST}$") + # MESSAGE (STATUS "===> ${TEST}") + TRY_RUN (${TEST}_RUN ${TEST}_COMPILE + ${HDF5_BINARY_DIR}/CMake + ${HDF5_SOURCE_DIR}/Resources/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") + 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") + FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Test ${TEST} Compile failed with the following output:\n ${OUTPUT}\n" + ) + ENDIF (${TEST}_COMPILE) + + 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}$") +ENDMACRO (H5MiscConversionTest) + +#----------------------------------------------------------------------------- +# Check various conversion capabilities +#----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------- +# Set flag to indicate that the machine can handle conversion from +# long double to integers accurately. This flag should be set "yes" for +# all machines except all SGIs. For SGIs, some conversions are +# incorrect and its cache value is set "no" in its config/irix6.x and +# irix5.x. +# +H5MiscConversionTest (H5_SIZEOF_LONG_DOUBLE H5_LDOUBLE_TO_INTEGER_ACCURATE "checking IF converting from long double to integers is accurate") +# ----------------------------------------------------------------------- +# Set flag to indicate that the machine can do conversion from +# long double to integers regardless of accuracy. This flag should be +# set "yes" for all machines except HP-UX 11.00. For HP-UX 11.00, the +# compiler has 'floating exception' when converting 'long double' to all +# integers except 'unsigned long long'. Other HP-UX systems are unknown +# yet. (1/8/05 - SLU) +# +H5ConversionTests (H5_LDOUBLE_TO_INTEGER_WORKS "Checking IF converting from long double to integers works") +# ----------------------------------------------------------------------- +# Set flag to indicate that the machine can handle conversion from +# integers to long double. (This flag should be set "yes" for all +# machines except all SGIs, where some conversions are +# incorrect and its cache value is set "no" in its config/irix6.x and +# irix5.x) +# +H5MiscConversionTest (H5_SIZEOF_LONG_DOUBLE H5_INTEGER_TO_LDOUBLE_ACCURATE "checking IF accurately converting from integers to long double") +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can accurately convert +# 'unsigned long' to 'float' values. +# (This flag should be set for all machines, except for Pathscale compiler +# on Sandia's Linux machine where the compiler interprets 'unsigned long' +# values as negative when the first bit of 'unsigned long' is on during +# the conversion to float.) +# +H5ConversionTests (H5_ULONG_TO_FLOAT_ACCURATE "Checking IF accurately converting unsigned long to float values") +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can accurately convert +# 'unsigned (long) long' values to 'float' and 'double' values. +# (This flag should be set for all machines, except for the SGIs, where +# the cache value is set in the config/irix6.x config file) and Solaris +# 64-bit machines, where the short program below tests if round-up is +# correctly handled. +# +H5ConversionTests (H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE "Checking IF accurately converting unsigned long long to floating-point values") +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can accurately convert +# 'float' or 'double' to 'unsigned long long' values. +# (This flag should be set for all machines, except for PGI compiler +# where round-up happens when the fraction of float-point value is greater +# than 0.5. +# +H5ConversionTests (H5_FP_TO_ULLONG_ACCURATE "Checking IF accurately roundup converting floating-point to unsigned long long values" ) +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can accurately convert +# 'float', 'double' or 'long double' to 'unsigned long long' values. +# (This flag should be set for all machines, except for HP-UX machines +# where the maximal number for unsigned long long is 0x7fffffffffffffff +# during conversion. +# +H5ConversionTests (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "Checking IF right maximum converting floating-point to unsigned long long values" ) +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can accurately convert +# 'long double' to 'unsigned int' values. (This flag should be set for +# all machines, except for some Intel compilers on some Linux.) +# +H5ConversionTests (H5_LDOUBLE_TO_UINT_ACCURATE "Checking IF correctly converting long double to unsigned int values") +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can _compile_ +# '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$) +# ---------------------------------------------------------------------- +# 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$) +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can convert from +# 'unsigned long long' to 'long double' without precision loss. +# (This flag should be set for all machines, except for FreeBSD(sleipnir) +# 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.) +# +H5ConversionTests (H5_ULLONG_TO_LDOUBLE_PRECISION "Checking IF converting unsigned long long to long double with precision") +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can handle overflow converting +# all floating-point to all integer types. +# (This flag should be set for all machines, except for Cray X1 where +# floating exception is generated when the floating-point value is greater +# than the maximal integer value). +# +H5ConversionTests (H5_FP_TO_INTEGER_OVERFLOW_WORKS "Checking IF overflows normally converting floating-point to integer values") +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can accurately convert +# 'long double' to '(unsigned) long long' values. (This flag should be set for +# all machines, except for Mac OS 10.4 and SGI IRIX64 6.5. When the bit sequence +# of long double is 0x4351ccf385ebc8a0bfcc2a3c..., the values of (unsigned)long long +# start to go wrong on these two machines. Adjusting it higher to +# 0x4351ccf385ebc8a0dfcc... or 0x4351ccf385ebc8a0ffcc... will make the converted +# values wildly wrong. This test detects this wrong behavior and disable the test. +# +H5ConversionTests (H5_LDOUBLE_TO_LLONG_ACCURATE "Checking IF correctly converting long double to (unsigned) long long values") +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine can accurately convert +# '(unsigned) long long' to 'long double' values. (This flag should be set for +# all machines, except for Mac OS 10.4, when the bit sequences are 003fff..., +# 007fff..., 00ffff..., 01ffff..., ..., 7fffff..., the converted values are twice +# as big as they should be. +# +H5ConversionTests (H5_LLONG_TO_LDOUBLE_CORRECT "Checking IF correctly converting (unsigned) long long to long double values") +H5ConversionTests (H5_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restrictions are strictly enforced") + +#----------------------------------------------------------------------------- +# 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 +# ---------------------------------------------------------------------------- +IF (WINDOWS) + SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") +ENDIF (WINDOWS) diff --git a/MANIFEST b/MANIFEST index 6e78b1d..93b5eeb 100644 --- a/MANIFEST +++ b/MANIFEST @@ -401,9 +401,11 @@ ./release_docs/INSTALL_MinGW.txt ./release_docs/INSTALL_VMS.txt ./release_docs/INSTALL_Windows.txt +./release_docs/CMake_Windows.TXT ./release_docs/INSTALL_Windows_From_Command_Line.txt ./release_docs/INSTALL_Windows_Short_NET.TXT ./release_docs/INSTALL_Windows_Short_VS2005.TXT +./release_docs/INSTALL_Windows_Short_VS2008.TXT ./release_docs/INSTALL_parallel ./release_docs/RELEASE.txt @@ -1519,7 +1521,9 @@ ./tools/h5diff/testfiles/h5diff_90.txt ./tools/h5diff/testfiles/h5diff_100.txt ./tools/h5diff/testfiles/h5diff_101.txt +./tools/h5diff/testfiles/h5diff_101w.txt ./tools/h5diff/testfiles/h5diff_102.txt +./tools/h5diff/testfiles/h5diff_102w.txt ./tools/h5diff/testfiles/h5diff_200.txt ./tools/h5diff/testfiles/h5diff_201.txt ./tools/h5diff/testfiles/h5diff_202.txt @@ -1848,6 +1852,62 @@ ./vms/tools/testfiles/tgroup-2.ddl ./vms/tools/testfiles/tperror.ddl +# CMake-specific Files +./Resources/CMake/FindSZIP.cmake +./Resources/ConversionTests.c +./Resources/GetTimeOfDayTest.cpp +./Resources/HDF5Tests.c +./Resources/xlatefile.c +./Resources/CheckTypeSize.cmake +./Resources/H5cxx_config.h.in +./Resources/H5pubconf.h.in +./Resources/hdf5_zlib.h.in +./Resources/HDF5Config.cmake.in +./Resources/HDF5Macros.cmake +./Resources/libhdf5.settings.cmake.in +./Resources/runTest.cmake +./CMakeLists.txt +./ConfigureChecks.cmake +./CTestConfig.cmake +./c++/CMakeLists.txt +./c++/examples/CMakeLists.txt +./c++/src/CMakeLists.txt +./c++/test/CMakeLists.txt +./examples/CMakeLists.txt +./fortran/CMakeLists.txt +./fortran/examples/CMakeLists.txt +./fortran/src/CMakeLists.txt +./fortran/test/CMakeLists.txt +./hl/CMakeLists.txt +./hl/c++/CMakeLists.txt +./hl/c++/examples/CMakeLists.txt +./hl/c++/src/CMakeLists.txt +./hl/c++/test/CMakeLists.txt +./hl/examples/CMakeLists.txt +./hl/fortran/CMakeLists.txt +./hl/fortran/examples/CMakeLists.txt +./hl/fortran/src/CMakeLists.txt +./hl/fortran/test/CMakeLists.txt +./hl/src/CMakeLists.txt +./hl/test/CMakeLists.txt +./hl/tools/CMakeLists.txt +./perform/CMakeLists.txt +./src/CMakeLists.txt +./test/CMakeLists.txt +./testpar/CMakeLists.txt +./tools/CMakeLists.txt +./tools/h5copy/CMakeLists.txt +./tools/h5diff/CMakeLists.txt +./tools/h5dump/CMakeLists.txt +./tools/h5import/CMakeLists.txt +./tools/h5jam/CMakeLists.txt +./tools/h5ls/CMakeLists.txt +./tools/h5repack/CMakeLists.txt +./tools/h5stat/CMakeLists.txt +./tools/lib/CMakeLists.txt +./tools/misc/CMakeLists.txt + + # Windows-specific Files. # Batch scripts ./windows/copy_hdf.bat diff --git a/Resources/CMake/FindSZIP.cmake b/Resources/CMake/FindSZIP.cmake new file mode 100644 index 0000000..190b0b5 --- /dev/null +++ b/Resources/CMake/FindSZIP.cmake @@ -0,0 +1,179 @@ + +# - Find SZIP library +# - Derived from the FindTiff.cmake that is included with cmake +# Find the native SZIP includes and library +# This module defines +# SZIP_INCLUDE_DIRS, where to find tiff.h, etc. +# SZIP_LIBRARIES, libraries to link against to use SZIP. +# SZIP_FOUND, If false, do not try to use SZIP. +# also defined, but not for general use are +# SZIP_LIBRARY, where to find the SZIP library. +# SZIP_LIBRARY_DEBUG - Debug version of tiff library +# SZIP_LIBRARY_RELEASE - Release Version of tiff library + +# MESSAGE (STATUS "Finding Szip library and headers..." ) + +############################################ +# +# Check the existence of the libraries. +# +############################################ +# This macro was taken directly from the FindQt4.cmake file that is included +# with the CMake distribution. This is NOT my work. All work was done by the +# original authors of the FindQt4.cmake file. Only minor modifications were +# made to remove references to Qt and make this file more generally applicable +######################################################################### + +MACRO (SZIP_ADJUST_LIB_VARS basename) + 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 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 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}) + 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} CACHE FILEPATH "The ${basename} library") + + IF (${basename}_LIBRARY) + SET (${basename}_FOUND 1) + ENDIF (${basename}_LIBRARY) + + 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 ) +ENDMACRO (SZIP_ADJUST_LIB_VARS) + + +# Look for the header file. +SET (SZIP_INCLUDE_SEARCH_DIRS + $ENV{SZIP_INSTALL}/include + $ENV{SZIP_INSTALL}/include/szip + /usr/include + /usr/include/szip +) + +SET (SZIP_LIB_SEARCH_DIRS + $ENV{SZIP_INSTALL}/lib + /usr/lib +) + +SET (SZIP_BIN_SEARCH_DIRS + $ENV{SZIP_INSTALL}/bin + /usr/bin +) + +FIND_PATH (SZIP_INCLUDE_DIR + NAMES szlib.h + PATHS ${SZIP_INCLUDE_SEARCH_DIRS} + NO_DEFAULT_PATH +) + +IF (WIN32 AND NOT MINGW) + SET (SZIP_SEARCH_DEBUG_NAMES "sz_d;libsz_d") + SET (SZIP_SEARCH_RELEASE_NAMES "sz;libsz") +ELSE (WIN32 AND NOT MINGW) + SET (SZIP_SEARCH_DEBUG_NAMES "sz_d") + SET (SZIP_SEARCH_RELEASE_NAMES "sz") +ENDIF (WIN32 AND NOT MINGW) + +# Look for the library. +FIND_LIBRARY (SZIP_LIBRARY_DEBUG + NAMES ${SZIP_SEARCH_DEBUG_NAMES} + PATHS ${SZIP_LIB_SEARCH_DIRS} + NO_DEFAULT_PATH +) + +FIND_LIBRARY (SZIP_LIBRARY_RELEASE + NAMES ${SZIP_SEARCH_RELEASE_NAMES} + PATHS ${SZIP_LIB_SEARCH_DIRS} + NO_DEFAULT_PATH +) + +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) + GET_FILENAME_COMPONENT (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_DEBUG} PATH) + 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) + +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 + "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) + ############################################# + # 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}) + # Add SZIP_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES + 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") + + # 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}) + # + ############################################# +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/Resources/CheckTypeSize.cmake b/Resources/CheckTypeSize.cmake new file mode 100644 index 0000000..2e83080 --- /dev/null +++ b/Resources/CheckTypeSize.cmake @@ -0,0 +1,48 @@ +# +# Check if the type exists and determine size of type. if the type +# exists, the size will be stored to the variable. +# +# CHECK_TYPE_SIZE - macro which checks the size of type +# VARIABLE - variable to store size if the type exists. +# HAVE_${VARIABLE} - does the variable exists or not +# + +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 + "-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}") + ENDIF("${def}") + ENDFOREACH (def) + + 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) + TRY_RUN (${VARIABLE} HAVE_${VARIABLE} + ${CMAKE_BINARY_DIR} + ${HDF5_PROJECT_DIR}/Resources/CheckTypeSize.c + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_TYPE_SIZE_FLAGS} + "${CHECK_TYPE_SIZE_ADD_LIBRARIES}" + OUTPUT_VARIABLE OUTPUT + ) + 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") + 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) +ENDMACRO (HDF_CHECK_TYPE_SIZE) diff --git a/Resources/ConversionTests.c b/Resources/ConversionTests.c new file mode 100644 index 0000000..0e24954 --- /dev/null +++ b/Resources/ConversionTests.c @@ -0,0 +1,422 @@ +#ifdef H5_FP_TO_INTEGER_OVERFLOW_WORKS_TEST + +int main(void) +{ + float f = 2147483648.0f; + int i; + + i = (int)f; + + done: + exit(0); +} + +#endif + +#ifdef H5_FP_TO_ULLONG_ACCURATE_TEST + +int main(void) +{ + float f = 111.60f; + double d = 222.55L; + unsigned long long l1 = (unsigned long long)f; + unsigned long long l2 = (unsigned long long)d; + int ret = 0; + + if(l1 == 112) + ret = 1; + if(l2 == 223) + ret = 1; + + done: + exit(ret); +} + +#endif + +#ifdef H5_FP_TO_ULLONG_RIGHT_MAXIMUM_TEST +int main(void) +{ + float f = 9701917572145405952.00f; + double d1 = 9701917572145405952.00L; + long double d2 = 9701917572145405952.00L; + double d3 = 2e40L; + unsigned long long l1 = (unsigned long long)f; + unsigned long long l2 = (unsigned long long)d1; + unsigned long long l3 = (unsigned long long)d2; + unsigned long long l4; + unsigned long long l5 = 0x7fffffffffffffffULL; + int ret = 0; + + if(l1 <= l5 || l2 <= l5 || l3 <= l5) + ret = 1; + + l4 = (unsigned long long)d3; + if(l4 <= l5) + ret = 1; + + done: + exit(ret); +} + +#endif + +#ifdef H5_LDOUBLE_TO_INTEGER_WORKS_TEST +int main(void) +{ + void *align; + long double ld = 9701917572145405952.00L; + unsigned char v1; + short v2; + unsigned int v3; + int ret = 0; + + align = (void*) malloc(sizeof(long double)); + memcpy(align, &ld, sizeof(long double)); + + /*For HU-UX11.00, there's floating exception(core dump) when doing some of casting + *from 'long double' to integers*/ + v1 = (unsigned char) (*((long double*) align)); + v2 = (short) (*((long double*) align)); + v3 = (unsigned int) (*((long double*) align)); + + done: exit(ret); +} + +#endif + +#ifdef H5_LDOUBLE_TO_LLONG_ACCURATE_TEST +int main(void) +{ + long double ld = 20041683600089727.779961L; + long long ll; + unsigned long long ull; + unsigned char s[16]; + int ret = 0; + + if(sizeof(long double) == 16) + { + /*make sure the long double type is the same as the failing type + *which has 16 bytes in size and 11 bits of exponent. If it is, + *the bit sequence should be like below. It's not + *a decent way to check but this info isn't available. */ + memcpy(s, &ld, 16); + if(s[0]==0x43 && s[1]==0x51 && s[2]==0xcc && s[3]==0xf3 && + s[4]==0x85 && s[5]==0xeb && s[6]==0xc8 && s[7]==0xa0 && + s[8]==0xbf && s[9]==0xcc && s[10]==0x2a && s[11]==0x3c) + { + + /*slightly adjust the bit sequence (s[8]=0xdf). The converted + *values will go wild on Mac OS 10.4 and IRIX64 6.5.*/ + s[0]=0x43; s[1]=0x51; s[2]=0xcc; s[3]=0xf3; + s[4]=0x85; s[5]=0xeb; s[6]=0xc8; s[7]=0xa0; + s[8]=0xdf; s[9]=0xcc; s[10]=0x2a; s[11]=0x3c; + s[12]=0x3d; s[13]=0x85; s[14]=0x56; s[15]=0x20; + + memcpy(&ld, s, 16); + ll = (long long)ld; + ull = (unsigned long long)ld; + + if(ll != 20041683600089728 || ull != 20041683600089728) + ret = 1; + } + } + done: + exit(ret); +} +#endif + +#ifdef H5_LDOUBLE_TO_UINT_ACCURATE_TEST +int main(void) +{ + long double ld = 2733248032.9183987530L; + unsigned int i; + int ret = 0; + + i = (unsigned int)ld; + if(i!=2733248032 && i!=2733248031 && i!=2733248033) + ret = 1; + + done: + exit(ret); +} +#endif + +#ifdef H5_LLONG_TO_LDOUBLE_CORRECT_TEST +int main(void) +{ + long double ld; + long long ll; + unsigned long long ull; + unsigned char s[16]; + int flag=0, ret=0; + + /*Determine if long double has 16 byte in size, 11 bit exponent, and + *the bias is 0x3ff */ + if(sizeof(long double) == 16) + { + ld = 1.0L; + memcpy(s, &ld, 16); + if(s[0]==0x3f && s[1]==0xf0 && s[2]==0x00 && s[3]==0x00 && + s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00) + flag = 1; + } + + if(flag==1 && sizeof(long long)==8) + { + ll = 0x01ffffffffffffffLL; + ld = (long double)ll; + memcpy(s, &ld, 16); + /*Check if the bit sequence is as supposed to be*/ + if(s[0]!=0x43 || s[1]!=0x7f || s[2]!=0xff || s[3]!=0xff || + s[4]!=0xff || s[5]!=0xff || s[6]!=0xff || s[7]!=0xff || + s[8]!=0xf0 || s[9]!=0x00 || s[10]!=0x00 || s[11]!=0x00) + ret = 1; + } + if(flag==1 && sizeof(unsigned long long)==8) + { + ull = 0x01ffffffffffffffULL; + ld = (long double)ull; + memcpy(s, &ld, 16); + if(s[0]!=0x43 || s[1]!=0x7f || s[2]!=0xff || s[3]!=0xff || + s[4]!=0xff || s[5]!=0xff || s[6]!=0xff || s[7]!=0xff || + s[8]!=0xf0 || s[9]!=0x00 || s[10]!=0x00 || s[11]!=0x00) + ret = 1; + } + done: + exit(ret); +} +#endif + +#ifdef H5_NO_ALIGNMENT_RESTRICTIONS_TEST + +#include +#include + +typedef struct +{ + size_t len; + void *p; +}hvl_t; + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus +extern "C" +# endif +int FC_DUMMY_MAIN() +{ return 1;} +#endif +#endif +int +main () +{ + + char *chp = "beefs"; + char **chpp = malloc (2 * sizeof (char *)); + char **chpp2; + hvl_t vl = + { 12345, (void *) chp}; + hvl_t *vlp; + hvl_t *vlp2; + + memcpy ((void *) ((char *) chpp + 1), &chp, sizeof (char *)); + chpp2 = (char **) ((char *) chpp + 1); + if (strcmp (*chpp2, chp)) + { + free (chpp); + return 1; + } + free (chpp); + + vlp = malloc (2 * sizeof (hvl_t)); + memcpy ((void *) ((char *) vlp + 1), &vl, sizeof (hvl_t)); + vlp2 = (hvl_t *) ((char *) vlp + 1); + if (vlp2->len != vl.len || vlp2->p != vl.p) + { + free (vlp); + return 1; + } + free (vlp); + + ; + return 0; +} + +#endif + +#ifdef H5_ULLONG_TO_LDOUBLE_PRECISION_TEST + +#include + + +int main(void) +{ + /* General variables */ + int endian; + int tst_value = 1; + int ret = 0; + + /* For FreeBSD */ + unsigned long long l = 0xa601e80bda85fcefULL; + long double ld; + unsigned char *c1, *c2; + size_t size; + + /* For Cygwin */ + unsigned long long l_cyg = 0xfffffffffffffff0ULL; + long double ld_cyg; + unsigned char *c2_cyg; + size_t size_cyg; + + /* Determine this system's endianess */ + c1 = (unsigned char*)calloc(1, sizeof(int)); + memcpy((void*)c1, &tst_value, sizeof(int)); + if(c1[0]==1) + endian = 0; /* little endian */ + else + endian = 1; /* big endian */ + + /* For FreeBSD */ + size = sizeof(long double); + memset(&ld, 0, size); + ld = (long double)l; + + c2 = (unsigned char*)calloc(1, size); + memcpy((void*)c2, &ld, size); + + /* Test if the last 2 bytes of mantissa are lost. Mainly for FreeBSD on Intel + * architecture(sleipnir) where it happens. */ + /*if(endian==0 && c2[0]==0 && c2[1]==0)*//*little endian*/ + if(endian==0 && c2[0]==0) + { /*little endian*/ + ret = 1; + goto done; + } + + /* For Cygwin */ + size_cyg = sizeof(long double); + memset(&ld_cyg, 0, size); + ld_cyg = (long double)l_cyg; + + c2_cyg = (unsigned char*)calloc(1, size_cyg); + memcpy((void*)c2_cyg, &ld_cyg, size_cyg); + + /* Test if the last 4 bytes(roughly) of mantissa are rounded up. Mainly for Cygwin + * where the values like 0xffffffffffffffff, 0xfffffffffffffffe, ..., + * 0xfffffffffffff000 ... are rounded up as 0x0000403f8000000000000000 + * instead of 0x0000403effffffffffffffff, 0x0000403efffffffffffffffe, ..., + * 0x0000403efffffffffffff000 ... + */ + if(endian==0 && c2_cyg[0]==0 && c2_cyg[1]==0 && c2_cyg[2]==0 && c2_cyg[3]==0) + ret = 1; + + done: + if(c1) + free(c1); + if(c2) + free(c2); + if(c2_cyg) + free(c2_cyg); + exit(ret); +} + +#endif + + +#ifdef H5_ULONG_TO_FLOAT_ACCURATE_TEST + +int main(void) +{ + int ret = 0; + unsigned long l1; + unsigned long l2; + unsigned long l3; + float f1; + float f2; + float f3; + + + if(sizeof(unsigned long)==8) { + l1 = 0xffffffffffffffffUL; + l2 = 0xffffffffffff0000UL; + l3 = 0xf000000000000000UL; + + f1 = (float)l1; + f2 = (float)l2; + f3 = (float)l3; + + if((f1 < 0) || (f2 < 0) || (f3 < 0)) + ret = 1; + } + +done: + exit(ret); +} + +#endif + +#ifdef H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE_TEST + +#include + + +int main(void) +{ + unsigned long l1; + unsigned long l2; + unsigned long l3; + unsigned long l4; + unsigned long long ld1; + unsigned long long ld2; + unsigned long long ld3; + unsigned long long ld4; + double d1, d2, d3, d4; + unsigned char s[8]; + int ret = 0; + + if(sizeof(unsigned long)==8) { + l1 = 0xf000000000000b00UL; /*Round-down case*/ + l2 = 0xf000000000000401UL; /*Round-up case*/ + l3 = 0xf000000000000400UL; /*Round-down case*/ + l4 = 0xf000000000000c00UL; /*Round-up case*/ + + d1 = (double)l1; + d2 = (double)l2; + d3 = (double)l3; + d4 = (double)l4; + } else if(sizeof(unsigned long long)==8) { + ld1 = 0xf000000000000b00ULL; /*Round-down case*/ + ld2 = 0xf000000000000401ULL; /*Round-up case*/ + ld3 = 0xf000000000000400ULL; /*Round-down case*/ + ld4 = 0xf000000000000c00ULL; /*Round-up case*/ + + d1 = (double)ld1; + d2 = (double)ld2; + d3 = (double)ld3; + d4 = (double)ld4; + } else { + ret = 1; + goto done; + } + + memcpy(s, &d1, 8); + if(s[7]!=1) + ret = 1; + + memcpy(s, &d2, 8); + if(s[7]!=1) + ret = 1; + + memcpy(s, &d3, 8); + if(s[7]!=0) + ret = 1; + + memcpy(s, &d4, 8); + if(s[7]!=2) + ret = 1; + +done: + exit(ret); +} +#endif diff --git a/Resources/GetTimeOfDayTest.cpp b/Resources/GetTimeOfDayTest.cpp new file mode 100644 index 0000000..3b5bf60 --- /dev/null +++ b/Resources/GetTimeOfDayTest.cpp @@ -0,0 +1,15 @@ +#if defined (TRY_SYS_TIME_H) +#include +/* #include */ +#endif + + +#if defined (TRY_TIME_H) +#include +#endif + +int main(int argc, char **argv) { + struct timeval t1; + gettimeofday(&t1, 0x00); + return 0; +} diff --git a/Resources/H5cxx_config.h.in b/Resources/H5cxx_config.h.in new file mode 100644 index 0000000..c4e1c03 --- /dev/null +++ b/Resources/H5cxx_config.h.in @@ -0,0 +1,5 @@ +/* src/H5cxx_config.h.in Created manually. */ + +/* Define if offsetof extension is present */ +#cmakedefine HAVE_OFFSETOF ${HAVE_OFFSETOF} + diff --git a/Resources/H5pubconf.h.in b/Resources/H5pubconf.h.in new file mode 100644 index 0000000..3f4bdc5 --- /dev/null +++ b/Resources/H5pubconf.h.in @@ -0,0 +1,745 @@ +/* H5pubconf.h Generated By CMake during the configuration */ + +#ifndef H5_CONFIG_H_ +#define H5_CONFIG_H_ + +/* Define if the Windows virtual file driver should be compiled */ +#cmakedefine H5_HAVE_WINDOWS @H5_HAVE_WINDOWS@ + +/* Define if the Windows virtual file driver should use buffered IO functions */ +/* #undef WINDOWS_USE_STDIO */ + +/* Define the maximum write size for the Windows file driver. Larger writes + will be split into many writes. Safe values are 1 <= WINDOWS_MAX_BUF <= 2GB-1. */ +#cmakedefine WINDOWS_MAX_BUF (1024 * 1024 * 1024) + +/* Defined if HDF5 was built with CMake AND build as a shared library */ +#cmakedefine H5_BUILT_AS_DYNAMIC_LIB @H5_BUILT_AS_DYNAMIC_LIB@ + +/* Defined if HDF5 CPP was built with CMake AND build as a shared library */ +#cmakedefine H5_CPP_BUILT_AS_DYNAMIC_LIB @H5_CPP_BUILT_AS_DYNAMIC_LIB@ + +/* Defined if HDF5 HL was built with CMake AND build as a shared library */ +#cmakedefine H5_HL_BUILT_AS_DYNAMIC_LIB @H5_HL_BUILT_AS_DYNAMIC_LIB@ + +/* Define if building universal (internal helper macro) */ +#cmakedefine H5_AC_APPLE_UNIVERSAL_BUILD @H5_AC_APPLE_UNIVERSAL_BUILD@ + +/* Define if your system generates wrong code for log2 routine. */ +#cmakedefine H5_BAD_LOG2_CODE_GENERATED @H5_BAD_LOG2_CODE_GENERATED@ + +/* Define if the memory buffers being written to disk should be cleared before + writing. */ +#cmakedefine H5_CLEAR_MEMORY @H5_CLEAR_MEMORY@ + +/* Define if your system can handle converting denormalized floating-point + values. */ +#cmakedefine H5_CONVERT_DENORMAL_FLOAT @H5_CONVERT_DENORMAL_FLOAT@ + +/* Define if C++ compiler recognizes offsetof */ +#cmakedefine H5_CXX_HAVE_OFFSETOF @H5_CXX_HAVE_OFFSETOF@ + +/* Define the default virtual file driver to compile */ +#cmakedefine H5_DEFAULT_VFD @H5_DEFAULT_VFD@ + +/* Define if `dev_t' is a scalar */ +#cmakedefine H5_DEV_T_IS_SCALAR @H5_DEV_T_IS_SCALAR@ + +/* Define to dummy `main' function (if any) required to link to the Fortran + libraries. */ +#cmakedefine H5_FC_DUMMY_MAIN @H5_FC_DUMMY_MAIN@ + +/* Define if F77 and FC dummy `main' functions are identical. */ +#cmakedefine H5_FC_DUMMY_MAIN_EQ_F77 @H5_FC_DUMMY_MAIN_EQ_F77@ + +/* Define to a macro mangling the given C identifier (in lower and upper + case), which must not contain underscores, for linking with Fortran. */ +#define @H5_FC_FUNC@ + +/* As FC_FUNC, but for C identifiers containing underscores. */ +#define @H5_FC_FUNC_@ + +/* Define if your system can handle overflow converting floating-point to + integer values. */ +#cmakedefine H5_FP_TO_INTEGER_OVERFLOW_WORKS @H5_FP_TO_INTEGER_OVERFLOW_WORKS@ + +/* Define if your system roundup accurately converting floating-point to + unsigned long long values. */ +#cmakedefine H5_FP_TO_ULLONG_ACCURATE @H5_FP_TO_ULLONG_ACCURATE@ + +/* Define if your system has right maximum convert floating-point to unsigned + long long values. */ +#cmakedefine H5_FP_TO_ULLONG_RIGHT_MAXIMUM @H5_FP_TO_ULLONG_RIGHT_MAXIMUM@ + +/* Define if gettimeofday() populates the tz pointer passed in */ +#cmakedefine H5_GETTIMEOFDAY_GIVES_TZ @H5_GETTIMEOFDAY_GIVES_TZ@ + +/* Define to 1 if you have the `alarm' function. */ +#cmakedefine H5_HAVE_ALARM @H5_HAVE_ALARM@ + +/* Define if the __attribute__(()) extension is present */ +#cmakedefine H5_HAVE_ATTRIBUTE @H5_HAVE_ATTRIBUTE@ + +/* Define to 1 if you have the `BSDgettimeofday' function. */ +#cmakedefine H5_HAVE_BSDGETTIMEOFDAY @H5_HAVE_BSDGETTIMEOFDAY@ + +/* Define if the compiler understands C99 designated initialization of structs + and unions */ +#cmakedefine H5_HAVE_C99_DESIGNATED_INITIALIZER @H5_HAVE_C99_DESIGNATED_INITIALIZER@ + +/* Define if the compiler understands the __func__ keyword */ +#cmakedefine H5_HAVE_C99_FUNC @H5_HAVE_C99_FUNC@ + +/* Define if the function stack tracing code is to be compiled in */ +#cmakedefine H5_HAVE_CODESTACK @H5_HAVE_CODESTACK@ + +/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. + */ +#cmakedefine H5_HAVE_DECL_TZNAME @H5_HAVE_DECL_TZNAME@ + +/* Define to 1 if you have the `difftime' function. */ +#cmakedefine H5_HAVE_DIFFTIME @H5_HAVE_DIFFTIME@ + +/* Define if the direct I/O virtual file driver should be compiled */ +#cmakedefine H5_HAVE_DIRECT @H5_HAVE_DIRECT@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_DLFCN_H @H5_HAVE_DLFCN_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_DMALLOC_H @H5_HAVE_DMALLOC_H@ + +/* Define if library information should be embedded in the executables */ +#cmakedefine H5_HAVE_EMBEDDED_LIBINFO @H5_HAVE_EMBEDDED_LIBINFO@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_FEATURES_H @H5_HAVE_FEATURES_H@ + +/* Define if support for deflate (zlib) filter is enabled */ +#cmakedefine H5_HAVE_FILTER_DEFLATE @H5_HAVE_FILTER_DEFLATE@ + +/* Define if support for Fletcher32 checksum is enabled */ +#cmakedefine H5_HAVE_FILTER_FLETCHER32 @H5_HAVE_FILTER_FLETCHER32@ + +/* Define if support for nbit filter is enabled */ +#cmakedefine H5_HAVE_FILTER_NBIT @H5_HAVE_FILTER_NBIT@ + +/* Define if support for scaleoffset filter is enabled */ +#cmakedefine H5_HAVE_FILTER_SCALEOFFSET @H5_HAVE_FILTER_SCALEOFFSET@ + +/* Define if support for shuffle filter is enabled */ +#cmakedefine H5_HAVE_FILTER_SHUFFLE @H5_HAVE_FILTER_SHUFFLE@ + +/* Define if support for szip filter is enabled */ +#cmakedefine H5_HAVE_FILTER_SZIP @H5_HAVE_FILTER_SZIP@ + +/* Define to 1 if you have the `fork' function. */ +#cmakedefine H5_HAVE_FORK @H5_HAVE_FORK@ + +/* Define to 1 if you have the `frexpf' function. */ +#cmakedefine H5_HAVE_FREXPF @H5_HAVE_FREXPF@ + +/* Define to 1 if you have the `frexpl' function. */ +#cmakedefine H5_HAVE_FREXPL @H5_HAVE_FREXPL@ + +/* Define to 1 if you have the `fseek64' function. */ +#cmakedefine H5_HAVE_FSEEK64 @H5_HAVE_FSEEK64@ + +/* Define to 1 if you have the `fseeko' function. */ +#cmakedefine H5_HAVE_FSEEKO @H5_HAVE_FSEEKO@ + +/* Define to 1 if you have the `fstat64' function. */ +#cmakedefine H5_HAVE_FSTAT64 @H5_HAVE_FSTAT64@ + +/* Define to 1 if you have the `ftello' function. */ +#cmakedefine H5_HAVE_FTELLO @H5_HAVE_FTELLO@ + +/* Define to 1 if you have the `ftruncate64' function. */ +#cmakedefine H5_HAVE_FTRUNCATE64 @H5_HAVE_FTRUNCATE64@ + +/* Define if the compiler understands the __FUNCTION__ keyword */ +#cmakedefine H5_HAVE_FUNCTION @H5_HAVE_FUNCTION@ + +/* Define to 1 if you have the `GetConsoleScreenBufferInfo' function. */ +#cmakedefine H5_HAVE_GETCONSOLESCREENBUFFERINFO @H5_HAVE_GETCONSOLESCREENBUFFERINFO@ + +/* Define to 1 if you have the `gethostname' function. */ +#cmakedefine H5_HAVE_GETHOSTNAME @H5_HAVE_GETHOSTNAME@ + +/* Define to 1 if you have the `getpwuid' function. */ +#cmakedefine H5_HAVE_GETPWUID @H5_HAVE_GETPWUID@ + +/* Define to 1 if you have the `getrusage' function. */ +#cmakedefine H5_HAVE_GETRUSAGE @H5_HAVE_GETRUSAGE@ + +/* Define to 1 if you have the `gettextinfo' function. */ +#cmakedefine H5_HAVE_GETTEXTINFO @H5_HAVE_GETTEXTINFO@ + +/* Define to 1 if you have the `gettimeofday' function. */ +#cmakedefine H5_HAVE_GETTIMEOFDAY @H5_HAVE_GETTIMEOFDAY@ + +/* Define to 1 if you have the `gettimeofday' function declared in time.h . */ +#cmakedefine H5_HAVE_TIME_GETTIMEOFDAY @H5_HAVE_TIME_GETTIMEOFDAY@ + +/* Define to 1 if you have the `gettimeofday' function declared in time.h . */ +#cmakedefine H5_HAVE_SYS_TIME_GETTIMEOFDAY @H5_HAVE_SYS_TIME_GETTIMEOFDAY@ + +/* Define to 1 if you have the `get_fpc_csr' function. */ +#cmakedefine H5_HAVE_GET_FPC_CSR @H5_HAVE_GET_FPC_CSR@ + +/* Define if we have GPFS support */ +#cmakedefine H5_HAVE_GPFS @H5_HAVE_GPFS@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_GPFS_H @H5_HAVE_GPFS_H@ + +/* Define if h5dump packed bits feature is enabled */ +#cmakedefine H5_HAVE_H5DUMP_PACKED_BITS @H5_HAVE_H5DUMP_PACKED_BITS@ + +/* Define if library will contain instrumentation to detect correct + optimization operation */ +#cmakedefine H5_HAVE_INSTRUMENTED_LIBRARY @H5_HAVE_INSTRUMENTED_LIBRARY@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_INTTYPES_H @H5_HAVE_INTTYPES_H@ + +/* Define to 1 if you have the `ioctl' function. */ +#cmakedefine H5_HAVE_IOCTL @H5_HAVE_IOCTL@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_IO_H @H5_HAVE_IO_H@ + +/* Define to 1 if you have the `dmalloc' library (-ldmalloc). */ +#cmakedefine H5_HAVE_LIBDMALLOC @H5_HAVE_LIBDMALLOC@ + +/* Define to 1 if you have the `lmpe' library (-llmpe). */ +#cmakedefine H5_HAVE_LIBLMPE @H5_HAVE_LIBLMPE@ + +/* Define to 1 if you have the `m' library (-lm). */ +#cmakedefine H5_HAVE_LIBM @H5_HAVE_LIBM@ + +/* Define to 1 if you have the `mpe' library (-lmpe). */ +#cmakedefine H5_HAVE_LIBMPE @H5_HAVE_LIBMPE@ + +/* Define to 1 if you have the `mpi' library (-lmpi). */ +#cmakedefine H5_HAVE_LIBMPI @H5_HAVE_LIBMPI@ + +/* Define to 1 if you have the `mpich' library (-lmpich). */ +#cmakedefine H5_HAVE_LIBMPICH @H5_HAVE_LIBMPICH@ + +/* Define to 1 if you have the `mpio' library (-lmpio). */ +#cmakedefine H5_HAVE_LIBMPIO @H5_HAVE_LIBMPIO@ + +/* Define to 1 if you have the `nsl' library (-lnsl). */ +#cmakedefine H5_HAVE_LIBNSL @H5_HAVE_LIBNSL@ + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +#cmakedefine H5_HAVE_LIBPTHREAD @H5_HAVE_LIBPTHREAD@ + +/* Define to 1 if you have the `socket' library (-lsocket). */ +#cmakedefine H5_HAVE_LIBSOCKET @H5_HAVE_LIBSOCKET@ + +/* Define to 1 if you have the `sz' library (-lsz). */ +#cmakedefine H5_HAVE_LIBSZ @H5_HAVE_LIBSZ@ + +/* Define to 1 if you have the `z' library (-lz). */ +#cmakedefine H5_HAVE_LIBZ @H5_HAVE_LIBZ@ + +/* Define to 1 if you have the `longjmp' function. */ +#cmakedefine H5_HAVE_LONGJMP @H5_HAVE_LONGJMP@ + +/* Define to 1 if you have the `lseek64' function. */ +#cmakedefine H5_HAVE_LSEEK64 @H5_HAVE_LSEEK64@ + +/* Define to 1 if you have the `lstat' function. */ +#cmakedefine H5_HAVE_LSTAT @H5_HAVE_LSTAT@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_MEMORY_H @H5_HAVE_MEMORY_H@ + +/* Define if we have MPE support */ +#cmakedefine H5_HAVE_MPE @H5_HAVE_MPE@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_MPE_H @H5_HAVE_MPE_H@ + +/* Define if MPI_File_get_size works correctly */ +#cmakedefine H5_HAVE_MPI_GET_SIZE @H5_HAVE_MPI_GET_SIZE@ + +/* Define if `MPI_Comm_c2f' and `MPI_Comm_f2c' exists */ +#cmakedefine H5_HAVE_MPI_MULTI_LANG_Comm @H5_HAVE_MPI_MULTI_LANG_Comm@ + +/* Define if `MPI_Info_c2f' and `MPI_Info_f2c' exists */ +#cmakedefine H5_HAVE_MPI_MULTI_LANG_Info @H5_HAVE_MPI_MULTI_LANG_Info@ + +/* Define if we have parallel support */ +#cmakedefine H5_HAVE_PARALLEL @H5_HAVE_PARALLEL@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_PTHREAD_H @H5_HAVE_PTHREAD_H@ + +/* Define to 1 if you have the `random' function. */ +#cmakedefine H5_HAVE_RANDOM @H5_HAVE_RANDOM@ + +/* Define to 1 if you have the `rand_r' function. */ +#cmakedefine H5_HAVE_RAND_R @H5_HAVE_RAND_R@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SETJMP_H @H5_HAVE_SETJMP_H@ + +/* Define to 1 if you have the `setsysinfo' function. */ +#cmakedefine H5_HAVE_SETSYSINFO @H5_HAVE_SETSYSINFO@ + +/* Define to 1 if you have the `sigaction' function. */ +#cmakedefine H5_HAVE_SIGACTION @H5_HAVE_SIGACTION@ + +/* Define to 1 if you have the `siglongjmp' function. */ +#cmakedefine H5_HAVE_SIGLONGJMP @H5_HAVE_SIGLONGJMP@ + +/* Define to 1 if you have the `signal' function. */ +#cmakedefine H5_HAVE_SIGNAL @H5_HAVE_SIGNAL@ + +/* Define to 1 if you have the `snprintf' function. */ +#cmakedefine H5_HAVE_SNPRINTF @H5_HAVE_SNPRINTF@ + +/* Define to 1 if you have the `srandom' function. */ +#cmakedefine H5_HAVE_SRANDOM @H5_HAVE_SRANDOM@ + +/* Define to 1 if you have the `stat64' function. */ +#cmakedefine H5_HAVE_STAT64 @H5_HAVE_STAT64@ + +/* Define if `struct stat' has the `st_blocks' field */ +#cmakedefine H5_HAVE_STAT_ST_BLOCKS @H5_HAVE_STAT_ST_BLOCKS@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_STDDEF_H @H5_HAVE_STDDEF_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_STDINT_H @H5_HAVE_STDINT_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_STDLIB_H @H5_HAVE_STDLIB_H@ + +/* Define to 1 if you have the `strdup' function. */ +#cmakedefine H5_HAVE_STRDUP @H5_HAVE_STRDUP@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_STRINGS_H @H5_HAVE_STRINGS_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_STRING_H @H5_HAVE_STRING_H@ + +/* Define if `struct text_info' is defined */ +#cmakedefine H5_HAVE_STRUCT_TEXT_INFO @H5_HAVE_STRUCT_TEXT_INFO@ + +/* Define if `struct timezone' is defined */ +#cmakedefine H5_HAVE_STRUCT_TIMEZONE @H5_HAVE_STRUCT_TIMEZONE@ + +/* Define to 1 if `struct tm' is a member of `tm_zone'. */ +#cmakedefine H5_HAVE_STRUCT_TM_TM_ZONE @H5_HAVE_STRUCT_TM_TM_ZONE@ + +/* Define if `struct videoconfig' is defined */ +#cmakedefine H5_HAVE_STRUCT_VIDEOCONFIG @H5_HAVE_STRUCT_VIDEOCONFIG@ + +/* Define to 1 if you have the `symlink' function. */ +#cmakedefine H5_HAVE_SYMLINK @H5_HAVE_SYMLINK@ + +/* Define to 1 if you have the `system' function. */ +#cmakedefine H5_HAVE_SYSTEM @H5_HAVE_SYSTEM@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_FPU_H @H5_HAVE_SYS_FPU_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_IOCTL_H @H5_HAVE_SYS_IOCTL_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_PROC_H @H5_HAVE_SYS_PROC_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_RESOURCE_H @H5_HAVE_SYS_RESOURCE_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_SOCKET_H @H5_HAVE_SYS_SOCKET_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_STAT_H @H5_HAVE_SYS_STAT_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_SYSINFO_H @H5_HAVE_SYS_SYSINFO_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_TIMEB_H @H5_HAVE_SYS_TIMEB_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_TIME_H @H5_HAVE_TIME_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_TIME_H @H5_HAVE_SYS_TIME_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SYS_TYPES_H @H5_HAVE_SYS_TYPES_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_SZLIB_H @H5_HAVE_SZLIB_H@ + +/* Define if we have thread safe support */ +#cmakedefine H5_HAVE_THREADSAFE @H5_HAVE_THREADSAFE@ + +/* Define if `timezone' is a global variable */ +#cmakedefine H5_HAVE_TIMEZONE @H5_HAVE_TIMEZONE@ + +/* Define if the ioctl TIOCGETD is defined */ +#cmakedefine H5_HAVE_TIOCGETD @H5_HAVE_TIOCGETD@ + +/* Define if the ioctl TIOGWINSZ is defined */ +#cmakedefine H5_HAVE_TIOCGWINSZ @H5_HAVE_TIOCGWINSZ@ + +/* Define to 1 if you have the `tmpfile' function. */ +#cmakedefine H5_HAVE_TMPFILE @H5_HAVE_TMPFILE@ + +/* Define if `tm_gmtoff' is a member of `struct tm' */ +#cmakedefine H5_HAVE_TM_GMTOFF @H5_HAVE_TM_GMTOFF@ + +/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use + `HAVE_STRUCT_TM_TM_ZONE' instead. */ +#cmakedefine H5_HAVE_TM_ZONE @H5_HAVE_TM_ZONE@ + +/* Define to 1 if you don't have `tm_zone' but do have the external array + `tzname'. */ +#cmakedefine H5_HAVE_TZNAME @H5_HAVE_TZNAME@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_UNISTD_H @H5_HAVE_UNISTD_H@ + +/* Define to 1 if you have the `vasprintf' function. */ +#cmakedefine H5_HAVE_VASPRINTF @H5_HAVE_VASPRINTF@ + +/* Define to 1 if you have the `vsnprintf' function. */ +#cmakedefine H5_HAVE_VSNPRINTF @H5_HAVE_VSNPRINTF@ + +/* Define to 1 if you have the `waitpid' function. */ +#cmakedefine H5_HAVE_WAITPID @H5_HAVE_WAITPID@ + +/* Define if your system has window style path name. */ +#cmakedefine H5_HAVE_WINDOW_PATH @H5_HAVE_WINDOW_PATH@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_WINSOCK_H @H5_HAVE_WINSOCK_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_ZLIB_H @H5_HAVE_ZLIB_H@ + +/* Define to 1 if you have the `_getvideoconfig' function. */ +#cmakedefine H5_HAVE__GETVIDEOCONFIG @H5_HAVE__GETVIDEOCONFIG@ + +/* Define to 1 if you have the `_scrsize' function. */ +#cmakedefine H5_HAVE__SCRSIZE @H5_HAVE__SCRSIZE@ + +/* Define if `__tm_gmtoff' is a member of `struct tm' */ +#cmakedefine H5_HAVE___TM_GMTOFF @H5_HAVE___TM_GMTOFF@ + +/* Define if your system can't handle converting floating-point values to long + long. */ +#cmakedefine H5_HW_FP_TO_LLONG_NOT_WORKS @H5_HW_FP_TO_LLONG_NOT_WORKS@ + +/* Define if HDF5's high-level library headers should be included in hdf5.h */ +#cmakedefine H5_INCLUDE_HL @H5_INCLUDE_HL@ + +/* Define if your system can accurately convert from integers to long double + values. */ +#cmakedefine H5_INTEGER_TO_LDOUBLE_ACCURATE @H5_INTEGER_TO_LDOUBLE_ACCURATE@ + +/* Define if your system can convert long double to integers accurately. */ +#cmakedefine H5_LDOUBLE_TO_INTEGER_ACCURATE @H5_LDOUBLE_TO_INTEGER_ACCURATE@ + +/* Define if your system can convert from long double to integer values. */ +#cmakedefine H5_LDOUBLE_TO_INTEGER_WORKS @H5_LDOUBLE_TO_INTEGER_WORKS@ + +/* Define if your system can convert long double to (unsigned) long long + values correctly. */ +#cmakedefine H5_LDOUBLE_TO_LLONG_ACCURATE @H5_LDOUBLE_TO_LLONG_ACCURATE@ + +/* Define if your system can convert long double to unsigned int values + correctly. */ +#cmakedefine H5_LDOUBLE_TO_UINT_ACCURATE @H5_LDOUBLE_TO_UINT_ACCURATE@ + +/* Define if your system can compile long long to floating-point casts. */ +#cmakedefine H5_LLONG_TO_FP_CAST_WORKS @H5_LLONG_TO_FP_CAST_WORKS@ + +/* Define if your system can convert (unsigned) long long to long double + values correctly. */ +#cmakedefine H5_LLONG_TO_LDOUBLE_CORRECT @H5_LLONG_TO_LDOUBLE_CORRECT@ + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#cmakedefine H5_LT_OBJDIR @H5_LT_OBJDIR@ + +/* Define if the metadata trace file code is to be compiled in */ +#cmakedefine H5_METADATA_TRACE_FILE @H5_METADATA_TRACE_FILE@ + +/* Define if your system can handle complicated MPI derived datatype + correctly. */ +#cmakedefine H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS @H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS@ + +/* Define if your system's `MPI_File_set_size' function works for files over + 2GB. */ +#cmakedefine H5_MPI_FILE_SET_SIZE_BIG @H5_MPI_FILE_SET_SIZE_BIG@ + +/* Define if your system can handle special collective IO properly. */ +#cmakedefine H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS @H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS@ + +/* Define if we can violate pointer alignment restrictions */ +#cmakedefine H5_NO_ALIGNMENT_RESTRICTIONS @H5_NO_ALIGNMENT_RESTRICTIONS@ + +/* Define if deprecated public API symbols are disabled */ +#cmakedefine H5_NO_DEPRECATED_SYMBOLS @H5_NO_DEPRECATED_SYMBOLS@ + +/* Define if shared writing must be disabled (CodeWarrior only) */ +#cmakedefine H5_NO_SHARED_WRITING @H5_NO_SHARED_WRITING@ + +/* Name of package */ +#define H5_PACKAGE "@HDF5_PACKAGE@" + +/* Define to the address where bug reports for this package should be sent. */ +#define H5_PACKAGE_BUGREPORT "@HDF5_PACKAGE_BUGREPORT@" + +/* Define to the full name of this package. */ +#define H5_PACKAGE_NAME "@HDF5_PACKAGE_NAME@" + +/* Define to the full name and version of this package. */ +#define H5_PACKAGE_STRING "@HDF5_PACKAGE_STRING@" + +/* Define to the one symbol short name of this package. */ +#define H5_PACKAGE_TARNAME "@HDF5_PACKAGE_TARNAME@" + +/* Define to the home page for this package. */ +#define H5_PACKAGE_URL "@HDF5_PACKAGE_URL@" + +/* Define to the version of this package. */ +#define H5_PACKAGE_VERSION "@HDF5_PACKAGE_VERSION@" + +/* Width for printf() for type `long long' or `__int64', use `ll' */ +#cmakedefine H5_PRINTF_LL_WIDTH @H5_PRINTF_LL_WIDTH@ + +/* The size of `char', as computed by sizeof. */ +#define H5_SIZEOF_CHAR @H5_SIZEOF_CHAR@ + +/* The size of `double', as computed by sizeof. */ +#define H5_SIZEOF_DOUBLE @H5_SIZEOF_DOUBLE@ + +/* The size of `float', as computed by sizeof. */ +#define H5_SIZEOF_FLOAT @H5_SIZEOF_FLOAT@ + +/* The size of `int', as computed by sizeof. */ +#define H5_SIZEOF_INT @H5_SIZEOF_INT@ + +/* The size of `int16_t', as computed by sizeof. */ +#define H5_SIZEOF_INT16_T @H5_SIZEOF_INT16_T@ + +/* The size of `int32_t', as computed by sizeof. */ +#define H5_SIZEOF_INT32_T @H5_SIZEOF_INT32_T@ + +/* The size of `int64_t', as computed by sizeof. */ +#define H5_SIZEOF_INT64_T @H5_SIZEOF_INT64_T@ + +/* The size of `int8_t', as computed by sizeof. */ +#define H5_SIZEOF_INT8_T @H5_SIZEOF_INT8_T@ + +/* The size of `int_fast16_t', as computed by sizeof. */ +#define H5_SIZEOF_INT_FAST16_T @H5_SIZEOF_INT_FAST16_T@ + +/* The size of `int_fast32_t', as computed by sizeof. */ +#define H5_SIZEOF_INT_FAST32_T @H5_SIZEOF_INT_FAST32_T@ + +/* The size of `int_fast64_t', as computed by sizeof. */ +#define H5_SIZEOF_INT_FAST64_T @H5_SIZEOF_INT_FAST64_T@ + +/* The size of `int_fast8_t', as computed by sizeof. */ +#define H5_SIZEOF_INT_FAST8_T @H5_SIZEOF_INT_FAST8_T@ + +/* The size of `int_least16_t', as computed by sizeof. */ +#define H5_SIZEOF_INT_LEAST16_T @H5_SIZEOF_INT_LEAST16_T@ + +/* The size of `int_least32_t', as computed by sizeof. */ +#define H5_SIZEOF_INT_LEAST32_T @H5_SIZEOF_INT_LEAST32_T@ + +/* The size of `int_least64_t', as computed by sizeof. */ +#define H5_SIZEOF_INT_LEAST64_T @H5_SIZEOF_INT_LEAST64_T@ + +/* The size of `int_least8_t', as computed by sizeof. */ +#define H5_SIZEOF_INT_LEAST8_T @H5_SIZEOF_INT_LEAST8_T@ + +#if !defined(__APPLE__) +/* The size of `size_t', as computed by sizeof. */ +#define H5_SIZEOF_SIZE_T @H5_SIZEOF_SIZE_T@ + +/* The size of `ssize_t', as computed by sizeof. */ +#define H5_SIZEOF_SSIZE_T @H5_SIZEOF_SSIZE_T@ + +/* The size of `long', as computed by sizeof. */ +#define H5_SIZEOF_LONG @H5_SIZEOF_LONG@ + +#else + # if defined(__LP64__) && __LP64__ + #define H5_SIZEOF_LONG 8 + #define H5_SIZEOF_SIZE_T 8 + #define H5_SIZEOF_SSIZE_T 8 + # else + #define H5_SIZEOF_LONG 4 + #define H5_SIZEOF_SIZE_T 4 + #define H5_SIZEOF_SSIZE_T 4 + # endif + +#endif + +/* The size of `long double', as computed by sizeof. */ +#define H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@ + +/* Define size of long long and/or __int64 bit integer type only if the type + exists. */ +#if !defined(__APPLE__) + #define H5_SIZEOF_LONG_LONG @H5_SIZEOF_LONG_LONG@ +#else + #define H5_SIZEOF_LONG_LONG 8 +#endif + +/* The size of `off64_t', as computed by sizeof. */ +#define H5_SIZEOF_OFF64_T @H5_SIZEOF_OFF64_T@ + +/* The size of `off_t', as computed by sizeof. */ +#define H5_SIZEOF_OFF_T @H5_SIZEOF_OFF_T@ + +/* The size of `short', as computed by sizeof. */ +#define H5_SIZEOF_SHORT @H5_SIZEOF_SHORT@ + +/* The size of `uint16_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT16_T @H5_SIZEOF_UINT16_T@ + +/* The size of `uint32_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT32_T @H5_SIZEOF_UINT32_T@ + +/* The size of `uint64_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT64_T @H5_SIZEOF_UINT64_T@ + +/* The size of `uint8_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT8_T @H5_SIZEOF_UINT8_T@ + +/* The size of `uint_fast16_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT_FAST16_T @H5_SIZEOF_UINT_FAST16_T@ + +/* The size of `uint_fast32_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT_FAST32_T @H5_SIZEOF_UINT_FAST32_T@ + +/* The size of `uint_fast64_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT_FAST64_T @H5_SIZEOF_UINT_FAST64_T@ + +/* The size of `uint_fast8_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT_FAST8_T @H5_SIZEOF_UINT_FAST8_T@ + +/* The size of `uint_least16_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT_LEAST16_T @H5_SIZEOF_UINT_LEAST16_T@ + +/* The size of `uint_least32_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT_LEAST32_T @H5_SIZEOF_UINT_LEAST32_T@ + +/* The size of `uint_least64_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT_LEAST64_T @H5_SIZEOF_UINT_LEAST64_T@ + +/* The size of `uint_least8_t', as computed by sizeof. */ +#define H5_SIZEOF_UINT_LEAST8_T @H5_SIZEOF_UINT_LEAST8_T@ + +/* The size of `unsigned', as computed by sizeof. */ +#define H5_SIZEOF_UNSIGNED @H5_SIZEOF_UNSIGNED@ + +/* The size of `__int64', as computed by sizeof. */ +#define H5_SIZEOF___INT64 @H5_SIZEOF___INT64@ + +/* Define to 1 if you have the ANSI C header files. */ +#cmakedefine H5_STDC_HEADERS @H5_STDC_HEADERS@ + +/* Define if strict file format checks are enabled */ +#cmakedefine H5_STRICT_FORMAT_CHECKS @H5_STRICT_FORMAT_CHECKS@ + +/* Define if your system supports pthread_attr_setscope(&attribute, + PTHREAD_SCOPE_SYSTEM) call. */ +#cmakedefine H5_SYSTEM_SCOPE_THREADS @H5_SYSTEM_SCOPE_THREADS@ + +/* Define to 1 if you can safely include both and . */ +#cmakedefine H5_TIME_WITH_SYS_TIME @H5_TIME_WITH_SYS_TIME@ + +/* Define to 1 if your declares `struct tm'. */ +#cmakedefine H5_TM_IN_SYS_TIME @H5_TM_IN_SYS_TIME@ + +/* Define if your system can compile unsigned long long to floating-point + casts. */ +#cmakedefine H5_ULLONG_TO_FP_CAST_WORKS @H5_ULLONG_TO_FP_CAST_WORKS@ + +/* Define if your system can convert unsigned long long to long double with + correct precision. */ +#cmakedefine H5_ULLONG_TO_LDOUBLE_PRECISION @H5_ULLONG_TO_LDOUBLE_PRECISION@ + +/* Define if your system accurately converting unsigned long to float values. + */ +#cmakedefine H5_ULONG_TO_FLOAT_ACCURATE @H5_ULONG_TO_FLOAT_ACCURATE@ + +/* Define if your system can accurately convert unsigned (long) long values to + floating-point values. */ +#cmakedefine H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE @H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE@ + +/* Define using v1.6 public API symbols by default */ +#cmakedefine H5_USE_16_API_DEFAULT @H5_USE_16_API_DEFAULT@ + +/* Define if a memory checking tool will be used on the library, to cause + library to be very picky about memory operations and also disable the + internal free list manager code. */ +#cmakedefine H5_USING_MEMCHECKER @H5_USING_MEMCHECKER@ + +/* Version number of package */ +#define VERSION "@HDF5_PACKAGE_VERSION@" + +/* Define if vsnprintf() returns the correct value for formatted strings that + don't fit into size allowed */ +#cmakedefine H5_VSNPRINTF_WORKS @H5_VSNPRINTF_WORKS@ + +/* Data accuracy is prefered to speed during data conversions */ +#cmakedefine H5_WANT_DATA_ACCURACY @H5_WANT_DATA_ACCURACY@ + +/* Check exception handling functions during data conversions */ +#cmakedefine H5_WANT_DCONV_EXCEPTION @H5_WANT_DCONV_EXCEPTION@ + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if !defined(__APPLE__) +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#else +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#endif + +/* Define to empty if `const' does not conform to ANSI C. */ +#cmakedefine H5_const + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#cmakedefine H5_inline @H5_inline@ +#endif + +/* Define to `long int' if does not define. */ +#cmakedefine H5_off_t + +/* Define to `unsigned long' if does not define. */ +#cmakedefine H5_size_t + +/* Define to `long' if does not define. */ +#cmakedefine H5_ssize_t + +#if defined(__cplusplus) && defined(inline) +#undef inline +#endif + +#endif \ No newline at end of file diff --git a/Resources/HDF5Config.cmake.in b/Resources/HDF5Config.cmake.in new file mode 100644 index 0000000..f7d1fd6 --- /dev/null +++ b/Resources/HDF5Config.cmake.in @@ -0,0 +1,32 @@ +# +# HDF5 Config file for CMake +# + +SET(HDF5_INCLUDE_DIRS "@HDF5_INCLUDE_DIRECTORIES@i" ) +SET(HDF5_LIBRARIES "@HDF5_LIBRARIES@" ) +SET(HDF5_LINK_DIRECTORIES "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@" ) + +# Names for hdf5 library +SET(HDF5_LIB_NAME "@HDF5_LIB_NAME@") +SET(HDF5_LIB_NAME_RELEASE "@HDF5_LIB_NAME_RELEASE@") +SET(HDF5_LIB_NAME_DEBUG "@HDF5_LIB_NAME_DEBUG@") + +# Names for hdf5_hl library +SET(HDF5_HL_LIB_NAME "@HDF5_HL_LIB_NAME@") +SET(HDF5_HL_LIB_NAME_RELEASE "@HDF5_HL_LIB_NAME_RELEASE@") +SET(HDF5_HL_LIB_NAME_DEBUG "@HDF5_HL_LIB_NAME_DEBUG@") + +# Names for hdf5_cpp library +SET(HDF5_CPP_LIB_NAME "@HDF5_CPP_LIB_NAME@") +SET(HDF5_CPP_LIB_NAME_RELEASE "@HDF5_CPP_LIB_NAME_RELEASE@") +SET(HDF5_CPP_LIB_NAME_DEBUG "@HDF5_CPP_LIB_NAME_DEBUG@") + +# Names for hdf5_test library +SET(HDF5_TEST_LIB_NAME "@HDF5_TEST_LIB_NAME@") +SET(HDF5_TEST_LIB_NAME_RELEASE "@HDF5_TEST_LIB_NAME_RELEASE@") +SET(HDF5_TEST_LIB_NAME_DEBUG "@HDF5_TEST_LIB_NAME_DEBUG@") + +# Names for hdf5_test library +SET(HDF5_TOOLS_LIB_NAME "@HDF5_TOOLS_LIB_NAME@") +SET(HDF5_TOOLS_LIB_NAME_RELEASE "@HDF5_TOOLS_LIB_NAME_RELEASE@") +SET(HDF5_TOOLS_LIB_NAME_DEBUG "@HDF5_TOOLS_LIB_NAME_DEBUG@") diff --git a/Resources/HDF5Macros.cmake b/Resources/HDF5Macros.cmake new file mode 100644 index 0000000..cb1b300 --- /dev/null +++ b/Resources/HDF5Macros.cmake @@ -0,0 +1,122 @@ +#------------------------------------------------------------------------------- +MACRO (SET_GLOBAL_VARIABLE name value) + 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}) + 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} + # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} + #) +ENDMACRO (IDE_GENERATED_PROPERTIES) + +#------------------------------------------------------------------------------- +MACRO (IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES) + # INSTALL (FILES ${HEADERS} + # DESTINATION include/R3D/${NAME} + # COMPONENT Headers + # ) + + 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} + # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} + #) +ENDMACRO (IDE_SOURCE_PROPERTIES) + +#------------------------------------------------------------------------------- +MACRO (H5_NAMING target) + IF (WIN32 AND NOT MINGW) + IF (BUILD_SHARED_LIBS) + IF (H5_LEGACY_NAMING) + SET_TARGET_PROPERTIES (${target} PROPERTIES OUTPUT_NAME "dll") + SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX "${target}") + ELSE (H5_LEGACY_NAMING) + SET_TARGET_PROPERTIES (${target} PROPERTIES OUTPUT_NAME "${target}dll") + ENDIF (H5_LEGACY_NAMING) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (WIN32 AND NOT MINGW) +ENDMACRO (H5_NAMING) + +#------------------------------------------------------------------------------- +MACRO (H5_SET_LIB_OPTIONS libtarget libname libtype) + # message (STATUS "${libname} libtype: ${libtype}") + IF (${libtype} MATCHES "SHARED") + IF (WIN32 AND NOT MINGW) + IF (H5_LEGACY_NAMING) + SET (LIB_RELEASE_NAME "${libname}dll") + SET (LIB_DEBUG_NAME "${libname}ddll") + ELSE (H5_LEGACY_NAMING) + SET (LIB_RELEASE_NAME "${libname}") + SET (LIB_DEBUG_NAME "${libname}_D") + ENDIF (H5_LEGACY_NAMING) + ELSE (WIN32 AND NOT MINGW) + SET (LIB_RELEASE_NAME "${libname}") + SET (LIB_DEBUG_NAME "${libname}_debug") + ENDIF (WIN32 AND NOT MINGW) + ELSE (${libtype} MATCHES "SHARED") + IF (WIN32 AND NOT MINGW) + IF (H5_LEGACY_NAMING) + SET (LIB_RELEASE_NAME "${libname}") + SET (LIB_DEBUG_NAME "${libname}d") + ELSE (H5_LEGACY_NAMING) + SET (LIB_RELEASE_NAME "lib${libname}") + SET (LIB_DEBUG_NAME "lib${libname}_D") + ENDIF (H5_LEGACY_NAMING) + ELSE (WIN32 AND NOT MINGW) + SET (LIB_RELEASE_NAME "lib${libname}") + SET (LIB_DEBUG_NAME "lib${libname}_debug") + ENDIF (WIN32 AND NOT MINGW) + ENDIF (${libtype} MATCHES "SHARED") + + SET_TARGET_PROPERTIES (${libtarget} + PROPERTIES + DEBUG_OUTPUT_NAME ${LIB_DEBUG_NAME} + RELEASE_OUTPUT_NAME ${LIB_RELEASE_NAME} + MINSIZEREL_OUTPUT_NAME ${LIB_RELEASE_NAME} + RELWITHDEBINFO_OUTPUT_NAME ${LIB_RELEASE_NAME} + ) + + #----- Use MSVC Naming conventions for Shared Libraries + IF (MINGW AND BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (${libtarget} + PROPERTIES + IMPORT_SUFFIX ".lib" + IMPORT_PREFIX "" + PREFIX "" + ) + ENDIF (MINGW AND BUILD_SHARED_LIBS) + + IF (BUILD_SHARED_LIBS) + 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}) + SET_TARGET_PROPERTIES (${libtarget} PROPERTIES SOVERSION ${LIBHDF_VERSION}) + ENDIF (BUILD_SHARED_LIBS) + + #-- 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) + 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) + +ENDMACRO (H5_SET_LIB_OPTIONS) + diff --git a/Resources/HDF5Tests.c b/Resources/HDF5Tests.c new file mode 100644 index 0000000..35e7258 --- /dev/null +++ b/Resources/HDF5Tests.c @@ -0,0 +1,366 @@ +#define SIMPLE_TEST(x) int main(){ x; return 0; } + +#ifdef CXX_HAVE_OFFSETOF + #include +#include + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus +extern "C" +# endif +int FC_DUMMY_MAIN() +{ return 1;} +#endif +#endif +int +main () +{ + + struct index_st + { + unsigned char type; + unsigned char num; + unsigned int len; + }; + typedef struct index_st index_t; + int x,y; + x = offsetof(struct index_st, len); + y = offsetof(index_t, num) + + ; + return 0; +} +#endif + +#ifdef HAVE_C99_DESIGNATED_INITIALIZER + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus +extern "C" +# endif +int FC_DUMMY_MAIN() +{ return 1;} +#endif +#endif +int +main () +{ + + typedef struct + { + int x; + union + { + int i; + double d; + }u; + }di_struct_t; + di_struct_t x = + { 0, + { .d = 0.0}}; + ; + return 0; +} + +#endif + +#ifdef HAVE_C99_FUNC + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ + const char *fname = __func__; + ; + return 0; +} + +#endif + +#ifdef VSNPRINTF_WORKS +#include +#include +#include + +int test_vsnprintf(const char *fmt,...) +{ + va_list ap; + char *s = malloc(16); + int ret; + + va_start(ap, fmt); + ret=vsnprintf(s,16,"%s",ap); + va_end(ap); + + return(ret!=42 ? 1 : 0); +} + +int main(void) +{ + exit(test_vsnprintf("%s","A string that is longer than 16 characters")); +} +#endif + + +#ifdef TIME_WITH_SYS_TIME +/* Time with sys/time test */ + +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} + +#endif + +#ifdef STDC_HEADERS +#include +#include +#include +#include +int main() { return 0; } +#endif /* STDC_HEADERS */ + +#ifdef HAVE_TM_ZONE + +#include +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include +SIMPLE_TEST(struct tm tm; tm.tm_zone); + +#endif /* HAVE_TM_ZONE */ + +#ifdef HAVE_STRUCT_TM_TM_ZONE + +#include +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include +SIMPLE_TEST(struct tm tm; tm.tm_zone); + +#endif /* HAVE_STRUCT_TM_TM_ZONE */ + +#ifdef HAVE_ATTRIBUTE + +#if 0 +static void test int __attribute((unused)) var) +{ + int __attribute__((unused)) x = var; +} + +int main(void) +{ + test(19); +} + +#else +int +main () +{ +int __attribute__((unused)) x + ; + return 0; +} +#endif + + +#endif /* HAVE_ATTRIBUTE */ + +#ifdef HAVE_FUNCTION + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +(void)__FUNCTION__ + ; + return 0; +} + +#endif /* HAVE_FUNCTION */ + +#ifdef HAVE_TM_GMTOFF + +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include +SIMPLE_TEST(struct tm tm; tm.tm_gmtoff=0); + +#endif /* HAVE_TM_GMTOFF */ + +#ifdef HAVE_TIMEZONE + +#include +#include +SIMPLE_TEST(timezone=0); + +#endif /* HAVE_TIMEZONE */ + +#ifdef HAVE_STRUCT_TIMEZONE + +#include +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include +SIMPLE_TEST(struct timezone tz; tz.tz_minuteswest=0); + +#endif /* HAVE_STRUCT_TIMEZONE */ + +#ifdef HAVE_STAT_ST_BLOCKS + +#include +SIMPLE_TEST(struct stat sb; sb.st_blocks=0); + +#endif /* HAVE_STAT_ST_BLOCKS */ + +#ifdef PRINTF_LL_WIDTH + +#ifdef HAVE_LONG_LONG +# define LL_TYPE long long +#else /* HAVE_LONG_LONG */ +# define LL_TYPE __int64 +#endif /* HAVE_LONG_LONG */ + +#include +#include +#include + +int main(void) +{ + char *llwidthArgs[] = { "l64", "l", "L", "q", "ll", NULL }; + char *s = malloc(128); + char **currentArg = NULL; + LL_TYPE x = (LL_TYPE)1048576 * (LL_TYPE)1048576; + for (currentArg = llwidthArgs; *currentArg != NULL; currentArg++) + { + char formatString[64]; + sprintf(formatString, "%%%sd", *currentArg); + sprintf(s, formatString, x); + if (strcmp(s, "1099511627776") == 0) + { + printf("PRINTF_LL_WIDTH=[%s]\n", *currentArg); + exit(0); + } + } + exit(1); +} + +#endif /* PRINTF_LL_WIDTH */ + +#ifdef SYSTEM_SCOPE_THREADS +#include +#include + +int main(void) +{ + pthread_attr_t attribute; + int ret; + + pthread_attr_init(&attribute); + ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM); + exit(ret==0 ? 0 : 1); +} + +#endif /* SYSTEM_SCOPE_THREADS */ + +#ifdef HAVE_SOCKLEN_T + +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + +SIMPLE_TEST(socklen_t foo); + +#endif /* HAVE_SOCKLEN_T */ + +#ifdef DEV_T_IS_SCALAR + +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +int main () +{ + dev_t d1, d2; + if(d1==d2) + return 0; + return 1; +} + +#endif /* DEV_T_IS_SCALAR */ + +#if defined( INLINE_TEST_inline ) || defined( INLINE_TEST___inline__ ) || defined( INLINE_TEST___inline ) +#ifndef __cplusplus +typedef int foo_t; +static INLINE_TEST_INLINE foo_t static_foo () { return 0; } +INLINE_TEST_INLINE foo_t foo () {return 0; } +int main() { return 0; } +#endif + +#endif /* INLINE_TEST */ + +#ifdef HAVE_OFF64_T +#include +int main() +{ + off64_t n = 0; + return (int)n; +} +#endif + + +#ifdef GETTIMEOFDAY_GIVES_TZ +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include +int main(void) +{ + struct timeval tv; + struct timezone tz; + tz.tz_minuteswest = 7777; /* Initialize to an unreasonable number */ + tz.tz_dsttime = 7; + gettimeofday(&tv, &tz); + /* Check whether the function returned any value at all */ + if(tz.tz_minuteswest == 7777 && tz.tz_dsttime == 7) + exit(1); + else exit (0); +} +#endif + diff --git a/Resources/hdf5_zlib.h.in b/Resources/hdf5_zlib.h.in new file mode 100644 index 0000000..104db27 --- /dev/null +++ b/Resources/hdf5_zlib.h.in @@ -0,0 +1 @@ +#include <@H5_ZLIB_HEADER@> diff --git a/Resources/libhdf5.settings.cmake.in b/Resources/libhdf5.settings.cmake.in new file mode 100644 index 0000000..a3032e5 --- /dev/null +++ b/Resources/libhdf5.settings.cmake.in @@ -0,0 +1,68 @@ + SUMMARY OF THE HDF5 CONFIGURATION + ================================= + +General Information: +------------------- + HDF5 Version: @H5_VERSION@ + Configured on: @CONFIG_DATE@ + Configured by: @CONFIG_USER@ + Configure mode: @CONFIG_MODE@ + Host system: @host_cpu@-@host_vendor@-@host_os@ + Uname information: @UNAME_INFO@ + Byte sex: @BYTESEX@ + Libraries: @STATIC_SHARED@ + Installation point: @prefix@ + +Compiling Options: +------------------ + Compilation Mode: @CONFIG_MODE@ + C Compiler: @CC_VERSION@ + CFLAGS: @CFLAGS@ + H5_CFLAGS: @H5_CFLAGS@ + AM_CFLAGS: @AM_CFLAGS@ + CPPFLAGS: @CPPFLAGS@ + H5_CPPFLAGS: @H5_CPPFLAGS@ + AM_CPPFLAGS: @AM_CPPFLAGS@ + Shared Libraries: @enable_shared@ + Static Libraries: @enable_static@ + Statically Linked Executables: @STATIC_EXEC@ + LDFLAGS: @LDFLAGS@ + AM_LDFLAGS: @AM_LDFLAGS@ + Extra libraries: @LIBS@ + Archiver: @AR@ + Ranlib: @RANLIB@ + Debugged Packages: @DEBUG_PKG@ + API Tracing: @TRACE_API@ + +Languages: +---------- + Fortran: @HDF_FORTRAN@ +@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Compiler: @FC@ +@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Flags: @FCFLAGS@ +@BUILD_FORTRAN_CONDITIONAL_TRUE@ H5 Fortran Flags: @H5_FCFLAGS@ +@BUILD_FORTRAN_CONDITIONAL_TRUE@ AM Fortran Flags: @AM_FCFLAGS@ + C++: @HDF_CXX@ +@BUILD_CXX_CONDITIONAL_TRUE@ C++ Compiler: @CXX@ +@BUILD_CXX_CONDITIONAL_TRUE@ C++ Flags: @CXXFLAGS@ +@BUILD_CXX_CONDITIONAL_TRUE@ H5 C++ Flags: @H5_CXXFLAGS@ +@BUILD_CXX_CONDITIONAL_TRUE@ AM C++ Flags: @AM_CXXFLAGS@ + +Features: +--------- + Parallel HDF5: @PARALLEL@ + High Level library: @HDF5_HL@ + Threadsafety: @THREADSAFE@ + Default API Mapping: @DEFAULT_API_VERSION@ + With Deprecated Public Symbols: @DEPRECATED_SYMBOLS@ + I/O filters (external): @EXTERNAL_FILTERS@ + I/O filters (internal): @FILTERS@ + MPE: @MPE@ + Direct VFD: @DIRECT_VFD@ + dmalloc: @HAVE_DMALLOC@ +Clear file buffers before write: @CLEARFILEBUF@ + Using memory checker: @USINGMEMCHECKER@ + Function Stack Tracing: @CODESTACK@ + GPFS: @GPFS@ + Strict File Format Checks: @STRICT_FORMAT_CHECKS@ + Optimization Instrumentation: @INSTRUMENT@ + Linux Large File Support (LFS): @LINUX_LFS@ diff --git a/Resources/runTest.cmake b/Resources/runTest.cmake new file mode 100644 index 0000000..4218671 --- /dev/null +++ b/Resources/runTest.cmake @@ -0,0 +1,82 @@ +# runTest.cmake executes a command and captures the output in a file. File is then compared +# against a reference file. Exit status of command can also be compared. + +# arguments checking +IF (NOT TEST_PROGRAM) + MESSAGE (FATAL_ERROR "Require TEST_PROGRAM to be defined") +ENDIF (NOT TEST_PROGRAM) +#IF (NOT TEST_ARGS) +# MESSAGE (STATUS "Require TEST_ARGS to be defined") +#ENDIF (NOT TEST_ARGS) +IF (NOT TEST_FOLDER) + MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") +ENDIF (NOT TEST_FOLDER) +IF (NOT TEST_OUTPUT) + MESSAGE (FATAL_ERROR "Require TEST_OUTPUT to be defined") +ENDIF (NOT TEST_OUTPUT) +#IF (NOT TEST_EXPECT) +# MESSAGE (STATUS "Require TEST_EXPECT to be defined") +#ENDIF (NOT TEST_EXPECT) +IF (NOT TEST_REFERENCE) + MESSAGE (FATAL_ERROR "Require TEST_REFERENCE to be defined") +ENDIF (NOT TEST_REFERENCE) + +SET (ERROR_APPEND 1) + +MESSAGE (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") + +# run the test program, capture the stdout/stderr and the result var +EXECUTE_PROCESS ( + COMMAND ${TEST_PROGRAM} ${TEST_ARGS} + WORKING_DIRECTORY ${TEST_FOLDER} + RESULT_VARIABLE TEST_RESULT + OUTPUT_FILE ${TEST_OUTPUT} + ERROR_FILE ${TEST_OUTPUT}.err + OUTPUT_VARIABLE TEST_ERROR + ERROR_VARIABLE TEST_ERROR +) + +MESSAGE (STATUS "COMMAND Result: ${TEST_RESULT}") + +IF (ERROR_APPEND) + FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) + FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +ENDIF (ERROR_APPEND) + +IF (TEST_APPEND) + FILE (APPEND ${TEST_OUTPUT} "${TEST_APPEND} ${TEST_RESULT}\n") +ENDIF (TEST_APPEND) + +# if the return value is !=0 bail out +IF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + MESSAGE ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != 0.\n${TEST_ERROR}") +ENDIF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + +MESSAGE (STATUS "COMMAND Error: ${TEST_ERROR}") + +IF (TEST_MASK) + 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}") + STRING(REGEX REPLACE "Storage:[^\n]+\n" "Storage:
\n" TEST_STREAM "${TEST_STREAM}") + FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +ENDIF (TEST_MASK) + +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) + +# now compare the output with the reference +EXECUTE_PROCESS ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_OUTPUT} ${TEST_REFERENCE} + RESULT_VARIABLE TEST_RESULT +) + +# again, if return value is !=0 scream and shout +IF (TEST_RESULT) + MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not match ${TEST_REFERENCE}") +ENDIF (TEST_RESULT) + +# everything went fine... +MESSAGE ("Passed: The output of ${TEST_PROGRAM} matches ${TEST_REFERENCE}") + diff --git a/Resources/xlatefile.c b/Resources/xlatefile.c new file mode 100644 index 0000000..c16f573 --- /dev/null +++ b/Resources/xlatefile.c @@ -0,0 +1,56 @@ +#include +#include +#include + +#define BUFFERSIZE 1024 + +int main(int argc, char *argv[]) { + FILE *infile = NULL; + FILE *outfile = NULL; + char *buffer = NULL; + char argbuf[8]; + unsigned int bytes = 0; + unsigned int 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/c++/CMakeLists.txt b/c++/CMakeLists.txt new file mode 100644 index 0000000..b1edc06 --- /dev/null +++ b/c++/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_CPP) + +#----------------------------------------------------------------------------- +# Shared/Static Libs +#----------------------------------------------------------------------------- +IF (BUILD_SHARED_LIBS) + SET (CPP_BUILT_AS_DYNAMIC_LIB 1) +ENDIF (BUILD_SHARED_LIBS) + +#----------------------------------------------------------------------------- +# Generate configure file +#----------------------------------------------------------------------------- +CONFIGURE_FILE (${HDF5_SOURCE_DIR}/Resources/H5cxx_config.h.in + ${HDF5_BINARY_DIR}/H5cxx_pubconf.h +) + +#----------------------------------------------------------------------------- +# Setup Include directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_CPP_SOURCE_DIR}/src) +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) + +ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src) + +#----------------------------------------------------------------------------- +# Build the CPP Examples +#----------------------------------------------------------------------------- +IF (HDF5_BUILD_EXAMPLES) + ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/examples ${HDF5_CPP_BINARY_DIR}/examples) +ENDIF (HDF5_BUILD_EXAMPLES) + +#----------------------------------------------------------------------------- +# Build the CPP unit tests +#----------------------------------------------------------------------------- +IF (BUILD_TESTING) + ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/test ${HDF5_CPP_BINARY_DIR}/test) +ENDIF (BUILD_TESTING) diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt new file mode 100644 index 0000000..1a9602a --- /dev/null +++ b/c++/examples/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required (VERSION 2.8) +# -------------------------------------------------------------------- +# Notes: When creating examples they should be prefixed +# with "cpp_ex_". This allows for easier filtering of the examples. +# -------------------------------------------------------------------- + +PROJECT (HDF5_CPP_EXAMPLES) + +#----------------------------------------------------------------------------- +# Define examples +#----------------------------------------------------------------------------- + +SET (examples + create + readdata + writedata + compound + extend_ds + chunks + h5group +) + +FOREACH (example ${examples}) + ADD_EXECUTABLE (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) + H5_NAMING (cpp_ex_${example}) + TARGET_LINK_LIBRARIES (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) +ENDFOREACH (example ${examples}) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt new file mode 100644 index 0000000..3658e57 --- /dev/null +++ b/c++/src/CMakeLists.txt @@ -0,0 +1,113 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_CPP_SRC) + +#----------------------------------------------------------------------------- +# Shared/Static Libs +#----------------------------------------------------------------------------- +IF (BUILD_SHARED_LIBS) + SET (CPP_BUILT_AS_DYNAMIC_LIB 1) +ENDIF (BUILD_SHARED_LIBS) + +#----------------------------------------------------------------------------- +# Generate configure file +#----------------------------------------------------------------------------- +CONFIGURE_FILE (${HDF5_SOURCE_DIR}/Resources/H5cxx_config.h.in + ${HDF5_BINARY_DIR}/H5cxx_pubconf.h +) + +#----------------------------------------------------------------------------- +# Define cpp Library +#----------------------------------------------------------------------------- +SET (CPP_SRCS + ${HDF5_CPP_SOURCE_DIR}/src/H5AbstractDs.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5ArrayType.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5AtomType.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5Attribute.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5CommonFG.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5CompType.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5DataSet.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5DataSpace.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5DataType.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5DcreatProp.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5DxferProp.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5EnumType.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5Exception.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5FaccProp.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5FcreatProp.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5File.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5FloatType.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5Group.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5IdComponent.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5IntType.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5Library.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5Object.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5PredType.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5PropList.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5StrType.cpp + ${HDF5_CPP_SOURCE_DIR}/src/H5VarLenType.cpp +) + +SET (CPP_HDRS + ${HDF5_CPP_SOURCE_DIR}/src/H5AbstractDs.h + ${HDF5_CPP_SOURCE_DIR}/src/H5Alltypes.h + ${HDF5_CPP_SOURCE_DIR}/src/H5ArrayType.h + ${HDF5_CPP_SOURCE_DIR}/src/H5AtomType.h + ${HDF5_CPP_SOURCE_DIR}/src/H5Attribute.h + ${HDF5_CPP_SOURCE_DIR}/src/H5Classes.h + ${HDF5_CPP_SOURCE_DIR}/src/H5CommonFG.h + ${HDF5_CPP_SOURCE_DIR}/src/H5CompType.h + ${HDF5_CPP_SOURCE_DIR}/src/H5Cpp.h + ${HDF5_CPP_SOURCE_DIR}/src/H5CppDoc.h + ${HDF5_CPP_SOURCE_DIR}/src/H5DataSet.h + ${HDF5_CPP_SOURCE_DIR}/src/H5DataSpace.h + ${HDF5_CPP_SOURCE_DIR}/src/H5DataType.h + ${HDF5_CPP_SOURCE_DIR}/src/H5DcreatProp.h + ${HDF5_CPP_SOURCE_DIR}/src/H5DxferProp.h + ${HDF5_CPP_SOURCE_DIR}/src/H5EnumType.h + ${HDF5_CPP_SOURCE_DIR}/src/H5Exception.h + ${HDF5_CPP_SOURCE_DIR}/src/H5FaccProp.h + ${HDF5_CPP_SOURCE_DIR}/src/H5FcreatProp.h + ${HDF5_CPP_SOURCE_DIR}/src/H5File.h + ${HDF5_CPP_SOURCE_DIR}/src/H5FloatType.h + ${HDF5_CPP_SOURCE_DIR}/src/H5Group.h + ${HDF5_CPP_SOURCE_DIR}/src/H5IdComponent.h + ${HDF5_CPP_SOURCE_DIR}/src/H5Include.h + ${HDF5_CPP_SOURCE_DIR}/src/H5IntType.h + ${HDF5_CPP_SOURCE_DIR}/src/H5Library.h + ${HDF5_CPP_SOURCE_DIR}/src/H5Object.h + ${HDF5_CPP_SOURCE_DIR}/src/H5PredType.h + ${HDF5_CPP_SOURCE_DIR}/src/H5PropList.h + ${HDF5_CPP_SOURCE_DIR}/src/H5StrType.h + ${HDF5_CPP_SOURCE_DIR}/src/H5VarLenType.h +) + +ADD_LIBRARY (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} ${CPP_SRCS} ${CPP_HDRS}) +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}) + +#----------------------------------------------------------------------------- +# Add file(s) to CMake Install +#----------------------------------------------------------------------------- +INSTALL ( + FILES + ${CPP_HDRS} + DESTINATION + include/cpp +) + +#----------------------------------------------------------------------------- +# Add Target(s) to CMake Install for import into other projects +#----------------------------------------------------------------------------- +IF (HDF5_EXPORTED_TARGETS) + INSTALL ( + TARGETS + ${HDF5_CPP_LIB_TARGET} + EXPORT + ${HDF5_EXPORTED_TARGETS} + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin + ) +ENDIF (HDF5_EXPORTED_TARGETS) + diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt new file mode 100644 index 0000000..ac72772 --- /dev/null +++ b/c++/test/CMakeLists.txt @@ -0,0 +1,47 @@ +cmake_minimum_required (VERSION 2.8) +# -------------------------------------------------------------------- +# Notes: When creating unit test executables they should be prefixed +# with "cpp_". This allows for easier filtering of the test suite when +# using ctest. An example would be +# ctest -R cpp_ +# which would only run the C++ based unit tests. +# -------------------------------------------------------------------- + +PROJECT (HDF5_CPP_TEST) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- +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 + ${HDF5_CPP_TEST_SOURCE_DIR}/tfile.cpp + ${HDF5_CPP_TEST_SOURCE_DIR}/tfilter.cpp + ${HDF5_CPP_TEST_SOURCE_DIR}/th5s.cpp + ${HDF5_CPP_TEST_SOURCE_DIR}/tlinks.cpp + ${HDF5_CPP_TEST_SOURCE_DIR}/trefer.cpp + ${HDF5_CPP_TEST_SOURCE_DIR}/ttypes.cpp + ${HDF5_CPP_TEST_SOURCE_DIR}/tvlstr.cpp + ${HDF5_CPP_TEST_SOURCE_DIR}/dsets.cpp + ${HDF5_CPP_TEST_SOURCE_DIR}/h5cpputil.cpp +) + +#----------------------------------------------------------------------------- +# 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}) + +INCLUDE_DIRECTORIES (${HDF5_TEST_SOURCE_DIR} ) + +ADD_EXECUTABLE (cpp_testhdf5 ${CPP_TEST_SRCS} ) +H5_NAMING (cpp_testhdf5) +TARGET_LINK_LIBRARIES (cpp_testhdf5 + ${HDF5_CPP_LIB_TARGET} + ${HDF5_LIB_TARGET} + ${HDF5_TEST_LIB_TARGET} +) + +ADD_TEST (NAME cpp_testhdf5 COMMAND $) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 0000000..fdd3f80 --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_EXAMPLES) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- +SET (examples + h5_write + h5_read + h5_extend_write + h5_chunk_read + h5_compound + h5_group + h5_select + h5_attribute + h5_mount + h5_reference + h5_drivers + h5_ref2reg + h5_extlink + h5_elink_unix2win + h5_shared_mesg +) + +FOREACH (example ${examples}) + ADD_EXECUTABLE (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) + H5_NAMING (${example}) + TARGET_LINK_LIBRARIES (${example} ${HDF5_LIB_TARGET}) +ENDFOREACH (example ${examples}) + +IF (H5_HAVE_PARALLEL) + ADD_EXECUTABLE (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) + H5_NAMING (ph5example) + TARGET_LINK_LIBRARIES (ph5example ${HDF5_LIB_TARGET}) +ENDIF (H5_HAVE_PARALLEL) diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt new file mode 100644 index 0000000..a649fab --- /dev/null +++ b/fortran/CMakeLists.txt @@ -0,0 +1,142 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_F90 C CXX Fortran) + +#----------------------------------------------------------------------------- +# Detect name mangling convention used between Fortran and C +#----------------------------------------------------------------------------- +INCLUDE (FortranCInterface) +FortranCInterface_HEADER ( + ${HDF5_F90_BINARY_DIR}/FCMangle.h + MACRO_NAMESPACE "H5_FC_" + SYMBOL_NAMESPACE "H5_FC_" + SYMBOLS mysub mymod:my_sub +) + +FILE (STRINGS ${HDF5_F90_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}" PARENT_SCOPE) + +FILE (STRINGS ${HDF5_F90_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}" PARENT_SCOPE) + +#----------------------------------------------------------------------------- +# 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 + "-DLINK_LIBRARIES:STRING=${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}" + ) + TRY_COMPILE (${VARIABLE} + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f + CMAKE_FLAGS "${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}" + OUTPUT_VARIABLE OUTPUT + ) + +# MESSAGE ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") +# MESSAGE ( "Test result ${OUTPUT}") +# MESSAGE ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + + 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}") + 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}) +ENDMACRO (CHECK_FORTRAN_FEATURE) + +#----------------------------------------------------------------------------- +# Configure Checks which require Fortran compilation must go in here +# not in the main ConfigureChecks.cmake files, because if the user has +# no Fortran compiler, problems arise. +# +# Be careful with leading spaces here, do not remove them. +#----------------------------------------------------------------------------- +CHECK_FORTRAN_FEATURE(sizeof + " + PROGRAM main + i = sizeof(x) + END PROGRAM + " + FORTRAN_HAVE_SIZEOF +) + +CHECK_FORTRAN_FEATURE(RealIsNotDouble + " + MODULE type_mod + INTERFACE h5t + MODULE PROCEDURE h5t_real + MODULE PROCEDURE h5t_dble + END INTERFACE + CONTAINS + SUBROUTINE h5t_real(r) + REAL :: r + END SUBROUTINE h5t_real + SUBROUTINE h5t_dble(d) + DOUBLE PRECISION :: d + END SUBROUTINE h5t_dble + END MODULE type_mod + PROGRAM main + USE type_mod + REAL :: r + DOUBLE PRECISION :: d + CALL h5t(r) + CALL h5t(d) + END PROGRAM main + " + FORTRAN_DEFAULT_REAL_NOT_DOUBLE +) + +#----------------------------------------------------------------------------- +# Make sure generated files and modules are picked up correctly +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES( + ${CMAKE_Fortran_MODULE_DIRECTORY} + ${HDF5_F90_BINARY_DIR} + ) + +#----------------------------------------------------------------------------- +# Traverse source subdirectory +#----------------------------------------------------------------------------- +ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/src ${HDF5_F90_BINARY_DIR}/src) + +#----------------------------------------------------------------------------- +# When building utility executables we reuse these variables +#----------------------------------------------------------------------------- +#inherit EXE_EXT from parent HDF5 cmake project +#inherit MAKE_SYSTEM from parent HDF5 cmake project +#inherit CFG_INIT from parent HDF5 cmake project + +#----------------------------------------------------------------------------- +# Build the Fortran Examples +#----------------------------------------------------------------------------- +IF (HDF5_BUILD_EXAMPLES) + ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/examples ${HDF5_F90_BINARY_DIR}/examples) +ENDIF (HDF5_BUILD_EXAMPLES) + +#----------------------------------------------------------------------------- +# Testing +#----------------------------------------------------------------------------- +IF (BUILD_TESTING) + ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/test ${HDF5_F90_BINARY_DIR}/test) +ENDIF (BUILD_TESTING) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt new file mode 100644 index 0000000..00b76a4 --- /dev/null +++ b/fortran/examples/CMakeLists.txt @@ -0,0 +1,61 @@ +cmake_minimum_required (VERSION 2.8) +# -------------------------------------------------------------------- +# Notes: When creating examples they should be prefixed +# with "f90_ex_". This allows for easier filtering of the examples. +# -------------------------------------------------------------------- +PROJECT (HDF5_F90_EXAMPLES C CXX Fortran) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SOURCE_DIR}/src) +LINK_DIRECTORIES ( + ${CMAKE_Fortran_MODULE_DIRECTORY} + ${HDF5_F90_BINARY_DIR} + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} +) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- +SET (examples + dsetexample + fileexample + rwdsetexample + attrexample + groupexample + grpsexample + grpdsetexample + hyperslab + selectele + grpit + refobjexample + refregexample + mountexample + compound +) + +FOREACH (example ${examples}) + ADD_EXECUTABLE (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) + H5_NAMING (f90_ex_${example}) + IF (WIN32) + IF (BUILD_SHARED_LIBS) + IF (MSVC) + SET_TARGET_PROPERTIES (f90_ex_${example} + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ENDIF (MSVC) + ENDIF (BUILD_SHARED_LIBS) + SET_PROPERTY (TARGET f90_ex_${example} + APPEND PROPERTY COMPILE_DEFINITIONS + HDF5F90_WINDOWS + ) + SET_TARGET_PROPERTIES (f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) + ENDIF (WIN32) + TARGET_LINK_LIBRARIES (f90_ex_${example} + ${HDF5_F90_LIB_TARGET} + ${HDF5_LIB_TARGET} + ) +ENDFOREACH (example ${examples}) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt new file mode 100644 index 0000000..dc68891 --- /dev/null +++ b/fortran/src/CMakeLists.txt @@ -0,0 +1,229 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_F90_SRC C CXX Fortran) + +#----------------------------------------------------------------------------- +# When building utility executables that generate other (source) files : +# we make use of the following variables defined in the root CMakeLists. +# Certain systems may add /Debug or /Release to output paths +# and we need to call the executable from inside the CMake configuration +#----------------------------------------------------------------------------- +#inherit EXE_EXT from parent HDF5 cmake project +#inherit CFG_INIT from parent HDF5 cmake project + +#----------------------------------------------------------------------------- +# Setup the Fortran auto-detection utilities +# H5test_kind(_SIZEOF).f90 used to generate H5fortran_detect.f90 +# 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 + ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind_SIZEOF.f90 + ) +ELSE (FORTRAN_HAVE_SIZEOF) + ADD_EXECUTABLE (H5test_FortranHavekind + ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind.f90 + ) +ENDIF (FORTRAN_HAVE_SIZEOF) +IF (WIN32) + IF (MSVC) + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (H5test_FortranHavekind + PROPERTIES + COMPILE_FLAGS "/MT" + ) + ENDIF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (H5test_FortranHavekind + PROPERTIES + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ENDIF (MSVC) +ENDIF (WIN32) +SET_TARGET_PROPERTIES (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran) + +SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5test_FortranHavekind${EXE_EXT}) +ADD_CUSTOM_COMMAND ( + OUTPUT ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 + COMMAND ${CMD} + ARGS > ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} + DEPENDS H5test_FortranHavekind +) +#----------------------------------------------------------------------------- +ADD_EXECUTABLE (H5fortran_detect + ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 +) +IF (WIN32) + IF (MSVC) + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (H5fortran_detect + PROPERTIES + COMPILE_FLAGS "/MT" + ) + ENDIF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (H5fortran_detect + PROPERTIES + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ENDIF (MSVC) +ENDIF (WIN32) +SET_TARGET_PROPERTIES (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran) + +SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5fortran_detect${EXE_EXT}) +ADD_CUSTOM_COMMAND ( + OUTPUT ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h + COMMAND ${CMD} + ARGS > ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} + DEPENDS H5fortran_detect +) + +#----------------------------------------------------------------------------- +ADD_EXECUTABLE (H5match_types + ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h + ${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c +) +SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5match_types${EXE_EXT}) +ADD_CUSTOM_COMMAND ( + OUTPUT ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h + ${HDF5_F90_BINARY_DIR}/H5fortran_types.f90 + COMMAND ${CMD} + WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR} + DEPENDS H5match_types +) + +#----------------------------------------------------------------------------- +# f90CStub lib +#----------------------------------------------------------------------------- +SET (f90CStub_C_SRCS + # generated files + ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h + + # normal distribution + ${HDF5_F90_SRC_SOURCE_DIR}/H5f90kit.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5_f.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Af.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Df.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Ef.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Ff.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Gf.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5If.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Lf.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Of.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Pf.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Rf.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Sf.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Tf.c + ${HDF5_F90_SRC_SOURCE_DIR}/H5Zf.c +) + +IF (H5_HAVE_PARALLEL) + SET (f90CStub_C_SRCS + ${f90CStub_C_SRCS} + ${HDF5_F90_SRC_SOURCE_DIR}/H5FDmpiof.c + ) +ENDIF (H5_HAVE_PARALLEL) + +SET_SOURCE_FILES_PROPERTIES (${f90CStub_C_SRCS} PROPERTIES LANGUAGE C) + +ADD_LIBRARY (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} ${f90CStub_C_SRCS}) +TARGET_LINK_LIBRARIES (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET}) +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}) + +#----------------------------------------------------------------------------- +# Fortran Real Size +#----------------------------------------------------------------------------- +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) + # default real is 8 bytes, so exclude double signatures + SET (F_DBLE "Exclude") +ENDIF (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) + +#----------------------------------------------------------------------------- +# Fortran Modules +#----------------------------------------------------------------------------- +SET (f90_F_SRCS + # generated files + ${HDF5_F90_BINARY_DIR}/H5fortran_types.f90 + + # normal distribution + ${HDF5_F90_SRC_SOURCE_DIR}/H5f90global.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5_ff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Aff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Dff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Eff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Fff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Gff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Iff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Lff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Off.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Pff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Rff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Sff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Tff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Zff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5_DBLE_Interface${F_DBLE}.f90 +) + +#----------------------------------------------------------------------------- +# Add H5FDMPIO if parallel +#----------------------------------------------------------------------------- +IF (H5_HAVE_PARALLEL) + 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) + SET (f90_F_SRCS + ${f90_F_SRCS} + ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.f90 + ) +ENDIF (H5_HAVE_PARALLEL) + +#----------------------------------------------------------------------------- +# Add Main fortran library +#----------------------------------------------------------------------------- +ADD_LIBRARY (${HDF5_F90_LIB_TARGET} ${LIB_TYPE} ${f90_F_SRCS}) +IF (WIN32) + IF (BUILD_SHARED_LIBS) + SET_PROPERTY (TARGET ${HDF5_F90_LIB_TARGET} + APPEND PROPERTY COMPILE_DEFINITIONS + BUILD_HDF5_DLL + ) + IF (MSVC) + SET_TARGET_PROPERTIES (${HDF5_F90_LIB_TARGET} + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE /DLL /DEF:${HDF5_F90_SRC_SOURCE_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) +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}) +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}) + +#----------------------------------------------------------------------------- +# Add Target(s) to CMake Install for import into other projects +#----------------------------------------------------------------------------- +IF (HDF5_EXPORTED_TARGETS) + INSTALL ( + TARGETS + ${HDF5_F90_C_LIB_TARGET} + ${HDF5_F90_LIB_TARGET} + EXPORT + ${HDF5_EXPORTED_TARGETS} + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin + ) +ENDIF (HDF5_EXPORTED_TARGETS) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt new file mode 100644 index 0000000..ec75c95 --- /dev/null +++ b/fortran/test/CMakeLists.txt @@ -0,0 +1,175 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SOURCE_DIR}/src) +LINK_DIRECTORIES ( + ${CMAKE_Fortran_MODULE_DIRECTORY} + ${HDF5_F90_BINARY_DIR} + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} +) + +#----------------------------------------------------------------------------- +# Add Test Lib +#----------------------------------------------------------------------------- +ADD_LIBRARY (${HDF5_F90_C_TEST_LIB_TARGET} ${LIB_TYPE} t.c) +# Must explicity add a dependency here to force the generation of headers +# which are created for ${HDF5_F90_C_LIB_TARGET} +#ADD_DEPENDENCIES(${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_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}) + +ADD_LIBRARY (${HDF5_F90_TEST_LIB_TARGET} ${LIB_TYPE} tf.f90) +# Must explicity add a dependency here to force the generation of headers +# which are created for ${HDF5_F90_C_LIB_TARGET} +ADD_DEPENDENCIES(${HDF5_F90_TEST_LIB_TARGET} + ${HDF5_F90_C_TEST_LIB_TARGET} +) +IF (WIN32) + IF (BUILD_SHARED_LIBS) + SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} + APPEND PROPERTY COMPILE_DEFINITIONS + BUILD_HDF5_DLL + ) + IF (MSVC) + SET_TARGET_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE /DLL" + ) + ENDIF (MSVC) + ENDIF (BUILD_SHARED_LIBS) + SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} + APPEND PROPERTY COMPILE_DEFINITIONS + HDF5F90_WINDOWS + ) +ENDIF (WIN32) +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}) +H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_TEST_LIB_NAME} ${LIB_TYPE}) + +#----------------------------------------------------------------------------- +# Add Tests +#----------------------------------------------------------------------------- + +#-- Adding test for testhdf5_fortran +ADD_EXECUTABLE (testhdf5_fortran + fortranlib_test.f90 + tH5A.f90 + tH5D.f90 + tH5E.f90 + tH5F.f90 + tH5G.f90 + tH5I.f90 + tH5P.f90 + tH5R.f90 + tH5S.f90 + tH5Sselect.f90 + tH5T.f90 + tH5VL.f90 + tH5Z.f90 +) +H5_NAMING (testhdf5_fortran) +TARGET_LINK_LIBRARIES (testhdf5_fortran + ${HDF5_F90_TEST_LIB_TARGET} + ${HDF5_F90_LIB_TARGET} + ${HDF5_LIB_TARGET} +) +IF (WIN32) + IF (MSVC) + TARGET_LINK_LIBRARIES (testhdf5_fortran "ws2_32.lib") + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (testhdf5_fortran + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +SET_TARGET_PROPERTIES (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran) + +ADD_TEST (NAME testhdf5_fortran COMMAND $) + +#-- Adding test for testhdf5_fortran_1_8 +ADD_EXECUTABLE (testhdf5_fortran_1_8 + fortranlib_test_1_8.f90 + tH5F.f90 + tH5O.f90 + tH5A_1_8.f90 + tH5G_1_8.f90 +) +H5_NAMING (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) + IF (MSVC) + TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8 "ws2_32.lib") + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (testhdf5_fortran_1_8 + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +SET_TARGET_PROPERTIES (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran) + +ADD_TEST (NAME testhdf5_fortran_1_8 COMMAND $) + +#-- Adding test for fflush1 +ADD_EXECUTABLE (fflush1 fflush1.f90) +H5_NAMING (fflush1) +TARGET_LINK_LIBRARIES (fflush1 + ${HDF5_F90_LIB_TARGET} + ${HDF5_F90_TEST_LIB_TARGET} + ${HDF5_LIB_TARGET} +) +IF (WIN32) + IF (MSVC) + TARGET_LINK_LIBRARIES (fflush1 "ws2_32.lib") + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (fflush1 + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +SET_TARGET_PROPERTIES (fflush1 PROPERTIES LINKER_LANGUAGE Fortran) + +ADD_TEST (NAME fflush1 COMMAND $) + +#-- Adding test for fflush2 +ADD_EXECUTABLE (fflush2 fflush2.f90) +H5_NAMING (fflush2) +TARGET_LINK_LIBRARIES (fflush2 + ${HDF5_F90_TEST_LIB_TARGET} + ${HDF5_F90_LIB_TARGET} + ${HDF5_LIB_TARGET} +) +IF (WIN32) + IF (MSVC) + TARGET_LINK_LIBRARIES (fflush2 "ws2_32.lib") + IF (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (fflush2 + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) +SET_TARGET_PROPERTIES (fflush2 PROPERTIES LINKER_LANGUAGE Fortran) + +ADD_TEST (NAME fflush2 COMMAND $) diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt new file mode 100644 index 0000000..bc7c652 --- /dev/null +++ b/hl/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_HL) + +#----------------------------------------------------------------------------- +# Shared Libs +#----------------------------------------------------------------------------- +IF (BUILD_SHARED_LIBS) + SET (HL_BUILT_AS_DYNAMIC_LIB 1) +ENDIF (BUILD_SHARED_LIBS) + +#----------------------------------------------------------------------------- +# List Source files +#----------------------------------------------------------------------------- +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) + ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/tools ${HDF5_HL_BINARY_DIR}/tools) +ENDIF (HDF5_BUILD_TOOLS) + +#-- Add High Level Examples +IF (HDF5_BUILD_EXAMPLES) + ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/examples ${HDF5_HL_BINARY_DIR}/examples) +ENDIF (HDF5_BUILD_EXAMPLES) + +#-- Build the Unit testing if requested +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) + +#-- Build the High Level Fortran source codes +IF (HDF5_BUILD_FORTRAN) + ADD_SUBDIRECTORY (fortran) +ENDIF (HDF5_BUILD_FORTRAN) + +IF (HDF5_BUILD_CPP_LIB) + ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/c++ ${HDF5_HL_BINARY_DIR}/c++) +ENDIF (HDF5_BUILD_CPP_LIB) diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt new file mode 100644 index 0000000..15ae809 --- /dev/null +++ b/hl/c++/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_HL_CPP) + +#----------------------------------------------------------------------------- +# Main HL lib is in /src +#----------------------------------------------------------------------------- +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) + ADD_SUBDIRECTORY (${HDF5_HL_CPP_SOURCE_DIR}/examples ${HDF5_HL_CPP_BINARY_DIR}/examples) +ENDIF (HDF5_BUILD_EXAMPLES) + +# -------------------------------------------------------------------- +# Add in the unit tests for the packet table c++ wrapper +# -------------------------------------------------------------------- + +IF (BUILD_TESTING) + ADD_SUBDIRECTORY (${HDF5_HL_CPP_SOURCE_DIR}/test ${HDF5_HL_CPP_BINARY_DIR}/test) +ENDIF (BUILD_TESTING) diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt new file mode 100644 index 0000000..cbe2626 --- /dev/null +++ b/hl/c++/examples/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_HL_CPP_EXAMPLES) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SOURCE_DIR}/src) + +# -------------------------------------------------------------------- +# Add in the examples for the Packet Table codes +# -------------------------------------------------------------------- +IF (HDF5_BUILD_EXAMPLES) + ADD_EXECUTABLE (ptExampleFL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleFL.cpp) + H5_NAMING (ptExampleFL) + TARGET_LINK_LIBRARIES ( + ptExampleFL + ${HDF5_HL_CPP_LIB_TARGET} + ${HDF5_HL_LIB_TARGET} + ${HDF5_LIB_TARGET} + ) + + ADD_EXECUTABLE (ptExampleVL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleVL.cpp) + H5_NAMING (ptExampleVL) + TARGET_LINK_LIBRARIES ( + ptExampleVL + ${HDF5_HL_CPP_LIB_TARGET} + ${HDF5_HL_LIB_TARGET} + ${HDF5_LIB_TARGET} + ) +ENDIF (HDF5_BUILD_EXAMPLES) diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt new file mode 100644 index 0000000..889b716 --- /dev/null +++ b/hl/c++/src/CMakeLists.txt @@ -0,0 +1,44 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_HL_CPP_SRC) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- +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) +INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_SOURCE_DIR}) + +ADD_LIBRARY ( ${HDF5_HL_CPP_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_CPP_SRCS}) +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}") +H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_CPP_LIB_NAME} ${LIB_TYPE}) + +#----------------------------------------------------------------------------- +# Add file(s) to CMake Install +#----------------------------------------------------------------------------- +INSTALL ( + FILES + ${HDF5_HL_CPP_HDRS} + DESTINATION + include/hl/cpp +) + +#----------------------------------------------------------------------------- +# Add Target(s) to CMake Install for import into other projects +#----------------------------------------------------------------------------- +IF (HDF5_EXPORTED_TARGETS) + INSTALL ( + TARGETS + ${HDF5_HL_CPP_LIB_TARGET} + EXPORT + ${HDF5_EXPORTED_TARGETS} + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin + ) +ENDIF (HDF5_EXPORTED_TARGETS) diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt new file mode 100644 index 0000000..c0a94f8 --- /dev/null +++ b/hl/c++/test/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_HL_CPP_TEST) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SOURCE_DIR}/src) + +# -------------------------------------------------------------------- +# Add in the unit tests for the packet table c++ wrapper +# -------------------------------------------------------------------- + +IF (BUILD_TESTING) + INCLUDE_DIRECTORIES (${HDF5_TEST_SOURCE_DIR}) + INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/test) + INCLUDE_DIRECTORIES (${HDF5_CPP_SOURCE_DIR}/src) + + ADD_EXECUTABLE (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp) + H5_NAMING (hl_ptableTest) + TARGET_LINK_LIBRARIES ( + hl_ptableTest + ${HDF5_LIB_TARGET} + ${HDF5_TEST_LIB_TARGET} + ${HDF5_CPP_LIB_TARGET} + ${HDF5_HL_LIB_TARGET} + ${HDF5_HL_CPP_LIB_TARGET} + ) + GET_TARGET_PROPERTY (hl_ptableTestpath hl_ptableTest LOCATION) + GET_FILENAME_COMPONENT (hl_ptableTestexe ${hl_ptableTestpath} NAME) + + ADD_TEST (NAME hl_ptableTest COMMAND $) +ENDIF (BUILD_TESTING) diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt new file mode 100644 index 0000000..934856a --- /dev/null +++ b/hl/examples/CMakeLists.txt @@ -0,0 +1,36 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_HL_EXAMPLES ) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- +SET (examples + ex_lite1 + ex_lite2 + ex_lite3 + ptExampleFL + ptExampleVL + ex_image1 + ex_image2 + ex_table_01 + ex_table_02 + ex_table_03 + ex_table_04 + ex_table_05 + ex_table_06 + ex_table_07 + ex_table_08 + ex_table_09 + ex_table_10 + ex_table_11 + ex_table_12 + ex_ds1 +) + +FOREACH (example ${examples}) + ADD_EXECUTABLE (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c) + H5_NAMING (hl_ex_${example}) + TARGET_LINK_LIBRARIES (hl_ex_${example} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) +ENDFOREACH (example ${examples}) + + diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt new file mode 100644 index 0000000..1be4012 --- /dev/null +++ b/hl/fortran/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT(HDF5_HL_F90 C CXX Fortran) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_F90_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR}) +INCLUDE_DIRECTORIES (${HDF5_F90_SRC_BINARY_DIR}) +INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY}) + +LINK_DIRECTORIES (${HDF5_SRC_DIR} ${HDF5_FORTRAN_SOURCE_DIR} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) + +#----------------------------------------------------------------------------- +# List Source files +#----------------------------------------------------------------------------- +ADD_SUBDIRECTORY (${HDF5_HL_F90_SOURCE_DIR}/src ${HDF5_HL_F90_BINARY_DIR}/src) + +#----------------------------------------------------------------------------- +# Build the HL 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) + +#----------------------------------------------------------------------------- +# Testing +#----------------------------------------------------------------------------- +IF (BUILD_TESTING) + ADD_SUBDIRECTORY (${HDF5_HL_F90_SOURCE_DIR}/test ${HDF5_HL_F90_BINARY_DIR}/test) +ENDIF (BUILD_TESTING) diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt new file mode 100644 index 0000000..64fd9df --- /dev/null +++ b/hl/fortran/examples/CMakeLists.txt @@ -0,0 +1,39 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_HL_F90_EXAMPLES C CXX Fortran) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SOURCE_DIR}/src) +LINK_DIRECTORIES ( + ${CMAKE_Fortran_MODULE_DIRECTORY} + ${HDF5_HL_F90_BINARY_DIR} + ${HDF5_F90_BINARY_DIR} + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} +) + +SET (examples + exlite +) + +FOREACH (example ${examples}) + ADD_EXECUTABLE (hl_f90_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.f90) + H5_NAMING (hl_f90_ex_${example}) + IF (BUILD_SHARED_LIBS) + IF (WIN32) + IF (MSVC) + SET_TARGET_PROPERTIES (hl_f90_ex_${example} + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ENDIF (MSVC) + ENDIF (WIN32) + ENDIF (BUILD_SHARED_LIBS) + 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) +ENDFOREACH (example ${examples}) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt new file mode 100644 index 0000000..a967d54 --- /dev/null +++ b/hl/fortran/src/CMakeLists.txt @@ -0,0 +1,103 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT(HDF5_HL_F90_SRC C CXX Fortran) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_F90_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR}) +INCLUDE_DIRECTORIES (${HDF5_F90_SRC_BINARY_DIR}) + +INCLUDE_DIRECTORIES (${HDF5_HL_F90_SRC_SOURCE_DIR}) +INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/src) + +INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SOURCE_DIR}/src) +LINK_DIRECTORIES ( + ${CMAKE_Fortran_MODULE_DIRECTORY} + ${HDF5_HL_F90_BINARY_DIR} + ${HDF5_F90_BINARY_DIR} + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} +) +#----------------------------------------------------------------------------- +# List Source files +#----------------------------------------------------------------------------- +#MESSAGE ("Fortran source is in ${HDF5_F90_SOURCE_DIR}/src ") + + +SET (HDF5_HL_F90_F_SRCS + ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5TBff.f90 + ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTff.f90 + ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMff.f90 +) + +SET (HDF5_HL_F90_C_SRCS + ${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 (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}) +TARGET_LINK_LIBRARIES (${HDF5_HL_F90_C_LIB_TARGET} + ${HDF5_F90_C_LIB_TARGET} + ${HDF5_HL_LIB_TARGET} +) +# +# To Ensure that generated files are built, we must force a dependency +# +ADD_DEPENDENCIES(${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_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}) + +ADD_LIBRARY (${HDF5_HL_F90_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_F_SRCS}) +IF (BUILD_SHARED_LIBS) + IF (WIN32) + SET_PROPERTY (TARGET ${HDF5_HL_F90_LIB_TARGET} + APPEND PROPERTY COMPILE_DEFINITIONS + BUILD_HDF5_DLL + ) + IF (MSVC) + SET_TARGET_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE /DLL" + ) + ENDIF (MSVC) + ENDIF (WIN32) +ENDIF (BUILD_SHARED_LIBS) +IF (WIN32) + SET_PROPERTY (TARGET ${HDF5_HL_F90_LIB_TARGET} + APPEND PROPERTY COMPILE_DEFINITIONS + HDF5F90_WINDOWS + ) + SET_TARGET_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) +ENDIF (WIN32) +SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT + "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}" +) +TARGET_LINK_LIBRARIES (${HDF5_HL_F90_LIB_TARGET} + ${HDF5_HL_F90_C_LIB_TARGET} +) +H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} ${LIB_TYPE}) +ADD_DEPENDENCIES (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_C_LIB_TARGET}) + +#----------------------------------------------------------------------------- +# Add Target(s) to CMake Install for import into other projects +#----------------------------------------------------------------------------- +IF (HDF5_EXPORTED_TARGETS) + INSTALL ( + TARGETS + ${HDF5_HL_F90_C_LIB_TARGET} + ${HDF5_HL_F90_LIB_TARGET} + EXPORT + ${HDF5_EXPORTED_TARGETS} + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin + ) +ENDIF (HDF5_EXPORTED_TARGETS) diff --git a/hl/fortran/src/H5IMcc.h b/hl/fortran/src/H5IMcc.h index 9f70bac..0b8a345 100644 --- a/hl/fortran/src/H5IMcc.h +++ b/hl/fortran/src/H5IMcc.h @@ -18,7 +18,7 @@ #include "H5LTprivate.h" #include "H5IMprivate.h" -#include "../../fortran/src/H5f90i_gen.h" +#include "H5f90i_gen.h" #ifdef __cplusplus extern "C" { diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt new file mode 100644 index 0000000..41cb675 --- /dev/null +++ b/hl/fortran/test/CMakeLists.txt @@ -0,0 +1,70 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran) + +#----------------------------------------------------------------------------- +# Add Tests +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SOURCE_DIR}/src) +LINK_DIRECTORIES ( + ${CMAKE_Fortran_MODULE_DIRECTORY} + ${HDF5_HL_F90_BINARY_DIR} + ${HDF5_F90_BINARY_DIR} + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} +) + +#-- Adding test for hl_f90_tstlite +ADD_EXECUTABLE (hl_f90_tstlite tstlite.f90) +H5_NAMING (hl_f90_tstlite) +IF (BUILD_SHARED_LIBS) + IF (WIN32) + IF (MSVC) + SET_TARGET_PROPERTIES (hl_f90_tstlite + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ENDIF (MSVC) + ENDIF (WIN32) +ENDIF (BUILD_SHARED_LIBS) +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) + +ADD_TEST (NAME hl_f90_tstlite COMMAND $) + +#-- Adding test for hl_f90_tstimage +ADD_EXECUTABLE (hl_f90_tstimage tstimage.f90) +H5_NAMING (hl_f90_tstimage) +IF (BUILD_SHARED_LIBS) + IF (WIN32) + IF (MSVC) + SET_TARGET_PROPERTIES (hl_f90_tstimage + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ENDIF (MSVC) + ENDIF (WIN32) +ENDIF (BUILD_SHARED_LIBS) +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) + +ADD_TEST (NAME hl_f90_tstimage COMMAND $) + +#-- Adding test for hl_f90_tsttable +ADD_EXECUTABLE (hl_f90_tsttable tsttable.f90) +H5_NAMING (hl_f90_tsttable) +IF (BUILD_SHARED_LIBS) + IF (WIN32) + IF (MSVC) + SET_TARGET_PROPERTIES (hl_f90_tsttable + PROPERTIES + COMPILE_FLAGS "/dll" + LINK_FLAGS "/SUBSYSTEM:CONSOLE" + ) + ENDIF (MSVC) + ENDIF (WIN32) +ENDIF (BUILD_SHARED_LIBS) +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) + +ADD_TEST (NAME hl_f90_tsttable COMMAND $) diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt new file mode 100644 index 0000000..8773e50 --- /dev/null +++ b/hl/src/CMakeLists.txt @@ -0,0 +1,65 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_HL_SRC) + +#----------------------------------------------------------------------------- +# Shared Libs +#----------------------------------------------------------------------------- +IF (BUILD_SHARED_LIBS) + SET (HL_BUILT_AS_DYNAMIC_LIB 1) +ENDIF (BUILD_SHARED_LIBS) + +#----------------------------------------------------------------------------- +# List Source files +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/src) + +SET (HL_SRCS + ${HDF5_HL_SRC_SOURCE_DIR}/H5DS.c + ${HDF5_HL_SRC_SOURCE_DIR}/H5IM.c + ${HDF5_HL_SRC_SOURCE_DIR}/H5LT.c + ${HDF5_HL_SRC_SOURCE_DIR}/H5LTanalyze.c + ${HDF5_HL_SRC_SOURCE_DIR}/H5LTparse.c + ${HDF5_HL_SRC_SOURCE_DIR}/H5PT.c + ${HDF5_HL_SRC_SOURCE_DIR}/H5TB.c +) + +SET (HL_HEADERS + ${HDF5_HL_SRC_SOURCE_DIR}/H5DSpublic.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5IMpublic.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5LTparse.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5LTpublic.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5PTpublic.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5TBpublic.h + ${HDF5_HL_SRC_SOURCE_DIR}/hdf5_hl.h +) + +ADD_LIBRARY (${HDF5_HL_LIB_TARGET} ${LIB_TYPE} ${HL_SRCS} ${HL_HEADERS}) +SET_TARGET_PROPERTIES(${HDF5_HL_LIB_TARGET} PROPERTIES DEFINE_SYMBOL ${HDF5_HL_LIB_CORENAME}_EXPORTS) +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}") +H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} ${LIB_TYPE}) + +#----------------------------------------------------------------------------- +# Add file(s) to CMake Install +#----------------------------------------------------------------------------- +INSTALL ( + FILES + ${HL_HEADERS} + DESTINATION + include +) + +#----------------------------------------------------------------------------- +# Add Target(s) to CMake Install for import into other projects +#----------------------------------------------------------------------------- +IF (HDF5_EXPORTED_TARGETS) + INSTALL ( + TARGETS + ${HDF5_HL_LIB_TARGET} + EXPORT + ${HDF5_EXPORTED_TARGETS} + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin + ) +ENDIF (HDF5_EXPORTED_TARGETS) diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt new file mode 100644 index 0000000..8397417 --- /dev/null +++ b/hl/test/CMakeLists.txt @@ -0,0 +1,67 @@ +cmake_minimum_required (VERSION 2.8) +# -------------------------------------------------------------------- +# Notes: When creating unit test executables they should be prefixed +# with "hl_". This allows for easier filtering of the test suite when +# using ctest. An example would be +# ctest -R hl_ +# which would only run the High Level based unit tests. +# -------------------------------------------------------------------- + +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) + +INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) +INCLUDE_DIRECTORIES (${HDF5_TEST_SOURCE_DIR}) + +# -------------------------------------------------------------------- +# Macro used to add a unit test +# -------------------------------------------------------------------- +MACRO (HL_ADD_TEST hl_name files) + ADD_EXECUTABLE (hl_${hl_name} ${hl_name}.c) + H5_NAMING (hl_${hl_name}) + TARGET_LINK_LIBRARIES (hl_${hl_name} + ${HDF5_HL_LIB_TARGET} + ${HDF5_LIB_TARGET} + ${HDF5_TEST_LIB_TARGET} + ) + + ADD_TEST (NAME hl_${hl_name} COMMAND $) + + #-- 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 ( + 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}) +ENDMACRO (HL_ADD_TEST) + +HL_ADD_TEST (test_ds "dsdata.txt;dslat.txt;dslon.txt;test_ds_be.h5;test_ds_le.h5") +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.hdf5;test_table_cray.hdf5;test_table_le.hdf5") + +# -------------------------------------------------------------------- +# 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 (NOT BUILD_SHARED_LIBS) + ADD_EXECUTABLE (hl_gen_test_ds gen_test_ds.c) + H5_NAMING (hl_gen_test_ds) + TARGET_LINK_LIBRARIES (hl_gen_test_ds + ${HDF5_HL_LIB_TARGET} + ${HDF5_LIB_TARGET} + ${HDF5_TEST_LIB_TARGET} + ) +ENDIF (NOT BUILD_SHARED_LIBS) diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt new file mode 100644 index 0000000..5730205 --- /dev/null +++ b/hl/tools/CMakeLists.txt @@ -0,0 +1,55 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_HL_TOOLS) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- +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 + ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/gif2mem.c + ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/gifread.c + ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/writehdf.c +) + +#-- Add gif2hdf5 program +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5) + +ADD_EXECUTABLE (gif2h5 ${GIF2H5_SRCS}) +H5_NAMING (gif2h5) +TARGET_LINK_LIBRARIES (gif2h5 ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + +#-- Add h52gif program +SET (hdf2gif_SRCS + ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/hdf2gif.c + ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/hdfgifwr.c +) +ADD_EXECUTABLE (hdf2gif ${hdf2gif_SRCS}) +H5_NAMING (hdf2gif) +TARGET_LINK_LIBRARIES (hdf2gif ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + +# -------------------------------------------------------------------- +# 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 (NOT BUILD_SHARED_LIBS) + ADD_EXECUTABLE (hl_h52gifgentest ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/h52gifgentst.c) + H5_NAMING (hl_h52gifgentest) + TARGET_LINK_LIBRARIES (hl_h52gifgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) + +# ADD_TEST (NAME hl_h52gifgentest COMMAND $) +ENDIF (NOT BUILD_SHARED_LIBS) + +#----------------------------------------------------------------------------- +# Add file(s) to CMake Install +#----------------------------------------------------------------------------- +INSTALL ( + TARGETS + gif2h5 + hdf2gif + RUNTIME DESTINATION + bin/tools +) diff --git a/perform/CMakeLists.txt b/perform/CMakeLists.txt new file mode 100644 index 0000000..57cda13 --- /dev/null +++ b/perform/CMakeLists.txt @@ -0,0 +1,74 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_PERFORM ) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TEST_SOURCE_DIR}) +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib ) + +#----------------------------------------------------------------------------- +# Add Tests +#----------------------------------------------------------------------------- + +#-- Adding test for h5perf_serial +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}) +H5_NAMING (h5perf_serial) +TARGET_LINK_LIBRARIES (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + +ADD_TEST (NAME h5perf_serial COMMAND $) + +#-- Adding test for chunk +SET (chunk_SRCS + ${HDF5_PERFORM_SOURCE_DIR}/chunk.c +) +ADD_EXECUTABLE(chunk ${chunk_SRCS}) +H5_NAMING (chunk) +TARGET_LINK_LIBRARIES(chunk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + +ADD_TEST (NAME chunk COMMAND $) + +#-- Adding test for iopipe +SET (iopipe_SRCS + ${HDF5_PERFORM_SOURCE_DIR}/iopipe.c +) +ADD_EXECUTABLE (iopipe ${iopipe_SRCS}) +H5_NAMING (iopipe) +TARGET_LINK_LIBRARIES (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + +ADD_TEST (NAME iopipe COMMAND $) + +#-- Adding test for overhead +SET (overhead_SRCS + ${HDF5_PERFORM_SOURCE_DIR}/overhead.c +) +ADD_EXECUTABLE (overhead ${overhead_SRCS}) +H5_NAMING (overhead) +TARGET_LINK_LIBRARIES (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + +ADD_TEST (NAME overhead COMMAND $) + +#-- Adding test for perf_meta +SET (perf_meta_SRCS + ${HDF5_PERFORM_SOURCE_DIR}/perf_meta.c +) +ADD_EXECUTABLE (perf_meta ${perf_meta_SRCS}) +H5_NAMING (perf_meta) +TARGET_LINK_LIBRARIES (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + +ADD_TEST (NAME perf_meta COMMAND $) + +#-- Adding test for zip_perf +SET (zip_perf_SRCS + ${HDF5_PERFORM_SOURCE_DIR}/zip_perf.c +) +ADD_EXECUTABLE (zip_perf ${zip_perf_SRCS}) +H5_NAMING (zip_perf) +TARGET_LINK_LIBRARIES (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +ADD_TEST (NAME zip_perf COMMAND $ "-h") diff --git a/release_docs/CMake_Windows.TXT b/release_docs/CMake_Windows.TXT new file mode 100755 index 0000000..c6ec38e --- /dev/null +++ b/release_docs/CMake_Windows.TXT @@ -0,0 +1,95 @@ +************************************************************************ +* Build and Install HDF5 C/C++ Library with CMake on Windows * +************************************************************************ + +Notes: This short instruction is written for users who want to quickly build + HDF5 library and tools from the HDF5 source code package using the CMake + tools on Windows with the Visual Studio product. + + For detailed HDF5 build and install information, or if you have trouble + following any steps in the instructions, please refer to + INSTALL_Windows.txt for further information. + + For users who would like to build and test HDF5 package from the + command line, please refer to INSTALL_Windows_From_Command_Line.txt. + + Notes: + + 1. CMake is being introduced in this release as early-access. While we + have attempted to provide error-free files, please understand that + this development with CMake has just began. + + 2. Testing of some tools have issues. + The following are failing sometimes on windows + hl_test_ds + + +======================================================================== + Preconditions +======================================================================== + + 1. We suggest you obtain the latest CMake for windows from the Kitware + web site. The HDF5 1.8.x product requires CMake version 2.8. + + If you plan to use Zlib or Szip, download the packages and install them + in a central location. For example, create a folder extlibs and install + the packages there. You should also read Section V in INSTALL_Windows.txt. + +======================================================================== + Building HDF5 C/C++ Libraries with CMake +======================================================================== + + 1. Run CMake + + The CMake executable is name "cmake-gui.exe" and should be available in + your Start menu. Specify the source and build directories. It is + recommemded that you choose a build directory different then the source + directory (for example, if the source is at c:\MyHDFstuff\hdf5, then + use c:\MyHDFstuff\hdf5\build or c:\MyHDFstuff\build\hdf5). + + 2. Configure the cache settings + + Click the Configure button. If this is the first time you are + running cmake-gui in this directory, you will be prompted for the + generator you wish to use (for example, Visual Studio 9 2008). CMake + will read in the CMakeLists.txt files from the source directory and + display options for the HDF5 project. After the first configure you + can adjust the cache settings and/or specify locations of other programs. + Any conflicts or new values will be highlighted by the configure + process in red. Once you are happy with all the settings, click the + Generate button to produce the appropriate build files (if you are using + a Visual Studio generator, solution and project files will be created). + + + 3. Build HDF5 + + You can build HDF5 using either the Visual Studio Environment or the command line. + + 3.1 If you wish to use the Visual Studio environment, open the solution file + in your build directory. + + 3.2 To build from the command line, navigate to your build directory and + execute the following; + + cmake --build . --config {Debug | Release} + + + 4. Test HDF5. + + To test the build, navigate to your build directory and execute; + + ctest . + + 5. The files that support building HDF5 with CMake are all the files in the Resources + folder, the CMakeLists.txt files in each source folder, and two additional files, + ConfigureChecks.cmake and CTestConfig.cmake. The CTestConfig.cmake is specific to + the internal testing performed by The HDF Group. It should be altered for the users + installation and needs. + + 6. More information about using CMake can be found at the KitWare site, www.cmake.org. + + +************************************************************************ + +Need further assistance, send email to help@hdfgroup.org + diff --git a/release_docs/INSTALL_Windows.txt b/release_docs/INSTALL_Windows.txt index de31747..f6f79f2 100644 --- a/release_docs/INSTALL_Windows.txt +++ b/release_docs/INSTALL_Windows.txt @@ -35,11 +35,11 @@ Contents: Preconditions: 1. Installed Microsoft Visual Studio. This document is written for Visual - Studio 2008. We no longer support building HDF5 - using Microsoft Visual Studio .NET 2003, or Visual Studio 2005. + Studio 2008. We no longer support building HDF5 using Microsoft Visual + Studio .NET 2003 or 2005. 2. (Optional) Installed Intel Compiler 10.1 or 11.1 if you want to build HDF5 - Fortran libraries. + Fortran libraries. We no longer support Intel Fortran Compiler 9.1. 3. Install Winzip or 7-zip for extracting source tarball. @@ -61,28 +61,34 @@ Preconditions: Click the "Miscellaneous" tab and uncheck "TAR file smart CR/LF conversion" option, then click OK. - 4. Set up a directory structure to unpack the library. For example: + 4. CMake is available for this release on a experimental basis. CMake 2.8.1 + can be downloaded from the KitWare website at http://www.kitware.com. + + Note: We have attempted to mirror our Autoconf configuration files for + maintainence reasons. We are still working out the problems with + some issues like fortran shared libraries and tools testing. We + will maintain the current VS2008 project files for the 1.8 product. + + 5. Set up a directory structure to unpack the library. For example: c:\ (any drive) MyHDFstuff\ (any folder name) - 5. Download the hdf5-1.9.x source code package and use 7zip or WinZip to + 6. Download the hdf5-1.9.x source code package and use 7zip or WinZip to extract the HDF5 package into c:\MyHDFstuff. This creates a directory called 'hdf5-1.9.x' under MyHDFstuff which contains several files and directories. Rename "hdf5-1.9.x" to "hdf5". - 6. HDF5 provide options to do in-memory compression within HDF5 library. + 7. HDF5 provide options to do in-memory compression within HDF5 library. Currently, two external compression libraries Zlib and Szip can be used with HDF5. - 6.1 HDF5 uses Zlib version 1.2.3 for compression and Zlib is NOT + 7.1 HDF5 uses Zlib version 1.2.5 for compression and Zlib is NOT distributed with HDF5 library in 1.9.x release. To use Zlib library, you have to install your own Zlib DLL library or go to - ftp://ftp.hdfgroup.org/lib-external/zlib/1.2/bin/windows - to download the Zlib library. - + http://www.zlib.net/ to download the Zlib library. - 6.2 HDF5 uses Szip version 2.1 for compression and Szip compression + 7.2 HDF5 uses Szip version 2.1 for compression and Szip compression software is provided with HDF5 products in 1.9.x release. To use Szip 2.1 library, you can download Szip source codes and binaries from ftp://ftp.hdfgroup.org/lib-external/szip/2.1/bin/windows @@ -93,7 +99,7 @@ Preconditions: Szip compression feature inside HDF5 is optional. - 7. Define the following environment variables: + 8. Define the following environment variables: HDF5_EXT_ZLIB HDF5_EXT_SZIP @@ -124,11 +130,10 @@ Preconditions: a. You will have to close and reopen running programs for the new environment variable settings to take effect. - b. c:\zlib123\zlib1.dll and c:\szip\dll\szlibdll.dll should be copied - into the location that the application can find, one suggestion is - to use the c:\WINDOWS\system. + b. c:\zlib\zlib1.dll and c:\szip\szip.dll should be copied + into a location that the application can find. - 6. Set up path for external libraries and headers + 9. Set up path for external libraries and headers Skip this part if you don't want to use ANY compression features provided by HDF5. Please do read Section V. @@ -139,21 +144,21 @@ Preconditions: Invoke Microsoft Visual Studio and go to "Tools" and select "Options", find "Projects", and then "VC++ Directories". - 6.1 If you are building on 64-bit Windows, find the "Platform" dropdown + 9.1 If you are building on 64-bit Windows, find the "Platform" dropdown and select "x64". - 6.2 Find the box "Show directories for", choose "Include files", if you + 9.2 Find the box "Show directories for", choose "Include files", if you can not find your Zlib and Szip header path (for example, - c:\zlib123\include, c:\szip\include) from the directory list, add the - header path (c:\zlib123\include, c:\szip\include) to the included + c:\zlib\include, c:\szip\include) from the directory list, add the + header path (c:\zlib\include, c:\szip\include) to the included directories. - 6.3 Find the box "Show directories for", choose "Library files". If you + 9.3 Find the box "Show directories for", choose "Library files". If you cannot find your Zlib and Szip library path (for example, - c:\zlib123\dll, c:\szip\dll) from the directory list, add the library - path (c:\zlib123\dll, c:\szip\dll) to the library directories. + c:\zlib\dll, c:\szip\dll) from the directory list, add the library + path (c:\zlib\dll, c:\szip\dll) to the library directories. - 6.4 If building Fortran libraries, you will also need to setup the path + 9.4 If building Fortran libraries, you will also need to setup the path for the Intel Fortran compiler. Please see Section VI. Notes: @@ -164,28 +169,30 @@ Notes: 2. Visual Studio 6.0 is no longer supported in HDF5 1.8 or later releases. Visual Studio .NET is no longer support in HDF5 1.8.4 or later releases. Visual Studio 2005 is no longer support in HDF5 1.8.5 or later releases. + Intel Fortran 9.1 is no longer support in HDF5 1.8.5 or later releases. 3. For users who want to quickly build HDF5 library or do not want to know HDF5 building and installation details, please read the - INSTALL_Windows_Short_***.txt relating to your compiler. + INSTALL_Windows_Short_2008.txt relating to your compiler. 4. For users who would like to build and test HDF5 package from the command - line, please read INSATLL_Windows_From_Command_Line.txt. + line, please read INSTALL_Windows_From_Command_Line.txt. - 5. HDF4-related tools are not built and released with HDF5 library packages + 5. For users who would like to build and test HDF5 package using CMake, + please read INSTALL_Windows_Using_CMake.txt. + + 6. HDF4-related tools are not built and released with HDF5 library packages any more. To obtain HDF4 related tools, please check http://hdfgroup.org/h4toh5/ and ftp://ftp.hdfgroup.org/HDF5/h4toh5 - 6. For Fortran users, Intel fortran Compiler 10.1 and 11.1 is currently - supported-- please see Section VI. Intel Compiler verion 9.x or earlier are - no longer supported. + 7. For Fortran users, Intel Fortran Compiler 10.1 is currently supported + -- please see Section VI. Intel Compiler verion 7.x, 8.x and 9.x are + no longer supported. Intel Compiler 11.1 can be used but the project files + must be upgraded within the Visual Studio IDE. - 7. For users who would like to build Muti-threaded version of HDF5 library, + 8. Visual Studio now only builds muti-threaded versions of HDF5 library, please read Section VII. - 8. To build HDF5 in Visual Studio 2010, be sure to read the instructions in - Section XI. - ======================================================================== Section I: What do we build and install? @@ -306,7 +313,7 @@ STEP 1: Building HDF5 Libraries and Tools Select "Build" -> "Build Solution" or "Rebuild Solution" to build release version of project "all". - Both debug and release versions must be built for testing. + Release version must be built for testing, debug version is optional. Warning messages can be ignored. @@ -459,6 +466,9 @@ We provide 2 options for users to test HDF5 libraries and tools. To use this option, HDF5 C++ and Fortran libraries must have been built. + nodebug -- can be added to any of the above to + not test debug versions + Invoke a command prompt window and run hdf5check with appropriate option. Users are encouraged to pipe the test output into a file. You should find no "*FAILED*" marks. @@ -796,7 +806,7 @@ To build and test HDF5 High Level C examples: Solution" option. Then open the solution - c:\MyHDFstuff\hdf5\windows\hl\examples\allhlcexamples\allhlcexamples.dsw + c:\MyHDFstuff\hdf5\windows\hl\examples\allhlcexamples\allhlcexamples.sln 2. Select "Build", and "Configuration Manager". @@ -894,7 +904,7 @@ project, you may choose one of the following two methods. HDF5, Zlib, and Szip header files directories. For example: c:\MyHDFstuff\hdf5\hdf5lib\release\include - c:\zlib123\include + c:\zlib\include c:\szip\include Then click OK. @@ -916,7 +926,7 @@ project, you may choose one of the following two methods. example, c:\MyHDFstuff\hdf5\hdf5lib\release\include - c:\zlib123\include + c:\zlib\include c:\szip\include @@ -941,7 +951,7 @@ project, you may choose one of the following two methods. HDF5, Zlib, and Szip library files directories. For example: c:\MyHDFstuff\hdf5\hdf5lib\release\lib - c:\zlib123\dll + c:\zlib\dll c:\szip\dll Note: To link with HDF5 DLLs rathern that static libraries, simply @@ -960,7 +970,7 @@ project, you may choose one of the following two methods. example, c:\MyHDFstuff\hdf5\hdf5lib\release\lib - c:\zlib123\dll + c:\zlib\dll c:\szip\dll Note: To link with HDF5 DLLs rathern that static libraries, simply @@ -1111,13 +1121,16 @@ Warning: When you modify the H5pubconf.h file as described below, DO NOT just Section VI: How to build HDF5 with Fortran Support ======================================================================== -Notes: 1. For Intel Compiler users, Intel fortran Compiler 10.1 and 11.1 are - currently supported-- please see below. Intel Compiler verion 9.x and - earlier are no longer supported. +Notes: 1. For Intel Compiler users, Intel fortran Compiler10.1 is + currently supported. Intel Compiler verion 7.x, 8.x and + 9.x are no longer supported. Intel Compiler 11.1 can be used, however + the fortran project files must be upgraded from within the IDE. - 2. The Compaq Fortran Compiler is no longer supported for HDF5 1.9. + 2. The Compaq Fortran Compiler is no longer supported for HDF5 1.8. - 3. Parallel builds should be disabled. To do so: Go to Tools > + 3. Visual Studio 2008 is supported only with Intel Fortran 10.1 and 11.1. + + 4. Parallel builds should be disabled. To do so: Go to Tools > Options > Projects and Solutions > Build and Run. Set "Maximum Number of Parallel Project Builds" to 1. @@ -1145,19 +1158,19 @@ Notes: 1. For Intel Compiler users, Intel fortran Compiler 10.1 and 11.1 are right panel, make sure your "Selected Compiler" is Intel Fortran. 3) Select the right-most box for "Libraries", and add Zlib and Szip - library paths (c:\zlib123\dll, c:\szip\dll for example). + library paths (c:\zlib\dll, c:\szip\dll for example). 4) Select right-most box for "Includes", and add Zlib and Szip header - paths (c:\zlib123\include c:\szip\include, for example). + paths (c:\zlib\include c:\szip\include, for example). 5) Then click "OK". -1. Build with Intel Fortran Compiler 10.1 or 11.1 under Visual Studio 2008 +1. Build with Intel Fortran Compiler 11.1 under Visual Studio 2008 Note: This step will build HDF5 Static and DLL C and C++ Library using Visual Studio compiler as well as HDF5 Static and High Level - Fortran Library using Intel Fortran Compiler. + Fortran Library using Intel Fortran 11.1 Compiler. 1.1 Open all_fortran.sln @@ -1381,10 +1394,11 @@ Notes: 1. For Intel Compiler users, Intel fortran Compiler 10.1 and 11.1 are Section VII : How to build Multi-threaded version of HDF5 library ======================================================================== -Notes: In Visual Studio 2008 Multi-threaded is built by default. Therefore, no extra +Notes: In Visual Studio 2008, the Single-threaded runtime libraries have been + depreciated, and Multi-threaded is built by default. Therefore, no extra work needs to be done to build Multi-threaded libraries in Visual Studio - 2008. - + 2008. + ======================================================================== Section VIII: How To Build And Test HDF5 With Thread-Safe Feature @@ -1577,7 +1591,7 @@ Notes: Prerequisites: - 1. A 64-bit Windows machine. Either AMD64 and Itanium is supported. + 1. A 64-bit Windows machine. 2. Microsoft Visual Studio 2008 installed with x64 Extensions. @@ -1623,7 +1637,7 @@ some minor changes. Therefore, follow the build instructions above, with the following considerations: 1. Only Visual Studio 2008 is currently supported on Windows Vista. - + 2. Elevated security permissions are required to test the HDF5 libraries. This is because DLLs are installed in the system directory. To enable elevated security: diff --git a/release_docs/INSTALL_Windows_From_Command_Line.txt b/release_docs/INSTALL_Windows_From_Command_Line.txt index 771bcf0..19f7be5 100755 --- a/release_docs/INSTALL_Windows_From_Command_Line.txt +++ b/release_docs/INSTALL_Windows_From_Command_Line.txt @@ -5,12 +5,15 @@ Note: This instruction is written for users who would like to build HDF5 libraries and tools from the HDF5 source code package on command line. We no longer support building HDF5 using Microsoft Visual - Studio 2005. + Studio .NET 2003 or Visual Studio VS2005 or Intel Fortran 91. Currently, we support: 1. Building and testing HDF5 C/C++/Fortran libraries on command line with Microsoft Visual Studio 2008 for 32- or 64-bit Windows. + + 2. Building and testing HDF5 C/C++/Fortran libraries and utilities using + CMake tools. Refer to CMAKE_Windows.txt file for detailed information. For all other Windows development tools, HDF5 should be built in the development environment. Please refer to INSTALL_Windows.txt @@ -42,7 +45,7 @@ notes in INSTALL_Windows.txt before starting below procedures. This should output a path similar to: C:\Program Files\Microsoft Visual Studio 9\Common7\Tools\ - + 1.2 Run batch file copy_hdf.bat. Go to c:\MyHDFstuff\hdf5\windows and run copy_hdf.bat. @@ -112,6 +115,7 @@ notes in INSTALL_Windows.txt before starting below procedures. /ivf101 Build HDF5 Fortran using Intel Visual Fortran 10.1 /ivf111 Build HDF5 Fortran using Intel Visual Fortran 11.1 /nodebug Build HDF5 release versions only + Note: Default is to build debug and release versions /useenv Build HDF5 using compiler settings defined in the environment, rather than the IDE. /? Help information diff --git a/release_docs/INSTALL_Windows_Short_VS2008.TXT b/release_docs/INSTALL_Windows_Short_VS2008.TXT new file mode 100755 index 0000000..8ff8866 --- /dev/null +++ b/release_docs/INSTALL_Windows_Short_VS2008.TXT @@ -0,0 +1,192 @@ +************************************************************************ +* Build and Install HDF5 C/C++ Library with Visual Studio 2008 * +* with Windows XP (Short Version) * +************************************************************************ + +Notes: This short instruction is written for users who want to quickly build + HDF5 library and tools from the HDF5 source code package with Microsoft + Visual Studio 2008 but do not want to know HDF5 building and installation + details on Windows XP. + + For detailed HDF5 build and install information, or if you have trouble + following any steps in the instructions, please refer to + INSTALL_Windows.txt for further information. + + For users who would like to build and test HDF5 package from the + command line, please refer to INSTALL_Windows_From_Command_Line.txt. + + Notes: + + 1. HDF5 1.8 can also be built using Visual Studio 2008 on Windows + Vista. For details, please see Section X of INSTALL_Windows.txt. + + 2. 64-bit builds are also supported in Visual Studio 2008. For details + please see Section IX of INSTALL_Windows.txt. + + 3. Fortran libraries can be built with Visual Studio 2008 and Intel + Fortran 10.1. For details, see Section VI of INSTALL_Windows.txt. + +WARNINGS: + +Please read CAREFULLY about HDF5 build and install preconditions and +notes in INSTALL_Windows.txt before starting below procedures. + + +======================================================================== + Preconditions +======================================================================== + + 1. Set up path for external libraries and headers + + Skip this part if you don't want to use ANY compression features provided + by HDF5. Please do read Section V in INSTALL_Windows.txt. + + You have to read this part even if you want to only use Zlib or Szip. You + also need to read Section V in INSTALL_Windows.txt. + + Invoke Microsoft Visual Studio and go to "Tools" and select "Options". In + the left pane of "Option" window poped up, choose and expand "Projects", + Click on "VC++ Directories". In the right pane, Find the box "Show + directories for", choose "Include files", if you can not find your Zlib + and Szip header path (for example, c:\zlib125\include, c:\szip\include) + from the directory list, add the header path (c:\zlib125\include, + c:\szip\include) to the included directories. + + Find the box "Show directories for", choose "Library files", If you cannot + find your Zlib and Szip library path (for example, c:\zlib125\dll, + c:\szip\dll) from the directory list, add the library path + (c:\zlib125\dll, c:\szip\dll) to the library directories. + +======================================================================== + Building HDF5 C/C++ Libraries with Visual Studio 2005 +======================================================================== + + 1. Run batch file copy_hdf.bat + + Go to c:\MyHDFstuff\hdf5\windows and run copy_hdf.bat. This process will + copy all the necessary batch files, windows specific source codes and + text files saved under c:\MyHDFstuff\hdf5\windows directory to the + corresponding directories under hdf5. + + 2. Invoke Microsoft Visual Studio compiler + + Invoke Microsoft Visual Studio. From the main menu, go to "File" and + select the "Open Solution" option. Then open the + c:\MyHDFstuff\hdf5\windows\proj\all\all.sln solution if you are building + without Fortran libraries, or + c:\MyHDFstuff\hdf5\windows\proj\all_fortran\all_fortran.sln if you would + like to use Fortran. + + You should find Windows project files listed as "all", "big", etc. on the + left. + + + 3. (Optional) Disable HDF5 C++ and High level C++ + + In HDF5 1.8, C++ and HL C++ libraries are built by default. To opt-out, + you must explicitly disable them. + + 3.1 Skip this step if you do want to build HDF5 High-Level C++ libraries + + Go to "Project" and select "Project Dependencies". Select "all", and + disable all of the following projects: + + hdf5_hl_cpp + hdf5_hl_cppdll + hl_test_table_cpp + hl_test_table_cppdll + + 3.2 Skip this step if you do want to build HDF5 High-Level libraries + + Go to "Project" and select "Project Dependencies". Select "all", and + disable all of the project files listed in the previous step, as well + as the following projects: + + hdf5_hl + hdf5_hldll + hl_test_image + hl_test_imagedll + hl_test_lite + hl_test_litedll + hl_test_table + hl_test_tabledll + hl_test_ds + hl_test_dsdll + hl_test_packet + hl_test_packetdll + + Click on "OK", From the main menu, choose "Build"-> "Build" or + "Rebuild ALL" to build both release and debug version of HDF5 + Libraries. + + + 4. Select "Build", then Select "Configuration Manager". + + 4.1 To build debug static libraries, debug multithreaded DLLs, and tests: + + In "Active Solution Configuration", select "Debug". Select "Close". + Select "Build" -> "Build Solution" or "Rebuild Solution" to build debug + version of project "all". + + 4.2 To build release static libraries, multithreaded DLLs and tests: + + In "Active Solution Configuration", select "Release". Select "Close". + Select "Build" -> "Build Solution" or "Rebuild Solution" to build release + version of project "all". + + Both debug and release versions must be built. + + Warning messages can be ignored. + +======================================================================== + Testing HDF5 C/C++ Libraries +======================================================================== + +HDF5 libraries and tools should be tested to make sure that they were +built correctly. c:\MyHDFstuff\hdf5\hdf5check.bat was provided to test +HDF5 libraries and tools. + +hdf5check.bat has four options: + + hdf5check test HDF5 C library and tools only + + hdf5check enablecpp test HDF5 C/C++ libraries and tools + + hdf5check enablefortran test HDF5 C/Fortran libraries and tools + + hdf5check enableall test HDF5 C/C++/Fortran libraries and tools + + nodebug -- can be added to any of the above to not + test debug versions + +Notes: Users who only build HDF5 C/C++ libraries ONLY have the first + two options. + +Invoke a command prompt window and run hdf5check with appropriate option. +Users are encouraged to pipe the test output into a file. You should find +no "*FAILED*" marks. + +If you want to test HDF5 libraries and tools one by one, please refer to +Section II, step 2 in INSTALL_Windows.txt. + + +======================================================================== + Installing HDF5 C/C++ Libraries +======================================================================== + +Run the batch file c:\MyHDFstuff\hdf5\installhdf5lib.bat to install +all HDF5 libraries and tools into c:\MyHDFstuff\hdf5\hdf5lib directory. + +======================================================================== + Building HDF5 Examples and Applications +======================================================================== + +Building HDF5 Examples is Optional. Please read Section II, step 4 and +the following part in INSTALL_Windows.txt for detailed information. + + + +************************************************************************ + +Need further assistance, send email to help@hdfgroup.org + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..bdcc598 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,722 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_SRC C CXX) + +#----------------------------------------------------------------------------- +# List Source Files +#----------------------------------------------------------------------------- +SET (H5_SRCS + ${HDF5_SRC_DIR}/H5.c + ${HDF5_SRC_DIR}/H5checksum.c + ${HDF5_SRC_DIR}/H5dbg.c + ${HDF5_SRC_DIR}/H5system.c + ${HDF5_SRC_DIR}/H5timer.c + ${HDF5_SRC_DIR}/H5trace.c +) + +SET (H5_HDRS + ${HDF5_SRC_DIR}/hdf5.h + ${HDF5_SRC_DIR}/H5api_adpt.h + ${HDF5_SRC_DIR}/H5public.h +) +IDE_GENERATED_PROPERTIES ("H5" "${H5_HDRS}" "${H5_SRCS}" ) + +SET (H5A_SRCS + ${HDF5_SRC_DIR}/H5A.c + ${HDF5_SRC_DIR}/H5Abtree2.c + ${HDF5_SRC_DIR}/H5Adense.c + ${HDF5_SRC_DIR}/H5Adeprec.c + ${HDF5_SRC_DIR}/H5Aint.c + ${HDF5_SRC_DIR}/H5Atest.c +) + +SET (H5A_HDRS + ${HDF5_SRC_DIR}/H5Apkg.h + ${HDF5_SRC_DIR}/H5Apublic.h +) +IDE_GENERATED_PROPERTIES ("H5A" "${H5A_HDRS}" "${H5A_SRCS}" ) + +SET (H5AC_SRCS + ${HDF5_SRC_DIR}/H5AC.c +) + +SET (H5AC_HDRS + ${HDF5_SRC_DIR}/H5ACpkg.h + ${HDF5_SRC_DIR}/H5ACpublic.h +) +IDE_GENERATED_PROPERTIES ("H5AC" "${H5AC_HDRS}" "${H5AC_SRCS}" ) + +SET (H5B_SRCS + ${HDF5_SRC_DIR}/H5B.c + ${HDF5_SRC_DIR}/H5B2.c + ${HDF5_SRC_DIR}/H5B2cache.c + ${HDF5_SRC_DIR}/H5B2dbg.c + ${HDF5_SRC_DIR}/H5B2hdr.c + ${HDF5_SRC_DIR}/H5B2int.c + ${HDF5_SRC_DIR}/H5B2stat.c + ${HDF5_SRC_DIR}/H5B2test.c + ${HDF5_SRC_DIR}/H5Bcache.c + ${HDF5_SRC_DIR}/H5Bdbg.c +) + +SET (H5B_HDRS + ${HDF5_SRC_DIR}/H5B2pkg.h + ${HDF5_SRC_DIR}/H5B2public.h + ${HDF5_SRC_DIR}/H5Bpkg.h + ${HDF5_SRC_DIR}/H5Bpublic.h +) +IDE_GENERATED_PROPERTIES ("H5B" "${H5B_HDRS}" "${H5B_SRCS}" ) + +SET (H5C_SRCS + ${HDF5_SRC_DIR}/H5C.c + ${HDF5_SRC_DIR}/H5CS.c +) + +SET (H5C_HDRS + ${HDF5_SRC_DIR}/H5Cpkg.h + ${HDF5_SRC_DIR}/H5Cpublic.h +) +IDE_GENERATED_PROPERTIES ("H5C" "${H5C_HDRS}" "${H5C_SRCS}" ) + +SET (H5D_SRCS + ${HDF5_SRC_DIR}/H5D.c + ${HDF5_SRC_DIR}/H5Dbtree.c + ${HDF5_SRC_DIR}/H5Dchunk.c + ${HDF5_SRC_DIR}/H5Dcompact.c + ${HDF5_SRC_DIR}/H5Dcontig.c + ${HDF5_SRC_DIR}/H5Ddbg.c + ${HDF5_SRC_DIR}/H5Ddeprec.c + ${HDF5_SRC_DIR}/H5Defl.c + ${HDF5_SRC_DIR}/H5Dfill.c + ${HDF5_SRC_DIR}/H5Dint.c + ${HDF5_SRC_DIR}/H5Dio.c + ${HDF5_SRC_DIR}/H5Dlayout.c + ${HDF5_SRC_DIR}/H5Dmpio.c + ${HDF5_SRC_DIR}/H5Doh.c + ${HDF5_SRC_DIR}/H5Dscatgath.c + ${HDF5_SRC_DIR}/H5Dselect.c + ${HDF5_SRC_DIR}/H5Dtest.c +) + +SET (H5D_HDRS + ${HDF5_SRC_DIR}/H5Dpkg.h + ${HDF5_SRC_DIR}/H5Dpublic.h +) +IDE_GENERATED_PROPERTIES ("H5D" "${H5D_HDRS}" "${H5D_SRCS}" ) + +SET (H5E_SRCS + ${HDF5_SRC_DIR}/H5E.c + ${HDF5_SRC_DIR}/H5Edeprec.c + ${HDF5_SRC_DIR}/H5Eint.c +) + +SET (H5E_HDRS + ${HDF5_SRC_DIR}/H5Edefin.h + ${HDF5_SRC_DIR}/H5Einit.h + ${HDF5_SRC_DIR}/H5Epkg.h + ${HDF5_SRC_DIR}/H5Epubgen.h + ${HDF5_SRC_DIR}/H5Epublic.h + ${HDF5_SRC_DIR}/H5Eterm.h +) +IDE_GENERATED_PROPERTIES ("H5E" "${H5E_HDRS}" "${H5E_SRCS}" ) + +SET (H5EA_SRCS + ${HDF5_SRC_DIR}/H5EA.c + ${HDF5_SRC_DIR}/H5EAcache.c + ${HDF5_SRC_DIR}/H5EAdbg.c + ${HDF5_SRC_DIR}/H5EAdblkpage.c + ${HDF5_SRC_DIR}/H5EAdblock.c + ${HDF5_SRC_DIR}/H5EAhdr.c + ${HDF5_SRC_DIR}/H5EAiblock.c + ${HDF5_SRC_DIR}/H5EAint.c + ${HDF5_SRC_DIR}/H5EAsblock.c + ${HDF5_SRC_DIR}/H5EAstat.c + ${HDF5_SRC_DIR}/H5EAtest.c +) + +SET (H5EA_HDRS + ${HDF5_SRC_DIR}/H5EApkg.h +) +IDE_GENERATED_PROPERTIES ("H5EA" "${H5EA_HDRS}" "${H5EA_SRCS}" ) + +SET (H5F_SRCS + ${HDF5_SRC_DIR}/H5F.c + ${HDF5_SRC_DIR}/H5Faccum.c + ${HDF5_SRC_DIR}/H5Fdbg.c + ${HDF5_SRC_DIR}/H5Fdeprec.c + ${HDF5_SRC_DIR}/H5Ffake.c + ${HDF5_SRC_DIR}/H5Fio.c + ${HDF5_SRC_DIR}/H5Fmount.c + ${HDF5_SRC_DIR}/H5Fmpi.c + ${HDF5_SRC_DIR}/H5Fquery.c + ${HDF5_SRC_DIR}/H5Fsfile.c + ${HDF5_SRC_DIR}/H5Fsuper.c + ${HDF5_SRC_DIR}/H5Fsuper_cache.c + ${HDF5_SRC_DIR}/H5Ftest.c +) + +SET (H5F_HDRS + ${HDF5_SRC_DIR}/H5Fpkg.h + ${HDF5_SRC_DIR}/H5Fpublic.h +) +IDE_GENERATED_PROPERTIES ("H5F" "${H5F_HDRS}" "${H5F_SRCS}" ) + +SET (H5FA_SRCS + ${HDF5_SRC_DIR}/H5FA.c + ${HDF5_SRC_DIR}/H5FAcache.c + ${HDF5_SRC_DIR}/H5FAdbg.c + ${HDF5_SRC_DIR}/H5FAdblock.c + ${HDF5_SRC_DIR}/H5FAdblkpage.c + ${HDF5_SRC_DIR}/H5FAhdr.c + ${HDF5_SRC_DIR}/H5FAstat.c + ${HDF5_SRC_DIR}/H5FAtest.c +) + +SET (H5FA_HDRS + ${HDF5_SRC_DIR}/H5FApkg.h +) +IDE_GENERATED_PROPERTIES ("H5FA" "${H5FA_HDRS}" "${H5FA_SRCS}" ) + +SET (H5FD_SRCS + ${HDF5_SRC_DIR}/H5FD.c + ${HDF5_SRC_DIR}/H5FDcore.c + ${HDF5_SRC_DIR}/H5FDdirect.c + ${HDF5_SRC_DIR}/H5FDfamily.c + ${HDF5_SRC_DIR}/H5FDint.c + ${HDF5_SRC_DIR}/H5FDlog.c + ${HDF5_SRC_DIR}/H5FDmpi.c + ${HDF5_SRC_DIR}/H5FDmpio.c + ${HDF5_SRC_DIR}/H5FDmpiposix.c + ${HDF5_SRC_DIR}/H5FDmulti.c + ${HDF5_SRC_DIR}/H5FDsec2.c + ${HDF5_SRC_DIR}/H5FDspace.c + ${HDF5_SRC_DIR}/H5FDstdio.c +) + +SET (H5FD_HDRS + ${HDF5_SRC_DIR}/H5FDcore.h + ${HDF5_SRC_DIR}/H5FDdirect.h + ${HDF5_SRC_DIR}/H5FDfamily.h + ${HDF5_SRC_DIR}/H5FDlog.h + ${HDF5_SRC_DIR}/H5FDmpi.h + ${HDF5_SRC_DIR}/H5FDmpio.h + ${HDF5_SRC_DIR}/H5FDmpiposix.h + ${HDF5_SRC_DIR}/H5FDmulti.h + ${HDF5_SRC_DIR}/H5FDpkg.h + ${HDF5_SRC_DIR}/H5FDpublic.h + ${HDF5_SRC_DIR}/H5FDsec2.h + ${HDF5_SRC_DIR}/H5FDstdio.h +) +IDE_GENERATED_PROPERTIES ("H5FD" "${H5FD_HDRS}" "${H5FD_SRCS}" ) + +SET (H5FS_SRCS + ${HDF5_SRC_DIR}/H5FS.c + ${HDF5_SRC_DIR}/H5FScache.c + ${HDF5_SRC_DIR}/H5FSdbg.c + ${HDF5_SRC_DIR}/H5FSsection.c + ${HDF5_SRC_DIR}/H5FSstat.c + ${HDF5_SRC_DIR}/H5FStest.c +) + +SET (H5FS_HDRS + ${HDF5_SRC_DIR}/H5FSpkg.h + ${HDF5_SRC_DIR}/H5FSpublic.h +) +IDE_GENERATED_PROPERTIES ("H5FS" "${H5FS_HDRS}" "${H5FS_SRCS}" ) + +SET (H5G_SRCS + ${HDF5_SRC_DIR}/H5G.c + ${HDF5_SRC_DIR}/H5Gbtree2.c + ${HDF5_SRC_DIR}/H5Gcache.c + ${HDF5_SRC_DIR}/H5Gcompact.c + ${HDF5_SRC_DIR}/H5Gdense.c + ${HDF5_SRC_DIR}/H5Gdeprec.c + ${HDF5_SRC_DIR}/H5Gent.c + ${HDF5_SRC_DIR}/H5Gint.c + ${HDF5_SRC_DIR}/H5Glink.c + ${HDF5_SRC_DIR}/H5Gloc.c + ${HDF5_SRC_DIR}/H5Gname.c + ${HDF5_SRC_DIR}/H5Gnode.c + ${HDF5_SRC_DIR}/H5Gobj.c + ${HDF5_SRC_DIR}/H5Goh.c + ${HDF5_SRC_DIR}/H5Groot.c + ${HDF5_SRC_DIR}/H5Gstab.c + ${HDF5_SRC_DIR}/H5Gtest.c + ${HDF5_SRC_DIR}/H5Gtraverse.c +) + +SET (H5G_HDRS + ${HDF5_SRC_DIR}/H5Gpkg.h + ${HDF5_SRC_DIR}/H5Gpublic.h +) +IDE_GENERATED_PROPERTIES ("H5G" "${H5G_HDRS}" "${H5G_SRCS}" ) + +SET (H5HF_SRCS + ${HDF5_SRC_DIR}/H5HF.c + ${HDF5_SRC_DIR}/H5HFbtree2.c + ${HDF5_SRC_DIR}/H5HFcache.c + ${HDF5_SRC_DIR}/H5HFdbg.c + ${HDF5_SRC_DIR}/H5HFdblock.c + ${HDF5_SRC_DIR}/H5HFdtable.c + ${HDF5_SRC_DIR}/H5HFhdr.c + ${HDF5_SRC_DIR}/H5HFhuge.c + ${HDF5_SRC_DIR}/H5HFiblock.c + ${HDF5_SRC_DIR}/H5HFiter.c + ${HDF5_SRC_DIR}/H5HFman.c + ${HDF5_SRC_DIR}/H5HFsection.c + ${HDF5_SRC_DIR}/H5HFspace.c + ${HDF5_SRC_DIR}/H5HFstat.c + ${HDF5_SRC_DIR}/H5HFtest.c + ${HDF5_SRC_DIR}/H5HFtiny.c +) + +SET (H5HF_HDRS + ${HDF5_SRC_DIR}/H5HFpkg.h + ${HDF5_SRC_DIR}/H5HFpublic.h +) +IDE_GENERATED_PROPERTIES ("H5HF" "${H5HF_HDRS}" "${H5HF_SRCS}" ) + +SET (H5HG_SRCS + ${HDF5_SRC_DIR}/H5HG.c + ${HDF5_SRC_DIR}/H5HGcache.c + ${HDF5_SRC_DIR}/H5HGdbg.c +) + +SET (H5HG_HDRS + ${HDF5_SRC_DIR}/H5HGpkg.h + ${HDF5_SRC_DIR}/H5HGpublic.h +) +IDE_GENERATED_PROPERTIES ("H5HG" "${H5HG_HDRS}" "${H5HG_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 + ${HDF5_SRC_DIR}/H5HLpkg.h + ${HDF5_SRC_DIR}/H5HLpublic.h +) +IDE_GENERATED_PROPERTIES ("H5HL" "${H5HL_HDRS}" "${H5HL_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 +) +IDE_GENERATED_PROPERTIES ("H5MF" "${H5MF_HDRS}" "${H5MF_SRCS}" ) + +SET (H5MP_SRCS + ${HDF5_SRC_DIR}/H5MP.c + ${HDF5_SRC_DIR}/H5MPtest.c +) + +SET (H5MP_HDRS + ${HDF5_SRC_DIR}/H5MPpkg.h +) +IDE_GENERATED_PROPERTIES ("H5MP" "${H5MP_HDRS}" "${H5MP_SRCS}" ) + +SET (H5O_SRCS + ${HDF5_SRC_DIR}/H5O.c + ${HDF5_SRC_DIR}/H5Oainfo.c + ${HDF5_SRC_DIR}/H5Oalloc.c + ${HDF5_SRC_DIR}/H5Oattr.c + ${HDF5_SRC_DIR}/H5Oattribute.c + ${HDF5_SRC_DIR}/H5Obogus.c + ${HDF5_SRC_DIR}/H5Obtreek.c + ${HDF5_SRC_DIR}/H5Ocache.c + ${HDF5_SRC_DIR}/H5Ochunk.c + ${HDF5_SRC_DIR}/H5Ocont.c + ${HDF5_SRC_DIR}/H5Ocopy.c + ${HDF5_SRC_DIR}/H5Odbg.c + ${HDF5_SRC_DIR}/H5Odrvinfo.c + ${HDF5_SRC_DIR}/H5Odtype.c + ${HDF5_SRC_DIR}/H5Oefl.c + ${HDF5_SRC_DIR}/H5Ofill.c + ${HDF5_SRC_DIR}/H5Ofsinfo.c + ${HDF5_SRC_DIR}/H5Oginfo.c + ${HDF5_SRC_DIR}/H5Olayout.c + ${HDF5_SRC_DIR}/H5Olinfo.c + ${HDF5_SRC_DIR}/H5Olink.c + ${HDF5_SRC_DIR}/H5Omessage.c + ${HDF5_SRC_DIR}/H5Omtime.c + ${HDF5_SRC_DIR}/H5Oname.c + ${HDF5_SRC_DIR}/H5Onull.c + ${HDF5_SRC_DIR}/H5Opline.c + ${HDF5_SRC_DIR}/H5Orefcount.c + ${HDF5_SRC_DIR}/H5Osdspace.c + ${HDF5_SRC_DIR}/H5Oshared.c + ${HDF5_SRC_DIR}/H5Oshmesg.c + ${HDF5_SRC_DIR}/H5Ostab.c + ${HDF5_SRC_DIR}/H5Otest.c + ${HDF5_SRC_DIR}/H5Ounknown.c +) + +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 + ${HDF5_SRC_DIR}/H5P.c + ${HDF5_SRC_DIR}/H5Pacpl.c + ${HDF5_SRC_DIR}/H5Pdapl.c + ${HDF5_SRC_DIR}/H5Pdcpl.c + ${HDF5_SRC_DIR}/H5Pdeprec.c + ${HDF5_SRC_DIR}/H5Pdxpl.c + ${HDF5_SRC_DIR}/H5Pfapl.c + ${HDF5_SRC_DIR}/H5Pfcpl.c + ${HDF5_SRC_DIR}/H5Pfmpl.c + ${HDF5_SRC_DIR}/H5Pgcpl.c + ${HDF5_SRC_DIR}/H5Pint.c + ${HDF5_SRC_DIR}/H5Plapl.c + ${HDF5_SRC_DIR}/H5Plcpl.c + ${HDF5_SRC_DIR}/H5Pocpl.c + ${HDF5_SRC_DIR}/H5Pocpypl.c + ${HDF5_SRC_DIR}/H5Pstrcpl.c + ${HDF5_SRC_DIR}/H5Ptest.c +) + +SET (H5P_HDRS + ${HDF5_SRC_DIR}/H5Ppkg.h + ${HDF5_SRC_DIR}/H5Ppublic.h +) +IDE_GENERATED_PROPERTIES ("H5P" "${H5P_HDRS}" "${H5P_SRCS}" ) + +SET (H5S_SRCS + ${HDF5_SRC_DIR}/H5S.c + ${HDF5_SRC_DIR}/H5Sall.c + ${HDF5_SRC_DIR}/H5Sdbg.c + ${HDF5_SRC_DIR}/H5Shyper.c + ${HDF5_SRC_DIR}/H5Smpio.c + ${HDF5_SRC_DIR}/H5Snone.c + ${HDF5_SRC_DIR}/H5Spoint.c + ${HDF5_SRC_DIR}/H5Sselect.c + ${HDF5_SRC_DIR}/H5Stest.c +) + +SET (H5S_HDRS + ${HDF5_SRC_DIR}/H5Spkg.h + ${HDF5_SRC_DIR}/H5Spublic.h +) +IDE_GENERATED_PROPERTIES ("H5S" "${H5S_HDRS}" "${H5S_SRCS}" ) + +SET (H5SM_SRCS + ${HDF5_SRC_DIR}/H5SM.c + ${HDF5_SRC_DIR}/H5SMbtree2.c + ${HDF5_SRC_DIR}/H5SMcache.c + ${HDF5_SRC_DIR}/H5SMmessage.c + ${HDF5_SRC_DIR}/H5SMtest.c +) + +SET (H5SM_HDRS + ${HDF5_SRC_DIR}/H5SMpkg.h +) +IDE_GENERATED_PROPERTIES ("H5SM" "${H5SM_HDRS}" "${H5SM_SRCS}" ) + +SET (H5T_SRCS + ${HDF5_SRC_DIR}/H5T.c + ${HDF5_SRC_DIR}/H5Tarray.c + ${HDF5_SRC_DIR}/H5Tbit.c + ${HDF5_SRC_DIR}/H5Tcommit.c + ${HDF5_SRC_DIR}/H5Tcompound.c + ${HDF5_SRC_DIR}/H5Tconv.c + ${HDF5_SRC_DIR}/H5Tcset.c + ${HDF5_SRC_DIR}/H5Tdbg.c + ${HDF5_SRC_DIR}/H5Tdeprec.c + ${HDF5_SRC_DIR}/H5Tenum.c + ${HDF5_SRC_DIR}/H5Tfields.c + ${HDF5_SRC_DIR}/H5Tfixed.c + ${HDF5_SRC_DIR}/H5Tfloat.c + ${HDF5_SRC_DIR}/H5Tnative.c + ${HDF5_SRC_DIR}/H5Toffset.c + ${HDF5_SRC_DIR}/H5Toh.c + ${HDF5_SRC_DIR}/H5Topaque.c + ${HDF5_SRC_DIR}/H5Torder.c + ${HDF5_SRC_DIR}/H5Tpad.c + ${HDF5_SRC_DIR}/H5Tprecis.c + ${HDF5_SRC_DIR}/H5Tstrpad.c + ${HDF5_SRC_DIR}/H5Tvisit.c + ${HDF5_SRC_DIR}/H5Tvlen.c +) + +SET (H5T_HDRS + ${HDF5_SRC_DIR}/H5Tpkg.h + ${HDF5_SRC_DIR}/H5Tpublic.h +) +IDE_GENERATED_PROPERTIES ("H5T" "${H5T_HDRS}" "${H5T_SRCS}" ) + +SET (H5Z_SRCS + ${HDF5_SRC_DIR}/H5Z.c + ${HDF5_SRC_DIR}/H5Zdeflate.c + ${HDF5_SRC_DIR}/H5Zfletcher32.c + ${HDF5_SRC_DIR}/H5Znbit.c + ${HDF5_SRC_DIR}/H5Zscaleoffset.c + ${HDF5_SRC_DIR}/H5Zshuffle.c + ${HDF5_SRC_DIR}/H5Zszip.c + ${HDF5_SRC_DIR}/H5Ztrans.c +) + +SET (H5Z_HDRS + ${HDF5_SRC_DIR}/H5Zpkg.h + ${HDF5_SRC_DIR}/H5Zpublic.h +) +IDE_GENERATED_PROPERTIES ("H5Z" "${H5Z_HDRS}" "${H5Z_SRCS}" ) + +SET (common_SRCS + ${H5_SRCS} + ${H5A_SRCS} + ${H5AC_SRCS} + ${H5B_SRCS} + ${H5C_SRCS} + ${H5D_SRCS} + ${H5E_SRCS} + ${H5EA_SRCS} + ${H5F_SRCS} + ${H5FA_SRCS} + ${H5FD_SRCS} + ${H5FS_SRCS} + ${H5G_SRCS} + ${H5HF_SRCS} + ${H5HG_SRCS} + ${H5HL_SRCS} + ${H5MF_SRCS} + ${H5MP_SRCS} + ${H5O_SRCS} + ${H5P_SRCS} + ${H5S_SRCS} + ${H5SM_SRCS} + ${H5T_SRCS} + ${H5Z_SRCS} + ${HDF5_SRC_DIR}/H5FL.c + ${HDF5_SRC_DIR}/H5FO.c + ${HDF5_SRC_DIR}/H5HP.c + ${HDF5_SRC_DIR}/H5I.c + ${HDF5_SRC_DIR}/H5L.c + ${HDF5_SRC_DIR}/H5Lexternal.c + ${HDF5_SRC_DIR}/H5MM.c + ${HDF5_SRC_DIR}/H5R.c + ${HDF5_SRC_DIR}/H5RC.c + ${HDF5_SRC_DIR}/H5Rdeprec.c + ${HDF5_SRC_DIR}/H5RS.c + ${HDF5_SRC_DIR}/H5SL.c + ${HDF5_SRC_DIR}/H5ST.c + ${HDF5_SRC_DIR}/H5TS.c + ${HDF5_SRC_DIR}/H5V.c + ${HDF5_SRC_DIR}/H5WB.c +) + +SET (H5_PUBLIC_HEADERS + ${H5_HDRS} + ${H5A_HDRS} + ${H5AC_HDRS} + ${H5B_HDRS} + ${H5C_HDRS} + ${H5D_HDRS} + ${H5E_HDRS} + ${H5EA_HDRS} + ${H5F_HDRS} + ${H5FA_HDRS} + ${H5FD_HDRS} + ${H5FS_HDRS} + ${H5G_HDRS} + ${H5HF_HDRS} + ${H5HG_HDRS} + ${H5HL_HDRS} + ${H5MF_HDRS} + ${H5MP_HDRS} + ${H5O_HDRS} + ${H5P_HDRS} + ${H5S_HDRS} + ${H5SM_HDRS} + ${H5T_HDRS} + ${H5Z_HDRS} + ${HDF5_SRC_DIR}/H5Ipkg.h + ${HDF5_SRC_DIR}/H5Ipublic.h + ${HDF5_SRC_DIR}/H5Lpkg.h + ${HDF5_SRC_DIR}/H5Lpublic.h + ${HDF5_SRC_DIR}/H5MMpublic.h + ${HDF5_SRC_DIR}/H5Rpkg.h + ${HDF5_SRC_DIR}/H5Rpublic.h +) + +# -------------------------------------------------------------------- +# If we are compiling on Windows then add the windows specific files +# -------------------------------------------------------------------- +IF (WIN32) + SET (common_SRCS ${common_SRCS} ${HDF5_SRC_DIR}/H5FDwindows.c) + SET (H5_PUBLIC_HEADERS ${H5_PUBLIC_HEADERS} ${HDF5_SRC_DIR}/H5FDwindows.h) +ENDIF (WIN32) + +SET (H5_PRIVATE_HEADERS + ${HDF5_SRC_DIR}/H5private.h + ${HDF5_SRC_DIR}/H5Aprivate.h + ${HDF5_SRC_DIR}/H5ACprivate.h + ${HDF5_SRC_DIR}/H5B2private.h + ${HDF5_SRC_DIR}/H5Bprivate.h + ${HDF5_SRC_DIR}/H5Cprivate.h + ${HDF5_SRC_DIR}/H5CSprivate.h + ${HDF5_SRC_DIR}/H5Dprivate.h + ${HDF5_SRC_DIR}/H5Eprivate.h + ${HDF5_SRC_DIR}/H5EAprivate.h + ${HDF5_SRC_DIR}/H5FAprivate.h + ${HDF5_SRC_DIR}/H5FDprivate.h + ${HDF5_SRC_DIR}/H5Fprivate.h + ${HDF5_SRC_DIR}/H5FLprivate.h + ${HDF5_SRC_DIR}/H5FOprivate.h + ${HDF5_SRC_DIR}/H5MFprivate.h + ${HDF5_SRC_DIR}/H5MMprivate.h + ${HDF5_SRC_DIR}/H5Cprivate.h + ${HDF5_SRC_DIR}/H5FSprivate.h + ${HDF5_SRC_DIR}/H5Gprivate.h + ${HDF5_SRC_DIR}/H5HFprivate.h + ${HDF5_SRC_DIR}/H5HGprivate.h + ${HDF5_SRC_DIR}/H5HLprivate.h + ${HDF5_SRC_DIR}/H5HPprivate.h + ${HDF5_SRC_DIR}/H5Iprivate.h + ${HDF5_SRC_DIR}/H5Lprivate.h + ${HDF5_SRC_DIR}/H5MPprivate.h + ${HDF5_SRC_DIR}/H5Oprivate.h + ${HDF5_SRC_DIR}/H5Pprivate.h + ${HDF5_SRC_DIR}/H5RCprivate.h + ${HDF5_SRC_DIR}/H5Rprivate.h + ${HDF5_SRC_DIR}/H5RSprivate.h + ${HDF5_SRC_DIR}/H5SLprivate.h + ${HDF5_SRC_DIR}/H5SMprivate.h + ${HDF5_SRC_DIR}/H5Sprivate.h + ${HDF5_SRC_DIR}/H5STprivate.h + ${HDF5_SRC_DIR}/H5Tprivate.h + ${HDF5_SRC_DIR}/H5TSprivate.h + ${HDF5_SRC_DIR}/H5Vprivate.h + ${HDF5_SRC_DIR}/H5WBprivate.h + ${HDF5_SRC_DIR}/H5Zprivate.h +) + +IF (WIN32) + SET (H5_PRIVATE_HEADERS + ${H5_PRIVATE_HEADERS} + ${HDF5_SRC_DIR}/H5win32defs.h + ) +ENDIF (WIN32) + +INCLUDE_DIRECTORIES (${HDF5_SOURCE_DIR}) +INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR}) + +#----------------------------------------------------------------------------- +# When building utility executables that generate other (source) files : +# we make use of the following variables defined in the root CMakeLists. +# Certain systems may add /Debug or /Release to output paths +# and we need to call the executable from inside the CMake configuration +#----------------------------------------------------------------------------- +#inherit EXE_EXT from parent HDF5 cmake project +#inherit CFG_INIT from parent HDF5 cmake project + +#----------------------------------------------------------------------------- +# Setup the H5Detect utility which generates H5Tinit with platform +# specific type checks inside +#----------------------------------------------------------------------------- +SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5detect${EXE_EXT}) +IF (XCODE) + SET (CMD "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/\${CONFIGURATION}/H5detect") +ENDIF (XCODE) +ADD_EXECUTABLE (H5detect ${HDF5_SRC_DIR}/H5detect.c) +IF (MSVC) + TARGET_LINK_LIBRARIES (H5detect "ws2_32.lib") +ENDIF (MSVC) + +ADD_CUSTOM_COMMAND ( + OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c + COMMAND ${CMD} + ARGS > ${HDF5_BINARY_DIR}/H5Tinit.c + DEPENDS H5detect +) + +SET (CMDL ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5make_libsettings${EXE_EXT}) +IF (XCODE) + SET (CMDL "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/\${CONFIGURATION}/H5make_libsettings") +ENDIF (XCODE) +ADD_EXECUTABLE (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) +IF (MSVC) + TARGET_LINK_LIBRARIES (H5make_libsettings "ws2_32.lib") +ENDIF (MSVC) + +ADD_CUSTOM_COMMAND ( + OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c + COMMAND ${CMDL} + ARGS > ${HDF5_BINARY_DIR}/H5lib_settings.c + DEPENDS H5make_libsettings +) + +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 ( + 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 ( + 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 + COMMENT " Creating Assignment overflow macro" +) + +#----------------------------------------------------------------------------- +# 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_TARGET_PROPERTIES(${HDF5_LIB_TARGET} PROPERTIES DEFINE_SYMBOL ${HDF5_LIB_CORENAME}_EXPORTS) +TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} ${LINK_LIBS}) +SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) +H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} ${LIB_TYPE}) + +#----------------------------------------------------------------------------- +# Add file(s) to CMake Install +#----------------------------------------------------------------------------- +INSTALL ( + FILES + ${H5_PUBLIC_HEADERS} + ${H5_PRIVATE_HEADERS} + DESTINATION + include +) + +#----------------------------------------------------------------------------- +# Add Target(s) to CMake Install for import into other projects +#----------------------------------------------------------------------------- +IF (HDF5_EXPORTED_TARGETS) + INSTALL ( + TARGETS + ${HDF5_LIB_TARGET} + EXPORT + ${HDF5_EXPORTED_TARGETS} + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin + ) +ENDIF (HDF5_EXPORTED_TARGETS) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..70f85c2 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,253 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (H5_TEST) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- +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 + ${HDF5_TEST_SOURCE_DIR}/h5test.h +) + +#----------------------------------------------------------------------------- +# 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) +INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) + +ADD_LIBRARY (${HDF5_TEST_LIB_TARGET} ${LIB_TYPE} ${TEST_LIB_SRCS} ${TEST_LIB_HEADERS}) +IF (BUILD_SHARED_LIBS) + IF (MSVC) + TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} "ws2_32.lib") + ENDIF (MSVC) +ENDIF (BUILD_SHARED_LIBS) +TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TEST_LIB_TARGET}") +H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} ${LIB_TYPE}) + +SET (testhdf5_SRCS + ${HDF5_TEST_SOURCE_DIR}/testhdf5.c + ${HDF5_TEST_SOURCE_DIR}/tarray.c + ${HDF5_TEST_SOURCE_DIR}/tattr.c + ${HDF5_TEST_SOURCE_DIR}/tchecksum.c + ${HDF5_TEST_SOURCE_DIR}/tconfig.c + ${HDF5_TEST_SOURCE_DIR}/tcoords.c + ${HDF5_TEST_SOURCE_DIR}/tfile.c + ${HDF5_TEST_SOURCE_DIR}/tgenprop.c + ${HDF5_TEST_SOURCE_DIR}/th5o.c + ${HDF5_TEST_SOURCE_DIR}/th5s.c + ${HDF5_TEST_SOURCE_DIR}/theap.c + ${HDF5_TEST_SOURCE_DIR}/tid.c + ${HDF5_TEST_SOURCE_DIR}/titerate.c + ${HDF5_TEST_SOURCE_DIR}/tmeta.c + ${HDF5_TEST_SOURCE_DIR}/tmisc.c + ${HDF5_TEST_SOURCE_DIR}/trefer.c + ${HDF5_TEST_SOURCE_DIR}/trefstr.c + ${HDF5_TEST_SOURCE_DIR}/tselect.c + ${HDF5_TEST_SOURCE_DIR}/tskiplist.c + ${HDF5_TEST_SOURCE_DIR}/tsohm.c + ${HDF5_TEST_SOURCE_DIR}/ttime.c + ${HDF5_TEST_SOURCE_DIR}/ttst.c + ${HDF5_TEST_SOURCE_DIR}/tunicode.c + ${HDF5_TEST_SOURCE_DIR}/tvltypes.c + ${HDF5_TEST_SOURCE_DIR}/tvlstr.c +) + +#-- Adding test for testhdf5 +ADD_EXECUTABLE (testhdf5 ${testhdf5_SRCS}) +H5_NAMING (testhdf5) +TARGET_LINK_LIBRARIES (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + +ADD_TEST (NAME testhdf5 COMMAND $) + +MACRO (ADD_H5_TEST file) + ADD_EXECUTABLE (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) + H5_NAMING (${file}) + TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + + ADD_TEST (NAME ${file} COMMAND $) +ENDMACRO (ADD_H5_TEST file) + +SET (H5_TESTS + lheap + ohdr + stab + gheap + #cache + #cache_api + pool + hyperslab + istore + bittests + dt_arith + dtypes + cmpd_dset + extend + external + objcopy + links + unlink + big + mtime + fillval + mount + flush1 + flush2 + app_ref + enum + set_extent + #ttsafe + getname + vfd + ntypes + dangle + dtransform + reserved + cross_read + freespace + mf + farray + earray + btree2 + fheap +) + +FOREACH (test ${H5_TESTS}) + ADD_H5_TEST(${test}) +ENDFOREACH (test ${H5_TESTS}) + +SET (H5_CHECK_TESTS +) + +FOREACH (chktest ${H5_CHECK_TESTS}) + ADD_H5_TEST(${chktest}) +ENDFOREACH (chktest ${H5_CHECK_TESTS}) + +#-- Allow extra time for fheap to complete 30min +IF (WIN32) + SET_TESTS_PROPERTIES (fheap PROPERTIES TIMEOUT 1800) +ENDIF (WIN32) + +#-- Adding test for cache +ADD_EXECUTABLE (cache ${HDF5_TEST_SOURCE_DIR}/cache.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) +H5_NAMING (cache) +TARGET_LINK_LIBRARIES (cache ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + +ADD_TEST (NAME cache COMMAND $) + +ADD_EXECUTABLE (cache_api ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) +H5_NAMING (cache_api) +TARGET_LINK_LIBRARIES (cache_api ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + +ADD_TEST (NAME cache_api COMMAND $) + +#-- Adding test for ttsafe +SET (ttsafe_SRCS + ttsafe.c + ttsafe_dcreate.c + ttsafe_error.c + ttsafe_cancel.c + ttsafe_acreate.c +) + +ADD_EXECUTABLE (ttsafe ${ttsafe_SRCS}) +H5_NAMING (ttsafe) +TARGET_LINK_LIBRARIES (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + +ADD_TEST (NAME ttsafe COMMAND $) + +#-- Copy all the HDF5 files from the test directory into the source directory +SET (HDF5_REFERENCE_TEST_FILES + tnullspace.h5 +) + +FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") + #MESSAGE (STATUS " Copying ${h5_file}") + ADD_CUSTOM_COMMAND ( + TARGET ${HDF5_TEST_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ) +ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + + +#-- Copy all the HDF5 files from the test directory into the source directory +SET (HDF5_REFERENCE_TEST_FILES + be_data.h5 + be_extlink1.h5 + be_extlink2.h5 + corrupt_stab_msg.h5 + deflate.h5 + family_v16_00000.h5 + family_v16_00001.h5 + family_v16_00002.h5 + family_v16_00003.h5 + filespace_1_6.h5 + filespace_1_8.h5 + fill_old.h5 + group_old.h5 + le_data.h5 + le_extlink1.h5 + le_extlink2.h5 + mergemsg.h5 + noencoder.h5 + specmetaread.h5 + tarrold.h5 + tbad_msg_count.h5 + tbogus.h5 + test_filters_be.hdf5 + test_filters_le.hdf5 + th5s.h5 + tlayouto.h5 + tmtimen.h5 + tmtimeo.h5 + vms_data.h5 +) + +FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + SET (dest "${H5_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 ${H5_TEST_SOURCE_DIR}/${h5_file} ${dest} + ) +ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + +# generator executables +IF (CREATE_GENERATORS) + SET (H5_GENERATORS + gen_bad_ohdr + gen_bogus + gen_cross + gen_deflate + gen_filters + gen_new_array + gen_new_fill + gen_new_group + gen_new_mtime + gen_new_super + gen_noencoder + gen_nullspace + gen_udlinks + space_overflow + gen_filespace + gen_specmetaread + ) + + FOREACH (gen ${H5_GENERATORS}) + ADD_EXECUTABLE (${gen} ${HDF5_TEST_SOURCE_DIR}/${gen}.c) + H5_NAMING (${gen}) + TARGET_LINK_LIBRARIES (${gen} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + ENDFOREACH (gen ${H5_GENERATORS}) + +ENDIF (CREATE_GENERATORS) diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt new file mode 100644 index 0000000..cf12342 --- /dev/null +++ b/testpar/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (H5_TEST_PAR) + +#----------------------------------------------------------------------------- +# Define Tests +#----------------------------------------------------------------------------- + +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 + ${HDF5_TEST_PAR_SOURCE_DIR}/t_mdset.c + ${HDF5_TEST_PAR_SOURCE_DIR}/t_ph5basic.c + ${HDF5_TEST_PAR_SOURCE_DIR}/t_coll_chunk.c + ${HDF5_TEST_PAR_SOURCE_DIR}/t_span_tree.c + ${HDF5_TEST_PAR_SOURCE_DIR}/t_chunk_alloc.c + ${HDF5_TEST_PAR_SOURCE_DIR}/t_filter_read.c +) + +#-- Adding test for testhdf5 +ADD_EXECUTABLE (testphdf5 ${testphdf5_SRCS}) +H5_NAMING (testphdf5) +TARGET_LINK_LIBRARIES (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + +ADD_TEST (NAME testphdf5 COMMAND $) + +MACRO (ADD_H5P_TEST file) + ADD_EXECUTABLE (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) + H5_NAMING (${file}) + TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + + ADD_TEST (NAME ${file} COMMAND $) +ENDMACRO (ADD_H5P_TEST file) + +SET (H5P_TESTS + t_mpi + t_posix_compliant + t_cache + t_pflush1 + t_pflush2 +) + +FOREACH (testp ${H5P_TESTS}) + ADD_H5P_TEST(${testp}) +ENDFOREACH (testp ${H5P_TESTS}) + diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt new file mode 100644 index 0000000..8c6e41f --- /dev/null +++ b/tools/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +# -------------------------------------------------------------------- +# If testing was NOT enabled, then we need to build the tools library +# -------------------------------------------------------------------- +IF (NOT BUILD_TESTING) + ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/lib) +ENDIF (NOT BUILD_TESTING) + +#-- Add the h5diff and test executables +ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5diff) + +#-- Add the h5ls executable +ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5ls) + +#-- Misc Executables +ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/misc) + +#-- Add the h5import and test executables +ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5import) + +#-- h5Repack executables +ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5repack) + +#-- Add the h5dump and test executables +ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5jam) + +#-- Add the h5copy and test executables +ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5copy) + +#-- Add the h5stat and test executables +ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5stat) + +#-- Add the h5dump and test executables +ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5dump) diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt new file mode 100644 index 0000000..302ad49 --- /dev/null +++ b/tools/h5copy/CMakeLists.txt @@ -0,0 +1,229 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS_H5COPY) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +# -------------------------------------------------------------------- +# Add the h5copy and test executables +# -------------------------------------------------------------------- +ADD_EXECUTABLE (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) +H5_NAMING (h5copy) +TARGET_LINK_LIBRARIES (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +SET (H5_DEP_EXECUTABLES h5copy) + +IF (BUILD_TESTING) + IF (NOT BUILD_SHARED_LIBS) + ADD_EXECUTABLE (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c) + H5_NAMING (h5copygentest) + TARGET_LINK_LIBRARIES (h5copygentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + + #ADD_TEST (NAME h5copygentest COMMAND $) + + SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} + #h5copygentest + ) + ENDIF (NOT BUILD_SHARED_LIBS) + + #-- Copy all the HDF5 files from the test directory into the source directory + SET (HDF5_REFERENCE_FILES + h5copy_extlinks_src.out.ls + h5copy_ref.out.ls + h5copytst.out.ls + ) + SET (HDF5_REFERENCE_TEST_FILES + h5copy_extlinks_src.h5 + h5copy_extlinks_trg.h5 + h5copy_ref.h5 + h5copytst.h5 + ) + + FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + FOREACH (ls_file ${HDF5_REFERENCE_FILES}) + SET (lsdest "${PROJECT_BINARY_DIR}/testfiles/${ls_file}") + #MESSAGE (STATUS " Translating ${ls_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5copy + POST_BUILD + COMMAND ${XLATE_UTILITY} + ARGS ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/${ls_file} ${lsdest} -l3 + ) + ENDFOREACH (ls_file ${HDF5_REFERENCE_FILES}) + + FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") + #MESSAGE (STATUS " Copying ${h5_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5copy + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ) + ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + + # Test files + 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) + + MACRO (ADD_H5_TEST testname resultcode testfile vparam srcname dstname) + + IF (NOT "${ARGN}" STREQUAL "") + ADD_TEST ( + NAME H5COPY-${testname} + COMMAND $ -f ${ARGN} -i ./testfiles/${testfile}.h5 -o ./testfiles/${testfile}.out.h5 -${vparam} -s ${srcname} -d ${dstname} + ) + ELSE (NOT "${ARGN}" STREQUAL "") + ADD_TEST ( + NAME H5COPY-${testname} + COMMAND $ -i ./testfiles/${testfile}.h5 -o ./testfiles/${testfile}.out.h5 -${vparam} -s ${srcname} -d ${dstname} + ) + ENDIF (NOT "${ARGN}" STREQUAL "") + IF (NOT ${resultcode} STREQUAL "2") + ADD_TEST ( + NAME H5COPY-DIFF_${testname} + COMMAND $ -q ./testfiles/${testfile}.h5 ./testfiles/${testfile}.out.h5 ${srcname} ${dstname} + ) + IF (${resultcode} STREQUAL "1") + SET_TESTS_PROPERTIES (H5COPY-DIFF_${testname} PROPERTIES WILL_FAIL "true") + ENDIF (${resultcode} STREQUAL "1") + ENDIF (NOT ${resultcode} STREQUAL "2") + ENDMACRO (ADD_H5_TEST testname resultcode testfile vparam srcname dstname) + + + MACRO (ADD_H5LS_TEST file) + ADD_TEST ( + NAME H5COPY-H5LS_${file} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=-Svr;./testfiles/${file}.out.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${file}.out.out" + -D "TEST_EXPECT=0" + -D "TEST_REFERENCE=./testfiles/${file}.out.ls" + -D "TEST_MASK=true" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDMACRO (ADD_H5LS_TEST file) + +############# COPY OBJECTS ############## + + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${HDF_FILE1}.out.h5 + ./testfiles/${HDF_FILE1}.out.out + ) + + # "Test copying various forms of datasets" + ADD_H5_TEST (simple 0 ${HDF_FILE1} v simple simple) + ADD_H5_TEST (chunk 0 ${HDF_FILE1} v chunk chunk) + ADD_H5_TEST (compact 0 ${HDF_FILE1} v compact compact) + ADD_H5_TEST (compound 0 ${HDF_FILE1} v compound compound) + ADD_H5_TEST (compressed 0 ${HDF_FILE1} v compressed compressed) + ADD_H5_TEST (named_vl 0 ${HDF_FILE1} v named_vl named_vl) + ADD_H5_TEST (nested_vl 0 ${HDF_FILE1} v nested_vl nested_vl) + + # "Test copying dataset within group in source file to root of destination" + ADD_H5_TEST (simple_top 0 ${HDF_FILE1} v grp_dsets/simple simple_top) + + # "Test copying & renaming dataset" + ADD_H5_TEST (rename 0 ${HDF_FILE1} v compound rename) + + # "Test copying empty, 'full' & 'nested' groups" + ADD_H5_TEST (grp_empty 0 ${HDF_FILE1} v grp_empty grp_empty) + ADD_H5_TEST (grp_dsets 0 ${HDF_FILE1} v grp_dsets grp_dsets) + ADD_H5_TEST (grp_nested 0 ${HDF_FILE1} v grp_nested grp_nested) + + # "Test copying dataset within group in source file to group in destination" + ADD_H5_TEST (simple_group 0 ${HDF_FILE1} v /grp_dsets/simple /grp_dsets/simple_group) + + # "Test copying & renaming group" + ADD_H5_TEST (grp_rename 1 ${HDF_FILE1} v grp_dsets grp_rename) + + # "Test copying 'full' group hierarchy into group in destination file" + ADD_H5_TEST (grp_dsets_rename 1 ${HDF_FILE1} v grp_dsets /grp_rename/grp_dsets) + + # "Test copying objects into group hier. that doesn't exist yet in destination file" + ADD_H5_TEST (A_B1_simple 0 ${HDF_FILE1} vp simple /A/B1/simple) + ADD_H5_TEST (A_B2_simple2 0 ${HDF_FILE1} vp simple /A/B2/simple2) + ADD_H5_TEST (C_D_simple 0 ${HDF_FILE1} vp /grp_dsets/simple /C/D/simple) + ADD_H5_TEST (E_F_grp_dsets 1 ${HDF_FILE1} vp /grp_dsets /E/F/grp_dsets) + ADD_H5_TEST (G_H_grp_nested 1 ${HDF_FILE1} vp /grp_nested /G/H/grp_nested) + + # Verify that the file created above is correct + ADD_H5LS_TEST (${HDF_FILE1}) + +############# COPY REFERENCES ############## + + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-clear-refs + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${HDF_FILE2}.out.h5 + ./testfiles/${HDF_FILE2}.out.out + ) + + # "Test copying object and region references" + ADD_H5_TEST (region_ref 2 ${HDF_FILE2} v / /COPY ref) + + # Verify that the file created above is correct + ADD_H5LS_TEST (${HDF_FILE2}) + +############# COPY EXT LINKS ############## + + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-clear-ext-links + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${HDF_EXT_SRC_FILE}.out.h5 + ./testfiles/${HDF_EXT_SRC_FILE}.out.out + ) + + # "Test copying external link directly without -f ext" + ADD_H5_TEST (ext_link 2 ${HDF_EXT_SRC_FILE} v /group_ext/extlink_dset /copy1_dset) + + # "Test copying external link directly with -f ext" + ADD_H5_TEST (ext_link_f 2 ${HDF_EXT_SRC_FILE} v /group_ext/extlink_dset /copy2_dset ext) + + # "Test copying dangling external link (no obj) directly without -f ext" + ADD_H5_TEST (ext_dangle_noobj 0 ${HDF_EXT_SRC_FILE} v /group_ext/extlink_notyet1 /copy_dangle1_1) + + # "Test copying dangling external link (no obj) directly with -f ext" + ADD_H5_TEST (ext_dangle_noobj_f 2 ${HDF_EXT_SRC_FILE} v /group_ext/extlink_notyet1 /copy_dangle1_2 ext) + + # "Test copying dangling external link (no file) directly without -f ext" + ADD_H5_TEST (ext_dangle_nofile 0 ${HDF_EXT_SRC_FILE} v /group_ext/extlink_notyet2 /copy_dangle2_1) + + # "Test copying dangling external link (no file) directly with -f ext" + ADD_H5_TEST (ext_dangle_nofile_f 2 ${HDF_EXT_SRC_FILE} v /group_ext/extlink_notyet2 /copy_dangle2_2 ext) + + # "Test copying a group contains external links without -f ext" + ADD_H5_TEST (ext_link_group 2 ${HDF_EXT_SRC_FILE} v /group_ext /copy1_group) + + # "Test copying a group contains external links with -f ext" + ADD_H5_TEST (ext_link_group_f 2 ${HDF_EXT_SRC_FILE} v /group_ext /copy2_group ext) + + # Verify that the file created above is correct + ADD_H5LS_TEST (${HDF_EXT_SRC_FILE}) + +ENDIF (BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- +INSTALL ( + TARGETS + h5copy + RUNTIME DESTINATION + bin/tools +) diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt new file mode 100644 index 0000000..b4ae18b --- /dev/null +++ b/tools/h5diff/CMakeLists.txt @@ -0,0 +1,654 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS_H5DIFF) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +# -------------------------------------------------------------------- +# Add the h5diff and test executables +# -------------------------------------------------------------------- +ADD_EXECUTABLE (h5diff + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_common.c + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_main.c +) +H5_NAMING (h5diff) +TARGET_LINK_LIBRARIES (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +SET (H5_DEP_EXECUTABLES h5diff) + +IF (BUILD_TESTING) + IF (NOT BUILD_SHARED_LIBS) + ADD_EXECUTABLE (h5diffgentest ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diffgentest.c) + H5_NAMING (h5diffgentest) + TARGET_LINK_LIBRARIES (h5diffgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + + #ADD_TEST (NAME h5diffgentest COMMAND $) + + SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} + # h5diffgentest + ) + ENDIF (NOT BUILD_SHARED_LIBS) + + #-- Copy all the HDF5 files from the test directory into the source directory + SET (HDF5_REFERENCE_FILES + h5diff_10.txt + h5diff_100.txt + #h5diff_101.txt + #h5diff_102.txt + h5diff_11.txt + h5diff_12.txt + h5diff_13.txt + h5diff_14.txt + h5diff_15.txt + h5diff_16_1.txt + h5diff_16_2.txt + h5diff_16_3.txt + h5diff_17.txt + h5diff_171.txt + h5diff_172.txt + h5diff_18_1.txt + h5diff_18.txt + h5diff_20.txt + h5diff_200.txt + h5diff_201.txt + h5diff_202.txt + h5diff_203.txt + h5diff_204.txt + h5diff_205.txt + h5diff_206.txt + h5diff_207.txt + h5diff_21.txt + h5diff_22.txt + h5diff_23.txt + h5diff_24.txt + h5diff_25.txt + h5diff_26.txt + h5diff_27.txt + h5diff_28.txt + h5diff_300.txt + h5diff_400.txt + h5diff_401.txt + h5diff_402.txt + h5diff_403.txt + h5diff_404.txt + h5diff_405.txt + h5diff_406.txt + h5diff_407.txt + h5diff_408.txt + h5diff_409.txt + h5diff_410.txt + h5diff_411.txt + h5diff_412.txt + h5diff_413.txt + h5diff_414.txt + h5diff_415.txt + h5diff_416.txt + h5diff_417.txt + h5diff_418.txt + h5diff_419.txt + h5diff_420.txt + h5diff_421.txt + h5diff_422.txt + h5diff_423.txt + h5diff_424.txt + h5diff_425.txt + h5diff_450.txt + h5diff_451.txt + h5diff_452.txt + h5diff_453.txt + h5diff_454.txt + h5diff_455.txt + h5diff_456.txt + h5diff_457.txt + h5diff_458.txt + h5diff_459.txt + h5diff_50.txt + h5diff_51.txt + h5diff_52.txt + h5diff_53.txt + h5diff_54.txt + h5diff_55.txt + h5diff_56.txt + h5diff_57.txt + h5diff_58.txt + h5diff_600.txt + h5diff_603.txt + h5diff_604.txt + h5diff_605.txt + h5diff_606.txt + h5diff_607.txt + h5diff_608.txt + h5diff_609.txt + h5diff_610.txt + h5diff_612.txt + h5diff_613.txt + h5diff_614.txt + h5diff_615.txt + h5diff_616.txt + h5diff_617.txt + h5diff_618.txt + h5diff_619.txt + h5diff_621.txt + h5diff_622.txt + h5diff_623.txt + h5diff_624.txt + h5diff_625.txt + h5diff_626.txt + h5diff_627.txt + h5diff_628.txt + h5diff_629.txt + h5diff_70.txt + h5diff_80.txt + h5diff_90.txt + ) + SET (HDF5_REFERENCE_TEST_FILES + h5diff_basic1.h5 + h5diff_basic2.h5 + h5diff_types.h5 + h5diff_dtypes.h5 + h5diff_attr1.h5 + h5diff_attr2.h5 + h5diff_dset1.h5 + h5diff_dset2.h5 + h5diff_hyper1.h5 + h5diff_hyper2.h5 + h5diff_empty.h5 + h5diff_links.h5 + h5diff_softlinks.h5 + h5diff_linked_softlink.h5 + h5diff_extlink_src.h5 + h5diff_extlink_trg.h5 + h5diff_ext2softlink_src.h5 + h5diff_ext2softlink_trg.h5 + h5diff_danglelinks1.h5 + h5diff_danglelinks2.h5 + ) + + FOREACH (txt_file ${HDF5_REFERENCE_FILES}) + SET (txtdest "${PROJECT_BINARY_DIR}/${txt_file}") + #MESSAGE (STATUS " Translating ${txt_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5diff + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/${txt_file} ${txtdest} + ) + ENDFOREACH (txt_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 ( + TARGET h5diff + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ) + ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + + IF (WIN32) + 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}/h5diff_101.txt + ) + + 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}/h5diff_102.txt + ) + ELSE (WIN32) + ADD_CUSTOM_COMMAND ( + TARGET h5diff + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_101.txt ${PROJECT_BINARY_DIR}/h5diff_101.txt + ) + + ADD_CUSTOM_COMMAND ( + TARGET h5diff + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_102.txt ${PROJECT_BINARY_DIR}/h5diff_102.txt + ) + ENDIF (WIN32) + + MACRO (ADD_H5_TEST resultfile resultcode) + ADD_TEST ( + NAME H5DIFF-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.txt" + -D "TEST_APPEND=EXIT CODE:" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDMACRO (ADD_H5_TEST file) + + +############################################################################### +## 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 (DANGLE_LINK_FILE1 h5diff_danglelinks1.h5) +SET (DANGLE_LINK_FILE2 h5diff_danglelinks2.h5) + +# ############################################################################ +# # Common usage +# ############################################################################ + +# 1.0 +ADD_H5_TEST (h5diff_10 0 -h) + +# 1.1 normal mode +ADD_H5_TEST (h5diff_11 1 ${FILE1} ${FILE2}) + +# 1.2 normal mode with objects +ADD_H5_TEST (h5diff_12 1 ${FILE1} ${FILE2} g1/dset1 g1/dset2) + +# 1.3 report mode +ADD_H5_TEST (h5diff_13 1 -r ${FILE1} ${FILE2}) + +# 1.4 report mode with objects +ADD_H5_TEST (h5diff_14 1 -r ${FILE1} ${FILE2} g1/dset1 g1/dset2) + +# 1.5 with -d +ADD_H5_TEST (h5diff_15 1 --report --delta=5 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 1.6.1 with -p (int) +ADD_H5_TEST (h5diff_16_1 1 -v -p 0.02 ${FILE1} ${FILE1} g1/dset5 g1/dset6) + +# 1.6.2 with -p (unsigned long_long) +ADD_H5_TEST (h5diff_16_2 1 --verbose --relative=0.02 ${FILE1} ${FILE1} g1/dset7 g1/dset8) + +# 1.6.3 with -p (double) +ADD_H5_TEST (h5diff_16_3 1 -v -p 0.02 ${FILE1} ${FILE1} g1/dset9 g1/dset10) + +# 1.7 verbose mode +ADD_H5_TEST (h5diff_17 1 -v ${FILE1} ${FILE2}) + +# 1.7 test 32-bit INFINITY +ADD_H5_TEST (h5diff_171 0 -v ${FILE1} ${FILE1} /g1/fp19) + +# 1.7 test 64-bit INFINITY +ADD_H5_TEST (h5diff_172 0 -v ${FILE1} ${FILE1} /g1/fp20) + +# 1.8 quiet mode +ADD_H5_TEST (h5diff_18 1 -q ${FILE1} ${FILE2}) + +# 1.8 -v and -q +ADD_H5_TEST (h5diff_18_1 2 -v -q ${FILE1} ${FILE2}) + + +# ############################################################################## +# # not comparable types +# ############################################################################## + +# 2.0 +ADD_H5_TEST (h5diff_20 0 -v ${FILE3} ${FILE3} dset g1) + +# 2.1 +ADD_H5_TEST (h5diff_21 0 -v ${FILE3} ${FILE3} dset l1) + +# 2.2 +ADD_H5_TEST (h5diff_22 0 -v ${FILE3} ${FILE3} dset t1) + +# ############################################################################## +# # compare groups, types, links (no differences and differences) +# ############################################################################## + +# 2.3 +ADD_H5_TEST (h5diff_23 0 -v ${FILE3} ${FILE3} g1 g1) + +# 2.4 +ADD_H5_TEST (h5diff_24 0 -v ${FILE3} ${FILE3} t1 t1) + +# 2.5 +ADD_H5_TEST (h5diff_25 0 -v ${FILE3} ${FILE3} l1 l1) + +# 2.6 +ADD_H5_TEST (h5diff_26 1 -v ${FILE3} ${FILE3} g1 g2) + +# 2.7 +ADD_H5_TEST (h5diff_27 1 -v ${FILE3} ${FILE3} t1 t2) + +# 2.8 +ADD_H5_TEST (h5diff_28 1 -v ${FILE3} ${FILE3} l1 l2) + + + +# ############################################################################## +# # Dataset datatypes +# ############################################################################## + +# 5.0 +ADD_H5_TEST (h5diff_50 1 -v ${FILE4} ${FILE4} dset0a dset0b) + +# 5.1 +ADD_H5_TEST (h5diff_51 1 -v ${FILE4} ${FILE4} dset1a dset1b) + +# 5.2 +ADD_H5_TEST (h5diff_52 1 -v ${FILE4} ${FILE4} dset2a dset2b) + +# 5.3 +ADD_H5_TEST (h5diff_53 1 -v ${FILE4} ${FILE4} dset3a dset4b) + +# 5.4 +ADD_H5_TEST (h5diff_54 1 -v ${FILE4} ${FILE4} dset4a dset4b) + +# 5.5 +ADD_H5_TEST (h5diff_55 1 -v ${FILE4} ${FILE4} dset5a dset5b) + +# 5.6 +ADD_H5_TEST (h5diff_56 1 -v ${FILE4} ${FILE4} dset6a dset6b) + +# 5.7 +ADD_H5_TEST (h5diff_57 0 -v ${FILE4} ${FILE4} dset7a dset7b) + +# 5.8 (region reference) +ADD_H5_TEST (h5diff_58 1 -v ${FILE7} ${FILE8} refreg) + +# ############################################################################## +# # Error messages +# ############################################################################## + + +# 6.0: Check if the command line number of arguments is less than 3 +ADD_H5_TEST (h5diff_600 1 ${FILE1}) + + +# ############################################################################## +# # -d +# ############################################################################## + + +# 6.3: negative value +ADD_H5_TEST (h5diff_603 1 -d -4 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.4: zero +ADD_H5_TEST (h5diff_604 1 -d 0 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.5: non number +ADD_H5_TEST (h5diff_605 1 -d u ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.6: hexadecimal +ADD_H5_TEST (h5diff_606 1 -d 0x1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.7: string +ADD_H5_TEST (h5diff_607 1 -d "1" ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.8: use system epsilon +ADD_H5_TEST (h5diff_608 1 --use-system-epsilon ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.9: number larger than biggest difference +ADD_H5_TEST (h5diff_609 0 -d 200 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.10: number smaller than smallest difference +ADD_H5_TEST (h5diff_610 1 -d 1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# ############################################################################## +# # -p +# ############################################################################## + +# 6.12: negative value +ADD_H5_TEST (h5diff_612 1 -p -4 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.13: zero +ADD_H5_TEST (h5diff_613 1 -p 0 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.14: non number +ADD_H5_TEST (h5diff_614 1 -p u ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.15: hexadecimal +ADD_H5_TEST (h5diff_615 1 -p 0x1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.16: string +ADD_H5_TEST (h5diff_616 1 -p "0.21" ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.17: repeated option +ADD_H5_TEST (h5diff_617 1 -p 0.21 -p 0.22 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.18: number larger than biggest difference +ADD_H5_TEST (h5diff_618 0 -p 2 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.19: number smaller than smallest difference +ADD_H5_TEST (h5diff_619 1 -p 0.005 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + + +# ############################################################################## +# # -n +# ############################################################################## + +# 6.21: negative value +ADD_H5_TEST (h5diff_621 1 -n -4 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.22: zero +ADD_H5_TEST (h5diff_622 1 -n 0 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.23: non number +ADD_H5_TEST (h5diff_623 1 -n u ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.24: hexadecimal +ADD_H5_TEST (h5diff_624 1 -n 0x1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.25: string +ADD_H5_TEST (h5diff_625 1 -n "2" ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.26: repeated option +ADD_H5_TEST (h5diff_626 1 -n 2 -n 3 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.27: number larger than biggest difference +ADD_H5_TEST (h5diff_627 1 --count=200 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.28: number smaller than smallest difference +ADD_H5_TEST (h5diff_628 1 -n 1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# Disabling this test as it hangs - LRK 20090618 +# 6.29 non valid files +#ADD_H5_TEST (h5diff_629 2 file1.h6 file2.h6) + +# ############################################################################## +# 7. attributes +# ############################################################################## +ADD_H5_TEST (h5diff_70 1 -v ${FILE5} ${FILE6}) + +# ############################################################################## +# 8. all dataset datatypes +# ############################################################################## +ADD_H5_TEST (h5diff_80 1 -v ${FILE7} ${FILE8}) + +# 9. compare a file with itself +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}) +#else +# ADD_H5_TEST (h5diff_100 1 -v ${FILE9} ${FILE10}) +#fi + +# 11. floating point comparison +ADD_H5_TEST (h5diff_101 1 -v ${FILE1} ${FILE1} g1/d1 g1/d2) + +ADD_H5_TEST (h5diff_102 1 -v ${FILE1} ${FILE1} g1/fp1 g1/fp2) + + +# not comparable -c flag +ADD_H5_TEST (h5diff_200 0 ${FILE2} ${FILE2} g2/dset1 g2/dset2) + +ADD_H5_TEST (h5diff_201 0 -c ${FILE2} ${FILE2} g2/dset1 g2/dset2) + +ADD_H5_TEST (h5diff_202 0 -c ${FILE2} ${FILE2} g2/dset2 g2/dset3) + +ADD_H5_TEST (h5diff_203 0 -c ${FILE2} ${FILE2} g2/dset3 g2/dset4) + +ADD_H5_TEST (h5diff_204 0 -c ${FILE2} ${FILE2} g2/dset4 g2/dset5) + +ADD_H5_TEST (h5diff_205 0 -c ${FILE2} ${FILE2} g2/dset5 g2/dset6) + + +# not comparable in compound +ADD_H5_TEST (h5diff_206 0 -c ${FILE2} ${FILE2} g2/dset7 g2/dset8) + +ADD_H5_TEST (h5diff_207 0 -c ${FILE2} ${FILE2} g2/dset8 g2/dset9) + +# ############################################################################## +# # Links compare without --follow-links nor --no-dangling-links +# ############################################################################## +# test for bug1749 +ADD_H5_TEST (h5diff_300 1 -v ${FILE12} ${FILE12} /link_g1 /link_g2) + +# ############################################################################## +# # Links compare with --follow-links Only +# ############################################################################## +# soft links file to file +ADD_H5_TEST (h5diff_400 0 --follow-links -v ${FILE13} ${FILE13}) + +# softlink vs dset" +ADD_H5_TEST (h5diff_401 1 --follow-links -v ${FILE13} ${FILE13} /softlink_dset1_1 /target_dset2) + +# dset vs softlink" +ADD_H5_TEST (h5diff_402 1 --follow-links -v ${FILE13} ${FILE13} /target_dset2 /softlink_dset1_1) + +# softlink vs softlink" +ADD_H5_TEST (h5diff_403 1 --follow-links -v ${FILE13} ${FILE13} /softlink_dset1_1 /softlink_dset2) + +# extlink vs extlink (FILE)" +ADD_H5_TEST (h5diff_404 0 --follow-links -v ${FILE15} ${FILE15}) + +# extlink vs dset" +ADD_H5_TEST (h5diff_405 1 --follow-links -v ${FILE15} ${FILE16} /ext_link_dset1 /target_group2/x_dset) + +# dset vs extlink" +ADD_H5_TEST (h5diff_406 1 --follow-links -v ${FILE16} ${FILE15} /target_group2/x_dset /ext_link_dset1) + +# extlink vs extlink" +ADD_H5_TEST (h5diff_407 1 --follow-links -v ${FILE15} ${FILE15} /ext_link_dset1 /ext_link_dset2) + +# softlink vs extlink" +ADD_H5_TEST (h5diff_408 1 --follow-links -v ${FILE13} ${FILE15} /softlink_dset1_1 /ext_link_dset2) + +# extlink vs softlink " +ADD_H5_TEST (h5diff_409 1 --follow-links -v ${FILE15} ${FILE13} /ext_link_dset2 /softlink_dset1_1) + +# linked_softlink vs linked_softlink (FILE)" +ADD_H5_TEST (h5diff_410 0 --follow-links -v ${FILE14} ${FILE14}) + +# dset2 vs linked_softlink_dset1" +ADD_H5_TEST (h5diff_411 1 --follow-links -v ${FILE14} ${FILE14} /target_dset2 /softlink1_to_slink2) + +# linked_softlink_dset1 vs dset2" +ADD_H5_TEST (h5diff_412 1 --follow-links -v ${FILE14} ${FILE14} /softlink1_to_slink2 /target_dset2) + +# linked_softlink_to_dset1 vs linked_softlink_to_dset2" +ADD_H5_TEST (h5diff_413 1 --follow-links -v ${FILE14} ${FILE14} /softlink1_to_slink2 /softlink2_to_slink2) + +# group vs linked_softlink_group1" +ADD_H5_TEST (h5diff_414 1 --follow-links -v ${FILE14} ${FILE14} /target_group /softlink3_to_slink2) + +# linked_softlink_group1 vs group" +ADD_H5_TEST (h5diff_415 1 --follow-links -v ${FILE14} ${FILE14} /softlink3_to_slink2 /target_group) + +# linked_softlink_to_group1 vs linked_softlink_to_group2" +ADD_H5_TEST (h5diff_416 1 --follow-links -v ${FILE14} ${FILE14} /softlink3_to_slink2 /softlink4_to_slink2) + +# non-exist-softlink vs softlink" +ADD_H5_TEST (h5diff_417 1 --follow-links -v ${FILE13} ${FILE13} /softlink_noexist /softlink_dset2) + +# softlink vs non-exist-softlink" +ADD_H5_TEST (h5diff_418 1 --follow-links -v ${FILE13} ${FILE13} /softlink_dset2 /softlink_noexist) + +# non-exist-extlink_file vs extlink" +ADD_H5_TEST (h5diff_419 1 --follow-links -v ${FILE15} ${FILE15} /ext_link_noexist2 /ext_link_dset2) + +# exlink vs non-exist-extlink_file" +ADD_H5_TEST (h5diff_420 1 --follow-links -v ${FILE15} ${FILE15} /ext_link_dset2 /ext_link_noexist2) + +# extlink vs non-exist-extlink_obj" +ADD_H5_TEST (h5diff_421 1 --follow-links -v ${FILE15} ${FILE15} /ext_link_dset2 /ext_link_noexist1) + +# non-exist-extlink_obj vs extlink" +ADD_H5_TEST (h5diff_422 1 --follow-links -v ${FILE15} ${FILE15} /ext_link_noexist1 /ext_link_dset2) + +# extlink_to_softlink_to_dset1 vs dset2" +ADD_H5_TEST (h5diff_423 1 --follow-links -v ${FILE17} ${FILE18} /ext_link_to_slink1 /dset2) + +# dset2 vs extlink_to_softlink_to_dset1" +ADD_H5_TEST (h5diff_424 1 --follow-links -v ${FILE18} ${FILE17} /dset2 /ext_link_to_slink1) + +# extlink_to_softlink_to_dset1 vs extlink_to_softlink_to_dset2" +ADD_H5_TEST (h5diff_425 1 --follow-links -v ${FILE17} ${FILE17} /ext_link_to_slink1 /ext_link_to_slink2) + + +# ############################################################################## +# # Dangling links compare (--follow-links and --no-dangling-links) +# ############################################################################## +# dangling links --follow-links (FILE to FILE) +ADD_H5_TEST (h5diff_450 1 --follow-links -v ${DANGLE_LINK_FILE1} ${DANGLE_LINK_FILE2}) + +# dangling links --follow-links and --no-dangling-links (FILE to FILE) +ADD_H5_TEST (h5diff_451 2 --follow-links -v --no-dangling-links ${DANGLE_LINK_FILE1} ${DANGLE_LINK_FILE2}) + +# try --no-dangling-links without --follow-links options +ADD_H5_TEST (h5diff_452 2 --no-dangling-links ${FILE13} ${FILE13}) + +# dangling link found for soft links (FILE to FILE) +ADD_H5_TEST (h5diff_453 2 --follow-links -v --no-dangling-links ${FILE13} ${FILE13}) + +# dangling link found for soft links (obj to obj) +ADD_H5_TEST (h5diff_454 2 --follow-links -v --no-dangling-links ${FILE13} ${FILE13} /softlink_dset2 /softlink_noexist) + +# dangling link found for soft links (obj to obj) Both dangle links +ADD_H5_TEST (h5diff_455 2 --follow-links -v --no-dangling-links ${FILE13} ${FILE13} /softlink_noexist /softlink_noexist) + +# dangling link found for ext links (FILE to FILE) +ADD_H5_TEST (h5diff_456 2 --follow-links -v --no-dangling-links ${FILE15} ${FILE15}) + +# dangling link found for ext links (obj to obj). target file exist +ADD_H5_TEST (h5diff_457 2 --follow-links -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_dset1 /ext_link_noexist1) + +# dangling link found for ext links (obj to obj). target file NOT exist +ADD_H5_TEST (h5diff_458 2 --follow-links -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_dset1 /ext_link_noexist2) + +# dangling link found for ext links (obj to obj). Both dangle links +ADD_H5_TEST (h5diff_459 2 --follow-links -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_noexist1 /ext_link_noexist2) + +ENDIF (BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- +INSTALL ( + TARGETS + h5diff + RUNTIME DESTINATION + bin/tools +) diff --git a/tools/h5diff/testfiles/h5diff_101w.txt b/tools/h5diff/testfiles/h5diff_101w.txt new file mode 100755 index 0000000..59176a2 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_101w.txt @@ -0,0 +1,10 @@ +dataset: and +size: [3x2] [3x2] +position d1 d2 difference +------------------------------------------------------------ +[ 0 1 ] 1e-009 2e-009 1e-009 +[ 1 0 ] 1e-009 9e-010 1e-010 +[ 1 1 ] 0 1e-009 1e-009 +[ 2 0 ] 1e-009 0 1e-009 +4 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_102w.txt b/tools/h5diff/testfiles/h5diff_102w.txt new file mode 100755 index 0000000..36a254e --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_102w.txt @@ -0,0 +1,10 @@ +dataset: and +size: [3x2] [3x2] +position fp1 fp2 difference +------------------------------------------------------------ +[ 0 1 ] 1e-005 2e-005 1e-005 +[ 1 0 ] 1e-005 9e-006 9.99999e-007 +[ 1 1 ] 0 1e-005 1e-005 +[ 2 0 ] 1e-005 0 1e-005 +4 differences found +EXIT CODE: 1 diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt new file mode 100644 index 0000000..e19acc4 --- /dev/null +++ b/tools/h5dump/CMakeLists.txt @@ -0,0 +1,611 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS_H5DUMP) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +# -------------------------------------------------------------------- +# Add the h5dump and test executables +# -------------------------------------------------------------------- +ADD_EXECUTABLE (h5dump ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump.c) +H5_NAMING (h5dump) +TARGET_LINK_LIBRARIES (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +SET (H5_DEP_EXECUTABLES h5dump) + +IF (BUILD_TESTING) + IF (NOT BUILD_SHARED_LIBS) + ADD_EXECUTABLE (h5dumpgentest ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) + H5_NAMING (h5dumpgentest) + TARGET_LINK_LIBRARIES (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + + #ADD_TEST (NAME h5dumpgentest COMMAND $) + + SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} + # h5dumpgentest + ) + ENDIF (NOT BUILD_SHARED_LIBS) + + #-- Copy all the HDF5 files from the test directory into the source directory + SET (HDF5_REFERENCE_FILES + tall-1.ddl + tall-2.ddl + tall-2A.ddl + tall-2B.ddl + tall-3.ddl + tall-4s.ddl + tall-5s.ddl + tallfilters.ddl + tarray1.ddl + tarray2.ddl + tarray3.ddl + tarray4.ddl + tarray5.ddl + tarray6.ddl + tarray7.ddl + tarray8.ddl + tattr-1.ddl + tattr-2.ddl + tattr-3.ddl + tattrreg.ddl + tattrregR.ddl + tbigdims.ddl + tboot1.ddl + tboot2.ddl + tchar1.ddl + tchunked.ddl + tcomp-1.ddl + tcomp-2.ddl + tcomp-3.ddl + tcomp-4.ddl + tcompact.ddl + tcontents.ddl + tcontiguos.ddl + tdatareg.ddl + tdataregR.ddl + tdeflate.ddl + tdset-1.ddl + tdset-2.ddl + tdset-3s.ddl + tempty.ddl + texternal.ddl + textlinksrc.ddl + textlinkfar.ddl + tfamily.ddl + tfill.ddl + tfletcher32.ddl + tfpformat.ddl + tgroup-1.ddl + tgroup-2.ddl + tgrp_comments.ddl + thlink-1.ddl + thlink-2.ddl + thlink-3.ddl + thlink-4.ddl + thlink-5.ddl + thyperslab.ddl + tindicesno.ddl + tindicessub1.ddl + tindicessub2.ddl + tindicessub3.ddl + tindicessub4.ddl + tindicesyes.ddl + tlarge_objname.ddl + #tldouble.ddl + tlonglinks.ddl + tloop-1.ddl + tmulti.ddl + tnamed_dtype_attr.ddl + tnestcomp-1.ddl + tnbit.ddl + tnofilename-with-packed-bits.ddl + tnofilename.ddl + tnullspace.ddl + tordergr1.ddl + tordergr2.ddl + tordergr3.ddl + tordergr4.ddl + tordergr5.ddl + torderattr1.ddl + torderattr2.ddl + torderattr3.ddl + torderattr4.ddl + tpackedbits.ddl + tpackedbits2.ddl + tperror.ddl + treference.ddl + tsaf.ddl + tscaleoffset.ddl + tshuffle.ddl + tslink-1.ddl + tslink-2.ddl + tsplit_file.ddl + tstr-1.ddl + tstr-2.ddl + tstring.ddl + tstring2.ddl + tstringe.ddl + tszip.ddl + tudlink-1.ddl + tudlink-2.ddl + tuserfilter.ddl + tvldtypes1.ddl + tvldtypes2.ddl + tvldtypes3.ddl + tvldtypes4.ddl + tvldtypes5.ddl + tvlstr.ddl + tvms.ddl + ) + SET (HDF5_REFERENCE_TEST_FILES + tbin1.ddl + tbin1.ddl + tbin2.ddl + tbin3.ddl + tbin4.ddl + out3.h5import + taindices.h5 + tall.h5 + tarray1.h5 + tarray2.h5 + tarray3.h5 + tarray4.h5 + tarray5.h5 + tarray6.h5 + tarray7.h5 + tarray8.h5 + tattr.h5 + tattr2.h5 + tattrreg.h5 + tbigdims.h5 + tbinary.h5 + tchar.h5 + tcompound.h5 + tcompound_complex.h5 + tdatareg.h5 + tdset.h5 + tempty.h5 + textlinkfar.h5 + textlinksrc.h5 + textlinktar.h5 + tfamily00000.h5 + tfamily00001.h5 + tfamily00002.h5 + tfamily00003.h5 + tfamily00004.h5 + tfamily00005.h5 + tfamily00006.h5 + tfamily00007.h5 + tfamily00008.h5 + tfamily00009.h5 + tfamily00010.h5 + tfcontents1.h5 + tfcontents2.h5 + tfilters.h5 + tfpformat.h5 + tfvalues.h5 + tgroup.h5 + tgrp_comments.h5 + thlink.h5 + thyperslab.h5 + tlarge_objname.h5 + #tldouble.h5 + tlonglinks.h5 + tloop.h5 + tmulti-b.h5 + tmulti-g.h5 + tmulti-l.h5 + tmulti-o.h5 + tmulti-r.h5 + tmulti-s.h5 + tnamed_dtype_attr.h5 + tnestedcomp.h5 + tnullspace.h5 + torderattr.h5 + tordergr.h5 + tsaf.h5 + tslink.h5 + tsplit_file-m.h5 + tsplit_file-r.h5 + tstr.h5 + tstr2.h5 + tstr3.h5 + tudlink.h5 + tvldtypes1.h5 + tvldtypes2.h5 + tvldtypes3.h5 + tvldtypes4.h5 + tvldtypes5.h5 + tvlstr.h5 + tvms.h5 + ) + + FOREACH (ddl_file ${HDF5_REFERENCE_FILES}) + SET (ddldest "${PROJECT_BINARY_DIR}/${ddl_file}") + #MESSAGE (STATUS " Translating ${ddl_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5dump + POST_BUILD + COMMAND ${XLATE_UTILITY} + ARGS ${HDF5_TOOLS_SOURCE_DIR}/testfiles/${ddl_file} ${ddldest} -l3 + ) + 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 ( + TARGET h5dump + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ) + ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + + 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}/tbin1LE.ddl + ) + + MACRO (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype) + IF (${testtype} STREQUAL "SKIP") + MESSAGE (STATUS "SKIP ${skipresultfile} ${ARGN}") + ELSE (${testtype} STREQUAL "SKIP") + ADD_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) + ENDIF (${testtype} STREQUAL "SKIP") + ENDMACRO (ADD_SKIP_H5_TEST) + + MACRO (ADD_H5_TEST resultfile resultcode) + ADD_TEST ( + NAME H5DUMP-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDMACRO (ADD_H5_TEST file) + + # Determine which filters are available + SET (USE_FILTER_SZIP H5_HAVE_FILTER_SZIP) + SET (USE_FILTER_DEFLATE H5_HAVE_FILTER_DEFLATE) + SET (USE_FILTER_SHUFFLE H5_HAVE_FILTER_SHUFFLE) + SET (USE_FILTER_FLETCHER32 H5_HAVE_FILTER_FLETCHER32) + SET (USE_FILTER_NBIT H5_HAVE_FILTER_NBIT) + SET (USE_FILTER_SCALEOFFSET H5_HAVE_FILTER_SCALEOFFSET) + +# Determine if H5dump packed bits feature is included + SET (USE_PACKED_BITS HDF5_USE_H5DUMP_PACKED_BITS) + +############################################################################## +############################################################################## +### T H E T E S T S ### +############################################################################## +############################################################################## + # test for displaying groups + ADD_H5_TEST (tgroup-1 0 tgroup.h5) + # test for displaying the selected groups + ADD_H5_TEST (tgroup-2 1 --group=/g2 --group / -g /y tgroup.h5) + + # test for displaying simple space datasets + ADD_H5_TEST (tdset-1 0 tdset.h5) + # test for displaying selected datasets + ADD_H5_TEST (tdset-2 1 -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5) + + # test for displaying attributes + ADD_H5_TEST (tattr-1 0 tattr.h5) + # test for displaying the selected attributes of string type and scalar space + ADD_H5_TEST (tattr-2 0 -a /attr1 --attribute /attr4 --attribute=/attr5 tattr.h5) + # test for header and error messages + ADD_H5_TEST (tattr-3 1 --header -a /attr2 --attribute=/attr tattr.h5) + # test for displaying attributes in shared datatype (also in group and dataset) + ADD_H5_TEST (tnamed_dtype_attr 0 tnamed_dtype_attr.h5) + + # test for displaying soft links and user-defined links + ADD_H5_TEST (tslink-1 0 tslink.h5) + ADD_H5_TEST (tudlink-1 0 tudlink.h5) + # test for displaying the selected link + ADD_H5_TEST (tslink-2 0 -l slink2 tslink.h5) + ADD_H5_TEST (tudlink-2 0 -l udlink2 tudlink.h5) + + # tests for hard links + ADD_H5_TEST (thlink-1 0 thlink.h5) + ADD_H5_TEST (thlink-2 0 -d /g1/dset2 --dataset /dset1 --dataset=/g1/g1.1/dset3 thlink.h5) + ADD_H5_TEST (thlink-3 0 -d /g1/g1.1/dset3 --dataset /g1/dset2 --dataset=/dset1 thlink.h5) + ADD_H5_TEST (thlink-4 0 -g /g1 thlink.h5) + ADD_H5_TEST (thlink-5 0 -d /dset1 -g /g2 -d /g1/dset2 thlink.h5) + + # tests for compound data types + ADD_H5_TEST (tcomp-1 0 tcompound.h5) + # test for named data types + ADD_H5_TEST (tcomp-2 0 -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5) + # test for unamed type + #ADD_H5_TEST (tcomp-3 0 -t /#6632 -g /group2 tcompound.h5) + # test complicated compound datatype + ADD_H5_TEST (tcomp-4 0 tcompound_complex.h5) + + #test for the nested compound type + ADD_H5_TEST (tnestcomp-1 0 tnestedcomp.h5) + + # test for options + ADD_H5_TEST (tall-1 0 tall.h5) + ADD_H5_TEST (tall-2 0 --header -g /g1/g1.1 -a attr2 tall.h5) + ADD_H5_TEST (tall-3 0 -d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink tall.h5) + + # test for loop detection + ADD_H5_TEST (tloop-1 0 tloop.h5) + + # test for string + ADD_H5_TEST (tstr-1 0 tstr.h5) + ADD_H5_TEST (tstr-2 0 tstr2.h5) + + # test for file created by Lib SAF team + ADD_H5_TEST (tsaf 0 tsaf.h5) + + # test for file with variable length data + ADD_H5_TEST (tvldtypes1 0 tvldtypes1.h5) + ADD_H5_TEST (tvldtypes2 0 tvldtypes2.h5) + ADD_H5_TEST (tvldtypes3 0 tvldtypes3.h5) + ADD_H5_TEST (tvldtypes4 0 tvldtypes4.h5) + ADD_H5_TEST (tvldtypes5 0 tvldtypes5.h5) + + #test for file with variable length string data + ADD_H5_TEST (tvlstr 0 tvlstr.h5) + + # test for files with array data + ADD_H5_TEST (tarray1 0 tarray1.h5) + ADD_H5_TEST (tarray2 0 tarray2.h5) + ADD_H5_TEST (tarray3 0 tarray3.h5) + ADD_H5_TEST (tarray4 0 tarray4.h5) + ADD_H5_TEST (tarray5 0 tarray5.h5) + ADD_H5_TEST (tarray6 0 tarray6.h5) + ADD_H5_TEST (tarray7 0 tarray7.h5) + ADD_H5_TEST (tarray8 0 tarray8.h5) + + # test for files with empty data + ADD_H5_TEST (tempty 0 tempty.h5) + + # test for files with groups that have comments + ADD_H5_TEST (tgrp_comments 0 tgrp_comments.h5) + + # test the --filedriver flag + ADD_H5_TEST (tsplit_file 0 --filedriver=split tsplit_file) + ADD_H5_TEST (tfamily 0 --filedriver=family tfamily%05d.h5) + ADD_H5_TEST (tmulti 0 --filedriver=multi tmulti) + + # test for files with group names which reach > 1024 bytes in size + ADD_H5_TEST (tlarge_objname 0 -w157 tlarge_objname.h5) + + # test '-A' to suppress data but print attr's + ADD_H5_TEST (tall-2A 0 -A tall.h5) + + # test '-r' to print attributes in ASCII instead of decimal + ADD_H5_TEST (tall-2B 0 -A -r tall.h5) + + # test Subsetting + ADD_H5_TEST (tall-4s 0 --dataset=/g1/g1.1/dset1.1.1 --start=1,1 --stride=2,3 --count=3,2 --block=1,1 tall.h5) + ADD_H5_TEST (tall-5s 0 -d "/g1/g1.1/dset1.1.2[0;2;10;]" tall.h5) + ADD_H5_TEST (tdset-3s 0 -d "/dset1[1,1;;;]" tdset.h5) + + # test printing characters in ASCII instead of decimal + ADD_H5_TEST (tchar1 0 -r tchar.h5) + + # test failure handling + # Missing file name + IF (${USE_PACKED_BITS}) + ADD_H5_TEST (tnofilename-with-packed-bits 1) + ELSE (${USE_PACKED_BITS}) + ADD_H5_TEST (tnofilename 1) + ENDIF (${USE_PACKED_BITS}) + + # rev. 2004 + + # tests for super block + ADD_H5_TEST (tboot1 0 -H -B -d dset tfcontents1.h5) + ADD_H5_TEST (tboot2 0 -B tfcontents2.h5) + + # test -p with a non existing dataset + ADD_H5_TEST (tperror 1 -p -d bogus tfcontents1.h5) + + # test for file contents + ADD_H5_TEST (tcontents 0 -n tfcontents1.h5) + + # tests for storage layout + # compact + ADD_H5_TEST (tcompact 0 -H -p -d compact tfilters.h5) + # contiguous + ADD_H5_TEST (tcontiguos 0 -H -p -d contiguous tfilters.h5) + # chunked + ADD_H5_TEST (tchunked 0 -H -p -d chunked tfilters.h5) + # external + ADD_H5_TEST (texternal 0 -H -p -d external tfilters.h5) + + # fill values + ADD_H5_TEST (tfill 0 -p tfvalues.h5) + + # several datatype, with references , print path + ADD_H5_TEST (treference 0 tattr2.h5) + + # escape/not escape non printable characters + ADD_H5_TEST (tstringe 0 -e tstr3.h5) + ADD_H5_TEST (tstring 0 tstr3.h5) + # char data as ASCII with non escape + ADD_H5_TEST (tstring2 0 -r -d str4 tstr3.h5) + + # array indices print/not print + ADD_H5_TEST (tindicesyes 0 taindices.h5) + ADD_H5_TEST (tindicesno 0 -y taindices.h5) + + ########## array indices with subsetting + # 1D case + ADD_H5_TEST (tindicessub1 0 -d 1d -s 1 -S 10 -c 2 -k 3 taindices.h5) + + # 2D case + ADD_H5_TEST (tindicessub2 0 -d 2d -s 1,2 -S 3,3 -c 3,2 -k 2,2 taindices.h5) + + # 3D case + ADD_H5_TEST (tindicessub3 0 -d 3d -s 0,1,2 -S 1,3,3 -c 2,2,2 -k 1,2,2 taindices.h5) + + # 4D case + ADD_H5_TEST (tindicessub4 0 -d 4d -s 0,0,1,2 -c 2,2,3,2 -S 1,1,3,3 -k 1,1,2,2 taindices.h5) + + # tests for filters + # SZIP + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SZIP) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SZIP) + ADD_SKIP_H5_TEST (tszip 0 ${TESTTYPE} -H -p -d szip tfilters.h5) + + # deflate + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_SKIP_H5_TEST (tdeflate 0 ${TESTTYPE} -H -p -d deflate tfilters.h5) + + # shuffle + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SHUFFLE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SHUFFLE) + ADD_SKIP_H5_TEST (tshuffle 0 ${TESTTYPE} -H -p -d shuffle tfilters.h5) + + # fletcher32 + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_FLETCHER32) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_FLETCHER32) + ADD_SKIP_H5_TEST (tfletcher32 0 ${TESTTYPE} -H -p -d fletcher32 tfilters.h5) + + # nbit + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_NBIT) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_NBIT) + ADD_SKIP_H5_TEST (tnbit 0 ${TESTTYPE} -H -p -d nbit tfilters.h5) + + # scaleoffset + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SCALEOFFSET) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SCALEOFFSET) + ADD_SKIP_H5_TEST (tscaleoffset 0 ${TESTTYPE} -H -p -d scaleoffset tfilters.h5) + + # all + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) + ADD_SKIP_H5_TEST (tallfilters 0 ${TESTTYPE} -H -p -d all tfilters.h5) + + # user defined + ADD_H5_TEST (tuserfilter 0 -H -p -d myfilter tfilters.h5) + + # test for displaying objects with very long names + ADD_H5_TEST (tlonglinks 0 tlonglinks.h5) + + # dimensions over 4GB, print boundary + ADD_H5_TEST (tbigdims 0 -d dset4gb -s 4294967284 -c 22 tbigdims.h5) + + # hyperslab read + ADD_H5_TEST (thyperslab 0 thyperslab.h5) + + # test for displaying dataset and attribute of null space + ADD_H5_TEST (tnullspace 0 tnullspace.h5) + + # test for long double (some systems do not have long double) + #ADD_H5_TEST (tldouble 0 tldouble.h5) + + # test for vms + ADD_H5_TEST (tvms 0 tvms.h5) + + # test for binary output + ADD_H5_TEST (tbin1LE 0 -d integer -o out1LE.bin -b LE tbinary.h5) + + # NATIVE default. the NATIVE test can be validated with h5import/h5diff + ADD_H5_TEST (tbin1 0 -d integer -o out1.bin -b tbinary.h5) + ADD_TEST (NAME H5DUMP-clear-out1 COMMAND ${CMAKE_COMMAND} -E remove out1.h5) + ADD_TEST (NAME H5DUMP-h5import-out1 COMMAND h5import out1.bin -c out3.h5import -o out1.h5) + ADD_TEST (NAME H5DUMP-h5diff-out1 COMMAND h5diff tbinary.h5 out1.h5 /integer /integer) + + ADD_H5_TEST (tbin2 0 -b BE -d float -o out2.bin tbinary.h5) + + # the NATIVE test can be validated with h5import/h5diff + ADD_H5_TEST (tbin3 0 -d integer -o out3.bin -b NATIVE tbinary.h5) + ADD_TEST (NAME H5DUMP-clear-out3 COMMAND ${CMAKE_COMMAND} -E remove out3.h5) + ADD_TEST (NAME H5DUMP-h5import-out3 COMMAND h5import out3.bin -c out3.h5import -o out3.h5) + ADD_TEST (NAME H5DUMP-h5diff-out3 COMMAND h5diff tbinary.h5 out3.h5 /integer /integer -q) + + ADD_H5_TEST (tbin4 0 -d double -b FILE -o out4.bin tbinary.h5) + + # Clean up binary output files + IF (NOT HDF5_NOCLEANUP) + ADD_TEST ( + NAME H5DUMP-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + out1.bin + out1LE.bin + out2.bin + out3.bin + out4.bin + out1.h5 + out3.h5 + ) + ENDIF (NOT HDF5_NOCLEANUP) + + # test for dataset region references + ADD_H5_TEST (tdatareg 0 tdatareg.h5) + ADD_H5_TEST (tdataregR 0 -R tdatareg.h5) + ADD_H5_TEST (tattrreg 0 tattrreg.h5) + ADD_H5_TEST (tattrregR 0 -R tattrreg.h5) + + # tests for group creation order + # "1" tracked, "2" name, root tracked + ADD_H5_TEST (tordergr1 0 --group=1 --sort_by=creation_order --sort_order=ascending tordergr.h5) + ADD_H5_TEST (tordergr2 0 --group=1 --sort_by=creation_order --sort_order=descending tordergr.h5) + ADD_H5_TEST (tordergr3 0 -g 2 -q name -z ascending tordergr.h5) + ADD_H5_TEST (tordergr4 0 -g 2 -q name -z descending tordergr.h5) + ADD_H5_TEST (tordergr5 0 -q creation_order tordergr.h5) + + # tests for attribute order + ADD_H5_TEST (torderattr1 0 -H --sort_by=name --sort_order=ascending torderattr.h5) + ADD_H5_TEST (torderattr2 0 -H --sort_by=name --sort_order=descending torderattr.h5) + ADD_H5_TEST (torderattr3 0 -H --sort_by=creation_order --sort_order=ascending torderattr.h5) + ADD_H5_TEST (torderattr4 0 -H --sort_by=creation_order --sort_order=descending torderattr.h5) + + # tests for floating point user defined printf format + ADD_H5_TEST (tfpformat 0 -m %.7f tfpformat.h5) + + # tests for traversal of external links + ADD_H5_TEST (textlinksrc 0 textlinksrc.h5) + ADD_H5_TEST (textlinkfar 0 textlinkfar.h5) + + # test for dataset packed bits + SET (TESTTYPE "TEST") + IF (NOT ${USE_PACKED_BITS}) + SET (TESTTYPE "SKIP") + ENDIF (NOT ${USE_PACKED_BITS}) + ADD_SKIP_H5_TEST (tpackedbits 0 ${TESTTYPE} -d /dset1 -M 0,2 tdset.h5) + ADD_SKIP_H5_TEST (tpackedbits2 0 ${TESTTYPE} -d /dset1 -M 0,2,2,1 tdset.h5) + +ENDIF (BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- +INSTALL ( + TARGETS + h5dump + RUNTIME DESTINATION + bin/tools +) diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt new file mode 100644 index 0000000..b99b45d --- /dev/null +++ b/tools/h5import/CMakeLists.txt @@ -0,0 +1,39 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS_H5IMPORT) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +# -------------------------------------------------------------------- +# Add the h5import and test executables +# -------------------------------------------------------------------- +ADD_EXECUTABLE (h5import ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5import.c) +H5_NAMING (h5import) +TARGET_LINK_LIBRARIES (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +SET (H5_DEP_EXECUTABLES h5import) + +IF (BUILD_TESTING) + ADD_EXECUTABLE (h5importtest ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5importtest.c) + H5_NAMING (h5importtest) + TARGET_LINK_LIBRARIES (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + + ADD_TEST (NAME h5importtest COMMAND $) + + SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} + h5importtest + ) +ENDIF (BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- +INSTALL ( + TARGETS + h5import + RUNTIME DESTINATION + bin/tools +) diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt new file mode 100644 index 0000000..2fe2c8c --- /dev/null +++ b/tools/h5jam/CMakeLists.txt @@ -0,0 +1,58 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS_H5JAM) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +# -------------------------------------------------------------------- +# Add the h5jam and test executables +# -------------------------------------------------------------------- +ADD_EXECUTABLE (h5jam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jam.c) +H5_NAMING (h5jam) +TARGET_LINK_LIBRARIES (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +ADD_EXECUTABLE (getub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/getub.c) +H5_NAMING (getub) +TARGET_LINK_LIBRARIES (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +ADD_EXECUTABLE (tellub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/tellub.c) +H5_NAMING (tellub) +TARGET_LINK_LIBRARIES (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +ADD_EXECUTABLE (h5unjam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5unjam.c) +H5_NAMING (h5unjam) +TARGET_LINK_LIBRARIES (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +SET (H5_DEP_EXECUTABLES + h5jam + getub + tellub + h5unjam +) + +IF (BUILD_TESTING) + IF (NOT BUILD_SHARED_LIBS) + ADD_EXECUTABLE (h5jamgentest ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jamgentest.c) + H5_NAMING (h5jamgentest) + TARGET_LINK_LIBRARIES (h5jamgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + + #ADD_TEST (NAME h5jamgentest COMMAND $) + + SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} + # h5jamgentest + ) + ENDIF (NOT BUILD_SHARED_LIBS) +ENDIF (BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- +INSTALL ( + TARGETS + h5jam h5unjam + RUNTIME DESTINATION + bin/tools +) diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt new file mode 100644 index 0000000..54669ad --- /dev/null +++ b/tools/h5ls/CMakeLists.txt @@ -0,0 +1,168 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS_H5LS) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +# -------------------------------------------------------------------- +# If testing was NOT enabled, then we need to build the tools library +# -------------------------------------------------------------------- +#-- Add the h5ls executable +ADD_EXECUTABLE (h5ls ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c) +H5_NAMING (h5ls) +TARGET_LINK_LIBRARIES (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +SET (H5_DEP_EXECUTABLES + h5ls +) + +IF (BUILD_TESTING) + #-- Copy all the HDF5 files from the test directory into the source directory + SET (HDF5_REFERENCE_FILES + help-1.ls + help-2.ls + help-3.ls + nosuchfile.ls + tall-1.ls + tall-2.ls + tarray1.ls + tattr2.ls + tcomp-1.ls + tdataregbe.ls + tdataregle.ls + tdset-1.ls + tempty.ls + textlink-1.ls + textlinksrc-1.ls + textlinksrc-2.ls + textlinksrc-3.ls + textlinksrc-4.ls + textlinksrc-5.ls + textlinksrc-6.ls + textlinksrc-7.ls + tgroup.ls + tgroup-1.ls + tgroup-2.ls + tgroup-3.ls + thlink-1.ls + tloop-1.ls + tnestcomp-1.ls + tsaf.ls + tslink-1.ls + tstr-1.ls + tudlink-1.ls + tvldtypes1.ls + tvldtypes2le.ls + tvldtypes2be.ls + ) + SET (HDF5_REFERENCE_TEST_FILES + tall.h5 + tarray1.h5 + tattr2.h5 + tcompound.h5 + tdatareg.h5 + tdset.h5 + tempty.h5 + textlink.h5 + textlinksrc.h5 + textlinktar.h5 + tgroup.h5 + thlink.h5 + tloop.h5 + tnestedcomp.h5 + tsaf.h5 + tslink.h5 + tstr.h5 + tudlink.h5 + tvldtypes1.h5 + ) + + FOREACH (ls_file ${HDF5_REFERENCE_FILES}) + SET (lsdest "${PROJECT_BINARY_DIR}/${ls_file}") + #MESSAGE (STATUS " Translating ${ls_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5ls + POST_BUILD + COMMAND ${XLATE_UTILITY} + ARGS ${HDF5_TOOLS_SOURCE_DIR}/testfiles/${ls_file} ${lsdest} -l3 + ) + ENDFOREACH (ls_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 ( + TARGET h5ls + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ) + ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + + MACRO (ADD_H5_TEST resultfile resultcode) + ADD_TEST ( + NAME H5LS-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ls" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDMACRO (ADD_H5_TEST file) + + ADD_H5_TEST (help-1 0 -w80 -h) + ADD_H5_TEST (help-2 0 -w80 --help) + ADD_H5_TEST (help-3 0 -w80 -?) + ADD_H5_TEST (tall-1 0 -w80 tall.h5) + ADD_H5_TEST (tall-2 0 -w80 -r -d tall.h5) + ADD_H5_TEST (tgroup 0 -w80 tgroup.h5) + ADD_H5_TEST (tgroup-3 0 -w80 tgroup.h5/g1) + ADD_H5_TEST (tgroup-1 1 -w80 -r -g tgroup.h5) + ADD_H5_TEST (tgroup-2 0 -w80 -g tgroup.h5/g1) + ADD_H5_TEST (tdset-1 0 -w80 -r -d tdset.h5) + ADD_H5_TEST (tslink-1 0 -w80 -r tslink.h5) + ADD_H5_TEST (textlink-1 0 -w80 -r textlink.h5) + ADD_H5_TEST (textlinksrc-1 0 -w80 -Er textlinksrc.h5) + ADD_H5_TEST (textlinksrc-2 0 -w80 -Erv textlinksrc.h5/ext_link5) + ADD_H5_TEST (textlinksrc-3 0 -w80 -Er textlinksrc.h5/ext_link1) + ADD_H5_TEST (textlinksrc-4 0 -w80 -r textlinksrc.h5) + ADD_H5_TEST (textlinksrc-5 0 -w80 -r textlinksrc.h5/ext_link1) + ADD_H5_TEST (textlinksrc-6 0 -w80 -E textlinksrc.h5) + ADD_H5_TEST (textlinksrc-7 0 -w80 -E textlinksrc.h5/ext_link1) + ADD_H5_TEST (tudlink-1 0 -w80 -r tudlink.h5) + ADD_H5_TEST (thlink-1 0 -w80 thlink.h5) + ADD_H5_TEST (tcomp-1 0 -w80 -r -d tcompound.h5) + ADD_H5_TEST (tnestcomp-1 0 -w80 -r -d tnestedcomp.h5) + ADD_H5_TEST (tloop-1 0 -w80 -r -d tloop.h5) + ADD_H5_TEST (tstr-1 0 -w80 -r -d tstr.h5) + ADD_H5_TEST (tsaf 0 -w80 -r -d tsaf.h5) + ADD_H5_TEST (tvldtypes1 0 -w80 -r -d tvldtypes1.h5) + ADD_H5_TEST (tarray1 0 -w80 -r -d tarray1.h5) + ADD_H5_TEST (tempty 0 -w80 -d tempty.h5) + ADD_H5_TEST (tattr2 0 -w80 -v -S tattr2.h5) + ADD_H5_TEST (nosuchfile 1 nosuchfile.h5) + IF (WORDS_BIGENDIAN) + ADD_H5_TEST (tvldtypes2be 0 -v tvldtypes1.h5) + ADD_H5_TEST (tdataregbe 0 -v tdatareg.h5) + ELSE (WORDS_BIGENDIAN) + ADD_H5_TEST (tvldtypes2le 0 -v tvldtypes1.h5) + ADD_H5_TEST (tdataregle 0 -v tdatareg.h5) + ENDIF (WORDS_BIGENDIAN) + +ENDIF (BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- +INSTALL ( + TARGETS + h5ls + RUNTIME DESTINATION + bin/tools +) diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt new file mode 100644 index 0000000..07688ae --- /dev/null +++ b/tools/h5repack/CMakeLists.txt @@ -0,0 +1,531 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS_H5REPACK) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +# -------------------------------------------------------------------- +# Add h5Repack executables and tests +# -------------------------------------------------------------------- +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 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_parse.c + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_refs.c + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_verify.c + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack.c +) +INCLUDE_DIRECTORIES (${HDF5_TEST_SOURCE_DIR}) +ADD_EXECUTABLE (h5repack ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c) +H5_NAMING (h5repack) +TARGET_LINK_LIBRARIES (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +SET (H5_DEP_EXECUTABLES h5repack) + +IF (BUILD_TESTING) + ADD_EXECUTABLE (testh5repack_detect_szip ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c) + H5_NAMING (testh5repack_detect_szip) + TARGET_LINK_LIBRARIES (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + + ADD_TEST (NAME testh5repack_detect_szip COMMAND $) + IF (HDF5_ENABLE_SZIP_SUPPORT) + SET (passRegex "yes") + SET_TESTS_PROPERTIES (testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "yes") + ELSE (HDF5_ENABLE_SZIP_SUPPORT) + SET (passRegex "no") + SET_TESTS_PROPERTIES (testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") + ENDIF (HDF5_ENABLE_SZIP_SUPPORT) + + ADD_EXECUTABLE (h5repacktest ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repacktst.c) + H5_NAMING (h5repacktest) + TARGET_LINK_LIBRARIES (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + + ADD_TEST (NAME h5repacktest COMMAND $) + + SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} + h5repacktest + testh5repack_detect_szip + ) + + + 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 (FILE_REF h5repack_refs.h5) + + #-- Copy all the HDF5 files from the test directory into the source directory + SET (HDF5_REFERENCE_TEST_FILES + h5repack_ext.bin + ublock.bin + h5repack.info + h5repack_attr.h5 + h5repack_deflate.h5 + h5repack_early.h5 + h5repack_ext.h5 + h5repack_fill.h5 + h5repack_filters.h5 + h5repack_fletcher.h5 + h5repack_hlink.h5 + h5repack_layout.h5 + h5repack_layouto.h5 + h5repack_named_dtypes.h5 + h5repack_nbit.h5 + h5repack_objs.h5 + h5repack_refs.h5 + h5repack_shuffle.h5 + h5repack_soffset.h5 + h5repack_szip.h5 + ) + SET (HDF5_COMMON_TEST_FILES + tfamily00000.h5 + tfamily00001.h5 + tfamily00002.h5 + tfamily00003.h5 + tfamily00004.h5 + tfamily00005.h5 + tfamily00006.h5 + tfamily00007.h5 + tfamily00008.h5 + tfamily00009.h5 + tfamily00010.h5 + ) + + FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") + #MESSAGE (STATUS " Copying ${h5_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5repack + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ) + ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + + FOREACH (h5c_file ${HDF5_COMMON_TEST_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5c_file}") + #MESSAGE (STATUS " Copying ${h5_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5repack + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/${h5c_file} ${dest} + ) + ENDFOREACH (h5c_file ${HDF5_COMMON_TEST_FILES}) + + + MACRO (ADD_H5_TEST testname testtype testfile) + IF (${testtype} STREQUAL "SKIP") + MESSAGE (STATUS "SKIP ${testfile} ${ARGN}") + ELSE (${testtype} STREQUAL "SKIP") + ADD_TEST ( + NAME H5REPACK-${testname} + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out.${testfile} + ) + ADD_TEST ( + NAME H5REPACK-DIFF_${testname} + COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out.${testfile} + ) + ENDIF (${testtype} STREQUAL "SKIP") + ENDMACRO (ADD_H5_TEST testname testfile testtype) + +# +# The tests +# We use the files generated by h5repacktst +# Each run generates ".out.h5" and the tool h5diff is used to +# compare the input and output files +# +# the tests are the same as the program h5repacktst, but run from the CLI +# + +# See which filters are usable (and skip tests for filters we +# don't have). Do this by searching H5pubconf.h to see which +# 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) + +# copy files (these files have no filters) +ADD_H5_TEST (fill "TEST" ${FILE0}) +ADD_H5_TEST (objs "TEST" ${FILE1}) +ADD_H5_TEST (attr "TEST" ${FILE2}) +ADD_H5_TEST (hlink "TEST" ${FILE3}) +ADD_H5_TEST (layout "TEST" ${FILE4}) +ADD_H5_TEST (early "TEST" ${FILE5}) + +# 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) +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) +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) +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) +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) +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) +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) +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) +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) +ADD_H5_TEST (all_filters ${TESTTYPE} ${arg}) + +########################################################### +# the following tests assume the input files have filters +########################################################### + +# 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) +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) +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) +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) +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) +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) +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) +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) +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) +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) +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) +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) +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) +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) +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) +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) +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) +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) +ADD_H5_TEST (deflate_limit ${TESTTYPE} ${arg}) + +#file +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}) + +######################################################### +# layout options (these files have no filters) +######################################################### + +ADD_H5_TEST (dset2_chunk_20x10 "TEST" ${FILE4} --layout=dset2:CHUNK=20x10) +ADD_H5_TEST (chunk_20x10 "TEST" ${FILE4} -l CHUNK=20x10) +ADD_H5_TEST (dset2_conti "TEST" ${FILE4} -l dset2:CONTI) +ADD_H5_TEST (conti "TEST" ${FILE4} -l CONTI) +ADD_H5_TEST (dset2_compa "TEST" ${FILE4} -l dset2:COMPA) +ADD_H5_TEST (compa "TEST" ${FILE4} -l COMPA) + + +################################################################ +# layout conversions (file has no filters) +############################################################### + +ADD_H5_TEST (dset_compa_conti "TEST" ${FILE4} -l dset_compact:CONTI) +ADD_H5_TEST (dset_compa_chunk "TEST" ${FILE4} -l dset_compact:CHUNK=2x5) +ADD_H5_TEST (dset_compa_compa "TEST" ${FILE4} -l dset_compact:COMPA) +ADD_H5_TEST (dset_conti_compa "TEST" ${FILE4} -l dset_contiguous:COMPA) +ADD_H5_TEST (dset_conti_chunk "TEST" ${FILE4} -l dset_contiguous:CHUNK=3x6) +ADD_H5_TEST (dset_conti_conti "TEST" ${FILE4} -l dset_contiguous:CONTI) +ADD_H5_TEST (chunk_compa "TEST" ${FILE4} -l dset_chunk:COMPA) +ADD_H5_TEST (chunk_conti "TEST" ${FILE4} -l dset_chunk:CONTI) +ADD_H5_TEST (chunk_18x13 "TEST" ${FILE4} -l dset_chunk:CHUNK=18x13) + +# Native option +# Do not use FILE1, as the named dtype will be converted to native, and h5diff will +# report a difference. +ADD_H5_TEST (native_fill "TEST" ${FILE0} -n) +ADD_H5_TEST (native_attr "TEST" ${FILE2} -n) + + +# latest file format with long switches. use FILE4=h5repack_layout.h5 (no filters) +SET (arg ${FILE4} --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_TEST (layout_long_switches ${TESTTYPE} ${arg}) + +# 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 "TEST") +IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") +ENDIF (NOT USE_FILTER_DEFLATE) +ADD_H5_TEST (layout_short_switches ${TESTTYPE} ${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) +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) +#ADD_H5_TEST (old_style_layout_short_switches ${TESTTYPE} ${arg}) + +# add a userblock to file +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) +ADD_H5_TEST (add_alignment "TEST" ${arg}) + +# Check repacking file with old version of layout message (should get upgraded +# to new version and be readable, etc.) +ADD_H5_TEST (upgrade_layout "TEST" ${FILE14}) + +# test for datum size > H5TOOLS_MALLOCSIZE +ADD_H5_TEST (gt_mallocsize "TEST" ${FILE1} -f GZIP=1) + +# Check repacking file with committed datatypes in odd configurations +ADD_H5_TEST (committed_dt "TEST" ${FILE15}) + +# tests family driver (file is located in common testfiles folder, uses TOOLTEST1 +#ADD_H5_TEST ( family "FAMILY" ${FILE16}) + +# test various references (bug 1814) +ADD_H5_TEST (bug1814 "TEST" ${FILE_REF}) + +ENDIF (BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- +INSTALL ( + TARGETS + h5repack + RUNTIME DESTINATION + bin/tools +) diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt new file mode 100644 index 0000000..98a9dde --- /dev/null +++ b/tools/h5stat/CMakeLists.txt @@ -0,0 +1,122 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS_H5STAT) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +# -------------------------------------------------------------------- +# Add the h5stat and test executables +# -------------------------------------------------------------------- +ADD_EXECUTABLE (h5stat ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat.c) +H5_NAMING (h5stat) +TARGET_LINK_LIBRARIES (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +SET (H5_DEP_EXECUTABLES h5stat) + +IF (BUILD_TESTING) + IF (NOT BUILD_SHARED_LIBS) + ADD_EXECUTABLE (h5stat_gentest ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat_gentest.c) + H5_NAMING (h5stat_gentest) + TARGET_LINK_LIBRARIES (h5stat_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + + #ADD_TEST (NAME h5stat_gentest COMMAND $) + + SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} + # h5stat_gentest + ) + ENDIF (NOT BUILD_SHARED_LIBS) + + #-- Copy all the HDF5 files from the test directory into the source directory + SET (HDF5_REFERENCE_FILES + h5stat_help1.ddl + h5stat_help2.ddl + h5stat_filters.ddl + h5stat_filters-file.ddl + h5stat_filters-F.ddl + h5stat_filters-d.ddl + h5stat_filters-g.ddl + h5stat_filters-dT.ddl + h5stat_filters-UD.ddl + h5stat_filters-UT.ddl + h5stat_tsohm.ddl + h5stat_newgrat.ddl + h5stat_newgrat-UG.ddl + h5stat_newgrat-UA.ddl + ) + SET (HDF5_REFERENCE_TEST_FILES + h5stat_filters.h5 + h5stat_tsohm.h5 + h5stat_newgrat.h5 + ) + + 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 + ) + 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 ( + 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}) + + MACRO (ADD_H5_TEST resultfile resultcode) + ADD_TEST ( + NAME H5STAT-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDMACRO (ADD_H5_TEST file) + +# Test for help flag + ADD_H5_TEST (h5stat_help1 0 -h) + ADD_H5_TEST (h5stat_help2 0 --help) + +# Test file with groups, compressed datasets, user-applied fileters, etc. +# h5stat_filters.h5 is a copy of ../../testfiles/tfilters.h5 as of release 1.8.0-alpha4 + ADD_H5_TEST (h5stat_filters 0 h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-file 0 -f h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-F 0 -F h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-d 0 -d h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-g 0 -g h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-dT 0 -dT h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-UD 0 -D h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-UT 0 -T h5stat_filters.h5) +# h5stat_tsohm.h5 is a copy of ../../../test/tsohm.h5 generated by tsohm.c +# as of release 1.8.0-alpha4 + ADD_H5_TEST (h5stat_tsohm 0 h5stat_tsohm.h5) +# h5stat_newgrat.h5 is generated by h5stat_gentest.c + ADD_H5_TEST (h5stat_newgrat 0 h5stat_newgrat.h5) + ADD_H5_TEST (h5stat_newgrat-UG 0 -G h5stat_newgrat.h5) + ADD_H5_TEST (h5stat_newgrat-UA 0 -A h5stat_newgrat.h5) +ENDIF (BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- +INSTALL ( + TARGETS + h5stat + RUNTIME DESTINATION + bin/tools +) diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt new file mode 100644 index 0000000..2e6501a --- /dev/null +++ b/tools/lib/CMakeLists.txt @@ -0,0 +1,68 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS_LIB) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- +#INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +#INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +SET (H5_TOOLS_LIB_SRCS + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5diff.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5diff_array.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5diff_attr.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5diff_dset.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5diff_util.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_filters.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_ref.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_str.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_type.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_utils.c + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5trav.c +) + +SET (H5_TOOLS_LIB_HDRS + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5trav.h + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools.h + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_utils.h + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_str.h + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5tools_ref.h + ${HDF5_TOOLS_SOURCE_DIR}/lib/h5diff.h +) + +#-- Always build a static library for linking the ${HDF5_LIB_NAME} tools together +ADD_LIBRARY (${HDF5_TOOLS_LIB_TARGET} ${LIB_TYPE} ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS}) +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 +) + +#----------------------------------------------------------------------------- +# Add file(s) to CMake Install +#----------------------------------------------------------------------------- +INSTALL ( + FILES + ${H5_TOOLS_LIB_HDRS} + DESTINATION + include/tools +) + +#----------------------------------------------------------------------------- +# Add Target(s) to CMake Install for import into other projects +#----------------------------------------------------------------------------- +IF (HDF5_EXPORTED_TARGETS) + INSTALL ( + TARGETS + ${HDF5_TOOLS_LIB_TARGET} + EXPORT + ${HDF5_EXPORTED_TARGETS} + LIBRARY DESTINATION lib/tools + ARCHIVE DESTINATION lib/tools + RUNTIME DESTINATION bin/tools + ) +ENDIF (HDF5_EXPORTED_TARGETS) diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt new file mode 100644 index 0000000..0b2eb42 --- /dev/null +++ b/tools/misc/CMakeLists.txt @@ -0,0 +1,100 @@ +cmake_minimum_required (VERSION 2.8) +PROJECT (HDF5_TOOLS_MISC) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) +INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) + +# -------------------------------------------------------------------- +# Add the misc and test executables +# -------------------------------------------------------------------- +#-- Misc Executables +ADD_EXECUTABLE (h5debug ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5debug.c) +H5_NAMING (h5debug) +TARGET_LINK_LIBRARIES (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + +ADD_EXECUTABLE (h5repart ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart.c) +H5_NAMING (h5repart) +TARGET_LINK_LIBRARIES (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + +ADD_EXECUTABLE (h5mkgrp ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5mkgrp.c) +H5_NAMING (h5mkgrp) +TARGET_LINK_LIBRARIES (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + +SET (H5_DEP_EXECUTABLES + h5debug + h5repart + h5mkgrp +) + +IF (BUILD_TESTING) + SET (HDF5_REFERENCE_TEST_FILES + family_file00000.h5 + family_file00001.h5 + family_file00002.h5 + family_file00003.h5 + family_file00004.h5 + family_file00005.h5 + family_file00006.h5 + family_file00007.h5 + family_file00008.h5 + family_file00009.h5 + family_file00010.h5 + family_file00011.h5 + family_file00012.h5 + family_file00013.h5 + family_file00014.h5 + family_file00015.h5 + family_file00016.h5 + 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 ( + TARGET h5repart + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ) + ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + + IF (NOT BUILD_SHARED_LIBS) + ADD_EXECUTABLE (h5repart_gentest ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart_gentest.c) + H5_NAMING (h5repart_gentest) + TARGET_LINK_LIBRARIES (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + #ADD_TEST (NAME h5repart_gentest COMMAND $) + ENDIF (NOT BUILD_SHARED_LIBS) + + ADD_EXECUTABLE (h5repart_test ${HDF5_TOOLS_MISC_SOURCE_DIR}/repart_test.c) + H5_NAMING (h5repart_test) + TARGET_LINK_LIBRARIES (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + + # repartition family member size to 20,000 bytes. + ADD_TEST (NAME h5repart_20K COMMAND $ -m 20000 family_file%05d.h5 fst_family%05d.h5) + # repartition family member size to 5 KB. + ADD_TEST (NAME h5repart_5K COMMAND $ -m 5k family_file%05d.h5 scd_family%05d.h5) + # convert family file to sec2 file of 20,000 bytes + ADD_TEST (NAME h5repart_sec2 COMMAND $ -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5) + + # test the output files repartitioned above. + ADD_TEST (NAME h5repart_test COMMAND $) + + SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} + # h5repart_gentest + h5repart_test + ) +ENDIF (BUILD_TESTING) + +#----------------------------------------------------------------------------- +# Rules for Installation of tools using make Install target +#----------------------------------------------------------------------------- +INSTALL ( + TARGETS + h5debug h5repart + RUNTIME DESTINATION + bin/tools +) -- cgit v0.12