[svn-r27038] Merge of r26393-27031 from the trunk.

Tested on 64-bit linux VM w/ C++ and Fortran 2003
This commit is contained in:
Dana Robinson 2015-05-07 16:05:14 -05:00
commit 984ecb72c2
246 changed files with 5556 additions and 4177 deletions

View File

@ -1,16 +1,4 @@
#-----------------------------------------------------------------------------
# Options for HDF5 Filters
#-----------------------------------------------------------------------------
MACRO (HDF5_SETUP_FILTERS FILTER)
option (HDF5_USE_FILTER_${FILTER} "Use the ${FILTER} Filter" ON)
if (HDF5_USE_FILTER_${FILTER})
set (H5_HAVE_FILTER_${FILTER} 1)
set (FILTERS "${FILTERS} ${FILTER}")
endif (HDF5_USE_FILTER_${FILTER})
# message (STATUS "Filter ${FILTER} is ${HDF5_USE_FILTER_${FILTER}}")
ENDMACRO (HDF5_SETUP_FILTERS)
include (ExternalProject)
#option (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO SVN TGZ)" "NO")
set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO SVN TGZ)")
@ -19,8 +7,8 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT
option (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 1)
option (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 1)
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN")
set (ZLIB_URL ${ZLIB_SVN_URL})
set (SZIP_URL ${SZIP_SVN_URL})
set (ZLIB_URL ${ZLIB_SVN_URL} CACHE STRING "Path to zlib Subversion repository")
set (SZIP_URL ${SZIP_SVN_URL} CACHE STRING "Path to szip Subversion repository")
elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
if (NOT TGZPATH)
set (TGZPATH ${HDF5_SOURCE_DIR})
@ -43,6 +31,9 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT)
find_package (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT})
if (NOT ZLIB_FOUND)
find_package (ZLIB) # Legacy find
if (ZLIB_FOUND)
set (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES})
endif (ZLIB_FOUND)
endif (NOT ZLIB_FOUND)
endif (NOT ZLIB_USE_EXTERNAL)
if (ZLIB_FOUND)
@ -51,7 +42,7 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT)
set (H5_HAVE_LIBZ 1)
set (H5_ZLIB_HEADER "zlib.h")
set (ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR})
set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR})
else (ZLIB_FOUND)
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
EXTERNAL_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${LIB_TYPE})
@ -87,6 +78,9 @@ if (HDF5_ENABLE_SZIP_SUPPORT)
find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT})
if (NOT SZIP_FOUND)
find_package (SZIP) # Legacy find
if (SZIP_FOUND)
set (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES})
endif (SZIP_FOUND)
endif (NOT SZIP_FOUND)
endif (NOT SZIP_USE_EXTERNAL)
if (SZIP_FOUND)

View File

@ -139,7 +139,7 @@ configure_file (
)
install (
FILES ${HDF5_BINARY_DIR}/libhdf5.settings
DESTINATION ${HDF5_INSTALL_CMAKE_DIR}
DESTINATION ${HDF5_INSTALL_LIB_DIR}
COMPONENT libraries
)
@ -176,9 +176,17 @@ if (HDF5_PACK_EXAMPLES)
COMPONENT hdfdocuments
)
if (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar xzf ${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}
)
install (
DIRECTORY ${HDF5_BINARY_DIR}/HDF5Examples-0.1.1-Source
DESTINATION ${HDF5_INSTALL_DATA_DIR}
USE_SOURCE_PERMISSIONS
COMPONENT hdfdocuments
)
install (
FILES
${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}
${HDF5_SOURCE_DIR}/release_docs/USING_CMake_Examples.txt
DESTINATION ${HDF5_INSTALL_DATA_DIR}
COMPONENT hdfdocuments
@ -363,8 +371,9 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES)
set(CPACK_WIX_PROPERTY_ARPCOMMENTS "HDF5 (Hierarchical Data Format 5) Software Library and Utilities")
set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "${HDF5_PACKAGE_URL}")
set(CPACK_WIX_PROPERTY_ARPHELPLINK "${HDF5_PACKAGE_BUGREPORT}")
set(CPACK_WIX_PATCH_FILE "${HDF_RESOURCES_DIR}/patch.xml")
if (BUILD_SHARED_LIBS)
set(CPACK_WIX_PATCH_FILE "${HDF_RESOURCES_DIR}/patch.xml")
endif (BUILD_SHARED_LIBS)
elseif (APPLE)
list (APPEND CPACK_GENERATOR "DragNDrop")
set (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON)
@ -380,7 +389,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES)
set (CPACK_BUNDLE_ICON "${HDF_RESOURCES_EXT_DIR}/hdf.icns")
set (CPACK_BUNDLE_PLIST "${HDF5_BINARY_DIR}/CMakeFiles/Info.plist")
set (CPACK_APPLE_GUI_INFO_STRING "HDF5 (Hierarchical Data Format 5) Software Library and Utilities")
set (CPACK_APPLE_GUI_COPYRIGHT "Copyright © 2006-2014 by The HDF Group. All rights reserved.")
set (CPACK_APPLE_GUI_COPYRIGHT "Copyright © 2006-2015 by The HDF Group. All rights reserved.")
set (CPACK_SHORT_VERSION_STRING "${CPACK_PACKAGE_VERSION}")
set (CPACK_APPLE_GUI_BUNDLE_NAME "${HDF5_PACKAGE_STRING}")
set (CPACK_APPLE_GUI_VERSION_STRING "${CPACK_PACKAGE_VERSION_STRING}")
@ -457,10 +466,22 @@ The HDF5 data model, file format, API, library, and tools are open and distribut
if (HDF5_PACKAGE_EXTLIBS)
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL)
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;ALL;/")
if (WIN32)
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;ALL;/")
else (WIN32)
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;libraries;/")
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;headers;/")
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;configinstall;/")
endif (WIN32)
endif (ZLIB_FOUND AND ZLIB_USE_EXTERNAL)
if (SZIP_FOUND AND SZIP_USE_EXTERNAL)
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;ALL;/")
if (WIN32)
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;ALL;/")
else (WIN32)
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;libraries;/")
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;headers;/")
set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;configinstall;/")
endif (WIN32)
endif (SZIP_FOUND AND SZIP_USE_EXTERNAL)
endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
endif (HDF5_PACKAGE_EXTLIBS)
@ -472,7 +493,10 @@ The HDF5 data model, file format, API, library, and tools are open and distribut
cpack_add_component_group(Runtime)
cpack_add_component_group(Documents)
cpack_add_component_group(Documents
EXPANDED
DESCRIPTION "Release notes for developing HDF5 applications"
)
cpack_add_component_group(Development
EXPANDED
@ -487,28 +511,27 @@ The HDF5 data model, file format, API, library, and tools are open and distribut
#---------------------------------------------------------------------------
# Now list the cpack commands
#---------------------------------------------------------------------------
CPACK_ADD_COMPONENT (hdfapplications
DISPLAY_NAME "HDF5 Applications"
DEPENDS libraries
GROUP Applications
)
CPACK_ADD_COMPONENT (libraries
DISPLAY_NAME "HDF5 Libraries"
GROUP Runtime
INSTALL_TYPES Full Developer User
)
CPACK_ADD_COMPONENT (headers
DISPLAY_NAME "HDF5 Headers"
DEPENDS libraries
GROUP Development
INSTALL_TYPES Full Developer
)
CPACK_ADD_COMPONENT (hdfdocuments
DISPLAY_NAME "HDF5 Documents"
GROUP Documents
INSTALL_TYPES Full Developer
)
CPACK_ADD_COMPONENT (configinstall
DISPLAY_NAME "HDF5 CMake files"
DEPENDS libraries
GROUP Development
INSTALL_TYPES Full Developer User
)
if (HDF5_BUILD_FORTRAN)
@ -516,11 +539,13 @@ The HDF5 data model, file format, API, library, and tools are open and distribut
DISPLAY_NAME "HDF5 Fortran Libraries"
DEPENDS libraries
GROUP Runtime
INSTALL_TYPES Full Developer User
)
CPACK_ADD_COMPONENT (fortheaders
DISPLAY_NAME "HDF5 Fortran Headers"
DEPENDS fortlibraries
GROUP Development
INSTALL_TYPES Full Developer
)
endif (HDF5_BUILD_FORTRAN)
@ -529,11 +554,13 @@ The HDF5 data model, file format, API, library, and tools are open and distribut
DISPLAY_NAME "HDF5 C++ Libraries"
DEPENDS libraries
GROUP Runtime
INSTALL_TYPES Full Developer User
)
CPACK_ADD_COMPONENT (cppheaders
DISPLAY_NAME "HDF5 C++ Headers"
DEPENDS cpplibraries
GROUP Development
INSTALL_TYPES Full Developer
)
endif (HDF5_BUILD_CPP_LIB)
@ -542,16 +569,19 @@ The HDF5 data model, file format, API, library, and tools are open and distribut
DISPLAY_NAME "HDF5 Tools Applications"
DEPENDS toolslibraries
GROUP Applications
INSTALL_TYPES Full Developer User
)
CPACK_ADD_COMPONENT (toolslibraries
DISPLAY_NAME "HDF5 Tools Libraries"
DEPENDS libraries
GROUP Runtime
INSTALL_TYPES Full Developer User
)
CPACK_ADD_COMPONENT (toolsheaders
DISPLAY_NAME "HDF5 Tools Headers"
DEPENDS toolslibraries
GROUP Development
INSTALL_TYPES Full Developer
)
endif (HDF5_BUILD_TOOLS)
@ -560,32 +590,42 @@ The HDF5 data model, file format, API, library, and tools are open and distribut
DISPLAY_NAME "HDF5 HL Libraries"
DEPENDS libraries
GROUP Runtime
INSTALL_TYPES Full Developer User
)
CPACK_ADD_COMPONENT (hlheaders
DISPLAY_NAME "HDF5 HL Headers"
DEPENDS hllibraries
GROUP Development
INSTALL_TYPES Full Developer
)
CPACK_ADD_COMPONENT (hltoolsapplications
DISPLAY_NAME "HDF5 HL Tools Applications"
DEPENDS hllibraries
GROUP Applications
INSTALL_TYPES Full Developer User
)
CPACK_ADD_COMPONENT (hlcpplibraries
DISPLAY_NAME "HDF5 HL C++ Libraries"
DEPENDS hllibraries
GROUP Runtime
)
CPACK_ADD_COMPONENT (hlcppheaders
DISPLAY_NAME "HDF5 HL C++ Headers"
DEPENDS hlcpplibraries
GROUP Development
)
CPACK_ADD_COMPONENT (hlfortlibraries
DISPLAY_NAME "HDF5 HL Fortran Libraries"
DEPENDS fortlibraries
GROUP Runtime
)
if (HDF5_BUILD_CPP_LIB)
CPACK_ADD_COMPONENT (hlcpplibraries
DISPLAY_NAME "HDF5 HL C++ Libraries"
DEPENDS hllibraries
GROUP Runtime
INSTALL_TYPES Full Developer User
)
CPACK_ADD_COMPONENT (hlcppheaders
DISPLAY_NAME "HDF5 HL C++ Headers"
DEPENDS hlcpplibraries
GROUP Development
INSTALL_TYPES Full Developer
)
endif (HDF5_BUILD_CPP_LIB)
if (HDF5_BUILD_FORTRAN)
CPACK_ADD_COMPONENT (hlfortlibraries
DISPLAY_NAME "HDF5 HL Fortran Libraries"
DEPENDS fortlibraries
GROUP Runtime
INSTALL_TYPES Full Developer User
)
endif (HDF5_BUILD_FORTRAN)
endif (HDF5_BUILD_HL_LIB)
endif (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES)

View File

@ -10,6 +10,24 @@ PROJECT (HDF5 C CXX)
# set CMAKE_INSTALL_PREFIX to the required install path.
# Make install can be used to install all components for system-wide use.
#
if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
MESSAGE(FATAL_ERROR "\nERROR! ${PROJECT_NAME} DOES NOT SUPPORT IN SOURCE BUILDS!\n"
"CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}"
" == CMAKE_CURRENT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}\n"
"NEXT STEPS:\n"
"(1) Delete the CMakeCache.txt file and the CMakeFiles/ directory\n"
" under the source directory for ${PROJECT_NAME}, otherwise you\n"
" will not be able to configure ${PROJECT_NAME} correctly!\n"
" * For example, on linux machines do:\n"
" $ rm -r CMakeCache.txt CMakeFiles/\n"
"(2) Create a different directory and configure ${PROJECT_NAME} in that directory.\n"
" * For example, on linux machines do:\n"
" $ mkdir MY_BUILD\n"
" $ cd MY_BUILD\n"
" $ cmake [OPTIONS] ..\n"
)
endif ()
#-----------------------------------------------------------------------------
# Instructions for use : Sub-Project Build
#
@ -283,8 +301,8 @@ if (BUILD_SHARED_LIBS)
else (BUILD_SHARED_LIBS)
set (H5_BUILT_AS_STATIC_LIB 1)
set (H5_ENABLE_STATIC_LIB YES)
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
endif (BUILD_SHARED_LIBS)
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
#-----------------------------------------------------------------------------
# Option to Build Static executables
@ -369,10 +387,11 @@ endif (MAKE_SYSTEM)
#-----------------------------------------------------------------------------
# Add some definitions for Debug Builds
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF)
mark_as_advanced (HDF5_ENABLE_TRACE)
if (CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions (-DDEBUG)
# Enable tracing of the API
option (HDF5_ENABLE_TRACE "Enable API tracing capability" ON)
if (HDF5_ENABLE_TRACE)
add_definitions (-DH5_DEBUG_API )
endif (HDF5_ENABLE_TRACE)
@ -381,14 +400,13 @@ if (CMAKE_BUILD_TYPE MATCHES Debug)
if (HDF5_ENABLE_INSTRUMENT)
set (H5_HAVE_INSTRUMENTED_LIBRARY 1)
endif (HDF5_ENABLE_INSTRUMENT)
mark_as_advanced (HDF5_Enable_Instrument)
mark_as_advanced (HDF5_ENABLE_INSTRUMENT)
#-- NMake Makefiles will overwhelm the console with warnings if -Wall is used.
if (NOT WIN32)
add_definitions (-Wall)
endif (NOT WIN32)
else (CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions (-DNDEBUG)
option (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF)
if (HDF5_ENABLE_TRACE)
add_definitions (-DH5_DEBUG_API )
endif (HDF5_ENABLE_TRACE)
@ -685,6 +703,9 @@ endif (HDF5_USE_18_API_DEFAULT)
#-----------------------------------------------------------------------------
include (UserMacros.cmake)
#-----------------------------------------------------------------------------
# Include filter (zlib, szip, etc.) macros
#-----------------------------------------------------------------------------
include (CMakeFilters.cmake)
#-----------------------------------------------------------------------------
@ -760,7 +781,7 @@ endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT
#-----------------------------------------------------------------------------
# Dashboard and Testing Settings
#-----------------------------------------------------------------------------
option (BUILD_TESTING "Build HDF5 Unit Testing" OFF)
option (BUILD_TESTING "Build HDF5 Unit Testing" ON)
if (BUILD_TESTING)
set (DART_TESTING_TIMEOUT 1200
CACHE INTEGER
@ -791,6 +812,37 @@ if (BUILD_TESTING)
configure_file (${HDF_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY)
endif (BUILD_TESTING)
#-----------------------------------------------------------------------------
# Option to build HDF5 Tools
#-----------------------------------------------------------------------------
if (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools")
option (HDF5_BUILD_TOOLS "Build HDF5 Tools" ON)
if (HDF5_BUILD_TOOLS)
add_subdirectory (${HDF5_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools)
endif (HDF5_BUILD_TOOLS)
endif (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools")
#-----------------------------------------------------------------------------
# Option to build examples
#-----------------------------------------------------------------------------
if (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples")
option (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" ON)
if (HDF5_BUILD_EXAMPLES)
add_subdirectory (${HDF5_SOURCE_DIR}/examples ${PROJECT_BINARY_DIR}/examples)
endif (HDF5_BUILD_EXAMPLES)
endif (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples")
#-----------------------------------------------------------------------------
# Option to build High Level API's
#-----------------------------------------------------------------------------
if (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl")
option (HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" ON)
if (HDF5_BUILD_HL_LIB)
set (H5_INCLUDE_HL 1)
add_subdirectory (${HDF5_SOURCE_DIR}/hl ${PROJECT_BINARY_DIR}/hl)
endif (HDF5_BUILD_HL_LIB)
endif (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl")
#-----------------------------------------------------------------------------
# Option to build Fortran bindings/tests/examples
# Make sure this appears before the CONFIGURE_FILE step
@ -828,21 +880,11 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for
endif (HDF5_BUILD_FORTRAN)
endif (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran")
#-----------------------------------------------------------------------------
# Option to build examples
#-----------------------------------------------------------------------------
if (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples")
option (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" OFF)
if (HDF5_BUILD_EXAMPLES)
add_subdirectory (${HDF5_SOURCE_DIR}/examples ${PROJECT_BINARY_DIR}/examples)
endif (HDF5_BUILD_EXAMPLES)
endif (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples")
#-----------------------------------------------------------------------------
# Option to build HDF5 C++ Library
#-----------------------------------------------------------------------------
if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++")
option (HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF)
option (HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" ON)
if (HDF5_BUILD_CPP_LIB)
# check for unsupported options
if (HDF5_ENABLE_PARALLEL)
@ -852,30 +894,15 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++")
set (H5_NO_STD 1)
endif (CMAKE_NO_STD_NAMESPACE)
add_subdirectory (${HDF5_SOURCE_DIR}/c++ ${PROJECT_BINARY_DIR}/c++)
if (HDF5_BUILD_HL_LIB)
if (EXISTS "${HDF5_SOURCE_DIR}/hl/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/c++")
#-- Build the High Level Fortran source codes
add_subdirectory (${HDF5_SOURCE_DIR}/hl/c++ ${PROJECT_BINARY_DIR}/hl/c++)
endif (EXISTS "${HDF5_SOURCE_DIR}/hl/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/c++")
endif (HDF5_BUILD_HL_LIB)
endif (HDF5_BUILD_CPP_LIB)
endif (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++")
#-----------------------------------------------------------------------------
# Option to build HDF5 Tools
#-----------------------------------------------------------------------------
if (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools")
option (HDF5_BUILD_TOOLS "Build HDF5 Tools" OFF)
if (HDF5_BUILD_TOOLS)
add_subdirectory (${HDF5_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools)
endif (HDF5_BUILD_TOOLS)
endif (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools")
#-----------------------------------------------------------------------------
# Option to build High Level API's
#-----------------------------------------------------------------------------
if (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl")
option (HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" OFF)
if (HDF5_BUILD_HL_LIB)
set (H5_INCLUDE_HL 1)
add_subdirectory (${HDF5_SOURCE_DIR}/hl ${PROJECT_BINARY_DIR}/hl)
endif (HDF5_BUILD_HL_LIB)
endif (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl")
#-----------------------------------------------------------------------------
# Check if Fortran's default real is double precision. If it is and HL is
# being built then configure should fail due to bug HDFFV-889.

View File

@ -4,7 +4,7 @@ HDF5 (Hierarchical Data Format 5) Software Library and Utilities
-----------------------------------------------------------------------------
HDF5 (Hierarchical Data Format 5) Software Library and Utilities
Copyright 2006-2014 by The HDF Group.
Copyright 2006-2015 by The HDF Group.
NCSA HDF5 (Hierarchical Data Format 5) Software Library and Utilities
Copyright 1998-2006 by the Board of Trustees of the University of Illinois.

View File

@ -72,6 +72,8 @@
./config/COPYING
./config/BlankForm
./config/apple
./config/cce-fflags
./config/cce-flags
./config/commence.am
./config/conclude.am
./config/examples.am
@ -2077,6 +2079,7 @@
./tools/h5diff/testfiles/tmpSingleSiteBethe.output.h5
#test files for h5repack
./tools/h5repack/testfiles/README
./tools/h5repack/testfiles/h5repack_attr.h5
./tools/h5repack/testfiles/h5repack_attr_refs.h5
./tools/h5repack/testfiles/h5repack_deflate.h5
@ -2094,6 +2097,8 @@
./tools/h5repack/testfiles/h5repack_layout3.h5
./tools/h5repack/testfiles/h5repack_layout.UD.h5
./tools/h5repack/testfiles/h5repack_named_dtypes.h5
./tools/h5repack/testfiles/h5repack_nested_8bit_enum_deflated.h5
./tools/h5repack/testfiles/h5repack_nested_8bit_enum.h5
./tools/h5repack/testfiles/h5repack_nbit.h5
./tools/h5repack/testfiles/h5repack_objs.h5
./tools/h5repack/testfiles/h5repack_refs.h5
@ -2274,6 +2279,8 @@
./hl/tools/gif2h5/writehdf.c
./hl/tools/gif2h5/h52gifgentst.c
./hl/tools/gif2h5/h52giftest.sh.in
./hl/tools/gif2h5/testfiles/REAMDE
./hl/tools/gif2h5/testfiles/ex_image2.h5
./hl/tools/gif2h5/testfiles/image1.gif
./hl/tools/gif2h5/testfiles/h52giftst.h5
@ -2436,3 +2443,7 @@
./tools/perform/CMakeLists.txt
./tools/perform/CMakeTests.cmake
# CMake-specific User Scripts
./config/cmake/scripts/CTestScript.cmake _DO_NOT_DISTRIBUTE_
./config/cmake/scripts/HDF518config.cmake _DO_NOT_DISTRIBUTE_

View File

@ -1,4 +1,4 @@
HDF5 version 1.9.215 currently under development
HDF5 version 1.9.218 currently under development
Please refer to the release_docs/INSTALL file for installation instructions.
------------------------------------------------------------------------------

View File

@ -23,6 +23,7 @@ makelog="#${progname}_2build.log"
testlog="#${progname}_3test.log"
packlog="#${progname}_4pack.log"
installlog="#${progname}_5install.log"
config_summary=libhdf5.settings
exit_code=0
# This command should be in the source directory's bin/
@ -45,9 +46,13 @@ fi
cacheinit=$srcdir/config/cmake/cacheinit.cmake
build_cpp_lib=-DHDF5_BUILD_CPP_LIB:BOOL=OFF # C++ interface default off
build_fortran=-DHDF5_BUILD_FORTRAN:BOOL=OFF # Fortran interface default off
enable_f2003=-DHDF5_ENABLE_F2003:BOOL=OFF # Fortran2003 interface default off
build_hl_lib=-DHDF5_BUILD_HL_LIB:BOOL=ON # High Level interface default on
build_testing=-DBUILD_TESTING:BOOL=ON # Build tests default on
build_tools=-DHDF5_BUILD_TOOLS:BOOL=ON # Build tools default on
with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT=ON # enable zlib filter default on
with_szlib=-DHDF5_ENABLE_SZIP_SUPPORT=OFF # enables zlib filter default off
shared_lib=-DBUILD_SHARED_LIBS:BOOL=ON # enables shared lib; default on
#=============
@ -71,14 +76,20 @@ Usage: $progname [<options>]
where options are:
--enable-fortran | --disable-fortran:
enable or disable fortran API. Default is off.
--enable-fortran2003 | --disable-fortran2003:
enable or disable fortran2003 API. Default is off.
--enable-cxx | --disable-cxx:
enable or disable c++ API. Default is off.
--enable-hl | --disable-hl:
enable or disable high level API. Default is on.
--enable-shared | --disable-shared:
enable or disable shared lib. Default is on.
--enable-tools | --disable-tools:
enable or disable building tools. Default is on.
--enable-testing | --disable-testing:
enable or disable building tests. Default is on.
--with-zlib | --without-zlib:
Use zlib library for external deflate I/O filter. Default is on.
--help: shows details help page
EOF
}
@ -106,7 +117,7 @@ STEP()
(TIMESTAMP; nerror=0 ;
echo "eval $command"
eval $command || nerror=1 ;
TIMESTAMP; exit $nerror) < /dev/null >> "$logfile" 2>&1
TIMESTAMP; exit $nerror) < /dev/null > "$logfile" 2>&1
if [ $? -ne 0 ]; then
echo "error in '$banner'. $progname aborted."
exit 1
@ -114,6 +125,40 @@ STEP()
}
# Install the generated installation image file. Different platform uses
# different image files.
# Linux: HDF5-<version>-Linux.sh file
# Mac OS X: Not implemented yet
# Others: Not implemented yet
INSTALL_HDF5()
{
myos="`uname -s`"
case "$myos" in
Linux)
install_file=./HDF5-${version}-Linux.sh
$install_file --skip-license $*
;;
Darwin) # Mac OSX DMG file
install_file=HDF5-${version}-Darwin.dmg
test -d hdf5 || mkdir hdf5
basename=`basename $install_file .dmg`
# mount the DMG file as /Volumes/$basename
# echo 'Y' as yes for license.
echo Y | hdiutil mount $install_file
# copy the contents to the install location
cp -R "/Volumes/$basename/HDF_Group" hdf5
# unmount the DMG file
hdiutil unmount /Volumes/$basename
;;
*) # unknown/unsupported OS.
echo "INSTALL_HDF5: Error--unknown/unsupported OS($myos)"
return 1
;;
esac
return 0
}
#==========
# main
#==========
@ -137,6 +182,12 @@ while [ $# -gt 0 ]; do
--disable-fortran)
build_fortran=-DHDF5_BUILD_FORTRAN:BOOL=OFF
;;
--enable-fortran2003)
enable_f2003=-DHDF5_ENABLE_F2003:BOOL=ON
;;
--disable-fortran2003)
enable_f2003=-DHDF5_ENABLE_F2003:BOOL=OFF
;;
--enable-cxx)
build_cpp_lib=-DHDF5_BUILD_CPP_LIB:BOOL=ON
;;
@ -149,6 +200,12 @@ while [ $# -gt 0 ]; do
--disable-hl)
build_hl_lib=-DHDF5_BUILD_HL_LIB:BOOL=OFF
;;
--enable-shared)
shared_lib=-DBUILD_SHARED_LIBS:BOOL=ON
;;
--disable-shared)
shared_lib=-DBUILD_SHARED_LIBS:BOOL=OFF
;;
--enable-tools)
build_tools=-DHDF5_BUILD_TOOLS:BOOL=ON
;;
@ -161,14 +218,21 @@ while [ $# -gt 0 ]; do
--disable-testing)
build_testing=-DBUILD_TESTING:BOOL=OFF
;;
--with-zlib)
with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON
;;
--without-zlib)
with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF
;;
--help)
# print the detail help page and exit
HELP
exit 0
;;
*)
echo "Unknown options"
echo "Unknown options: $1"
HELP
exit 1
;;
esac
shift
@ -194,16 +258,22 @@ if [ $? != 0 ]; then
echo $vers failed. Aborted.
exit 1
fi
echo Running Cmake for HDF5-${version} ...
echo Running Cmake for HDF5-${version} ...
# 4. Configure the C library, tools and tests with this command:
# If successful, append the configure summary to the configure logfile.
STEP "Configure..." "cmake \
-C $cacheinit \
$build_cpp_lib \
$build_fortran \
$enable_f2003 \
$build_hl_lib \
$shared_lib \
$build_testing \
$build_tools \
$srcdir" $configlog
$with_zlib \
$with_szlib \
$srcdir" $configlog &&\
cat $config_summary >> $configlog
# 5. Build the C library, tools and tests with this command:
STEP "Build the library, tools and tests, ..." "cmake --build . --config Release" $makelog
@ -215,7 +285,8 @@ STEP "Test the library and tools..." "ctest . -C Release" $testlog
STEP "Create an install image..." "cpack -C Release CPackConfig.cmake" $packlog
# 8. Install with this command:
STEP "Install..." "./HDF5-${version}-Linux.sh --skip-license" $installlog
#STEP "Install..." "./HDF5-${version}-Linux.sh --skip-license" $installlog
STEP "Install..." "INSTALL_HDF5" $installlog
# save the last exit code
exit_code=$?

View File

@ -187,6 +187,10 @@ die "unable to read file: $RELEASE\n" unless -r $file;
my $CONFIGURE = $file;
$CONFIGURE =~ s/[^\/]*$/..\/configure.ac/;
die "unable to read file: $CONFIGURE\n" unless -r $file;
# cpp_doc_config
my $CPP_DOC_CONFIG = $file;
$CPP_DOC_CONFIG =~ s/[^\/]*$/..\/c++\/src\/cpp_doc_config/;
die "unable to read file: $CPP_DOC_CONFIG\n" unless -r $file;
# Get the current version number.
open FILE, $file or die "unable to open $file: $!\n";
@ -234,7 +238,8 @@ if ($set) {
$README = "";
$RELEASE = "";
$CONFIGURE = "";
$LT_VERS = "";
$CPP_DOC_CONFIG = "";
$LT_VERS = "";
@newver = @curver;
}
@ -309,6 +314,46 @@ if ($RELEASE) {
close FILE;
}
# Update the c++/src/cpp_doc_config file
if ($CPP_DOC_CONFIG) {
my $data = read_file($CPP_DOC_CONFIG);
my $version_string = sprintf("HDF5 version %d.%d.%d%s %s",
@newver[0,1,2],
$newver[3] eq "" ? "" : "-".$newver[3],
"currently under development");
$data =~ s/PROJECT_NUMBER\s*=.*/PROJECT_NUMBER = $version_string/;
write_file($CPP_DOC_CONFIG, $data);
}
# helper function to read the file for updating c++/src/cpp_doc_config file.
# The version string in that file is not at the top, so the string replacement
# is not for the first line, and reading/writing the entire file as one string
# facilitates the substring replacement.
sub read_file {
my ($filename) = @_;
open my $in, $filename or die "Could not open '$filename' for reading $!";
local $/ = undef;
my $all = <$in>;
close $in;
return $all;
}
# helper function to write the file for updating c++/src/cpp_doc_config file.
sub write_file {
my ($filename, $content) = @_;
open my $out, ">$filename" or die "Could not open '$filename' for writing $!";;
print $out $content;
close $out;
return;
}
sub gen_configure {
my ($name, $conf) = @_;

View File

@ -50,31 +50,33 @@ Usage: $0 -d <dir> [-h] [--nocheck] [--private] <methods> ...
This must be run at the top level of the source directory.
The other command-line options are the names of the programs to use
for compressing the resulting tar archive (if none are given then
"tar md5" is assumed):
"tar" is assumed):
tar -- use tar and don't do any compressing.
gzip -- use gzip with "-9" and append ".gz" to the output name.
bzip2 -- use bzip2 with "-9" and append ".bz2" to the output name.
zip -- convert all text files to DOS style and form a zip file for Windows use.
md5 -- produce a md5 checksum in addition to the archive.
doc -- produce the latest doc tree in addition to the archive.
An md5 checksum is produced for each archive created and stored in the md5 file.
Examples:
$ bin/release -d /tmp
/tmp/hdf5-1.8.13-RELEASE.txt
/tmp/hdf5-1.8.13.md5
/tmp/hdf5-1.8.13.tar
/tmp/hdf5-1.8.13.tar.md5
$ bin/release -d /tmp gzip
/tmp/hdf5-1.8.13-RELEASE.txt
/tmp/hdf5-1.8.13.md5
/tmp/hdf5-1.8.13.tar.gz
$ bin/release -d /tmp tar gzip zip md5
$ bin/release -d /tmp tar gzip zip
/tmp/hdf5-1.8.13-RELEASE.txt
/tmp/hdf5-1.8.13.md5
/tmp/hdf5-1.8.13.tar
/tmp/hdf5-1.8.13.tar.gz
/tmp/hdf5-1.8.13.tar.md5
/tmp/hdf5-1.8.13.tar.zip
EOF
@ -212,9 +214,9 @@ while [ -n "$1" ]; do
esac
done
# Default methods are tar and md5
# Default method is tar
if [ "X$methods" = "X" ]; then
methods="tar md5"
methods="tar"
fi
# Create the temporay work directory.
@ -289,26 +291,28 @@ test "$verbose" && echo " Running tar..." 1>&2
)
# Compress
MD5file=$HDF5_VERS.md5
cp /dev/null $DEST/$MD5file
for comp in $methods; do
case $comp in
tar)
cp -p $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.tar
(cd $DEST; md5sum $HDF5_VERS.tar >> $MD5file)
;;
gzip)
test "$verbose" && echo " Running gzip..." 1>&2
gzip -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.gz
(cd $DEST; md5sum $HDF5_VERS.tar.gz >> $MD5file)
;;
bzip2)
test "$verbose" && echo " Running bzip2..." 1>&2
bzip2 -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.bz2
(cd $DEST; md5sum $HDF5_VERS.tar.bz2 >> $MD5file)
;;
zip)
test "$verbose" && echo " Creating zip ball..." 1>&2
tar2zip $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.zip 1>&2
;;
md5)
test "$verbose" && echo " Creating checksum..." 1>&2
(cd $tmpdir; md5sum $HDF5_VERS.tar ) > $DEST/$HDF5_VERS.tar.md5
(cd $DEST; md5sum $HDF5_VERS.zip >> $MD5file)
;;
doc)
test "$verbose" && echo " Creating docs..." 1>&2

View File

@ -67,8 +67,8 @@ ReleaseDir_default=release_dir
ZLIB_default=
ZLIB=$ZLIB_default
# What compression methods to use? (md5 does checksum).
METHODS="gzip zip bzip2 md5 doc"
# What compression methods to use?
METHODS="gzip zip bzip2 doc"
# Use User's MAKE if set. Else use generic make.
MAKE=${MAKE:-make}

View File

@ -35,7 +35,7 @@ set (tutr_examples
foreach (example ${examples})
add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp)
TARGET_NAMING (cpp_ex_${example} ${LIB_TYPE})
TARGET_C_PROPERTIES (cpp_ex_${example} " " " ")
TARGET_C_PROPERTIES (cpp_ex_${example} ${LIB_TYPE} " " " ")
target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp)
endforeach (example ${examples})
@ -43,7 +43,7 @@ endforeach (example ${examples})
foreach (example ${tutr_examples})
add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp)
TARGET_NAMING (cpp_ex_${example} ${LIB_TYPE})
TARGET_C_PROPERTIES (cpp_ex_${example} " " " ")
TARGET_C_PROPERTIES (cpp_ex_${example} ${LIB_TYPE} " " " ")
target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp)
endforeach (example ${tutr_examples})

View File

@ -42,8 +42,8 @@ INSTALL_FILES=create.cpp readdata.cpp writedata.cpp compound.cpp \
# Some of the examples depend on files created by running other examples
readdata.chkexe_: create.chkexe_
chunks.chkexe_: extend_ds.chkexe_
h5tutr_rdwt.chkexe_: h5tutrcrtdat.chkexe
h5tutrcrtatt.chkexe_: h5tutrcrtdat.chkexe
h5tutr_rdwt.chkexe_: h5tutr_crtdat.chkexe
h5tutrcrtatt.chkexe_: h5tutr_crtdat.chkexe
h5tutr_crtgrpd.chkexe_: h5tutr_crtgrpar.chkexe
# Tell conclude.am that these are C++ tests.
@ -52,6 +52,7 @@ CXX_API=yes
# Where to install examples
# Note: no '/' after DESTDIR. Explanation in commence.am
EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/c++
EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples
# How to build programs using h5c++
$(EXTRA_PROG): $(H5CPP)

View File

@ -34,7 +34,7 @@ EXIT_FAILURE=1
# Where the tool is installed.
# default is relative path to installed location of the tools
prefix="${prefix:-../../../}"
prefix="${prefix:-@prefix@}"
AR="@AR@"
RANLIB="@RANLIB@"
H5TOOL="h5c++" # The tool name

View File

@ -84,7 +84,7 @@ set (CPP_HDRS
)
add_library (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} ${CPP_SRCS} ${CPP_HDRS})
TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} " " " ")
TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} " " " ")
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})

View File

@ -21,6 +21,7 @@
#include "H5PropList.h"
#include "H5Object.h"
#include "H5AbstractDs.h"
#include "H5DataSpace.h"
#include "H5DcreatProp.h"
#include "H5CommonFG.h"
#include "H5Alltypes.h"
@ -40,6 +41,12 @@ AbstractDs::AbstractDs(){}
// Function: AbstractDs default constructor
///\brief Creates an AbstractDs instance using an existing id.
// Programmer Binh-Minh Ribler - 2000
//
// *** Deprecation warning ***
// This constructor is no longer appropriate because the data member "id" had
// been moved to the sub-classes. It will be removed in 1.10 release. If its
// removal does not raise any problems in 1.10, it will be removed from 1.8 in
// subsequent releases.
//--------------------------------------------------------------------------
AbstractDs::AbstractDs(const hid_t ds_id){}
@ -47,8 +54,13 @@ AbstractDs::AbstractDs(const hid_t ds_id){}
// Function: AbstractDs copy constructor
///\brief Copy constructor: makes a copy of the original AbstractDs object.
// Programmer Binh-Minh Ribler - 2000
// *** Deprecation warning ***
// This constructor is no longer appropriate because the data member "id" had
// been moved to the sub-classes. It is removed from 1.8.15 because it is
// a noop and it can be generated by the compiler if needed.
//--------------------------------------------------------------------------
AbstractDs::AbstractDs(const AbstractDs& original){}
//--------------------------------------------------------------------------
// AbstractDs::AbstractDs(const AbstractDs& original){}
//--------------------------------------------------------------------------
// Function: AbstractDs::getTypeClass
@ -113,8 +125,9 @@ DataType AbstractDs::getDataType() const
// depending on which object invokes getDataType. Then, create and
// return the DataType object
try {
DataType datatype(p_get_type());
return(datatype);
DataType datatype;
f_DataType_setId(&datatype, p_get_type());
return(datatype);
}
catch (DataSetIException E) {
throw DataTypeIException("DataSet::getDataType", E.getDetailMsg());
@ -139,8 +152,9 @@ ArrayType AbstractDs::getArrayType() const
// depending on which object invokes getArrayType. Then, create and
// return the ArrayType object
try {
ArrayType arraytype(p_get_type());
return(arraytype);
ArrayType arraytype;
f_DataType_setId(&arraytype, p_get_type());
return(arraytype);
}
catch (DataSetIException E) {
throw DataTypeIException("DataSet::getArrayType", E.getDetailMsg());
@ -165,8 +179,9 @@ CompType AbstractDs::getCompType() const
// depending on which object invokes getCompType. Then, create and
// return the CompType object
try {
CompType comptype(p_get_type());
return(comptype);
CompType comptype;
f_DataType_setId(&comptype, p_get_type());
return(comptype);
}
catch (DataSetIException E) {
throw DataTypeIException("DataSet::getCompType", E.getDetailMsg());
@ -191,8 +206,9 @@ EnumType AbstractDs::getEnumType() const
// depending on which object invokes getEnumType. Then, create and
// return the EnumType object
try {
EnumType enumtype(p_get_type());
return(enumtype);
EnumType enumtype;
f_DataType_setId(&enumtype, p_get_type());
return(enumtype);
}
catch (DataSetIException E) {
throw DataTypeIException("DataSet::getEnumType", E.getDetailMsg());
@ -217,8 +233,9 @@ IntType AbstractDs::getIntType() const
// depending on which object invokes getIntType. Then, create and
// return the IntType object
try {
IntType inttype(p_get_type());
return(inttype);
IntType inttype;
f_DataType_setId(&inttype, p_get_type());
return(inttype);
}
catch (DataSetIException E) {
throw DataTypeIException("DataSet::getIntType", E.getDetailMsg());
@ -243,8 +260,9 @@ FloatType AbstractDs::getFloatType() const
// depending on which object invokes getFloatType. Then, create and
// return the FloatType object
try {
FloatType floatype(p_get_type());
return(floatype);
FloatType floatype;
f_DataType_setId(&floatype, p_get_type());
return(floatype);
}
catch (DataSetIException E) {
throw DataTypeIException("DataSet::getFloatType", E.getDetailMsg());
@ -269,8 +287,9 @@ StrType AbstractDs::getStrType() const
// depending on which object invokes getStrType. Then, create and
// return the StrType object
try {
StrType strtype(p_get_type());
return(strtype);
StrType strtype;
f_DataType_setId(&strtype, p_get_type());
return(strtype);
}
catch (DataSetIException E) {
throw DataTypeIException("DataSet::getStrType", E.getDetailMsg());
@ -295,8 +314,9 @@ VarLenType AbstractDs::getVarLenType() const
// depending on which object invokes getVarLenType. Then, create and
// return the VarLenType object
try {
VarLenType varlentype(p_get_type());
return(varlentype);
VarLenType varlentype;
f_DataType_setId(&varlentype, p_get_type());
return(varlentype);
}
catch (DataSetIException E) {
throw DataTypeIException("DataSet::getVarLenType", E.getDetailMsg());

View File

@ -28,6 +28,7 @@ class FloatType;
class IntType;
class StrType;
class VarLenType;
class DataSpace;
/*! \class AbstractDs
\brief AbstractDs is an abstract base class, inherited by Attribute
@ -70,9 +71,6 @@ class H5_DLLCPP AbstractDs {
///\brief Returns this class name.
virtual H5std_string fromClass() const = 0;
// Copy constructor
AbstractDs( const AbstractDs& original );
// Destructor
virtual ~AbstractDs();
@ -80,8 +78,17 @@ class H5_DLLCPP AbstractDs {
// Default constructor
AbstractDs();
// Constructor that takes an attribute id or a dataset id.
AbstractDs( const hid_t ds_id );
// *** Deprecation warning ***
// The following two constructors are no longer appropriate after the
// data member "id" had been moved to the sub-classes.
// The copy constructor is a noop and is removed in 1.8.15 and the
// other will be removed from 1.10 release, and then from 1.8 if its
// removal does not raise any problems in two 1.10 releases.
AbstractDs(const hid_t h5_id);
// Copy constructor
// AbstractDs( const AbstractDs& original );
private:
// This member function is implemented by DataSet and Attribute.

View File

@ -49,7 +49,6 @@ class H5_DLLCPP ArrayType : public DataType {
// Noop destructor
virtual ~ArrayType();
protected:
// Default constructor
ArrayType();

View File

@ -74,7 +74,8 @@ Attribute::Attribute(const Attribute& original) : AbstractDs(), IdComponent()
//--------------------------------------------------------------------------
Attribute::Attribute(const hid_t existing_id) : AbstractDs(), IdComponent()
{
id = existing_id;
id = existing_id;
incRefCount(); // increment number of references to this id
}
//--------------------------------------------------------------------------
@ -270,8 +271,9 @@ DataSpace Attribute::getSpace() const
// If the dataspace id is valid, create and return the DataSpace object
if( dataspace_id > 0 )
{
DataSpace dataspace( dataspace_id );
return( dataspace );
DataSpace dataspace;
f_DataSpace_setId(&dataspace, dataspace_id);
return(dataspace);
}
else
{
@ -392,10 +394,12 @@ H5std_string Attribute::getName() const
//--------------------------------------------------------------------------
H5std_string Attribute::getName(size_t len) const
{
H5std_string attr_name;
ssize_t name_size = getName(attr_name, len);
return(attr_name);
// let caller catch exception if any
H5std_string attr_name;
ssize_t name_size = getName(attr_name, len);
if (name_size < 0)
return("");
else
return(attr_name);
}
//--------------------------------------------------------------------------

View File

@ -31,6 +31,16 @@ namespace H5 {
*/
class H5_DLLCPP Attribute : public AbstractDs, public IdComponent {
public:
// Copy constructor: makes a copy of an existing Attribute object.
Attribute( const Attribute& original );
// Default constructor
Attribute();
// Creates a copy of an existing attribute using the attribute id
Attribute( const hid_t attr_id );
// Closes this attribute.
virtual void close();
@ -70,15 +80,6 @@ class H5_DLLCPP Attribute : public AbstractDs, public IdComponent {
///\brief Returns this class name.
virtual H5std_string fromClass () const { return("Attribute"); }
// Creates a copy of an existing attribute using the attribute id
Attribute( const hid_t attr_id );
// Copy constructor: makes a copy of an existing Attribute object.
Attribute( const Attribute& original );
// Default constructor
Attribute();
// Gets the attribute id.
virtual hid_t getId() const;
@ -109,6 +110,10 @@ class H5_DLLCPP Attribute : public AbstractDs, public IdComponent {
// do not inherit H5Object::renameAttr
void renameAttr() {}
// Friend function to set Attribute id. For library use only.
friend void f_Attribute_setId(Attribute* attr, hid_t new_id);
};
#ifndef H5_NO_NAMESPACE
}

View File

@ -14,6 +14,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <string>
#include <iostream>
#include "H5Include.h"
#include "H5Exception.h"
@ -33,9 +34,6 @@
#include "H5Alltypes.h"
#include "H5private.h" // for HDstrcpy
#include <iostream>
using namespace std;
// There are a few comments that are common to most of the functions
// defined in this file so they are listed here.
// - getLocId is called by all functions, that call a C API, to get
@ -51,6 +49,7 @@ using namespace std;
#ifndef H5_NO_NAMESPACE
namespace H5 {
using namespace std;
#endif
//--------------------------------------------------------------------------
@ -100,7 +99,9 @@ Group CommonFG::createGroup( const char* name, size_t size_hint ) const
throwException("createGroup", "H5Gcreate2 failed");
// No failure, create and return the Group object
Group group( group_id );
Group group;
CommonFG *ptr = &group;
ptr->p_setId(group_id);
return( group );
}
@ -136,7 +137,9 @@ Group CommonFG::openGroup( const char* name ) const
throwException("openGroup", "H5Gopen2 failed");
// No failure, create and return the Group object
Group group( group_id );
Group group;
CommonFG *ptr = &group;
ptr->p_setId(group_id);
return( group );
}
@ -178,7 +181,8 @@ DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, co
throwException("createDataSet", "H5Dcreate2 failed");
// No failure, create and return the DataSet object
DataSet dataset( dataset_id );
DataSet dataset;
f_DataSet_setId(&dataset, dataset_id);
return( dataset );
}
@ -213,7 +217,8 @@ DataSet CommonFG::openDataSet( const char* name ) const
throwException("openDataSet", "H5Dopen2 failed");
// No failure, create and return the DataSet object
DataSet dataset( dataset_id );
DataSet dataset;
f_DataSet_setId(&dataset, dataset_id);
return( dataset );
}
@ -576,7 +581,8 @@ DataType CommonFG::openDataType( const char* name ) const
throwException("openDataType", "H5Topen2 failed");
// No failure, create and return the DataType object
DataType data_type(type_id);
DataType data_type;
f_DataType_setId(&data_type, type_id);
return(data_type);
}
@ -611,7 +617,8 @@ ArrayType CommonFG::openArrayType( const char* name ) const
throwException("openArrayType", "H5Topen2 failed");
// No failure, create and return the ArrayType object
ArrayType array_type (type_id);
ArrayType array_type;
f_DataType_setId(&array_type, type_id);
return(array_type);
}
@ -646,7 +653,8 @@ CompType CommonFG::openCompType( const char* name ) const
throwException("openCompType", "H5Topen2 failed");
// No failure, create and return the CompType object
CompType comp_type(type_id);
CompType comp_type;
f_DataType_setId(&comp_type, type_id);
return(comp_type);
}
@ -681,7 +689,8 @@ EnumType CommonFG::openEnumType( const char* name ) const
throwException("openEnumType", "H5Topen2 failed");
// No failure, create and return the EnumType object
EnumType enum_type(type_id);
EnumType enum_type;
f_DataType_setId(&enum_type, type_id);
return(enum_type);
}
@ -716,7 +725,8 @@ IntType CommonFG::openIntType( const char* name ) const
throwException("openIntType", "H5Topen2 failed");
// No failure, create and return the IntType object
IntType int_type(type_id);
IntType int_type;
f_DataType_setId(&int_type, type_id);
return(int_type);
}
@ -751,7 +761,8 @@ FloatType CommonFG::openFloatType( const char* name ) const
throwException("openFloatType", "H5Topen2 failed");
// No failure, create and return the FloatType object
FloatType float_type(type_id);
FloatType float_type;
f_DataType_setId(&float_type, type_id);
return(float_type);
}
@ -786,7 +797,8 @@ StrType CommonFG::openStrType( const char* name ) const
throwException("openStrType", "H5Topen2 failed");
// No failure, create and return the StrType object
StrType str_type(type_id);
StrType str_type;
f_DataType_setId(&str_type, type_id);
return(str_type);
}
@ -821,7 +833,8 @@ VarLenType CommonFG::openVarLenType( const char* name ) const
throwException("openVarLenType", "H5Topen2 failed");
// No failure, create and return the VarLenType object
VarLenType varlen_type(type_id);
VarLenType varlen_type;
f_DataType_setId(&varlen_type, type_id);
return(varlen_type);
}
@ -1100,6 +1113,58 @@ H5O_type_t CommonFG::childObjType(hsize_t index, H5_index_t index_type, H5_iter_
return(objtype);
}
//--------------------------------------------------------------------------
// Function: CommonFG::childObjVersion
///\brief Returns the object header version of an object in this file/group,
/// given the object's name.
///\param objname - IN: Name of the object
///\return Object version, which can have the following values:
/// \li \c H5O_VERSION_1
/// \li \c H5O_VERSION_2
///\exception H5::FileIException or H5::GroupIException
/// Exception will be thrown when:
/// - an error returned by the C API
/// - version number is not one of the valid values above
// Programmer Binh-Minh Ribler - April, 2014
//--------------------------------------------------------------------------
unsigned CommonFG::childObjVersion(const char* objname) const
{
H5O_info_t objinfo;
unsigned version = 0;
// Use C API to get information of the object
herr_t ret_value = H5Oget_info_by_name(getLocId(), objname, &objinfo, H5P_DEFAULT);
// Throw exception if C API returns failure
if (ret_value < 0)
throwException("childObjVersion", "H5Oget_info_by_name failed");
// Return a valid version or throw an exception for invalid value
else
{
version = objinfo.hdr.version;
if (version != H5O_VERSION_1 && version != H5O_VERSION_2)
throwException("childObjVersion", "Invalid version for object");
}
return(version);
}
//--------------------------------------------------------------------------
// Function: CommonFG::childObjVersion
///\brief This is an overloaded member function, provided for convenience.
/// It takes an \a H5std_string for the object's name.
///\brief Returns the type of an object in this group, given the
/// object's name.
///\param objname - IN: Name of the object (H5std_string&)
///\exception H5::FileIException or H5::GroupIException
// Programmer Binh-Minh Ribler - April, 2014
//--------------------------------------------------------------------------
unsigned CommonFG::childObjVersion(const H5std_string& objname) const
{
// Use overloaded function
unsigned version = childObjVersion(objname.c_str());
return(version);
}
#ifndef H5_NO_DEPRECATED_SYMBOLS
#ifndef DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
@ -1172,6 +1237,7 @@ H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const
}
return (obj_type);
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
#endif /* H5_NO_DEPRECATED_SYMBOLS */
@ -1189,6 +1255,37 @@ CommonFG::CommonFG() {}
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
CommonFG::~CommonFG() {}
//--------------------------------------------------------------------------
// Function: f_DataType_setId - friend
// Purpose: This function is friend to class H5::DataType so that it
// can set DataType::id in order to work around a problem
// described in the JIRA issue HDFFV-7947.
// Applications shouldn't need to use it.
// param dtype - IN/OUT: DataType object to be changed
// param new_id - IN: New id to set
// Programmer Binh-Minh Ribler - 2015
//--------------------------------------------------------------------------
void f_DataType_setId(DataType* dtype, hid_t new_id)
{
dtype->id = new_id;
}
//--------------------------------------------------------------------------
// Function: f_DataSet_setId - friend
// Purpose: This function is friend to class H5::DataSet so that it
// can set DataSet::id in order to work around a problem
// described in the JIRA issue HDFFV-7947.
// Applications shouldn't need to use it.
// param dset - IN/OUT: DataSet object to be changed
// param new_id - IN: New id to set
// Programmer Binh-Minh Ribler - 2015
//--------------------------------------------------------------------------
void f_DataSet_setId(DataSet* dset, hid_t new_id)
{
dset->id = new_id;
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
#ifndef H5_NO_NAMESPACE

View File

@ -21,6 +21,7 @@
namespace H5 {
#endif
// Class forwarding
class Group;
class H5File;
class ArrayType;
@ -70,6 +71,11 @@ class H5_DLLCPP CommonFG {
H5O_type_t childObjType(const char* objname) const;
H5O_type_t childObjType(hsize_t index, H5_index_t index_type=H5_INDEX_NAME, H5_iter_order_t order=H5_ITER_INC, const char* objname=".") const;
// Returns the object header version of an object in this file or group,
// given the object's name.
unsigned childObjVersion(const char* objname) const;
unsigned childObjVersion(const H5std_string& objname) const;
#ifndef H5_NO_DEPRECATED_SYMBOLS
// Returns the type of an object in this group, given the
// object's index.
@ -159,6 +165,10 @@ class H5_DLLCPP CommonFG {
// Noop destructor.
virtual ~CommonFG();
protected:
virtual void p_setId(const hid_t new_id) = 0;
#endif // DOXYGEN_SHOULD_SKIP_THIS
}; // end of CommonFG declaration

View File

@ -227,7 +227,8 @@ hid_t CompType::p_get_member_type(unsigned member_num) const
DataType CompType::getMemberDataType( unsigned member_num ) const
{
try {
DataType datatype(p_get_member_type(member_num));
DataType datatype;
f_DataType_setId(&datatype, p_get_member_type(member_num));
return(datatype);
}
catch (DataTypeIException E) {
@ -248,6 +249,7 @@ ArrayType CompType::getMemberArrayType( unsigned member_num ) const
{
try {
ArrayType arraytype(p_get_member_type(member_num));
f_DataType_setId(&arraytype, p_get_member_type(member_num));
return(arraytype);
}
catch (DataTypeIException E) {
@ -268,6 +270,7 @@ CompType CompType::getMemberCompType( unsigned member_num ) const
{
try {
CompType comptype(p_get_member_type(member_num));
f_DataType_setId(&comptype, p_get_member_type(member_num));
return(comptype);
}
catch (DataTypeIException E) {
@ -288,6 +291,7 @@ EnumType CompType::getMemberEnumType( unsigned member_num ) const
{
try {
EnumType enumtype(p_get_member_type(member_num));
f_DataType_setId(&enumtype, p_get_member_type(member_num));
return(enumtype);
}
catch (DataTypeIException E) {
@ -308,6 +312,7 @@ IntType CompType::getMemberIntType( unsigned member_num ) const
{
try {
IntType inttype(p_get_member_type(member_num));
f_DataType_setId(&inttype, p_get_member_type(member_num));
return(inttype);
}
catch (DataTypeIException E) {
@ -328,6 +333,7 @@ FloatType CompType::getMemberFloatType( unsigned member_num ) const
{
try {
FloatType floatype(p_get_member_type(member_num));
f_DataType_setId(&floatype, p_get_member_type(member_num));
return(floatype);
}
catch (DataTypeIException E) {
@ -348,6 +354,7 @@ StrType CompType::getMemberStrType( unsigned member_num ) const
{
try {
StrType strtype(p_get_member_type(member_num));
f_DataType_setId(&strtype, p_get_member_type(member_num));
return(strtype);
}
catch (DataTypeIException E) {
@ -368,6 +375,7 @@ VarLenType CompType::getMemberVarLenType( unsigned member_num ) const
{
try {
VarLenType varlentype(p_get_member_type(member_num));
f_DataType_setId(&varlentype, p_get_member_type(member_num));
return(varlentype);
}
catch (DataTypeIException E) {

View File

@ -52,7 +52,7 @@ namespace H5 {
///\brief Default constructor: creates a stub DataSet.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataSet::DataSet() : AbstractDs(), H5Object(), id(H5I_INVALID_HID) {}
DataSet::DataSet() : H5Object(), AbstractDs(), id(H5I_INVALID_HID) {}
//--------------------------------------------------------------------------
// Function: DataSet overloaded constructor
@ -60,9 +60,10 @@ DataSet::DataSet() : AbstractDs(), H5Object(), id(H5I_INVALID_HID) {}
///\param existing_id - IN: Id of an existing dataset
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataSet::DataSet(const hid_t existing_id) : AbstractDs(), H5Object()
DataSet::DataSet(const hid_t existing_id) : H5Object(), AbstractDs()
{
id = existing_id;
incRefCount(); // increment number of references to this id
}
//--------------------------------------------------------------------------
@ -71,7 +72,7 @@ DataSet::DataSet(const hid_t existing_id) : AbstractDs(), H5Object()
///\param original - IN: DataSet instance to copy
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataSet::DataSet(const DataSet& original) : AbstractDs(original), H5Object(original)
DataSet::DataSet(const DataSet& original) : H5Object(), AbstractDs()
{
id = original.getId();
incRefCount(); // increment number of references to this id
@ -95,7 +96,7 @@ DataSet::DataSet(const DataSet& original) : AbstractDs(original), H5Object(origi
// Jul, 2008
// Added for application convenience.
//--------------------------------------------------------------------------
DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : AbstractDs(), H5Object(), id(H5I_INVALID_HID)
DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), AbstractDs(), id(H5I_INVALID_HID)
{
id = H5Location::p_dereference(loc.getId(), ref, ref_type, plist, "constructor - by dereferenced");
}
@ -114,7 +115,7 @@ DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, co
// Jul, 2008
// Added for application convenience.
//--------------------------------------------------------------------------
DataSet::DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : AbstractDs(), H5Object(), id(H5I_INVALID_HID)
DataSet::DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), AbstractDs(), id(H5I_INVALID_HID)
{
id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference");
}
@ -137,7 +138,8 @@ DataSpace DataSet::getSpace() const
throw DataSetIException("DataSet::getSpace", "H5Dget_space failed");
}
//create dataspace object using the existing id then return the object
DataSpace data_space( dataspace_id );
DataSpace data_space;
f_DataSpace_setId(&data_space, dataspace_id);
return( data_space );
}
@ -170,8 +172,8 @@ DSetCreatPropList DataSet::getCreatePlist() const
throw DataSetIException("DataSet::getCreatePlist", "H5Dget_create_plist failed");
}
// create and return the DSetCreatPropList object
DSetCreatPropList create_plist( create_plist_id );
return( create_plist );
DSetCreatPropList create_plist(create_plist_id); // ok to use existing id const
return(create_plist);
}
//--------------------------------------------------------------------------

View File

@ -30,6 +30,7 @@ namespace H5 {
*/
class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
public:
// Close this dataset.
virtual void close();
@ -125,6 +126,10 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
// Reads variable or fixed len strings from this dataset.
void p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const;
void p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const;
// Friend function to set DataSet id. For library use only.
friend void f_DataSet_setId(DataSet* dset, hid_t new_id);
};
#ifndef H5_NO_NAMESPACE
}

View File

@ -85,6 +85,7 @@ DataSpace::DataSpace( int rank, const hsize_t * dims, const hsize_t * maxdims) :
DataSpace::DataSpace(const hid_t existing_id) : IdComponent()
{
id = existing_id;
incRefCount(); // increment number of references to this id
}
//--------------------------------------------------------------------------
@ -93,7 +94,7 @@ DataSpace::DataSpace(const hid_t existing_id) : IdComponent()
///\param original - IN: DataSpace object to copy
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataSpace::DataSpace(const DataSpace& original) : IdComponent(original)
DataSpace::DataSpace(const DataSpace& original) : IdComponent()
{
id = original.getId();
incRefCount(); // increment number of references to this id

View File

@ -129,6 +129,9 @@ class H5_DLLCPP DataSpace : public IdComponent {
private:
hid_t id; // HDF5 dataspace id
// Friend function to set DataSpace id. For library use only.
friend void f_DataSpace_setId(DataSpace *dspace, hid_t new_id);
};
#ifndef H5_NO_NAMESPACE
}

View File

@ -71,6 +71,7 @@ DataType::DataType() : H5Object(), id(H5I_INVALID_HID) {}
DataType::DataType(const hid_t existing_id) : H5Object()
{
id = existing_id;
incRefCount(); // increment number of references to this id
}
//--------------------------------------------------------------------------
@ -105,7 +106,7 @@ DataType::DataType( const H5T_class_t type_class, size_t size ) : H5Object()
// Jul, 2008
// Added for application convenience.
//--------------------------------------------------------------------------
DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID)
DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object()
{
id = H5Location::p_dereference(loc.getId(), ref, ref_type, plist, "constructor - by dereference");
}
@ -134,12 +135,33 @@ DataType::DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type,
///\brief Copy constructor: makes a copy of the original DataType object.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataType::DataType(const DataType& original) : H5Object(original)
DataType::DataType(const DataType& original) : H5Object()
{
id = original.getId();
incRefCount(); // increment number of references to this id
}
//--------------------------------------------------------------------------
// Function: DataType overloaded constructor
///\brief Creates a integer type using a predefined type
///\param pred_type - IN: Predefined datatype
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
// Description
// Copying the type so that when a predefined type is passed in,
// a copy of it is made, not just a duplicate of the HDF5 id.
// Note: calling DataType::copy will invoke DataType::close()
// unnecessarily and will produce undefined behavior.
// -BMR, Apr 2015
//--------------------------------------------------------------------------
DataType::DataType(const PredType& pred_type) : H5Object()
{
// call C routine to copy the datatype
id = H5Tcopy( pred_type.getId() );
if (id < 0)
throw DataTypeIException("DataType constructor", "H5Tcopy failed");
}
//--------------------------------------------------------------------------
// Function: DataType::copy
///\brief Copies an existing datatype to this datatype object
@ -203,11 +225,22 @@ void DataType::copy(const DataSet& dset)
// Makes a copy of the type on the right hand side and stores
// the new id in the left hand side object.
// Programmer Binh-Minh Ribler - 2000
// Modification
// Changed operator= to simply copy the id of rhs instead of
// calling H5Tcopy because, when the operator= is invoked, a
// different datatype id is created and it won't have the same
// characteristics as the original one, specifically, if the
// rhs represents a named datatype, "this" would still be a
// transient datatype.
// BMR - Mar, 2015
//--------------------------------------------------------------------------
DataType& DataType::operator=( const DataType& rhs )
{
if (this != &rhs)
copy(rhs);
{
id = rhs.id;
incRefCount(); // increment number of references to this id
}
return(*this);
}
@ -463,8 +496,9 @@ DataType DataType::getSuper() const
// the base type, otherwise, raise exception
if( base_type_id > 0 )
{
DataType base_type( base_type_id );
return( base_type );
DataType base_type;
base_type.p_setId(base_type_id);
return(base_type);
}
else
{

View File

@ -36,6 +36,9 @@ class H5_DLLCPP DataType : public H5Object {
// Copy constructor: makes a copy of the original object
DataType( const DataType& original );
// Creates a copy of a predefined type
DataType(const PredType& pred_type);
// Creates a datatype by way of dereference.
DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
@ -133,6 +136,9 @@ class H5_DLLCPP DataType : public H5Object {
#endif // DOXYGEN_SHOULD_SKIP_THIS
private:
// Friend function to set DataType id. For library use only.
friend void f_DataType_setId(DataType* dtype, hid_t new_id);
void p_commit(hid_t loc_id, const char* name);
};
#ifndef H5_NO_NAMESPACE

View File

@ -35,11 +35,11 @@ Exception::Exception() : detail_message(""), func_name("") {}
// Function: Exception overloaded constructor
///\brief Creates an exception with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param func - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
Exception::Exception(const H5std_string& func_name, const H5std_string& message) : detail_message(message), func_name(func_name) {}
Exception::Exception(const H5std_string& func, const H5std_string& message) : detail_message(message), func_name(func) {}
//--------------------------------------------------------------------------
// Function: Exception copy constructor
@ -350,10 +350,10 @@ FileIException::FileIException():Exception(){}
// Function: FileIException overloaded constructor
///\brief Creates a FileIException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param func - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
FileIException::FileIException(const H5std_string& func_name, const H5std_string& message) : Exception(func_name, message) {}
FileIException::FileIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
// Function: FileIException destructor
///\brief Noop destructor.
@ -373,10 +373,10 @@ GroupIException::GroupIException():Exception(){}
// Function: GroupIException overloaded constructor
///\brief Creates a GroupIException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param func - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
GroupIException::GroupIException(const H5std_string& func_name, const H5std_string& message) : Exception(func_name, message) {}
GroupIException::GroupIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
// Function: GroupIException destructor
///\brief Noop destructor.
@ -396,10 +396,10 @@ DataSpaceIException::DataSpaceIException():Exception(){}
// Function: DataSpaceIException overloaded constructor
///\brief Creates a DataSpaceIException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param func - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
DataSpaceIException::DataSpaceIException(const H5std_string& func_name, const H5std_string& message) : Exception(func_name, message) {}
DataSpaceIException::DataSpaceIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
// Function: DataSpaceIException destructor
///\brief Noop destructor.
@ -419,10 +419,10 @@ DataTypeIException::DataTypeIException():Exception(){}
// Function: DataTypeIException overloaded constructor
///\brief Creates a DataTypeIException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param func - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
DataTypeIException::DataTypeIException(const H5std_string& func_name, const H5std_string& message) : Exception(func_name, message) {}
DataTypeIException::DataTypeIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
// Function: DataTypeIException destructor
///\brief Noop destructor.
@ -442,10 +442,10 @@ PropListIException::PropListIException():Exception(){}
// Function: PropListIException overloaded constructor
///\brief Creates a PropListIException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param func - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
PropListIException::PropListIException(const H5std_string& func_name, const H5std_string& message) : Exception(func_name, message) {}
PropListIException::PropListIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
// Function: PropListIException destructor
///\brief Noop destructor.
@ -465,10 +465,10 @@ DataSetIException::DataSetIException():Exception(){}
// Function: DataSetIException overloaded constructor
///\brief Creates a DataSetIException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param func - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
DataSetIException::DataSetIException(const H5std_string& func_name, const H5std_string& message) : Exception(func_name, message) {}
DataSetIException::DataSetIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
// Function: DataSetIException destructor
///\brief Noop destructor.
@ -488,10 +488,10 @@ AttributeIException::AttributeIException():Exception(){}
// Function: AttributeIException overloaded constructor
///\brief Creates an AttributeIException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param func - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
AttributeIException::AttributeIException(const H5std_string& func_name, const H5std_string& message) : Exception(func_name, message) {}
AttributeIException::AttributeIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
// Function: AttributeIException destructor
///\brief Noop destructor.
@ -511,10 +511,10 @@ ReferenceException::ReferenceException():Exception(){}
// Function: ReferenceException overloaded constructor
///\brief Creates a ReferenceException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param func - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
ReferenceException::ReferenceException(const H5std_string& func_name, const H5std_string& message) : Exception(func_name, message) {}
ReferenceException::ReferenceException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
// Function: ReferenceException destructor
///\brief Noop destructor.
@ -534,10 +534,10 @@ LibraryIException::LibraryIException():Exception(){}
// Function: LibraryIException overloaded constructor
///\brief Creates a LibraryIException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param func - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
LibraryIException::LibraryIException(const H5std_string& func_name, const H5std_string& message) : Exception(func_name, message) {}
LibraryIException::LibraryIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
// Function: LibraryIException destructor
///\brief Noop destructor.
@ -557,10 +557,10 @@ LocationException::LocationException():Exception(){}
// Function: LocationException overloaded constructor
///\brief Creates a LocationException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param func - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
LocationException::LocationException(const H5std_string& func_name, const H5std_string& message) : Exception(func_name, message) {}
LocationException::LocationException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
// Function: LocationException destructor
///\brief Noop destructor.
@ -580,10 +580,10 @@ IdComponentException::IdComponentException(): Exception() {}
// Function: IdComponentException overloaded constructor
///\brief Creates a IdComponentException with the name of the function,
/// in which the failure occurs, and an optional detailed message.
///\param func_name - IN: Name of the function where failure occurs
///\param func - IN: Name of the function where failure occurs
///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
IdComponentException::IdComponentException(const H5std_string& func_name, const H5std_string& message) : Exception(func_name, message) {}
IdComponentException::IdComponentException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
// Function: IdComponentException destructor
///\brief Noop destructor.

View File

@ -40,10 +40,10 @@ FileAccPropList::FileAccPropList() : PropList( H5P_FILE_ACCESS ) {}
//--------------------------------------------------------------------------
// Function: FileAccPropList copy constructor
///\brief Copy Constructor: makes a copy of the original
/// FileAccPropList object.
///\param original - IN: FileAccPropList instance to copy
// Programmer: Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FileAccPropList::FileAccPropList(const FileAccPropList& orig) : PropList(orig) {}
FileAccPropList::FileAccPropList(const FileAccPropList& original) : PropList(original) {}
//--------------------------------------------------------------------------
// Function: FileAccPropList overloaded constructor
@ -663,6 +663,67 @@ unsigned FileAccPropList::getGcReferences() const
return( gc_ref );
}
//--------------------------------------------------------------------------
// Function: FileAccPropList::setLibverBounds
///\brief Sets bounds on versions of library format to be used when creating
/// or writing objects.
///\param libver_low - IN: Earliest version of the library that will be
/// used for creating or writing objects
///\param libver_high - IN: Latest version of the library that will be
///\exception H5::PropListIException
///\par Description
/// Valid values of \a libver_low are as follows:
/// \li \c H5F_LIBVER_EARLIEST (Default)
/// \li \c H5F_LIBVER_18
/// \li \c H5F_LIBVER_LATEST
///
/// Valid values of \a libver_high are as follows:
/// \li \c H5F_LIBVER_18
/// \li \c H5F_LIBVER_LATEST (Default)
///
/// For more details, please refer to
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLibverBounds
// Programmer: Binh-Minh Ribler - March, 2015
//--------------------------------------------------------------------------
void FileAccPropList::setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const
{
herr_t ret_value = H5Pset_libver_bounds(id, libver_low, libver_high);
if (ret_value < 0)
{
throw PropListIException("FileAccPropList::setLibverBounds", "H5Pset_libver_bounds failed");
}
}
//--------------------------------------------------------------------------
// Function: FileAccPropList::getLibverBounds
///\brief Gets the current settings for the library version format bounds
/// from a file access property list.
///\param libver_low - OUT: Earliest version of the library that will be
/// used for creating or writing objects
///\param libver_high - OUT: Latest version of the library that will be
/// used for creating or writing objects
///\exception H5::PropListIException
///\par Description
/// On success, the argument \a libver_low can have the following
/// values:
/// \li \c H5F_LIBVER_EARLIEST
/// \li \c H5F_LIBVER_18
/// \li \c H5F_LIBVER_LATEST
///
/// and \a libver_high:
/// \li \c H5F_LIBVER_18
/// \li \c H5F_LIBVER_LATEST
// Programmer: Binh-Minh Ribler - March, 2015
//--------------------------------------------------------------------------
void FileAccPropList::getLibverBounds(H5F_libver_t& libver_low, H5F_libver_t& libver_high) const
{
herr_t ret_value = H5Pget_libver_bounds(id, &libver_low, &libver_high);
if( ret_value < 0 )
{
throw PropListIException("FileAccPropList::getLibverBounds", "H5Pget_libver_bounds failed");
}
}
//--------------------------------------------------------------------------
// Function: FileAccPropList destructor
///\brief Noop destructor

View File

@ -126,6 +126,13 @@ class H5_DLLCPP FileAccPropList : public PropList {
// Returns garbage collecting references setting.
unsigned getGcReferences() const;
// Sets bounds on versions of library format to be used when creating
// or writing objects.
void setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const;
// Gets the current settings for the library version format bounds.
void getLibverBounds(H5F_libver_t& libver_low, H5F_libver_t& libver_high) const;
///\brief Returns this class name.
virtual H5std_string fromClass () const { return("FileAccPropList"); }

View File

@ -50,7 +50,7 @@ namespace H5 {
///\brief Default constructor: creates a stub H5File object.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5File::H5File() : H5Location(), id(H5I_INVALID_HID) {}
H5File::H5File() : H5Location(), CommonFG(), id(H5I_INVALID_HID) {}
//--------------------------------------------------------------------------
// Function: H5File overloaded constructor
@ -73,9 +73,6 @@ H5File::H5File() : H5Location(), id(H5I_INVALID_HID) {}
/// exists, and fail, otherwise
/// \li \c H5F_ACC_RDWR - Open file for read/write, if it already
/// exists, and fail, otherwise
/// \li \c H5F_ACC_DEBUG - print debug information. This flag is
/// used only by HDF5 library developers; it is neither
/// tested nor supported for use in applications.
///\par
/// For info on file creation in the case of an already-open file,
/// please refer to the \b Special \b case section in the C layer
@ -86,7 +83,7 @@ H5File::H5File() : H5Location(), id(H5I_INVALID_HID) {}
// to catch then re-throw it. -BMR 2013/03/21
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(), id(H5I_INVALID_HID)
H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(), CommonFG(), id(H5I_INVALID_HID)
{
try {
p_get_file(name, flags, create_plist, access_plist);
@ -111,7 +108,7 @@ H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& c
// to catch then re-throw it. -BMR 2013/03/21
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(), id(H5I_INVALID_HID)
H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(), CommonFG(), id(H5I_INVALID_HID)
{
try {
p_get_file(name.c_str(), flags, create_plist, access_plist);
@ -133,30 +130,49 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro
{
// These bits only set for creation, so if any of them are set,
// create the file.
if( flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC|H5F_ACC_DEBUG))
if( flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC))
{
hid_t create_plist_id = create_plist.getId();
hid_t access_plist_id = access_plist.getId();
id = H5Fcreate( name, flags, create_plist_id, access_plist_id );
if( id < 0 ) // throw an exception when open/create fail
{
throw FileIException("H5File constructor", "H5Fcreate failed");
}
hid_t create_plist_id = create_plist.getId();
hid_t access_plist_id = access_plist.getId();
id = H5Fcreate( name, flags, create_plist_id, access_plist_id );
if( id < 0 ) // throw an exception when open/create fail
{
throw FileIException("H5File constructor", "H5Fcreate failed");
}
}
// Open the file if none of the bits above are set.
else
{
hid_t access_plist_id = access_plist.getId();
id = H5Fopen( name, flags, access_plist_id );
if( id < 0 ) // throw an exception when open/create fail
{
throw FileIException("H5File constructor", "H5Fopen failed");
}
hid_t access_plist_id = access_plist.getId();
id = H5Fopen( name, flags, access_plist_id );
if( id < 0 ) // throw an exception when open/create fail
{
throw FileIException("H5File constructor", "H5Fopen failed");
}
}
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
// Function: H5File overloaded constructor
///\brief Creates an H5File object using an existing file id.
///\param existing_id - IN: Id of an existing file
// Programmer Binh-Minh Ribler - 2015
// Description
// Mar 29, 2015
// Added in responding to a request from user Jason Newton.
// However, it is not recommended to use the private member "id"
// in applications. Unlike other situations, where similar
// constructor is needed by the library in order to return
// an object, H5File doesn't need it. -BMR (HDFFV-8766 partially)
//--------------------------------------------------------------------------
H5File::H5File(hid_t existing_id) : H5Location(), CommonFG()
{
id = existing_id;
incRefCount(); // increment number of references to this id
}
//--------------------------------------------------------------------------
// Function: H5File copy constructor
///\brief Copy constructor: makes a copy of the original
@ -164,7 +180,7 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro
///\param original - IN: H5File instance to copy
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5File::H5File(const H5File& original) : H5Location(original)
H5File::H5File(const H5File& original) : H5Location(), CommonFG()
{
id = original.getId();
incRefCount(); // increment number of references to this id
@ -225,6 +241,13 @@ bool H5File::isHdf5(const H5std_string& name )
//--------------------------------------------------------------------------
void H5File::openFile(const char* name, unsigned int flags, const FileAccPropList& access_plist)
{
try {
close();
}
catch (Exception close_error) {
throw FileIException("H5File::openFile", close_error.getDetailMsg());
}
hid_t access_plist_id = access_plist.getId();
id = H5Fopen (name, flags, access_plist_id);
if (id < 0) // throw an exception when open fails
@ -378,25 +401,6 @@ ssize_t H5File::getObjCount(unsigned types) const
return (num_objs);
}
//--------------------------------------------------------------------------
// Function: H5File::getObjCount
///\brief This is an overloaded member function, provided for convenience.
/// It takes no parameter and returns the object count of all
/// object types.
///\return Number of opened object IDs
///\exception H5::FileIException
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
ssize_t H5File::getObjCount() const
{
ssize_t num_objs = H5Fget_obj_count(id, H5F_OBJ_ALL);
if( num_objs < 0 )
{
throw FileIException("H5File::getObjCount", "H5Fget_obj_count failed");
}
return (num_objs);
}
//--------------------------------------------------------------------------
// Function: H5File::getObjIDs
///\brief Retrieves a list of opened object IDs (files, datasets,

View File

@ -59,8 +59,7 @@ class H5_DLLCPP H5File : public H5Location, public CommonFG {
// Returns the number of opened object IDs (files, datasets, groups
// and datatypes) in the same file.
ssize_t getObjCount(unsigned types) const;
ssize_t getObjCount() const;
ssize_t getObjCount(unsigned types = H5F_OBJ_ALL) const;
// Retrieves a list of opened object IDs (files, datasets, groups
// and datatypes) in the same file.
@ -84,6 +83,10 @@ class H5_DLLCPP H5File : public H5Location, public CommonFG {
// Gets the file id
virtual hid_t getLocId() const;
// Creates an H5File using an existing file id. Not recommended
// in applications.
H5File(hid_t existing_id);
#endif // DOXYGEN_SHOULD_SKIP_THIS
///\brief Returns this class name.

View File

@ -51,7 +51,7 @@ namespace H5 {
///\brief Default constructor: creates a stub Group.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
Group::Group() : H5Object(), id(H5I_INVALID_HID) {}
Group::Group() : H5Object(), CommonFG(), id(H5I_INVALID_HID) {}
//--------------------------------------------------------------------------
// Function: Group copy constructor
@ -59,7 +59,7 @@ Group::Group() : H5Object(), id(H5I_INVALID_HID) {}
///\param original - IN: Original group to copy
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
Group::Group(const Group& original) : H5Object(original)
Group::Group(const Group& original) : H5Object(), CommonFG()
{
id = original.getId();
incRefCount(); // increment number of references to this id
@ -82,9 +82,10 @@ hid_t Group::getLocId() const
///\param existing_id - IN: Id of an existing group
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
Group::Group(const hid_t existing_id) : H5Object()
Group::Group(const hid_t existing_id) : H5Object(), CommonFG()
{
id = existing_id;
incRefCount(); // increment number of references to this id
}
//--------------------------------------------------------------------------
@ -100,7 +101,7 @@ Group::Group(const hid_t existing_id) : H5Object()
/// is a datatype that has been named by DataType::commit.
// Programmer Binh-Minh Ribler - Oct, 2006
//--------------------------------------------------------------------------
Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID)
Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), CommonFG(), id(H5I_INVALID_HID)
{
id = H5Location::p_dereference(loc.getId(), ref, ref_type, plist, "constructor - by dereference");
}
@ -115,7 +116,7 @@ Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const
///\exception H5::ReferenceException
// Programmer Binh-Minh Ribler - Oct, 2006
//--------------------------------------------------------------------------
Group::Group(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID)
Group::Group(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), CommonFG(), id(H5I_INVALID_HID)
{
id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference");
}

View File

@ -37,16 +37,33 @@ namespace H5 {
///\param h5_id - IN: Id of an existing object
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//
// *** Deprecation warning ***
// This constructor is no longer appropriate because the data member "id" had
// been moved to the sub-classes. It will be removed in 1.10 release. If its
// removal does not raise any problems in 1.10, it will be removed from 1.8 in
// subsequent releases.
//--------------------------------------------------------------------------
IdComponent::IdComponent(const hid_t h5_id) {}
//void IdComponent::p_setId(const hid_t new_id)
//{
//p_setId(new_id);
//}
//--------------------------------------------------------------------------
// Function: IdComponent copy constructor
///\brief Copy constructor: makes a copy of the original IdComponent object.
///\param original - IN: IdComponent instance to copy
// Purpose: This noop copy constructor is removed as a result of the data
// member "id" being moved down to sub-classes. (Mar 2015)
// Parameters: original - IN: IdComponent instance to copy
// Programmer Binh-Minh Ribler - 2000
//
// *** Deprecation warning ***
// This constructor is no longer appropriate because the data member "id" had
// been moved to the sub-classes. It is removed from 1.8.15 because it is
// a noop and it can be generated by the compiler if needed.
//--------------------------------------------------------------------------
IdComponent::IdComponent( const IdComponent& original ) {}
// IdComponent::IdComponent(const IdComponent& original) {}
//--------------------------------------------------------------------------
// Function: IdComponent::incRefCount
@ -82,12 +99,14 @@ void IdComponent::decRefCount(const hid_t obj_id) const
{
if (p_valid_id(obj_id))
if (H5Idec_ref(obj_id) < 0)
{
if (H5Iget_ref(obj_id) <= 0)
throw IdComponentException(inMemFunc("decRefCount"),
"object ref count is 0 or negative");
else
throw IdComponentException(inMemFunc("decRefCount"),
"decrementing object ref count failed");
}
}
//--------------------------------------------------------------------------

View File

@ -60,11 +60,18 @@ class H5_DLLCPP IdComponent {
// Sets the identifier of this object to a new value.
void setId(const hid_t new_id);
// *** Deprecation warning ***
// The following two constructors are no longer appropriate after the
// data member "id" had been moved to the sub-classes.
// The copy constructor is a noop and is removed in 1.8.15 and the
// other will be removed from 1.10 release, and then from 1.8 if its
// removal does not raise any problems in two 1.10 releases.
// Creates an object to hold an HDF5 identifier.
IdComponent( const hid_t h5_id );
// Copy constructor: makes copy of the original IdComponent object.
IdComponent( const IdComponent& original );
// IdComponent( const IdComponent& original );
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// Pure virtual function for there are various H5*close for the
@ -97,6 +104,7 @@ class H5_DLLCPP IdComponent {
// Sets the identifier of this object to a new value. - this one
// doesn't increment reference count
virtual void p_setId(const hid_t new_id) = 0;
//virtual void p_setId(const hid_t new_id);
#endif // DOXYGEN_SHOULD_SKIP_THIS

View File

@ -28,3 +28,15 @@ typedef int bool;
const bool false = 0;
const bool true = 1;
#endif
// These are defined in H5Opkg.h, which should not be included in the C++ API,
// so re-define them here for now.
/* Initial version of the object header format */
#define H5O_VERSION_1 1
/* Revised version - leaves out reserved bytes and alignment padding, and adds
* magic number as prefix and checksum as suffix for all chunks.
*/
#define H5O_VERSION_2 2

View File

@ -24,7 +24,7 @@ namespace H5 {
//! Class IntType operates on HDF5 integer datatype.
class H5_DLLCPP IntType : public AtomType {
public:
// Creates a integer type using a predefined type
// Creates an integer type using a predefined type
IntType(const PredType& pred_type);
// Gets the integer datatype of the specified dataset

View File

@ -70,17 +70,28 @@ H5Location::H5Location() : IdComponent() {}
// object.
// Parameters object_id - IN: Id of an existing HDF5 object
// Programmer Binh-Minh Ribler - 2000
// *** Deprecation warning ***
// This constructor is no longer appropriate because the data member "id" had
// been moved to the sub-classes. It will be removed in 1.10 release. If its
// removal does not raise any problems in 1.10, it will be removed from 1.8 in
// subsequent releases.
//--------------------------------------------------------------------------
H5Location::H5Location(const hid_t object_id) : IdComponent(object_id) {}
H5Location::H5Location(const hid_t object_id) : IdComponent() {}
//--------------------------------------------------------------------------
// Function: H5Location copy constructor
///\brief Copy constructor: makes a copy of the original H5Location
/// instance.
// Purpose: This noop copy constructor is removed as a result of the data
// member "id" being moved down to sub-classes. (Mar 2015)
///\param original - IN: H5Location instance to copy
// Programmer Binh-Minh Ribler - 2000
//
// *** Deprecation warning ***
// This constructor is no longer appropriate because the data member "id" had
// been moved to the sub-classes. It is removed from 1.8.15 because it is
// a noop and it can be generated by the compiler if needed.
//--------------------------------------------------------------------------
H5Location::H5Location( const H5Location& original ) : IdComponent( original ) {}
// H5Location::H5Location(const H5Location& original) : IdComponent() {}
#endif // DOXYGEN_SHOULD_SKIP_THIS
@ -115,8 +126,9 @@ Attribute H5Location::createAttribute( const char* name, const DataType& data_ty
// If the attribute id is valid, create and return the Attribute object
if( attr_id > 0 )
{
Attribute attr( attr_id );
return( attr );
Attribute attr;
f_Attribute_setId(&attr, attr_id);
return( attr );
}
else
throw AttributeIException(inMemFunc("createAttribute"), "H5Acreate2 failed");
@ -147,8 +159,9 @@ Attribute H5Location::openAttribute( const char* name ) const
hid_t attr_id = H5Aopen(getId(), name, H5P_DEFAULT);
if( attr_id > 0 )
{
Attribute attr( attr_id );
return( attr );
Attribute attr;
f_Attribute_setId(&attr, attr_id);
return( attr );
}
else
{
@ -182,12 +195,13 @@ Attribute H5Location::openAttribute( const unsigned int idx ) const
H5_ITER_INC, (hsize_t)idx, H5P_DEFAULT, H5P_DEFAULT);
if( attr_id > 0 )
{
Attribute attr( attr_id );
return( attr );
Attribute attr;
f_Attribute_setId(&attr, attr_id);
return(attr);
}
else
{
throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen_by_idx failed");
throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen_by_idx failed");
}
}
@ -893,6 +907,12 @@ H5O_type_t H5Location::p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const
///\return DataSpace object
///\exception H5::ReferenceException
// Programmer Binh-Minh Ribler - May, 2004
// Modification
// Mar 29, 2015
// Used friend function to set id for DataSpace instead of the
// existing id constructor or the setId method to avoid incrementing
// ref count, as a work-around for a problem described in the JIRA
// issue HDFFV-7947. -BMR
//--------------------------------------------------------------------------
DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const
{
@ -902,8 +922,9 @@ DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const
throw ReferenceException(inMemFunc("getRegion"), "H5Rget_region failed");
}
try {
DataSpace dataspace(space_id);
return(dataspace);
DataSpace dataspace;
f_DataSpace_setId(&dataspace, space_id);
return(dataspace);
}
catch (DataSpaceIException E) {
throw ReferenceException(inMemFunc("getRegion"), E.getDetailMsg());
@ -918,6 +939,36 @@ DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const
//--------------------------------------------------------------------------
H5Location::~H5Location() {}
//--------------------------------------------------------------------------
// Function: f_Attribute_setId - friend
// Purpose: This function is friend to class H5::Attribute so that it
// can set Attribute::id in order to work around a problem
// described in the JIRA issue HDFFV-7947.
// Applications shouldn't need to use it.
// param attr - IN/OUT: Attribute object to be changed
// param new_id - IN: New id to set
// Programmer Binh-Minh Ribler - 2015
//--------------------------------------------------------------------------
void f_Attribute_setId(Attribute* attr, hid_t new_id)
{
attr->id = new_id;
}
//--------------------------------------------------------------------------
// Function: f_DataSpace_setId - friend
// Purpose: This function is friend to class H5::DataSpace so that it can
// can set DataSpace::id in order to work around a problem
// described in the JIRA issue HDFFV-7947.
// Applications shouldn't need to use it.
// param dspace - IN/OUT: DataSpace object to be changed
// param new_id - IN: New id to set
// Programmer Binh-Minh Ribler - 2015
//--------------------------------------------------------------------------
void f_DataSpace_setId(DataSpace* dspace, hid_t new_id)
{
dspace->id = new_id;
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
#ifndef H5_NO_NAMESPACE

View File

@ -138,13 +138,21 @@ class H5_DLLCPP H5Location : public IdComponent {
// Default constructor
H5Location();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// *** Deprecation warning ***
// The following two constructors are no longer appropriate after the
// data member "id" had been moved to the sub-classes.
// The copy constructor is a noop and is removed in 1.8.15 and the
// other will be removed from 1.10 release, and then from 1.8 if its
// removal does not raise any problems in two 1.10 releases.
// Creates a copy of an existing object giving the location id.
H5Location(const hid_t loc_id);
// Copy constructor.
H5Location(const H5Location& original);
// H5Location(const H5Location& original);
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// Creates a reference to an HDF5 object or a dataset region.
void p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const;
@ -159,6 +167,10 @@ class H5_DLLCPP H5Location : public IdComponent {
// Retrieves the type of object that an object reference points to.
H5O_type_t p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const;
// Sets the identifier of this object to a new value. - this one
// doesn't increment reference count
virtual void p_setId(const hid_t new_id) = 0;
#endif // DOXYGEN_SHOULD_SKIP_THIS
// Noop destructor.

View File

@ -50,8 +50,26 @@ H5Object::H5Object() : H5Location() {}
// object.
// Parameters object_id - IN: Id of an existing HDF5 object
// Programmer Binh-Minh Ribler - 2000
// *** Deprecation warning ***
// This constructor is no longer appropriate because the data member "id" had
// been moved to the sub-classes. It will be removed in 1.10 release. If its
// removal does not raise any problems in 1.10, it will be removed from 1.8 in
// subsequent releases.
//--------------------------------------------------------------------------
H5Object::H5Object( const hid_t object_id ) : H5Location( object_id ) {}
H5Object::H5Object(const hid_t object_id) : H5Location() {}
//--------------------------------------------------------------------------
// Function: H5Object copy constructor
///\brief Copy constructor: makes a copy of the original H5Object
/// instance.
///\param original - IN: H5Object instance to copy
// Programmer Binh-Minh Ribler - 2000
// *** Deprecation warning ***
// This constructor is no longer appropriate because the data member "id" had
// been moved to the sub-classes. It is removed from 1.8.15 because it is
// a noop and it can be generated by the compiler if needed.
//--------------------------------------------------------------------------
// H5Object::H5Object(const H5Object& original) : H5Location() {}
//--------------------------------------------------------------------------
// Function: getObjName
@ -164,15 +182,6 @@ ssize_t H5Object::getObjName(H5std_string& obj_name, size_t len) const
return(name_size);
}
//--------------------------------------------------------------------------
// Function: H5Object copy constructor
///\brief Copy constructor: makes a copy of the original H5Object
/// instance.
///\param original - IN: H5Object instance to copy
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5Object::H5Object( const H5Object& original ) : H5Location( original ) {}
//--------------------------------------------------------------------------
// Function: H5Object destructor
///\brief Noop destructor.

View File

@ -47,9 +47,6 @@ namespace H5 {
class H5_DLLCPP H5Object : public H5Location {
public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// Copy constructor: makes copy of an H5Object object.
H5Object(const H5Object& original);
// Gets the name of this HDF5 object, i.e., Group, DataSet, or
// DataType.
ssize_t getObjName(char *obj_name, size_t buf_size = 0) const;
@ -63,9 +60,19 @@ class H5_DLLCPP H5Object : public H5Location {
// Default constructor
H5Object();
// *** Deprecation warning ***
// The following two constructors are no longer appropriate after the
// data member "id" had been moved to the sub-classes.
// The copy constructor is a noop and is removed in 1.8.15 and the
// other will be removed from 1.10 release, and then from 1.8 if its
// removal does not raise any problems in two 1.10 releases.
// Creates a copy of an existing object giving the object id
H5Object( const hid_t object_id );
// Copy constructor: makes copy of an H5Object object.
// H5Object(const H5Object& original);
#endif // DOXYGEN_SHOULD_SKIP_THIS
}; /* end class H5Object */

View File

@ -54,7 +54,7 @@ PropList::PropList() : IdComponent(), id(H5P_DEFAULT) {}
///\param original - IN: The original property list to copy
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
PropList::PropList(const PropList& original) : IdComponent(original)
PropList::PropList(const PropList& original) : IdComponent()
{
id = original.getId();
incRefCount(); // increment number of references to this id
@ -258,6 +258,7 @@ void PropList::p_setId(const hid_t new_id)
// reset object's id to the given id
id = new_id;
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------

View File

@ -40,7 +40,6 @@ class H5_DLLCPP VarLenType : public DataType {
// Noop destructor
virtual ~VarLenType();
protected:
// Default constructor
VarLenType();
};

View File

@ -38,7 +38,7 @@ PROJECT_NAME = "HDF5 C++ API"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 1.8.13
PROJECT_NUMBER = HDF5 version 1.9.218 currently under development
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@ -36,7 +36,7 @@ configure_file (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @O
add_executable (cpp_testhdf5 ${CPP_TEST_SRCS} )
TARGET_NAMING (cpp_testhdf5 ${LIB_TYPE})
TARGET_C_PROPERTIES (cpp_testhdf5 " " " ")
TARGET_C_PROPERTIES (cpp_testhdf5 ${LIB_TYPE} " " " ")
target_link_libraries (cpp_testhdf5
${HDF5_CPP_LIB_TARGET}
${HDF5_LIB_TARGET}

View File

@ -56,11 +56,12 @@ const H5std_string DSET_TCONV_NAME ("tconv");
const H5std_string DSET_COMPRESS_NAME("compressed");
const H5std_string DSET_BOGUS_NAME ("bogus");
/* Temporary filter IDs used for testing */
const int H5Z_FILTER_BOGUS = 305;
// Local prototypes
static size_t filter_bogus(unsigned int flags, size_t cd_nelmts,
const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
// UNUSED variables caused warning, but taking them out caused failure.
/*-------------------------------------------------------------------------
* Function: test_create
@ -458,13 +459,10 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{
*-------------------------------------------------------------------------
*/
static size_t
/*bogus(unsigned int UNUSED flags, size_t UNUSED cd_nelmts,
const unsigned int UNUSED cd_values[], size_t nbytes,
size_t UNUSED *buf_size, void UNUSED **buf)
BMR: removed UNUSED for now until asking Q. or R. to pass compilation*/
filter_bogus(unsigned int flags, size_t cd_nelmts,
const unsigned int cd_values[], size_t nbytes,
size_t *buf_size, void **buf)
// UNUSED variables caused warning, but taking them out caused failure.
{
return nbytes;
}

View File

@ -53,9 +53,9 @@ const size_t ATTR_MAX_DIMS = 7;
/* 3-D dataset with fixed dimensions */
const int SPACE1_RANK = 3;
const int SPACE1_DIM1 = 3;
const int SPACE1_DIM2 = 15;
const int SPACE1_DIM3 = 13;
const hsize_t SPACE1_DIM1 = 3;
const hsize_t SPACE1_DIM2 = 15;
const hsize_t SPACE1_DIM3 = 13;
/* Object names */
const H5std_string DSET1_NAME("Dataset1");
@ -65,7 +65,7 @@ const H5std_string TYPE1_NAME("/Type");
/* Attribute Rank & Dimensions */
const H5std_string ATTR1_NAME("Attr1");
const int ATTR1_RANK = 1;
const int ATTR1_DIM1 = 3;
const hsize_t ATTR1_DIM1 = 3;
int attr_data1[ATTR1_DIM1]={512,-234,98123}; /* Test data for 1st attribute */
// File attribute, using the same rank and dimensions as ATTR1_NAME's
@ -74,8 +74,8 @@ const H5std_string FATTR2_NAME("File Attr2");
const H5std_string ATTR2_NAME("Attr2");
const int ATTR2_RANK = 2;
const int ATTR2_DIM1 = 2;
const int ATTR2_DIM2 = 2;
const hsize_t ATTR2_DIM1 = 2;
const hsize_t ATTR2_DIM2 = 2;
int attr_data2[ATTR2_DIM1][ATTR2_DIM2]={{7614,-416},{197814,-3}}; /* Test data for 2nd attribute */
const H5std_string ATTR3_NAME("Attr3");
@ -123,7 +123,7 @@ static void test_attr_basic_write()
hsize_t dims2[] = {ATTR1_DIM1};
hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2};
int read_data1[ATTR1_DIM1]={0}; // Buffer for reading 1st attribute
int i;
hsize_t i;
// Output message about test being performed
SUBTEST("Basic Attribute Writing Functions");
@ -384,7 +384,7 @@ static void test_attr_getname()
static void test_attr_rename()
{
int read_data1[ATTR1_DIM1]={0}; // Buffer for reading the attribute
int i;
hsize_t i;
// Output message about test being performed
SUBTEST("Checking for Existence and Renaming Attribute");
@ -493,7 +493,7 @@ static void test_attr_rename()
********************************************************************/
static void test_attr_basic_read()
{
int i, j;
hsize_t i, j;
// Output message about test being performed
SUBTEST("Basic Attribute Reading Functions");
@ -624,7 +624,6 @@ static void test_attr_compound_read()
size_t size; // Attribute datatype size as stored in file
size_t offset; // Attribute datatype field offset
struct attr4_struct read_data4[ATTR4_DIM1][ATTR4_DIM2]; // Buffer for reading 4th attribute
hsize_t i,j;
// Output message about test being performed
SUBTEST("Basic Attribute Functions");
@ -654,7 +653,7 @@ static void test_attr_compound_read()
// Get the dims of the dataspace and verify them
int ndims = space.getSimpleExtentDims(dims);
if(dims[0]!=ATTR4_DIM1)
verify_val(ndims, ATTR4_RANK, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
verify_val((long)dims[0], (long)ATTR4_DIM1, "DataSpace::getSimpleExtentDims",__LINE__, __FILE__);
verify_val((long)dims[1], (long)ATTR4_DIM2, "DataSpace::getSimpleExtentDims",__LINE__, __FILE__);
@ -673,13 +672,14 @@ static void test_attr_compound_read()
// Verify that the fields have the same names as when the type
// was created
for(i=0; i<fields; i++)
int j;
for(j=0; j<fields; j++)
{
H5std_string fieldname = datatype.getMemberName(i);
H5std_string fieldname = datatype.getMemberName(j);
if(!((fieldname == ATTR4_FIELDNAME1) ||
(fieldname == ATTR4_FIELDNAME2) ||
(fieldname == ATTR4_FIELDNAME3)))
TestErrPrintf("%d:invalid field name for field #%d: %s\n",__LINE__,i,fieldname.c_str());
TestErrPrintf("%d:invalid field name for field #%d: %s\n",__LINE__,j,fieldname.c_str());
} /* end for */
offset = datatype.getMemberOffset(0);
@ -729,23 +729,38 @@ static void test_attr_compound_read()
attr.read(datatype, read_data4);
// Verify values read in
for(i=0; i<ATTR4_DIM1; i++)
for(j=0; j<ATTR4_DIM2; j++)
if(HDmemcmp(&attr_data4[i][j],&read_data4[i][j],sizeof(struct attr4_struct))) {
TestErrPrintf("%d:attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n",__LINE__,i,j,attr_data4[i][j].i,i,j,read_data4[i][j].i);
TestErrPrintf("%d:attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n",__LINE__,i,j,attr_data4[i][j].d,i,j,read_data4[i][j].d);
TestErrPrintf("%d:attribute data different: attr_data4[%d][%d].c=%c, read_data4[%d][%d].c=%c\n",__LINE__,i,j,attr_data4[i][j].c,i,j,read_data4[i][j].c);
hsize_t ii, jj;
for(ii=0; ii<ATTR4_DIM1; ii++)
for(jj=0; jj<ATTR4_DIM2; jj++)
if(HDmemcmp(&attr_data4[ii][jj],&read_data4[ii][jj],sizeof(struct attr4_struct))) {
TestErrPrintf("%d:attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n",__LINE__,ii,jj,attr_data4[ii][jj].i,ii,jj,read_data4[ii][jj].i);
TestErrPrintf("%d:attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n",__LINE__,ii,jj,attr_data4[ii][jj].d,ii,jj,read_data4[ii][jj].d);
TestErrPrintf("%d:attribute data different: attr_data4[%d][%d].c=%c, read_data4[%d][%d].c=%c\n",__LINE__,ii,jj,attr_data4[ii][jj].c,ii,jj,read_data4[ii][jj].c);
} /* end if */
// Verify name
H5std_string attr_name = attr.getName();
verify_val(attr_name, ATTR4_NAME, "Attribute::getName", __LINE__, __FILE__);
PASSED();
} // end try block
catch (Exception E) {
issue_fail_msg("test_attr_compound_read()", __LINE__, __FILE__, E.getCDetailMsg());
}
try
{
// Now, try truncating the file to make sure reference counting is good.
// If any references to ids in the previous block are left unterminated,
// the truncating will fail, because the file will not be closed in
// the file.close() above.
H5File file1(FILE_COMPOUND, H5F_ACC_TRUNC);
PASSED();
} // end try block
catch (FileIException E) {
issue_fail_msg("test_attr_compound_read()", __LINE__, __FILE__, "Unable to truncate file, possibly because some objects are left opened");
}
} // test_attr_compound_read()
/****************************************************************
@ -928,7 +943,7 @@ static void test_attr_mult_read()
int read_data1[ATTR1_DIM1]={0}; // Buffer for reading 1st attribute
int read_data2[ATTR2_DIM1][ATTR2_DIM2]={{0}}; // Buffer for reading 2nd attribute
double read_data3[ATTR3_DIM1][ATTR3_DIM2][ATTR3_DIM3]={{{0}}}; // Buffer for reading 3rd attribute
int i,j,k;
hsize_t i,j,k;
// Output message about test being performed
SUBTEST("Multiple Attribute Reading Functions");
@ -959,7 +974,7 @@ static void test_attr_mult_read()
// Get the dims of the dataspace and verify them
hsize_t dims[ATTR_MAX_DIMS]; // Attribute dimensions
int ndims = space.getSimpleExtentDims(dims);
if(dims[0]!=ATTR1_DIM1)
if ((long)dims[0] != (long)ATTR1_DIM1)
TestErrPrintf("%d:attribute dimensions different: dims[0]=%d, should be %d\n",__LINE__,(int)dims[0],ATTR1_DIM1);
/* Verify Datatype */
@ -1010,10 +1025,9 @@ static void test_attr_mult_read()
// Get the dims of the dataspace and verify them
ndims = space.getSimpleExtentDims(dims);
if(dims[0]!=ATTR2_DIM1)
TestErrPrintf("%d:attribute dimensions different: dims[0]=%d, should be %d\n",__LINE__,(int)dims[0],ATTR2_DIM1);
if(dims[1]!=ATTR2_DIM2)
TestErrPrintf("%d:attribute dimensions different: dims[1]=%d, should be %d\n",__LINE__,(int)dims[1],ATTR2_DIM2);
verify_val((long)dims[0], (long)ATTR2_DIM1, "DataSpace::getSimpleExtentDims",__LINE__, __FILE__);
verify_val((long)dims[1], (long)ATTR2_DIM2, "DataSpace::getSimpleExtentDims",__LINE__, __FILE__);
/* Verify Datatype */

View File

@ -780,7 +780,7 @@ static void test_compound_set_size()
CompType dtype_tmp = file.openCompType("dtype");
// Make a copy of the data type
dtype = dtype_tmp;
dtype.copy(dtype_tmp);
// Verify that the compound is not packed
// packed = dtype_tmp.packed(); // not until C library provides API

View File

@ -330,6 +330,32 @@ static void test_file_open()
verify_val(iparm1, F2_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__);
verify_val(iparm2, F2_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__);
// Test H5File constructor with existing file id
H5File file2(file1.getId());
file1.close();
// Try truncating the file, and it should fail because the file is
// still opened with file2.
try {
H5File file3 (FILE2, H5F_ACC_TRUNC); // should throw E
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("H5File constructor", "Attempt truncating an opened file.");
}
catch( FileIException E ) // catching H5F_ACC_TRUNC on opened file
{} // do nothing, FAIL expected
// Now, really close the file.
file2.close();
// Truncating should succeed now.
H5File file3(FILE2, H5F_ACC_TRUNC);
// Opening another file to file3 object, FILE2 should be closed, so
// the next attempt to truncate FILE2 should succeed.
file3.openFile(FILE1, H5F_ACC_RDONLY);
H5File file4(FILE2, H5F_ACC_TRUNC);
PASSED();
} // end of try block
@ -501,6 +527,7 @@ const H5std_string FATTR1_NAME ("file attribute 1");
const H5std_string FATTR2_NAME ("file attribute 2");
int fattr_data[ATTR1_DIM1]={512,-234,98123}; /* Test data for file attribute */
int dattr_data[ATTR1_DIM1]={256,-123,1000}; /* Test data for dataset attribute */
static void test_file_attribute()
{
int rdata[ATTR1_DIM1];
@ -602,6 +629,119 @@ static void test_file_attribute()
}
} // test_file_attribute()
const H5std_string FILE6("tfile5.h5");
const H5std_string ROOTGROUP("/");
const H5std_string GROUP1("/G1");
const H5std_string SUBGROUP3("/G1/G3");
/*-------------------------------------------------------------------------
* Function: test_libver_bounds_real
*
* Purpose: Verify that a file created and modified with the
* specified libver bounds has the specified object header
* versions for the right objects.
*
* Return: None
*
* Programmer: Binh-Minh Ribler (use C version)
* March, 2015
*
*-------------------------------------------------------------------------
*/
static void test_libver_bounds_real(
H5F_libver_t libver_create, unsigned oh_vers_create,
H5F_libver_t libver_mod, unsigned oh_vers_mod)
{
try {
/*
* Create a new file using the default creation property and access property
* with latest library version.
*/
FileAccPropList fapl;
fapl.setLibverBounds(libver_create, H5F_LIBVER_LATEST);
H5File file(FILE6, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl);
/*
* Make sure the root group has the correct object header version
*/
unsigned obj_version = file.childObjVersion(ROOTGROUP);
verify_val(obj_version, oh_vers_create, "H5File::childObjVersion", __LINE__, __FILE__);
/*
* Reopen the file and make sure the root group still has the correct version
*/
file.close();
fapl.setLibverBounds(libver_mod, H5F_LIBVER_LATEST);
file.openFile(FILE6, H5F_ACC_RDWR, fapl);
obj_version = file.childObjVersion(ROOTGROUP);
verify_val(obj_version, oh_vers_create, "H5File::childObjVersion", __LINE__, __FILE__);
/*
* Create a group named "/G1" in the file, and make sure it has the correct
* object header version
*/
Group group = file.createGroup(GROUP1);
obj_version = file.childObjVersion(GROUP1);
verify_val(obj_version, oh_vers_mod, "H5File::childObjVersion", __LINE__, __FILE__);
group.close(); // close "/G1"
/*
* Create a group named "/G1/G3" in the file, and make sure it has the
* correct object header version
*/
group = file.createGroup(SUBGROUP3);
obj_version = group.childObjVersion(SUBGROUP3);
verify_val(obj_version, oh_vers_mod, "H5File::childObjVersion", __LINE__, __FILE__);
group.close(); // close "/G1/G3"
/*
* Make sure the root group still has the correct object header version
*/
obj_version = file.childObjVersion(ROOTGROUP);
verify_val(obj_version, oh_vers_create, "H5File::childObjVersion", __LINE__, __FILE__);
// Everything should be closed as they go out of scope
} // end of try block
catch (Exception E) {
issue_fail_msg("test_libver_bounds_real()", __LINE__, __FILE__, E.getCDetailMsg());
}
} /* end test_libver_bounds_real() */
/*-------------------------------------------------------------------------
*
* Function: test_libver_bounds
*
* Purpose: Verify that a file created and modified with various
* libver bounds is handled correctly.
*
* Return: None
*
* Programmer: Binh-Minh Ribler (use C version)
* March 2015
*
*-------------------------------------------------------------------------
*/
static void test_libver_bounds()
{
// Output message about test being performed
SUBTEST("Setting library version bounds");
/* Run the tests */
test_libver_bounds_real(H5F_LIBVER_EARLIEST, H5O_VERSION_1, H5F_LIBVER_LATEST, H5O_VERSION_2);
test_libver_bounds_real(H5F_LIBVER_LATEST, H5O_VERSION_2, H5F_LIBVER_EARLIEST, H5O_VERSION_1);
PASSED();
} /* end test_libver_bounds() */
/*-------------------------------------------------------------------------
* Function: test_file
*
@ -629,6 +769,7 @@ void test_file()
test_file_size(); // Test file size
test_file_name(); // Test getting file's name
test_file_attribute(); // Test file attribute feature
test_libver_bounds(); // Test format version
} // test_file()
@ -655,4 +796,5 @@ void cleanup_file()
HDremove(FILE3.c_str());
HDremove(FILE4.c_str());
HDremove(FILE5.c_str());
HDremove(FILE6.c_str());
} // cleanup_file

View File

@ -57,9 +57,13 @@ static herr_t test_filter_internal(hid_t fid, const char *name, hid_t dcpl,
#endif
/* Temporary filter IDs used for testing */
#define H5Z_FILTER_BOGUS 305
const int H5Z_FILTER_BOGUS = 305;
#if 0 // UNUSED variables caused warning, so duplicated below with NULL instead
static size_t filter_bogus(unsigned int flags, size_t cd_nelmts,
const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
#endif
static size_t filter_bogus(size_t nbytes);
/* This message derives from H5Z */
const H5Z_class2_t H5Z_BOGUS[1] = {{
H5Z_CLASS_T_VERS, /* H5Z_class_t version */
@ -88,9 +92,12 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{
*-------------------------------------------------------------------------
*/
static size_t
#if 0 // UNUSED variables caused warning, so duplicated below with NULL instead
filter_bogus(unsigned int UNUSED flags, size_t UNUSED cd_nelmts,
const unsigned int UNUSED *cd_values, size_t nbytes,
size_t UNUSED *buf_size, void UNUSED **buf)
#endif
filter_bogus(size_t nbytes)
{
return nbytes;
}
@ -239,7 +246,8 @@ static void test_szip_filter(H5File& file1)
#else /* H5_HAVE_FILTER_SZIP */
SUBTEST("szip filter");
SKIPPED();
puts(" Szip filter not enabled");
H5std_string fname = file1.getFileName();
cerr << " Szip filter not enabled for file '" << fname << "'" << endl;
#endif /* H5_HAVE_FILTER_SZIP */
} // test_szip_filter

View File

@ -181,19 +181,39 @@ static void test_get_objname_ontypes()
Group grp = file.createGroup ("typetests");
// Create a datatype and save it
IntType inttype(PredType::STD_B8LE);
inttype.commit(file, "INT type of STD_B8LE");
// Close the type then open it again to test getting its name
inttype.close();
inttype = file.openIntType("INT type of STD_B8LE");
// Get and verify its name
H5std_string inttype_name = inttype.getObjName();
verify_val(inttype_name, "/INT type of STD_B8LE", "DataType::getObjName", __LINE__, __FILE__);
// Make copy of a predefined type and save it
DataType dtype(PredType::STD_B8LE);
dtype.commit(file, "STD_B8LE");
// Close the data type and file
dtype.close();
file.close();
// Re-open the file and the data type to test getting its name
file.openFile(FILE_OBJECTS, H5F_ACC_RDWR);
dtype = file.openDataType("STD_B8LE");
// Get and verify its name
H5std_string type_name = dtype.getObjName();
verify_val(type_name, "/STD_B8LE", "DataSet::getObjName", __LINE__, __FILE__);
verify_val(type_name, "/STD_B8LE", "DataType::getObjName", __LINE__, __FILE__);
// Test getting type's name from copied type
DataType copied_type;
copied_type.copy(dtype);
copied_type.commit(file, "copy of STD_B8LE");
type_name = copied_type.getObjName();
verify_val(type_name, "/copy of STD_B8LE", "DataSet::getObjName", __LINE__, __FILE__);
verify_val(type_name, "/copy of STD_B8LE", "DataType::getObjName", __LINE__, __FILE__);
// Test copying an integer predefined type
IntType new_int_type(PredType::NATIVE_INT);
@ -201,14 +221,14 @@ static void test_get_objname_ontypes()
// Name this datatype
new_int_type.commit(grp, "IntType NATIVE_INT");
ssize_t name_len = new_int_type.getObjName(type_name); // default len
verify_val(type_name, "/typetests/IntType NATIVE_INT", "DataSet::getObjName", __LINE__, __FILE__);
verify_val(name_len, (ssize_t)HDstrlen("/typetests/IntType NATIVE_INT"), "DataType::getObjName", __LINE__, __FILE__);
verify_val(type_name, "/typetests/IntType NATIVE_INT", "DataType::getObjName", __LINE__, __FILE__);
// Close everything or they can be closed when objects go out of scope
dtype.close();
copied_type.close();
new_int_type.close();
grp.close();
file.close();
PASSED();
} // end top try block

View File

@ -462,11 +462,11 @@ test_reference_group(void)
// Check number of objects in the group dereferenced by constructor
hsize_t nobjs = refgroup.getNumObjs();
verify_val(nobjs, 3, "H5Group::getNumObjs",__LINE__,__FILE__);
verify_val(nobjs, (hsize_t)3, "H5Group::getNumObjs",__LINE__,__FILE__);
// Check number of objects in the group dereferenced by ::reference
nobjs = group.getNumObjs();
verify_val(nobjs, 3, "H5Group::getNumObjs",__LINE__,__FILE__);
verify_val(nobjs, (hsize_t)3, "H5Group::getNumObjs",__LINE__,__FILE__);
// Check getting file name given the group dereferenced via constructor
H5std_string fname = refgroup.getFileName();
@ -479,7 +479,7 @@ test_reference_group(void)
// Unlink one of the objects in the dereferenced group, and re-check
refgroup.unlink(GROUPNAME2);
nobjs = refgroup.getNumObjs();
verify_val(nobjs, 2, "H5Group::getNumObjs",__LINE__,__FILE__);
verify_val(nobjs, (hsize_t)2, "H5Group::getNumObjs",__LINE__,__FILE__);
// Close resources
group.close();
@ -686,43 +686,43 @@ test_reference_region_1D(void)
reg_sp.getSelectHyperBlocklist((hsize_t)0, (hsize_t)nelms, coords);
// Verify values in the list
verify_val(coords[0], 2, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[1], 3, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[2], 7, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[3], 8, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[4], 12, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[5], 13, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[6], 17, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[7], 18, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[8], 22, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[9], 23, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[10], 27, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[11], 28, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[12], 32, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[13], 33, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[14], 37, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[15], 38, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[16], 42, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[17], 43, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[18], 47, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[19], 48, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[20], 52, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[21], 53, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[22], 57, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[23], 58, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[24], 62, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[25], 63, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[26], 67, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[27], 68, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[28], 72, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[29], 73, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[0], (hsize_t)2, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[1], (hsize_t)3, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[2], (hsize_t)7, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[3], (hsize_t)8, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[4],(hsize_t)12, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[5],(hsize_t)13, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[6],(hsize_t)17, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[7],(hsize_t)18, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[8],(hsize_t)22, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[9],(hsize_t)23, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[10],(hsize_t)27, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[11],(hsize_t)28, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[12],(hsize_t)32, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[13],(hsize_t)33, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[14],(hsize_t)37, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[15],(hsize_t)38, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[16],(hsize_t)42, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[17],(hsize_t)43, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[18],(hsize_t)47, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[19],(hsize_t)48, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[20],(hsize_t)52, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[21],(hsize_t)53, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[22],(hsize_t)57, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[23],(hsize_t)58, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[24],(hsize_t)62, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[25],(hsize_t)63, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[26],(hsize_t)67, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[27],(hsize_t)68, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[28],(hsize_t)72, "Hyperslab Coordinates",__LINE__,__FILE__);
verify_val(coords[29],(hsize_t)73, "Hyperslab Coordinates",__LINE__,__FILE__);
HDfree(coords);
// Check boundaries
reg_sp.getSelectBounds(low, high);
verify_val(low[0], 2, "DataSpace::getSelectBounds",__LINE__,__FILE__);
verify_val(high[0], 73, "DataSpace::getSelectBounds",__LINE__,__FILE__);
verify_val(low[0],(hsize_t)2, "DataSpace::getSelectBounds",__LINE__,__FILE__);
verify_val(high[0],(hsize_t)73, "DataSpace::getSelectBounds",__LINE__,__FILE__);
/* Close region space */
reg_sp.close();
@ -760,8 +760,8 @@ test_reference_region_1D(void)
// Check boundaries
elm_sp.getSelectBounds(low, high);
verify_val(low[0], 3, "DataSpace::getSelectBounds",__LINE__,__FILE__);
verify_val(high[0], 97, "DataSpace::getSelectBounds",__LINE__,__FILE__);
verify_val(low[0],(hsize_t)3, "DataSpace::getSelectBounds",__LINE__,__FILE__);
verify_val(high[0],(hsize_t)97, "DataSpace::getSelectBounds",__LINE__,__FILE__);
// Close element space
elm_sp.close();

View File

@ -109,7 +109,7 @@ static void test_classes()
{
SUBTEST("PredType::getClass()");
try {
int curr_nerrors = GetTestNumErrs();
// maybe later, int curr_nerrors = GetTestNumErrs();
// PredType::NATIVE_INT should be in H5T_INTEGER class
H5T_class_t tcls = PredType::NATIVE_INT.getClass();
@ -283,10 +283,16 @@ static void test_query()
tid2.close();
file.close();
// Try truncating the file to make sure reference counting is good.
// If any references to ids of tid1 and tid2 are left unterminated,
// the truncating will fail, because the file will not be closed in
// the file.close() above.
H5File file1(FILENAME[2], H5F_ACC_TRUNC);
PASSED();
} // end of try block
catch (Exception E) {
issue_fail_msg("test_query", __LINE__, __FILE__, E.getCDetailMsg());
issue_fail_msg("test_query", __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_query
@ -467,27 +473,20 @@ static void test_named ()
trans_type.setPrecision(256);
trans_type.close();
/*
* Close the committed type and reopen it. It should return a named type.
* This had something to do with the way IntType was returned and assigned
and caused itype.committed not working correctly. So, use another_type for
now.
// Close the committed type and reopen it. It should be a named type.
itype.close();
itype = file.openIntType("native-int");
iscommitted = itype.committed();
*/
IntType another_type = file.openIntType("native-int");
iscommitted = another_type.committed();
if (!iscommitted)
throw InvalidActionException("IntType::committed()", "Opened named types should be named types!");
// Create a dataset that uses the named type, then get the dataset's
// datatype and make sure it's a named type.
DataSet dset = file.createDataSet("dset1", another_type, space);
DataSet dset = file.createDataSet("dset1", itype, space);
ds_type = new DataType(dset.getDataType());
iscommitted = ds_type->committed();
if (!iscommitted)
throw InvalidActionException("IntType::committed()", "1 Dataset type should be named type!");
throw InvalidActionException("IntType::committed()", "Dataset type should be named type!");
dset.close();
ds_type->close();
delete ds_type;

View File

@ -60,6 +60,7 @@ const hsize_t SPACE1_DIM1 = 4;
** Note: exact copy from the C version.
** (Not used now)
****************************************************************/
#if 0 // not used now
static void *test_vlstr_alloc_custom(size_t size, void *info)
{
void *ret_value=NULL; // Pointer to return
@ -81,6 +82,7 @@ static void *test_vlstr_alloc_custom(size_t size, void *info)
return(ret_value);
}
#endif
/****************************************************************
**
@ -92,6 +94,7 @@ static void *test_vlstr_alloc_custom(size_t size, void *info)
** Note: exact copy from the C version.
** (Not used now)
****************************************************************/
#if 0 // not used now
static void test_vlstr_free_custom(void *_mem, void *info)
{
unsigned char *mem;
@ -111,6 +114,7 @@ static void test_vlstr_free_custom(void *_mem, void *info)
HDfree(mem);
} // end if
}
#endif
/*-------------------------------------------------------------------------
* Function: test_vlstring_dataset
@ -256,7 +260,7 @@ static void test_vlstring_array_dataset()
char *string_ds_check[SPACE1_DIM1];
dataset.read(string_ds_check, vlst);
int ii;
hsize_t ii;
for (ii = 0; ii < SPACE1_DIM1; ii++)
{
if(HDstrcmp(string_ds_check[ii], string_ds_array[ii])!=0)
@ -351,25 +355,25 @@ static void test_vlstrings_special()
dataset.read(rdata, vlst);
// Check data read in.
hsize_t i; // counting variable
for (i=0; i<SPACE1_DIM1; i++)
if(rdata[i]!=NULL)
TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)i,rdata[i]);
hsize_t ii; // counting variable
for (ii=0; ii<SPACE1_DIM1; ii++)
if(rdata[ii]!=NULL)
TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)ii,rdata[ii]);
// Write dataset to disk, then read it back.
dataset.write(wdata, vlst);
dataset.read(rdata, vlst);
// Compare data read in.
for (i = 0; i < SPACE1_DIM1; i++) {
size_t wlen = HDstrlen(wdata[i]);
size_t rlen = HDstrlen(rdata[i]);
for (ii = 0; ii < SPACE1_DIM1; ii++) {
size_t wlen = HDstrlen(wdata[ii]);
size_t rlen = HDstrlen(rdata[ii]);
if(wlen != rlen) {
TestErrPrintf("VL data lengths don't match!, strlen(wdata[%d])=%u, strlen(rdata[%d])=%u\n", (int)i, (unsigned)wlen, (int)i, (unsigned)rlen);
TestErrPrintf("VL data lengths don't match!, strlen(wdata[%d])=%u, strlen(rdata[%d])=%u\n", (int)ii, (unsigned)wlen, (int)ii, (unsigned)rlen);
continue;
} // end if
if(HDstrcmp(wdata[i],rdata[i]) != 0) {
TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n", (int)i, wdata[i], (int)i, rdata[i]);
if(HDstrcmp(wdata[ii],rdata[ii]) != 0) {
TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n", (int)ii, wdata[ii], (int)ii, rdata[ii]);
continue;
} // end if
} // end for
@ -398,9 +402,9 @@ static void test_vlstrings_special()
dataset.read(rdata, vlst);
// Check data read in.
for (i=0; i<SPACE1_DIM1; i++)
if(rdata[i]!=NULL)
TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)i,rdata[i]);
for (ii=0; ii<SPACE1_DIM1; ii++)
if(rdata[ii]!=NULL)
TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)ii,rdata[ii]);
// Try to write nil strings to disk.
dataset.write(wdata2, vlst);
@ -409,9 +413,9 @@ static void test_vlstrings_special()
dataset.read(rdata, vlst);
// Check data read in.
for (i=0; i<SPACE1_DIM1; i++)
if(rdata[i]!=NULL)
TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)i,rdata[i]);
for (ii=0; ii<SPACE1_DIM1; ii++)
if(rdata[ii]!=NULL)
TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)ii,rdata[ii]);
// Close objects and file.
dataset.close();
@ -793,7 +797,7 @@ static void test_vlstring_array_attribute()
char *string_att_check[SPACE1_DIM1];
gr_attr.read(vlst, &string_att_check);
int ii;
hsize_t ii;
for (ii = 0; ii < SPACE1_DIM1; ii++)
{
if(HDstrcmp(string_att_check[ii], string_att_array[ii])!=0)

73
config/cce-fflags Normal file
View File

@ -0,0 +1,73 @@
# -*- shell-script -*-
#
# Copyright by The HDF Group.
# All rights reserved.
#
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the files COPYING and Copyright.html. COPYING can be found at the root
# of the source code distribution tree; Copyright.html can be found at the
# root level of an installed copy of the electronic HDF5 document set and
# is linked from the top-level documents page. It can also be found at
# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
# access to either file, you may request a copy from help@hdfgroup.org.
# This file should be sourced into configure if the compiler is the
# Cray Compiling Environment (CCE) compiler or a derivative. It is careful not to do anything
# if the compiler is not Cray; otherwise `cc_flags_set' is set to `yes'
#
# Get the compiler version in a way that works for cce
# unless a compiler version is already known
#
# cc_vendor: The compiler name: Cray
# cc_version: Version number: 8.3.0
#
if test X = "X$f9x_flags_set"; then
f9x_version="`$FC $FCFLAGS $H5_FCFLAGS -V 2>&1 |grep 'Cray'`"
if test X != "X$f9x_version"; then
f9x_vendor=cce
f9x_version=`echo $f9x_version |sed 's/.*Version \([-a-z0-9\.\-]*\).*/\1/'`
echo "compiler '$FC' is Cray $f9x_vendor-$f9x_version"
fc_version_info=$f9x_version
fi
fi
# Common Cray flags for various situations
if test "X-cce" = "X-$f9x_vendor"; then
# Insert section about version specific problems from compiler flags here,
# if necessary.
arch=
# Architecture-specific flags
# Nothing currently. (Uncomment code below and modify to add any)
#case "$host_os-$host_cpu" in
# *-i686)
# arch="-march=i686"
# ;;
#esac
# General
H5_FCFLAGS="${H5_FCFLAGS} -hnocaf"
# Production
# -Wl,-s to remove all symbols for smaller file
PROD_FCFLAGS="-O3 -Wl,-s"
# Debug
DEBUG_FCFLAGS="-g -O0"
# Profile
# Use this for profiling with gprof
PROFILE_FCFLAGS="-g -p"
# Flags are set
f9x_flags_set=yes
fi
# Clear f9x info if no flags set
if test "X-$f9x_flags_set" = "X-"; then
f9x_vendor=
f9x_version=
fi

79
config/cce-flags Normal file
View File

@ -0,0 +1,79 @@
# -*- shell-script -*-
#
# Copyright by The HDF Group.
# All rights reserved.
#
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the files COPYING and Copyright.html. COPYING can be found at the root
# of the source code distribution tree; Copyright.html can be found at the
# root level of an installed copy of the electronic HDF5 document set and
# is linked from the top-level documents page. It can also be found at
# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
# access to either file, you may request a copy from help@hdfgroup.org.
# This file should be sourced into configure if the compiler is the
# Cray Compiling Environment (CCE) compiler or a derivative. It is careful not to do anything
# if the compiler is not Cray; otherwise `cc_flags_set' is set to `yes'
#
# Get the compiler version in a way that works for cce
# unless a compiler version is already known
#
# cc_vendor: The compiler name: Cray
# cc_version: Version number: 8.3.0
#
if test X = "X$cc_flags_set"; then
cc_version="`$CC $CFLAGS $H5_CFLAGS -V 2>&1 |grep 'Cray'`"
if test X != "X$cc_version"; then
cc_vendor=cce
cc_version=`echo $cc_version |sed 's/.*Version \([-a-z0-9\.\-]*\).*/\1/'`
echo "compiler '$CC' is Cray $cc_vendor-$cc_version"
cc_version_info=$cc_version
cxx_version_info=$cc_version
fi
fi
# Common Cray flags for various situations
if test "X-cce" = "X-$cc_vendor"; then
# Insert section about version specific problems from compiler flags here,
# if necessary.
arch=
# Architecture-specific flags
# Nothing currently. (Uncomment code below and modify to add any)
#case "$host_os-$host_cpu" in
# *-i686)
# arch="-march=i686"
# ;;
#esac
# General
# Default to C99 standard.
H5_CFLAGS="${H5_CFLAGS:--hc99 $arch}"
# Production
# -Wl,-s to remove all symbols for smaller file
PROD_CFLAGS="-O3 -Wl,-s"
PROD_CPPFLAGS=
# Debug
DEBUG_CFLAGS="-g -O0"
DEBUG_CPPFLAGS=
# Profile
# Use this for profiling with gprof
PROFILE_CFLAGS="-g -p"
PROFILE_CPPFLAGS=
# Flags are set
cc_flags_set=yes
fi
# Clear cc info if no flags set
if test "X-$cc_flags_set" = "X-"; then
cc_vendor=
cc_version=
fi

View File

@ -92,45 +92,6 @@ endif (WINDOWS)
# ----------------------------------------------------------------------
CHECK_FUNCTION_EXISTS (difftime H5_HAVE_DIFFTIME)
#CHECK_FUNCTION_EXISTS (gettimeofday H5_HAVE_GETTIMEOFDAY)
# Since gettimeofday is not defined any where standard, lets look in all the
# usual places. On MSVC we are just going to use ::clock()
if (NOT MSVC)
if ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$")
TRY_COMPILE (HAVE_TIME_GETTIMEOFDAY
${CMAKE_BINARY_DIR}
${HDF_RESOURCES_EXT_DIR}/GetTimeOfDayTest.cpp
COMPILE_DEFINITIONS -DTRY_TIME_H
OUTPUT_VARIABLE OUTPUT
)
if (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE")
set (H5_HAVE_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_TIME_GETTIMEOFDAY")
set (H5_HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_GETTIMEOFDAY")
endif (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE")
endif ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$")
if ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$")
TRY_COMPILE (HAVE_SYS_TIME_GETTIMEOFDAY
${CMAKE_BINARY_DIR}
${HDF_RESOURCES_EXT_DIR}/GetTimeOfDayTest.cpp
COMPILE_DEFINITIONS -DTRY_SYS_TIME_H
OUTPUT_VARIABLE OUTPUT
)
if (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE")
set (H5_HAVE_SYS_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_SYS_TIME_GETTIMEOFDAY")
set (H5_HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_GETTIMEOFDAY")
endif (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE")
endif ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$")
if (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY)
message (STATUS "---------------------------------------------------------------")
message (STATUS "Function 'gettimeofday()' was not found. HDF5 will use its")
message (STATUS " own implementation.. This can happen on older versions of")
message (STATUS " MinGW on Windows. Consider upgrading your MinGW installation")
message (STATUS " to a newer version such as MinGW 3.12")
message (STATUS "---------------------------------------------------------------")
endif (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY)
endif (NOT MSVC)
# Find the library containing clock_gettime()
if (NOT WINDOWS)

View File

@ -88,10 +88,6 @@
/* Define if Darwin or Mac OS X */
#cmakedefine H5_HAVE_DARWIN @H5_HAVE_DARWIN@
/* 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@
@ -167,12 +163,6 @@
/* 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 sys/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@
@ -195,24 +185,12 @@
/* 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@
@ -282,9 +260,6 @@
/* 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@
@ -366,9 +341,6 @@
/* Define to 1 if you have the <sys/timeb.h> header file. */
#cmakedefine H5_HAVE_SYS_TIMEB_H @H5_HAVE_SYS_TIMEB_H@
/* Define to 1 if you have the <time.h> header file. */
#cmakedefine H5_HAVE_TIME_H @H5_HAVE_TIME_H@
/* Define to 1 if you have the <sys/time.h> header file. */
#cmakedefine H5_HAVE_SYS_TIME_H @H5_HAVE_SYS_TIME_H@
@ -399,9 +371,6 @@
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine H5_HAVE_UNISTD_H @H5_HAVE_UNISTD_H@
/* Define to 1 if you have the `asprintf' function. */
#cmakedefine H5_HAVE_ASPRINTF @H5_HAVE_ASPRINTF@
/* Define to 1 if you have the `vasprintf' function. */
#cmakedefine H5_HAVE_VASPRINTF @H5_HAVE_VASPRINTF@
@ -623,9 +592,6 @@
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#cmakedefine H5_TIME_WITH_SYS_TIME @H5_TIME_WITH_SYS_TIME@
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#cmakedefine H5_TM_IN_SYS_TIME @H5_TM_IN_SYS_TIME@
/* Define using v1.6 public API symbols by default */
#cmakedefine H5_USE_16_API_DEFAULT @H5_USE_16_API_DEFAULT@
@ -684,8 +650,4 @@
/* Define to `long' if <sys/types.h> does not define. */
#cmakedefine H5_ssize_t
#if defined(__cplusplus) && defined(inline)
#undef inline
#endif
#endif

View File

@ -13,25 +13,25 @@ set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY})
set(CTEST_BUILD_CONFIGURATION "Release")
#set(NO_MAC_FORTRAN "true")
#set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON")
#set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_ENABLE_F2003:BOOL=ON)
set(CTEST_USE_TAR_SOURCE "${CTEST_SCRIPT_ARG}")
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_ENABLE_F2003:BOOL=ON")
#set(CTEST_USE_TAR_SOURCE "${CTEST_SCRIPT_ARG}")
###############################################################################################################
# Adjust the following SET Commands as needed
###############################################################################################################
if(WIN32)
if(STATICLIBRARIES)
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DUSE_SHARED_LIBS:BOOL=OFF")
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")
endif(STATICLIBRARIES)
set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake/hdf5")
set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake")
set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build)
set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}")
set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
else(WIN32)
if(STATICLIBRARIES)
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DUSE_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
endif(STATICLIBRARIES)
set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake/hdf5")
set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake")
set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib")
set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build)
set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}")
@ -71,8 +71,8 @@ if(CTEST_USE_TAR_SOURCE)
message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]")
execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv)
else(WIN32)
message(STATUS "extracting... [${CTEST_CMAKE_COMMAND} -E tar -xvf ${CTEST_SOURCE_NAME}.tar.gz]")
execute_process(COMMAND tar -xvf ${CTEST_SOURCE_NAME}.tar.gz RESULT_VARIABLE rv)
message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]")
execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv)
endif(WIN32)
if(NOT rv EQUAL 0)

View File

@ -24,15 +24,15 @@ Installation
After Installation
===========================================================================
The compressed examples file HDF5Examples-0.1.1-Source.@BINARY_EXAMPLE_ENDING@, located in the
The examples folder, HDF5Examples, located in the
HDF5 install folder, can be built and tested with CMake and the supplied
HDF518_Examples.cmake file. The HDF518_Examples.cmake expects HDF5 to have
been installed in the default location with above compilers. Also, CMake and 7Zip
utilities should be installed.
been installed in the default location with above compilers. Also, the CMake
utility should be installed.
To test the installation with the examples;
Create a directory to run the examples.
Copy HDF5Examples-0.1.1-Source.@BINARY_EXAMPLE_ENDING@ to this directory, do NOT unzip.
Copy HDF5Examples folder to this directory.
Copy HDF518_Examples.cmake to this directory.
Edit HDF518_Examples.cmake line 8 to set INSTALLDIR to where HDF5 is installed.
(The default should be correct unless you installed into a different folder.)

View File

@ -10,18 +10,10 @@ set (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE)
set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE)
set (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE)
set (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE)
set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE)
set (HDF5_ENABLE_F2003 ON CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE)
set (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE)
set (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE)
set (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE)
set (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE)

View File

@ -3,63 +3,76 @@
#-----------------------------------------------------------------------------
@PACKAGE_INIT@
string(TOUPPER @HDF5_PACKAGE@ HDF5_PACKAGE_NAME)
set (${HDF5_PACKAGE_NAME}_VALID_COMPONENTS
C
CXX
Fortran
HL
CXX_HL
Fortran_HL
Tools
)
#-----------------------------------------------------------------------------
# User Options
#-----------------------------------------------------------------------------
set (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@)
set (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@)
set (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@)
set (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@)
set (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@)
set (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@)
set (HDF5_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@)
set (HDF5_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@)
set (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@)
set (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
set (HDF5_PACKAGE_EXTLIBS @HDF5_PACKAGE_EXTLIBS@)
set (${HDF5_PACKAGE_NAME}_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@)
set (${HDF5_PACKAGE_NAME}_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@)
set (${HDF5_PACKAGE_NAME}_ENABLE_F2003 @HDF5_ENABLE_F2003@)
set (${HDF5_PACKAGE_NAME}_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@)
set (${HDF5_PACKAGE_NAME}_BUILD_TOOLS @HDF5_BUILD_TOOLS@)
set (${HDF5_PACKAGE_NAME}_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@)
set (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@)
set (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@)
set (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@)
set (${HDF5_PACKAGE_NAME}_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
set (${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS @HDF5_PACKAGE_EXTLIBS@)
set (${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES @HDF5_LIBRARIES_TO_EXPORT@)
#-----------------------------------------------------------------------------
# Dependencies
#-----------------------------------------------------------------------------
IF(HDF5_ENABLE_PARALLEL)
SET(HDF5_MPI_C_INCLUDE_PATH "@MPI_C_INCLUDE_PATH@")
SET(HDF5_MPI_C_LIBRARIES "@MPI_C_LIBRARIES@")
ENDIF(HDF5_ENABLE_PARALLEL)
if (${HDF5_PACKAGE_NAME}_ENABLE_PARALLEL)
set (${HDF5_PACKAGE_NAME}_MPI_C_INCLUDE_PATH "@MPI_C_INCLUDE_PATH@")
set (${HDF5_PACKAGE_NAME}_MPI_C_LIBRARIES "@MPI_C_LIBRARIES@")
endif ()
#-----------------------------------------------------------------------------
# Directories
#-----------------------------------------------------------------------------
set (HDF5_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@" "${HDF5_MPI_C_INCLUDE_PATH}" )
set (${HDF5_PACKAGE_NAME}_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@" "${${HDF5_PACKAGE_NAME}_MPI_C_INCLUDE_PATH}")
set (HDF5_SHARE_DIR "@PACKAGE_SHARE_INSTALL_DIR@")
set_and_check (HDF5_BUILD_DIR "@PACKAGE_CURRENT_BUILD_DIR@")
set (${HDF5_PACKAGE_NAME}_SHARE_DIR "@PACKAGE_SHARE_INSTALL_DIR@")
set_and_check (${HDF5_PACKAGE_NAME}_BUILD_DIR "@PACKAGE_CURRENT_BUILD_DIR@")
if (HDF5_BUILD_FORTRAN)
set (HDF5_INCLUDE_DIR_FORTRAN "@PACKAGE_INCLUDE_INSTALL_DIR@" )
endif (HDF5_BUILD_FORTRAN)
if (${HDF5_PACKAGE_NAME}_BUILD_FORTRAN)
set (${HDF5_PACKAGE_NAME}_INCLUDE_DIR_FORTRAN "@PACKAGE_INCLUDE_INSTALL_DIR@")
endif ()
if (HDF5_BUILD_CPP_LIB)
set (HDF5_INCLUDE_DIR_CPP "@PACKAGE_INCLUDE_INSTALL_DIR@" )
endif (HDF5_BUILD_CPP_LIB)
if (${HDF5_PACKAGE_NAME}_BUILD_CPP_LIB)
set (${HDF5_PACKAGE_NAME}_INCLUDE_DIR_CPP "@PACKAGE_INCLUDE_INSTALL_DIR@")
endif ()
if (HDF5_BUILD_HL_LIB)
set (HDF5_INCLUDE_DIR_HL "@PACKAGE_INCLUDE_INSTALL_DIR@" )
endif (HDF5_BUILD_HL_LIB)
if (${HDF5_PACKAGE_NAME}_BUILD_HL_LIB)
set (${HDF5_PACKAGE_NAME}_INCLUDE_DIR_HL "@PACKAGE_INCLUDE_INSTALL_DIR@")
endif ()
if (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
set (HDF5_INCLUDE_DIR_HL_CPP "@PACKAGE_INCLUDE_INSTALL_DIR@" )
endif (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB)
if (${HDF5_PACKAGE_NAME}_BUILD_HL_LIB AND ${HDF5_PACKAGE_NAME}_BUILD_CPP_LIB)
set (${HDF5_PACKAGE_NAME}_INCLUDE_DIR_HL_CPP "@PACKAGE_INCLUDE_INSTALL_DIR@")
endif ()
if (HDF5_BUILD_TOOLS)
set (HDF5_INCLUDE_DIR_TOOLS "@PACKAGE_INCLUDE_INSTALL_DIR@" )
set_and_check (HDF5_TOOLS_DIR "@PACKAGE_CURRENT_BUILD_DIR@/bin" )
endif (HDF5_BUILD_TOOLS)
if (${HDF5_PACKAGE_NAME}_BUILD_TOOLS)
set (${HDF5_PACKAGE_NAME}_INCLUDE_DIR_TOOLS "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check (${HDF5_PACKAGE_NAME}_TOOLS_DIR "@PACKAGE_CURRENT_BUILD_DIR@/bin")
endif ()
if (HDF5_BUILD_SHARED_LIBS)
set (H5_BUILT_AS_DYNAMIC_LIB 1 )
else (HDF5_BUILD_SHARED_LIBS)
set (H5_BUILT_AS_STATIC_LIB 1 )
endif (HDF5_BUILD_SHARED_LIBS)
set (H5_BUILT_AS_DYNAMIC_LIB 1)
else ()
set (H5_BUILT_AS_STATIC_LIB 1)
endif ()
#-----------------------------------------------------------------------------
# Version Strings
@ -73,14 +86,62 @@ set (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@)
# project which has already built hdf5 as a subproject
#-----------------------------------------------------------------------------
if (NOT TARGET "@HDF5_PACKAGE@")
if (HDF5_ENABLE_Z_LIB_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "zlib")
include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
endif (HDF5_ENABLE_Z_LIB_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "zlib")
if (HDF5_ENABLE_SZIP_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "szip")
include (@PACKAGE_SHARE_INSTALL_DIR@/@SZIP_PACKAGE_NAME@/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
endif (HDF5_ENABLE_SZIP_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "szip")
if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "zlib")
include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
endif ()
if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "szip")
include (@PACKAGE_SHARE_INSTALL_DIR@/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
endif ()
include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
set (HDF5_LIBRARIES "@HDF5_LIBRARIES_TO_EXPORT@")
endif (NOT TARGET "@HDF5_PACKAGE@")
endif ()
check_required_components(hdf5)
# Handle default component :
if (NOT ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS)
set (${HDF5_PACKAGE_NAME}_FIND_COMPONENTS C HL)
set (${HDF5_PACKAGE_NAME}_FIND_REQUIRED_C true)
endif ()
# Handle requested components:
list (REMOVE_DUPLICATES ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS)
foreach (comp IN LISTS ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS)
set (hdf5_comp2)
if (${comp} STREQUAL "C")
set (hdf5_comp "hdf5")
elseif (${comp} STREQUAL "CXX")
set (hdf5_comp "hdf5_cpp")
elseif (${comp} STREQUAL "HL")
set (hdf5_comp "hdf5_hl")
elseif (${comp} STREQUAL "CXX_HL")
set (hdf5_comp "hdf5_hl_cpp")
elseif (${comp} STREQUAL "Tools")
set (hdf5_comp "hdf5_tools")
elseif (${comp} STREQUAL "Fortran")
set (hdf5_comp2 "hdf5_f90cstub")
set (hdf5_comp "hdf5_fortran")
elseif (${comp} STREQUAL "Fortran_HL")
set (hdf5_comp2 "hdf5_hl_f90cstub")
set (hdf5_comp "hdf5_hl_fortran")
endif ()
list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}" HAVE_COMP)
if (${HAVE_COMP} LESS 0)
set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 0)
else ()
if (hdf5_comp2)
list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp2}" HAVE_COMP2)
if (${HAVE_COMP2} LESS 0)
set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 0)
else ()
set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 1)
string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_LIBRARY COMP_LIBRARY)
set (${HDF5_PACKAGE_NAME}_LIBRARIES ${${HDF5_PACKAGE_NAME}_LIBRARIES} ${hdf5_comp2} ${hdf5_comp})
endif ()
else ()
set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 1)
string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_LIBRARY COMP_LIBRARY)
set (${HDF5_PACKAGE_NAME}_LIBRARIES ${${HDF5_PACKAGE_NAME}_LIBRARIES} ${hdf5_comp})
endif ()
endif ()
endforeach ()
check_required_components(${HDF5_PACKAGE_NAME}_FIND_COMPONENTS)

View File

@ -23,8 +23,8 @@ Compiling Options:
CPPFLAGS: @CPPFLAGS@
H5_CPPFLAGS: @H5_CPPFLAGS@
AM_CPPFLAGS: @AM_CPPFLAGS@
Shared Libraries: @H5_ENABLE_SHARED_LIB@
Static Libraries: @H5_ENABLE_STATIC_LIB@
Shared C Library: @H5_ENABLE_SHARED_LIB@
Static C Library: @H5_ENABLE_STATIC_LIB@
Statically Linked Executables: @BUILD_STATIC_EXECS@
LDFLAGS: @CMAKE_SHARED_LINKER_FLAGS@
AM_LDFLAGS: @AM_LDFLAGS@
@ -42,11 +42,16 @@ Languages:
@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Flags: @CMAKE_Fortran_FLAGS@
@BUILD_FORTRAN_CONDITIONAL_TRUE@ H5 Fortran Flags: @H5_FCFLAGS@
@BUILD_FORTRAN_CONDITIONAL_TRUE@ AM Fortran Flags: @AM_FCFLAGS@
@BUILD_FORTRAN_CONDITIONAL_TRUE@ Shared Fortran Library: @H5_ENABLE_SHARED_LIB@
@BUILD_FORTRAN_CONDITIONAL_TRUE@ Static Fortran Library: @H5_ENABLE_STATIC_LIB@
C++: @HDF5_BUILD_CPP_LIB@
@BUILD_CXX_CONDITIONAL_TRUE@ C++ Compiler: @CMAKE_CXX_COMPILER@
@BUILD_CXX_CONDITIONAL_TRUE@ C++ Flags: @CMAKE_CXX_FLAGS@
@BUILD_CXX_CONDITIONAL_TRUE@ H5 C++ Flags: @H5_CXXFLAGS@
@BUILD_CXX_CONDITIONAL_TRUE@ AM C++ Flags: @AM_CXXFLAGS@
@BUILD_CXX_CONDITIONAL_TRUE@ Shared C++ Library: @H5_ENABLE_SHARED_LIB@
@BUILD_CXX_CONDITIONAL_TRUE@ Static C++ Library: @H5_ENABLE_STATIC_LIB@
Features:
---------
@ -56,7 +61,6 @@ Features:
Default API Mapping: @DEFAULT_API_VERSION@
With Deprecated Public Symbols: @HDF5_ENABLE_DEPRECATED_SYMBOLS@
I/O filters (external): @EXTERNAL_FILTERS@
I/O filters (internal): @FILTERS@
MPE: @H5_HAVE_LIBLMPE@
Direct VFD: @H5_HAVE_DIRECT@
dmalloc: @H5_HAVE_LIBDMALLOC@

View File

@ -0,0 +1,282 @@
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
########################################################
# This dashboard is maintained by The HDF Group
# For any comments please contact cdashhelp@hdfgroup.org
#
########################################################
# -----------------------------------------------------------
# -- Get environment
# -----------------------------------------------------------
if(NOT SITE_OS_NAME)
## machine name not provided - attempt to discover with uname
## -- set hostname
## --------------------------
find_program(HOSTNAME_CMD NAMES hostname)
exec_program(${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME)
set(CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}")
find_program(UNAME NAMES uname)
macro(getuname name flag)
exec_program("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}")
endmacro(getuname)
getuname(osname -s)
getuname(osrel -r)
getuname(cpu -m)
message(STATUS "Dashboard script uname output: ${osname}-${osrel}-${cpu}\n")
set(CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}")
if(USE_AUTOTOOLS)
set(CTEST_BUILD_NAME "AT-${CTEST_BUILD_NAME}")
endif()
if(SITE_BUILDNAME_SUFFIX)
set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}")
endif()
set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS}")
else(NOT SITE_OS_NAME)
## machine name provided
## --------------------------
if(CMAKE_HOST_UNIX)
set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_OS_BITS}-${SITE_COMPILER_NAME}-${SITE_COMPILER_VERSION}")
else()
set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}")
endif()
if(SITE_BUILDNAME_SUFFIX)
set(CTEST_BUILD_NAME ${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX})
endif()
set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}")
endif(NOT SITE_OS_NAME)
#-----------------------------------------------------------------------------
# MAC machines need special option
#-----------------------------------------------------------------------------
if(APPLE)
# Compiler choice
execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE)
set(ENV{CC} "${XCODE_CC}")
set(ENV{CXX} "${XCODE_CXX}")
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
endif(APPLE)
#-----------------------------------------------------------------------------
set(NEED_REPOSITORY_CHECKOUT 0)
set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"")
if(CTEST_USE_TAR_SOURCE)
## Uncompress source if tar file provided
## --------------------------
if(WIN32)
message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_USE_TAR_SOURCE}.zip]")
execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv)
else()
message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]")
execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv)
endif()
if(NOT rv EQUAL 0)
message(STATUS "extracting... [error-(${rv}) clean up]")
file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}")
message(FATAL_ERROR "error: extract of ${CTEST_USE_TAR_SOURCE} failed")
endif()
file(RENAME ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY})
else(CTEST_USE_TAR_SOURCE)
if(LOCAL_UPDATE)
if(CTEST_USE_GIT_SOURCE)
find_program(CTEST_GIT_COMMAND NAMES git git.cmd)
set(CTEST_GIT_UPDATE_OPTIONS)
if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}")
set(NEED_REPOSITORY_CHECKOUT 1)
endif()
if(${NEED_REPOSITORY_CHECKOUT})
if(REPOSITORY_BRANCH)
set(GITUpdateOptions "clone \"${REPOSITORY_URL}\" --branch \"${REPOSITORY_BRANCH}\" \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules")
else()
set(GITUpdateOptions "clone \"${REPOSITORY_URL}\" \"${CTEST_SOURCE_DIRECTORY}\" --recurse-submodules")
endif()
set(CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} ${GITUpdateOptions}")
else()
set(GITUpdateOptions "pull")
endif()
set(CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}")
else(CTEST_USE_GIT_SOURCE)
## --------------------------
## use subversion to get source
#-----------------------------------------------------------------------------
## cygwin does not handle the find_package() call
## --------------------------
set(CTEST_UPDATE_COMMAND "SVNCommand")
if(NOT SITE_CYGWIN})
find_package (Subversion)
set(CTEST_SVN_COMMAND "${Subversion_SVN_EXECUTABLE}")
set(CTEST_UPDATE_COMMAND "${Subversion_SVN_EXECUTABLE}")
else()
set(CTEST_SVN_COMMAND "/usr/bin/svn")
set(CTEST_UPDATE_COMMAND "/usr/bin/svn")
endif()
if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}")
set(NEED_REPOSITORY_CHECKOUT 1)
endif()
if(NOT CTEST_REPO_VERSION)
set(CTEST_REPO_VERSION "HEAD")
endif()
if(${NEED_REPOSITORY_CHECKOUT})
set(CTEST_CHECKOUT_COMMAND
"${CTEST_SVN_COMMAND} co ${REPOSITORY_URL} \"${CTEST_SOURCE_DIRECTORY}\" -r ${CTEST_REPO_VERSION}")
else(${NEED_REPOSITORY_CHECKOUT})
if(CTEST_REPO_VERSION)
set(CTEST_SVN_UPDATE_OPTIONS "-r ${CTEST_REPO_VERSION}")
endif()
endif(${NEED_REPOSITORY_CHECKOUT})
endif(CTEST_USE_GIT_SOURCE)
endif(LOCAL_UPDATE)
endif(CTEST_USE_TAR_SOURCE)
#-----------------------------------------------------------------------------
## Clear the build directory
## --------------------------
set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE)
if(NOT EXISTS "${CTEST_BINARY_DIRECTORY}")
file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
else()
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
endif()
# Use multiple CPU cores to build
include(ProcessorCount)
ProcessorCount(N)
if(NOT N EQUAL 0)
if(NOT WIN32)
set(CTEST_BUILD_FLAGS -j${N})
endif()
set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
endif()
#-----------------------------------------------------------------------------
# Send the main script as a note.
list(APPEND CTEST_NOTES_FILES
"${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}"
"${CMAKE_CURRENT_LIST_FILE}"
"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake"
)
#-----------------------------------------------------------------------------
# Check for required variables.
# --------------------------
foreach(req
CTEST_CMAKE_GENERATOR
CTEST_SITE
CTEST_BUILD_NAME
)
if(NOT DEFINED ${req})
message(FATAL_ERROR "The containing script must set ${req}")
endif()
endforeach(req)
#-----------------------------------------------------------------------------
# Initialize the CTEST commands
#------------------------------
if(LOCAL_MEMCHECK_TEST)
find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
set (CTEST_CONFIGURE_COMMAND
"${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\""
)
else()
if(LOCAL_COVERAGE_TEST)
find_program(CTEST_COVERAGE_COMMAND NAMES gcov)
endif()
set (CTEST_CONFIGURE_COMMAND
"${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\""
)
endif()
#-----------------------------------------------------------------------------
## -- set output to english
set($ENV{LC_MESSAGES} "en_EN")
# Print summary information.
foreach(v
CTEST_SITE
CTEST_BUILD_NAME
CTEST_SOURCE_DIRECTORY
CTEST_BINARY_DIRECTORY
CTEST_CMAKE_GENERATOR
CTEST_BUILD_CONFIGURATION
CTEST_GIT_COMMAND
CTEST_CHECKOUT_COMMAND
CTEST_CONFIGURE_COMMAND
CTEST_SCRIPT_DIRECTORY
CTEST_USE_LAUNCHERS
)
set(vars "${vars} ${v}=[${${v}}]\n")
endforeach(v)
message(STATUS "Dashboard script configuration:\n${vars}\n")
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
## NORMAL process
## -- LOCAL_UPDATE updates the source folder from svn
## -- LOCAL_SUBMIT reports to CDash server
## -- LOCAL_SKIP_TEST skips the test process (only builds)
## -- LOCAL_MEMCHECK_TEST executes the Valgrind testing
## -- LOCAL_COVERAGE_TEST executes code coverage process
## --------------------------
ctest_start (${MODEL} TRACK ${MODEL})
if(LOCAL_UPDATE)
ctest_update (SOURCE "${CTEST_SOURCE_DIRECTORY}")
endif()
configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake)
ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}")
ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}")
if(LOCAL_SUBMIT)
ctest_submit (PARTS Update Configure Notes)
endif()
ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND)
if(LOCAL_SUBMIT)
ctest_submit (PARTS Build)
endif()
if(NOT LOCAL_SKIP_TEST)
if(NOT LOCAL_MEMCHECK_TEST)
ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res)
if(LOCAL_SUBMIT)
ctest_submit (PARTS Test)
endif()
if(res GREATER 0)
message(FATAL_ERROR "Failed tests: ${res}\n")
endif()
else()
ctest_memcheck (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args})
if(LOCAL_SUBMIT)
ctest_submit (PARTS MemCheck)
endif(LOCAL_SUBMIT)
endif()
if(LOCAL_COVERAGE_TEST)
ctest_coverage (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND)
if(LOCAL_SUBMIT)
ctest_submit (PARTS Coverage)
endif()
endif()
endif(NOT LOCAL_SKIP_TEST)
if(NOT LOCAL_MEMCHECK_TEST AND NOT LOCAL_NO_PACKAGE)
##-----------------------------------------------
## Package the product
##-----------------------------------------------
execute_process(COMMAND cpack -C ${CTEST_BUILD_CONFIGURATION} -V
WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY}
RESULT_VARIABLE cpackResult
OUTPUT_VARIABLE cpackLog
ERROR_VARIABLE cpackLog.err
)
file(WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}")
if(cpackResult GREATER 0)
message (FATAL_ERROR "Failed packaging: ${cpackResult}\n")
endif()
endif(NOT LOCAL_MEMCHECK_TEST AND NOT LOCAL_NO_PACKAGE)
#-----------------------------------------------------------------------------

View File

@ -0,0 +1,169 @@
#########################################################################
### For Windows ${CTEST_SCRIPT_ARG} is one of ###
### [64-VS2013, 32-VS2013, 64-VS2012, 32-VS2012] ###
### ctest -S HDF518config.cmake,32-VS2012 -C Release -V -O hdf518.log ###
#########################################################################
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
set(CTEST_SOURCE_VERSION 1.8.15)
set(CTEST_SOURCE_NAME hdf5-${CTEST_SOURCE_VERSION})
set(CTEST_BINARY_NAME "build")
set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}")
if(WIN32)
set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}")
set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
else()
set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}")
set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}")
endif()
###################################################################
### Following Line is one of [Release, RelWithDebInfo, Debug] #####
set(CTEST_BUILD_CONFIGURATION "Release")
###################################################################
###################################################################
######### Following describes compiler ############
if(WIN32)
set(SITE_OS_NAME "Windows")
set(SITE_OS_VERSION "WIN7")
if(${CTEST_SCRIPT_ARG} STREQUAL "64-VS2013")
set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64")
set(SITE_OS_BITS "64")
set(SITE_COMPILER_NAME "vs2013")
set(SITE_COMPILER_VERSION "12")
elseif(${CTEST_SCRIPT_ARG} STREQUAL "32-VS2013")
set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013")
set(SITE_OS_BITS "32")
set(SITE_COMPILER_NAME "vs2013")
set(SITE_COMPILER_VERSION "12")
elseif(${CTEST_SCRIPT_ARG} STREQUAL "64-VS2012")
set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64")
set(SITE_OS_BITS "64")
set(SITE_COMPILER_NAME "vs2012")
set(SITE_COMPILER_VERSION "11")
elseif(${CTEST_SCRIPT_ARG} STREQUAL "32-VS2012")
set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012")
set(SITE_OS_BITS "32")
set(SITE_COMPILER_NAME "vs2012")
set(SITE_COMPILER_VERSION "11")
endif()
## Set the following to unique id your computer ##
set(CTEST_SITE "WIN7${CTEST_SCRIPT_ARG}.XXXX")
else()
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
## Set the following to unique id your computer ##
if(APPLE)
set(CTEST_SITE "MAC.XXXX")
else()
set(CTEST_SITE "LINUX.XXXX")
endif()
endif()
###################################################################
###################################################################
######### Following is for submission to CDash ############
###################################################################
set(MODEL "Experimental")
######### Following describes computer ############
## following is optional to describe build ##
set(SITE_BUILDNAME_SUFFIX "STATIC")
###################################################################
###################################################################
##### Following controls CDash submission #####
#set(LOCAL_SUBMIT "TRUE")
##### Following controls test process #####
#set(LOCAL_SKIP_TEST "TRUE")
#set(LOCAL_MEMCHECK_TEST "TRUE")
#set(LOCAL_COVERAGE_TEST "TRUE")
##### Following controls cpack command #####
#set(LOCAL_NO_PACKAGE "TRUE")
##### Following controls source update #####
#set(LOCAL_UPDATE "TRUE")
set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8")
#uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows
#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}")
###################################################################
###################################################################
#### Change default configuration of options in config/cmake/cacheinit.cmake file ###
#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ")
### uncomment/comment and change the following lines for configuration options
### comment the following line or change OFF to ON in order to build shared libraries
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")
#### ext libraries ####
### ext libs from tgz
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH=${CTEST_SCRIPT_DIRECTORY}")
### ext libs from svn
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=SVN")
### ext libs on system
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib -DZLIB_INCLUDE_DIR:PATH=some_location/include")
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include")
### disable ext libs building
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF")
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF")
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF")
#### fortran ####
### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON")
### disable Fortran; change OFF to ON in order to build FORTRAN libraries
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
### disable test program builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF")
### disable packaging
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NO_PACKAGES:BOOL=ON")
### Create install package with external libraries (szip, zlib, jpeg)
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON")
### change install prefix
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=install")
###################################################################
if(WIN32)
include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake)
if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.exe")
file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.msi")
file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.zip")
file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
else()
include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake)
if(APPLE)
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.dmg")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.tar.gz")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.sh")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
else()
if(CYGWIN)
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-CYGWIN.sh")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-CYGWIN.tar.gz")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
else()
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Linux.sh")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Linux.tar.gz")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
endif()
endif()
endif()

View File

@ -38,6 +38,9 @@ fi
# Figure out PGI C compiler flags
. $srcdir/config/pgi-flags
# Figure out CCE C compiler flags
. $srcdir/config/cce-flags
# Figure out Intel C compiler flags
. $srcdir/config/intel-flags
@ -89,10 +92,13 @@ else
esac
fi
# Figure out PGI F90 compiler flags
# Figure out PGI FC compiler flags
. $srcdir/config/pgi-fflags
# Figure out Intel F90 compiler flags
# Figure out CCE FC compiler flags
. $srcdir/config/cce-fflags
# Figure out Intel FC compiler flags
. $srcdir/config/intel-fflags
case $FC_BASENAME in
@ -125,6 +131,10 @@ if test -z "$CXX"; then
fi
# compiler version strings
# check if the compiler_version_info is already set
if test -z "$cc_version_info"; then
case $CC in
# whatever matches *pgcc* will also match *gcc*, so this one must come first
*pgcc*)
@ -153,7 +163,11 @@ case $CC in
;;
esac
fi
# get fortran version info
# check if the compiler_version_info is already set
if test -z "$fc_version_info"; then
case $FC in
*gfortran*)
fc_version_info=`$FC $FCFLAGS $H5_FCFLAGS --version 2>&1 |\
@ -199,9 +213,11 @@ case $FC in
echo "No match to get fc_version_info for $FC"
;;
esac
fi
# get c++ version info
# check if the compiler_version_info is already set
if test -z "$cxx_version_info"; then
case $CXX in
*g++*)
cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\
@ -226,4 +242,4 @@ case $CXX in
echo "No match to get cxx_version_info for $CXX"
;;
esac
fi

View File

@ -19,7 +19,7 @@
# After making changes, run bin/reconfigure to update other configure related
# files like Makefile.in.
LT_VERS_INTERFACE = 6
LT_VERS_REVISION = 205
LT_VERS_REVISION = 208
LT_VERS_AGE = 0
## If the API changes *at all*, increment LT_VERS_INTERFACE and

View File

@ -26,7 +26,7 @@ AC_PREREQ([2.69])
## NOTE: Do not forget to change the version number here when we do a
## release!!!
##
AC_INIT([HDF5], [1.9.215], [help@hdfgroup.org])
AC_INIT([HDF5], [1.9.218], [help@hdfgroup.org])
AC_CONFIG_SRCDIR([src/H5.c])
AC_CONFIG_HEADER([src/H5config.h])
@ -637,6 +637,19 @@ AC_SUBST([RUNSERIAL])
AC_SUBST([RUNPARALLEL])
AC_SUBST([TESTPARALLEL])
## ----------------------------------------------------------------------
## Disable shared libraries on CYGWIN. (LK - 04/16/15)
## A number of tests run by "make check" fail on CYGWIN, so for HDF5 v1.8.15
## we will change the default for shared libraries to disabled.
case "`uname`" in
CYGWIN*)
enable_shared="no"
CHECK_WARN="Shared libraries are not currently supported on CYGWIN."
;;
esac
## ----------------------------------------------------------------------
## Fortran libraries are not currently supported on Mac. Disable them.
## (this is overridable with --enable-unsupported).
@ -950,6 +963,11 @@ case "$host_cpu-$host_vendor-$host_os" in
## however, we do not do this since it breaks the big test on some
## older platforms.
H5_CPPFLAGS="-D_BSD_SOURCE $H5_CPPFLAGS"
## _BSD_SOURCE is deprecated as of glibc 2.20, in favor of _DEFAULT_SOURCE.
## To avoid warnings, we define _DEFAULT_SOURCE in addition to _BSD_SOURCE,
## which should work for all versions of glibc.
H5_CPPFLAGS="-D_DEFAULT_SOURCE $H5_CPPFLAGS"
;;
esac
@ -1182,7 +1200,7 @@ case $withval in
;;
no)
HAVE_ZLIB="no"
AC_MSG_CHECKING([for GNU zlib])
AC_MSG_CHECKING([for zlib])
AC_MSG_RESULT([suppressed])
;;
*)
@ -2879,5 +2897,11 @@ cat >> src/H5config.h <<EOF
#endif
EOF
## HDF5 configure code created by autotools with gcc 4.9.2 is adding problematic
## linker flags: -l with no library name; -l <libname>, specifically gfortran or m.
## This sed script corrects "-l <libname>" first and then "-l " with no library name.
## If the order is not preserved, all instances of "-l " will be removed.
sed -e '/^postdeps/ s/-l \([a-zA-Z]\)/-l\1/g' -e '/^postdeps/ s/-l //g' -i libtool
## show the configure settings
cat src/libhdf5.settings

View File

@ -39,7 +39,7 @@ set (examples
foreach (example ${examples})
add_executable (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c)
TARGET_NAMING (${example} ${LIB_TYPE})
TARGET_C_PROPERTIES (${example} " " " ")
TARGET_C_PROPERTIES (${example} ${LIB_TYPE} " " " ")
target_link_libraries (${example} ${HDF5_LIB_TARGET})
set_target_properties (${example} PROPERTIES FOLDER examples)
endforeach (example ${examples})
@ -47,7 +47,7 @@ endforeach (example ${examples})
if (H5_HAVE_PARALLEL)
add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c)
TARGET_NAMING (ph5example ${LIB_TYPE})
TARGET_C_PROPERTIES (ph5example " " " ")
TARGET_C_PROPERTIES (ph5example ${LIB_TYPE} " " " ")
target_link_libraries (ph5example ${HDF5_LIB_TARGET})
set_target_properties (ph5example PROPERTIES FOLDER examples)
endif (H5_HAVE_PARALLEL)

View File

@ -33,7 +33,7 @@ EXIT_FAILURE=1
# Where the tool is installed.
# default is relative path to installed location of the tools
prefix="${prefix:-../../../}"
prefix="${prefix:-@prefix@}"
PARALLEL=@PARALLEL@ # Am I in parallel mode?
AR="@AR@"
RANLIB="@RANLIB@"

View File

@ -8,7 +8,7 @@ PROJECT (HDF5_F90_EXAMPLES C CXX Fortran)
#-----------------------------------------------------------------------------
# Setup include Directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src)
INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src)
#-----------------------------------------------------------------------------
# Define Sources
@ -41,57 +41,52 @@ set (F2003_examples
foreach (example ${examples})
add_executable (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
TARGET_NAMING (f90_ex_${example} ${LIB_TYPE})
TARGET_FORTRAN_PROPERTIES (f90_ex_${example} " " " ")
if (WIN32)
set_property (TARGET f90_ex_${example}
APPEND PROPERTY COMPILE_DEFINITIONS
HDF5F90_WINDOWS
)
endif (WIN32)
TARGET_FORTRAN_PROPERTIES (f90_ex_${example} ${LIB_TYPE} " " " ")
target_link_libraries (f90_ex_${example}
${HDF5_F90_LIB_TARGET}
${HDF5_LIB_TARGET}
)
set_target_properties (f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran)
set_target_properties (f90_ex_${example} PROPERTIES FOLDER examples/fortran)
target_include_directories (f90_ex_${example} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
set_target_properties (f90_ex_${example} PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER examples/fortran
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}
)
endforeach (example ${examples})
if (HDF5_ENABLE_F2003)
foreach (example ${F2003_examples})
add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
TARGET_NAMING (f03_ex_${example} ${LIB_TYPE})
TARGET_FORTRAN_PROPERTIES (f03_ex_${example} " " " ")
if (WIN32)
set_property (TARGET f03_ex_${example}
APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS
)
endif (WIN32)
TARGET_FORTRAN_PROPERTIES (f03_ex_${example} ${LIB_TYPE} " " " ")
target_link_libraries (f03_ex_${example}
${HDF5_F90_LIB_TARGET}
${HDF5_LIB_TARGET}
)
set_target_properties (f03_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran)
set_target_properties (f03_ex_${example} PROPERTIES FOLDER examples/fortran03)
target_include_directories (f03_ex_${example} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
set_target_properties (f03_ex_${example} PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER examples/fortran03
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}
)
endforeach (example ${F2003_examples})
endif (HDF5_ENABLE_F2003)
if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90)
TARGET_NAMING (f90_ex_ph5example ${LIB_TYPE})
TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example " " " ")
if (WIN32)
set_property (TARGET f90_ex_ph5example
APPEND PROPERTY COMPILE_DEFINITIONS
HDF5F90_WINDOWS
)
endif (WIN32)
TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example ${LIB_TYPE} " " " ")
target_link_libraries (f90_ex_ph5example
${HDF5_F90_LIB_TARGET}
${HDF5_LIB_TARGET}
${MPI_Fortran_LIBRARIES}
)
set_target_properties (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran)
set_target_properties (f90_ex_ph5example PROPERTIES FOLDER examples/fortran)
target_include_directories (f90_ex_ph5example PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
set_target_properties (f90_ex_ph5example PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER examples/fortran
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}
)
endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
if (BUILD_TESTING)

View File

@ -79,6 +79,7 @@ endif
# Tell automake how to install examples
# Note: no '/' after DESTDIR. Explanation in commence.am
EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/fortran
EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples
# List dependencies for each example. Normally, automake would take
# care of this for us, but if we tell automake about the programs it

View File

@ -34,7 +34,7 @@ EXIT_FAILURE=1
# Where the tool is installed.
# default is relative path to installed location of the tools
prefix="${prefix:-../../../}"
prefix="${prefix:-@prefix@}"
PARALLEL=@PARALLEL@ # Am I in parallel mode?
AR="@AR@"
RANLIB="@RANLIB@"

View File

@ -54,7 +54,10 @@ if (WIN32 AND MSVC)
LINK_FLAGS "/SUBSYSTEM:CONSOLE"
)
endif (WIN32 AND MSVC)
set_target_properties (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran)
set_target_properties (H5test_FortranHavekind PROPERTIES
LINKER_LANGUAGE Fortran
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}
)
set (CMD $<TARGET_FILE:H5test_FortranHavekind>)
add_custom_command (
@ -142,7 +145,7 @@ set (f90CStub_C_HDRS
)
add_library (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} ${f90CStub_C_SRCS} ${f90CStub_C_HDRS})
TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} " " " ")
TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} " " " ")
target_link_libraries (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS})
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_NAME} ${LIB_TYPE})
@ -247,8 +250,7 @@ if (WIN32)
HDF5F90_WINDOWS
)
endif (WIN32)
TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} " " ${SHARED_LINK_FLAGS})
set_target_properties (${HDF5_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran)
TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} ${LIB_TYPE} " " ${SHARED_LINK_FLAGS})
target_link_libraries (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET})
if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
target_link_libraries (${HDF5_F90_LIB_TARGET} ${MPI_Fortran_LIBRARIES})
@ -259,6 +261,7 @@ set_target_properties (${HDF5_F90_LIB_TARGET} PROPERTIES
FOLDER libraries/fortran
LINKER_LANGUAGE Fortran
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}
)
#-----------------------------------------------------------------------------
@ -278,100 +281,50 @@ install (
)
if (WIN32)
install (
FILES
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5fortran_types.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/hdf5.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5global.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5a.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5d.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5e.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5f.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5g.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5i.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5l.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5lib.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5o.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5p.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5r.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5s.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5t.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5z.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5a_provisional.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5d_provisional.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5e_provisional.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5f_provisional.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5l_provisional.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5lib_provisional.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5o_provisional.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5p_provisional.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5r_provisional.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5t_provisional.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5_dble_interface.mod
DESTINATION
${HDF5_INSTALL_INCLUDE_DIR}
COMPONENT
fortheaders
)
if (H5_TEST_KIND_NAME)
install (
FILES
${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/${H5_TEST_KIND_NAME}.mod
DESTINATION
${HDF5_INSTALL_INCLUDE_DIR}
COMPONENT
fortheaders
)
endif (H5_TEST_KIND_NAME)
set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE})
else (WIN32)
install (
FILES
${CMAKE_Fortran_MODULE_DIRECTORY}/h5fortran_types.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/hdf5.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5global.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5f.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5a.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5d.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5e.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5f.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5g.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5i.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5l.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5lib.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5o.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5p.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5r.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5s.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5t.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5z.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5a_provisional.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5d_provisional.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5e_provisional.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5f_provisional.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5l_provisional.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5lib_provisional.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5o_provisional.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5p_provisional.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5r_provisional.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5t_provisional.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/h5_dble_interface.mod
DESTINATION
${HDF5_INSTALL_INCLUDE_DIR}
COMPONENT
fortheaders
)
if (H5_TEST_KIND_NAME)
install (
FILES
${CMAKE_Fortran_MODULE_DIRECTORY}/${H5_TEST_KIND_NAME}.mod
DESTINATION
${HDF5_INSTALL_INCLUDE_DIR}
COMPONENT
fortheaders
)
endif (H5_TEST_KIND_NAME)
set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY})
endif (WIN32)
set (mod_files
${MOD_BUILD_DIR}/h5fortran_types.mod
${MOD_BUILD_DIR}/hdf5.mod
${MOD_BUILD_DIR}/h5global.mod
${MOD_BUILD_DIR}/h5a.mod
${MOD_BUILD_DIR}/h5d.mod
${MOD_BUILD_DIR}/h5e.mod
${MOD_BUILD_DIR}/h5f.mod
${MOD_BUILD_DIR}/h5g.mod
${MOD_BUILD_DIR}/h5i.mod
${MOD_BUILD_DIR}/h5l.mod
${MOD_BUILD_DIR}/h5lib.mod
${MOD_BUILD_DIR}/h5o.mod
${MOD_BUILD_DIR}/h5p.mod
${MOD_BUILD_DIR}/h5r.mod
${MOD_BUILD_DIR}/h5s.mod
${MOD_BUILD_DIR}/h5t.mod
${MOD_BUILD_DIR}/h5z.mod
${MOD_BUILD_DIR}/h5a_provisional.mod
${MOD_BUILD_DIR}/h5d_provisional.mod
${MOD_BUILD_DIR}/h5e_provisional.mod
${MOD_BUILD_DIR}/h5f_provisional.mod
${MOD_BUILD_DIR}/h5l_provisional.mod
${MOD_BUILD_DIR}/h5lib_provisional.mod
${MOD_BUILD_DIR}/h5o_provisional.mod
${MOD_BUILD_DIR}/h5p_provisional.mod
${MOD_BUILD_DIR}/h5r_provisional.mod
${MOD_BUILD_DIR}/h5t_provisional.mod
${MOD_BUILD_DIR}/h5_dble_interface.mod
)
install (
FILES
${mod_files}
DESTINATION
${HDF5_INSTALL_INCLUDE_DIR}
COMPONENT
fortheaders
)
#-----------------------------------------------------------------------------
# Add Target(s) to CMake Install for import into other projects
#-----------------------------------------------------------------------------

View File

@ -632,7 +632,7 @@ nh5dwrite_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_
* Allocate temporary buffer and copy references from Fortran.
*/
n = (unsigned int)*dims;
buf_c = (hobj_ref_t*)HDmalloc(sizeof(hobj_ref_t)*(n));
buf_c = (hobj_ref_t*)HDmalloc(sizeof(hobj_ref_t)*n);
if ( buf_c != NULL ) {
for (i = 0; i < n; i++)
HDmemcpy(&buf_c[i], &buf[i], sizeof(haddr_t));
@ -699,7 +699,7 @@ nh5dwrite_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_
/*
* Allocate temporary buffer and copy references from Fortran.
*/
buf_c = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t)*(n));
buf_c = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t)*n);
if ( buf_c != NULL ) {
for (i = 0; i < n; i++) {
HDmemcpy(&buf_c[i], buf, H5R_DSET_REG_REF_BUF_SIZE);
@ -1722,7 +1722,7 @@ nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_s
max_len = (size_t)dims[0];
num_elem = H5Sget_select_npoints(c_mem_space_id);
if(num_elem != dims[1]) return ret_value;
if(num_elem != (hssize_t)dims[1]) return ret_value;
c_buf = (hvl_t *)HDmalloc((size_t)num_elem * sizeof(hvl_t));
if (c_buf == NULL) return ret_value;
@ -2037,7 +2037,7 @@ nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac
max_len = (size_t)dims[0];
num_elem = H5Sget_select_npoints(c_mem_space_id);
if(num_elem != dims[1]) return ret_value;
if(num_elem != (hssize_t)dims[1]) return ret_value;
c_buf = (hvl_t *)HDmalloc((size_t)num_elem * sizeof(hvl_t));
if (c_buf == NULL) return ret_value;

View File

@ -632,7 +632,7 @@ nh5fget_name_c(hid_t_f *obj_id, size_t_f *size, _fcd buf, size_t_f *buflen)
/*
* Call H5Fget_name function
*/
if ((size_c = (size_t_f)H5Fget_name((hid_t)*obj_id, c_buf, (size_t)*buflen)) < 0)
if ((size_c = H5Fget_name((hid_t)*obj_id, c_buf, (size_t)*buflen)) < 0)
HGOTO_DONE(FAIL);
/*
@ -703,13 +703,16 @@ h5fget_file_image_c(hid_t_f *file_id, void *buf_ptr, size_t_f *buf_len, size_t_f
/******/
{
herr_t ret_value=0; /* Return value */
ssize_t c_buf_req;
/*
* Call h5fget_file_image function
*/
if ((*buf_req = (size_t_f)H5Fget_file_image((hid_t)*file_id, buf_ptr, (size_t)*buf_len)) < 0)
if ( (c_buf_req = H5Fget_file_image((hid_t)*file_id, buf_ptr, (size_t)*buf_len)) < 0)
HGOTO_DONE(FAIL);
*buf_req = (size_t_f)c_buf_req;
done:
return ret_value;
}

View File

@ -67,7 +67,7 @@ nh5gcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint,
/*
* Call H5Gcreate function.
*/
if(*size_hint == OBJECT_NAMELEN_DEFAULT_F ){
if(*size_hint == (size_t_f)OBJECT_NAMELEN_DEFAULT_F ){
c_grp_id = H5Gcreate2((hid_t)*loc_id, c_name,(hid_t)*lcpl_id,(hid_t)*gcpl_id,(hid_t)*gapl_id);}
else {
/* Create the group creation property list */

View File

@ -677,9 +677,9 @@ done:
/****if* H5Lf/h5lget_name_by_idx_c
* NAME
* h5lget_name_by_idx_c
* h5lget_name_by_idx_c
* PURPOSE
* Call H5Lget_name_by_idx
* Call H5Lget_name_by_idx
* INPUTS
*
* loc_id - File or group identifier specifying location of subject group
@ -694,10 +694,10 @@ done:
* name - Buffer in which link value is returned
* size - The size of the link name on success
* RETURNS
* 0 on success, -1 on failure
* 0 on success, -1 on failure
* AUTHOR
* M. Scot Breitenfeld
* March 10, 2008
* March 10, 2008
* SOURCE
*/
int_f
@ -706,9 +706,10 @@ nh5lget_name_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen,
size_t_f *size, _fcd name, hid_t_f *lapl_id)
/******/
{
char *c_group_name = NULL; /* Buffer to hold C string */
char *c_group_name = NULL; /* Buffer to hold C string */
char *c_name = NULL; /* Buffer to hold C string */
size_t c_size;
ssize_t c_size_link;
int_f ret_value = 0; /* Return value */
/*
@ -725,10 +726,12 @@ nh5lget_name_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen,
if(NULL == (c_name = (char *)HDmalloc(c_size)))
HGOTO_DONE(FAIL)
if((*size = (size_t_f)H5Lget_name_by_idx((hid_t)*loc_id, c_group_name, (H5_index_t)*index_field,
if((c_size_link = H5Lget_name_by_idx((hid_t)*loc_id, c_group_name, (H5_index_t)*index_field,
(H5_iter_order_t)*order, (hsize_t)*n,c_name, c_size, (hid_t)*lapl_id)) < 0)
HGOTO_DONE(FAIL)
*size = (size_t_f)c_size_link;
/*
* Convert C name to FORTRAN and place it in the given buffer
*/

View File

@ -23,6 +23,8 @@
#include "H5f90.h"
#include "H5Eprivate.h"
int_f
fill_h5o_info_t_f(H5O_info_t Oinfo, H5O_info_t_f *object_info);
int_f
fill_h5o_info_t_f(H5O_info_t Oinfo, H5O_info_t_f *object_info) {
@ -874,6 +876,7 @@ nh5oget_comment_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *name_size,
char *c_comment = NULL; /* Buffer to hold C string */
char *c_name = NULL; /* Buffer to hold C string */
int_f ret_value = 0; /* Return value */
ssize_t c_bufsize;
size_t c_commentsize;
/*
@ -895,9 +898,11 @@ nh5oget_comment_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *name_size,
* Call H5Oget_comment_by_name function.
*/
if((*bufsize = (size_t_f)H5Oget_comment_by_name((hid_t)*loc_id, c_name, c_comment, (size_t)*commentsize,(hid_t)*lapl_id )) < 0)
if((c_bufsize = H5Oget_comment_by_name((hid_t)*loc_id, c_name, c_comment, (size_t)*commentsize,(hid_t)*lapl_id )) < 0)
HGOTO_DONE(FAIL);
*bufsize = (size_t_f)c_bufsize;
/*
* Convert C name to FORTRAN and place it in the given buffer
*/

View File

@ -160,41 +160,32 @@ done:
/****if* H5Pf/h5pget_class_c
* NAME
* h5pget_class_c
* h5pget_class_c
* PURPOSE
* Call H5Pget_class to determine property list class
* Call H5Pget_class to determine property list class
* INPUTS
* prp_id - identifier of the dataspace
* prp_id - identifier of the dataspace
* OUTPUTS
* classtype - class type; possible values are:
* H5P_ROOT_F -1
* H5P_FILE_CREATE_F 0
* H5P_FILE_ACCESS_F 1
* H5P_DATASET_CREATE_F 2
* H5P_DATASET_XFER_F 3
* H5P_FILE_MOUNT_F 4
* classtype - class type
* RETURNS
* 0 on success, -1 on failure
* 0 on success, -1 on failure
* AUTHOR
* Elena Pourmal
* Saturday, August 14, 1999
* Saturday, August 14, 1999
* SOURCE
*/
int_f
nh5pget_class_c ( hid_t_f *prp_id , int_f *classtype)
nh5pget_class_c ( hid_t_f *prp_id , hid_t_f *classtype)
/******/
{
hid_t c_classtype;
int_f ret_value = 0;
c_classtype = H5Pget_class((hid_t)*prp_id);
if(c_classtype == H5P_ROOT) {
*classtype = H5P_ROOT;
if( (c_classtype = H5Pget_class((hid_t)*prp_id)) < 0)
HGOTO_DONE(FAIL)
}
*classtype = (int_f)c_classtype;
*classtype = (hid_t_f)c_classtype;
done:
return ret_value;

View File

@ -237,18 +237,10 @@ CONTAINS
! Returns the property list class for a property list.
!
! INPUTS
!
! prp_id - property list identifier
!
! OUTPUTS
!
! classtype - property list class
! Possible values are:
! H5P_ROOT_F
! H5P_FILE_CREATE_F
! H5P_FILE_ACCESS_F
! H5P_DATASET_CREATE_F
! H5P_DATASET_XFER_F
! H5P_FILE_MOUNT_F
! hdferr: - error code
! Success: 0
! Failure: -1
@ -265,30 +257,21 @@ CONTAINS
! Fortran90 Interface:
SUBROUTINE h5pget_class_f(prp_id, classtype, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
INTEGER, INTENT(OUT) :: classtype ! The type of the property list
! to be created. Possible values are:
! H5P_ROOT_F
! H5P_FILE_CREATE_F
! H5P_FILE_ACCESS_F
! H5P_DATASET_CREATE_F
! H5P_DATASET_XFER_F
! H5P_FILE_MOUNT_F
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
INTEGER(HID_T), INTENT(OUT) :: classtype ! The type of the property list
! to be created.
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
!*****
! INTEGER, EXTERNAL :: h5pget_class_c
! MS FORTRAN needs explicit interface for C functions called here.
!
INTERFACE
INTEGER FUNCTION h5pget_class_c(prp_id, classtype)
USE H5GLOBAL
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_CLASS_C'::h5pget_class_c
!DEC$ENDIF
INTEGER(HID_T), INTENT(IN) :: prp_id
INTEGER, INTENT(OUT) :: classtype
INTEGER(HID_T), INTENT(IN) :: prp_id
INTEGER(HID_T), INTENT(OUT) :: classtype
END FUNCTION h5pget_class_c
END INTERFACE
@ -1449,7 +1432,7 @@ CONTAINS
!****s* H5P/h5pget_fapl_core_f
! NAME
! h5pget_fapl_core_f
! h5pget_fapl_core_f
!
! PURPOSE
! Queries core file driver properties.
@ -1487,9 +1470,6 @@ CONTAINS
!*****
INTEGER :: backing_store_flag
! INTEGER, EXTERNAL :: h5pget_fapl_core_c
! MS FORTRAN needs explicit interface for C functions called here.
!
INTERFACE
INTEGER FUNCTION h5pget_fapl_core_c(prp_id, increment, backing_store_flag)
USE H5GLOBAL
@ -3644,7 +3624,7 @@ CONTAINS
! size - Actual length of the class name
! NOTE: If provided buffer "name" is smaller,
! than name will be truncated to fit into
! provided user buffer
! provided user buffer.
! hdferr: - error code
! Success: 0
! Failure: -1
@ -4222,50 +4202,46 @@ CONTAINS
! Fortran90 Interface:
SUBROUTINE h5pset_fapl_multi_l(prp_id, memb_map, memb_fapl, memb_name, memb_addr, relax, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier
INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_map ! Mapping array
INTEGER(HID_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_fapl ! Property list for each memory usage type
CHARACTER(LEN=*), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_name ! Names of member file
REAL, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_addr
LOGICAL, INTENT(IN) :: relax ! Flag
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
INTEGER(HID_T), INTENT(IN) :: prp_id
INTEGER, DIMENSION(*), INTENT(IN) :: memb_map
INTEGER(HID_T), DIMENSION(*), INTENT(IN) :: memb_fapl
CHARACTER(LEN=*), DIMENSION(*), INTENT(IN) :: memb_name
REAL, DIMENSION(*), INTENT(IN) :: memb_addr
LOGICAL, INTENT(IN) :: relax
INTEGER, INTENT(OUT) :: hdferr
!*****
INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: lenm
INTEGER, DIMENSION(1:H5FD_MEM_NTYPES_F) :: lenm
INTEGER :: maxlen
INTEGER :: flag
INTEGER :: flag = 0
INTEGER :: i
! INTEGER, EXTERNAL :: h5pset_fapl_multi_c
! MS FORTRAN needs explicit interface for C functions called here.
!
INTERFACE
INTEGER FUNCTION h5pset_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, &
maxlen, memb_addr, flag)
USE H5GLOBAL
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_MULTI_C'::h5pset_fapl_multi_c
!DEC$ENDIF
!DEC$ATTRIBUTES reference :: memb_name
INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier
INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_map
INTEGER(HID_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_fapl
CHARACTER(LEN=*), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_name
REAL, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_addr
!INTEGER(HADDR_T), DIMENSION(H5FD_MEM_NTYPES_F), INTENT(IN) :: memb_addr
INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: lenm
INTEGER, DIMENSION(*), INTENT(IN) :: memb_map
INTEGER(HID_T), DIMENSION(*), INTENT(IN) :: memb_fapl
CHARACTER(LEN=*), DIMENSION(*), INTENT(IN) :: memb_name
REAL, DIMENSION(*), INTENT(IN) :: memb_addr
INTEGER, DIMENSION(*) :: lenm
INTEGER :: maxlen
INTEGER, INTENT(IN) :: flag
END FUNCTION h5pset_fapl_multi_c
END INTERFACE
maxlen = LEN(memb_name(1))
DO i=0, H5FD_MEM_NTYPES_F-1
DO i=1, H5FD_MEM_NTYPES_F
lenm(i) = LEN_TRIM(memb_name(i))
ENDDO
flag = 0
IF (relax) flag = 1
hdferr = h5pset_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, maxlen, memb_addr, flag)
IF(relax) flag = 1
hdferr = h5pset_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, maxlen, memb_addr, flag)
END SUBROUTINE h5pset_fapl_multi_l
!****s* H5P/h5pset_fapl_multi_s
! NAME
@ -4303,6 +4279,7 @@ CONTAINS
INTERFACE
INTEGER FUNCTION h5pset_fapl_multi_sc(prp_id,flag)
USE H5GLOBAL
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FAPL_MULTI_SC'::h5pset_fapl_multi_sc
!DEC$ENDIF
@ -4346,51 +4323,50 @@ CONTAINS
SUBROUTINE h5pget_fapl_multi_f(prp_id, memb_map, memb_fapl, memb_name, memb_addr, relax, hdferr, maxlen_out)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier
INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_map
INTEGER(HID_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_fapl
CHARACTER(LEN=*), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_name
!INTEGER(HADDR_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_addr
REAL, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_addr
INTEGER, DIMENSION(*), INTENT(OUT) :: memb_map
INTEGER(HID_T), DIMENSION(*), INTENT(OUT) :: memb_fapl
CHARACTER(LEN=*), DIMENSION(*), INTENT(OUT) :: memb_name
REAL, DIMENSION(*), INTENT(OUT) :: memb_addr
INTEGER, OPTIONAL, INTENT(OUT) :: maxlen_out
LOGICAL, INTENT(OUT) :: relax
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
!*****
INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: lenm
INTEGER, DIMENSION(1:H5FD_MEM_NTYPES_F) :: lenm
INTEGER :: maxlen
INTEGER :: c_maxlen_out
INTEGER :: flag
INTEGER :: i
! INTEGER, EXTERNAL :: h5pget_fapl_multi_c
! MS FORTRAN needs explicit interface for C functions called here.
!
INTERFACE
INTEGER FUNCTION h5pget_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, &
maxlen, memb_addr, flag, c_maxlen_out)
USE H5GLOBAL
IMPLICIT NONE
!DEC$IF DEFINED(HDF5F90_WINDOWS)
!DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FAPL_MULTI_C'::h5pget_fapl_multi_c
!DEC$ENDIF
!DEC$ATTRIBUTES reference :: memb_name
INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier
INTEGER, DIMENSION(H5FD_MEM_NTYPES_F), INTENT(OUT) :: memb_map
INTEGER(HID_T), DIMENSION(H5FD_MEM_NTYPES_F), INTENT(OUT) :: memb_fapl
CHARACTER(LEN=*), DIMENSION(H5FD_MEM_NTYPES_F), INTENT(OUT) :: memb_name
REAL, DIMENSION(H5FD_MEM_NTYPES_F), INTENT(OUT) :: memb_addr
INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: lenm
INTEGER, DIMENSION(*), INTENT(OUT) :: memb_map
INTEGER(HID_T), DIMENSION(*), INTENT(OUT) :: memb_fapl
CHARACTER(LEN=*), DIMENSION(*), INTENT(OUT) :: memb_name
REAL, DIMENSION(*), INTENT(OUT) :: memb_addr
INTEGER, DIMENSION(*) :: lenm
INTEGER :: maxlen
INTEGER :: c_maxlen_out
INTEGER, INTENT(OUT) :: flag
END FUNCTION h5pget_fapl_multi_c
END INTERFACE
maxlen = LEN(memb_name(0))
DO i=0, H5FD_MEM_NTYPES_F-1
maxlen = LEN(memb_name(1))
DO i=1, H5FD_MEM_NTYPES_F
lenm(i) = LEN_TRIM(memb_name(i))
ENDDO
hdferr = h5pget_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, maxlen, memb_addr, flag, c_maxlen_out)
hdferr = h5pget_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, maxlen, memb_addr, flag, c_maxlen_out)
relax = .TRUE.
IF(flag .EQ. 0) relax = .FALSE.
IF(flag .EQ. 0) relax = .FALSE.
IF(PRESENT(maxlen_out)) maxlen_out = c_maxlen_out
END SUBROUTINE h5pget_fapl_multi_f
!****s* H5P/h5pset_szip_f

View File

@ -148,13 +148,11 @@ h5rcreate_ptr_c (void *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *r
{
int ret_value = -1;
char *c_name;
size_t c_namelen;
/*
* Convert FORTRAN name to C name
*/
c_namelen = (size_t)*namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, (size_t)*namelen);
if (c_name == NULL) return ret_value;
/*

View File

@ -14,18 +14,18 @@
!
! COPYRIGHT
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
! Copyright by The HDF Group. *
! Copyright by the Board of Trustees of the University of Illinois. *
! All rights reserved. *
! *
! This file is part of HDF5. The full HDF5 copyright notice, including *
! terms governing use, modification, and redistribution, is contained in *
! the files COPYING and Copyright.html. COPYING can be found at the root *
! of the source code distribution tree; Copyright.html can be found at the *
! root level of an installed copy of the electronic HDF5 document set and *
! is linked from the top-level documents page. It can also be found at *
! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
! access to either file, you may request a copy from help@hdfgroup.org. *
! Copyright by The HDF Group. *
! Copyright by the Board of Trustees of the University of Illinois. *
! All rights reserved. *
! *
! This file is part of HDF5. The full HDF5 copyright notice, including *
! terms governing use, modification, and redistribution, is contained in *
! the files COPYING and Copyright.html. COPYING can be found at the root *
! of the source code distribution tree; Copyright.html can be found at the *
! root level of an installed copy of the electronic HDF5 document set and *
! is linked from the top-level documents page. It can also be found at *
! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
! access to either file, you may request a copy from help@hdfgroup.org. *
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
!
! NOTES
@ -551,7 +551,7 @@ CONTAINS
INTEGER(HID_T), INTENT(IN) :: loc_id
TYPE(hobj_ref_t_f), INTENT(IN), TARGET :: ref
INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size
CHARACTER(LEN=*), INTENT(OUT) :: name
CHARACTER(LEN=*), INTENT(INOUT) :: name
INTEGER, INTENT(OUT) :: hdferr
!*****
@ -598,7 +598,7 @@ CONTAINS
INTEGER(HID_T), INTENT(IN) :: loc_id
TYPE(hdset_reg_ref_t_f), INTENT(IN), TARGET :: ref
INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size
CHARACTER(LEN=*), INTENT(OUT) :: name
CHARACTER(LEN=*), INTENT(INOUT) :: name
INTEGER, INTENT(OUT) :: hdferr
!*****
INTEGER(SIZE_T) :: size_default
@ -647,7 +647,7 @@ CONTAINS
INTEGER(HID_T), INTENT(IN) :: loc_id
INTEGER, INTENT(IN) :: ref_type
TYPE(C_PTR), INTENT(IN) :: ref
CHARACTER(LEN=*), INTENT(OUT) :: name
CHARACTER(LEN=*), INTENT(INOUT) :: name
INTEGER, INTENT(OUT) :: hdferr
INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size
!*****

View File

@ -14,18 +14,18 @@
!
! COPYRIGHT
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
! Copyright by The HDF Group. *
! Copyright by the Board of Trustees of the University of Illinois. *
! All rights reserved. *
! *
! This file is part of HDF5. The full HDF5 copyright notice, including *
! terms governing use, modification, and redistribution, is contained in *
! the files COPYING and Copyright.html. COPYING can be found at the root *
! of the source code distribution tree; Copyright.html can be found at the *
! root level of an installed copy of the electronic HDF5 document set and *
! is linked from the top-level documents page. It can also be found at *
! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
! access to either file, you may request a copy from help@hdfgroup.org. *
! Copyright by The HDF Group. *
! Copyright by the Board of Trustees of the University of Illinois. *
! All rights reserved. *
! *
! This file is part of HDF5. The full HDF5 copyright notice, including *
! terms governing use, modification, and redistribution, is contained in *
! the files COPYING and Copyright.html. COPYING can be found at the root *
! of the source code distribution tree; Copyright.html can be found at the *
! root level of an installed copy of the electronic HDF5 document set and *
! is linked from the top-level documents page. It can also be found at *
! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
! access to either file, you may request a copy from help@hdfgroup.org. *
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
!
! NOTES

View File

@ -298,7 +298,7 @@ nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f *startblock,
if (rank < 0 ) return ret_value;
c_startblock = (hsize_t)*startblock;
c_buf = (hsize_t*)HDmalloc(sizeof(hsize_t)*(size_t)(c_num_blocks*2*rank));
c_buf = (hsize_t*)HDmalloc(sizeof(hsize_t)*(size_t)(c_num_blocks*2*(hsize_t)rank));
if (!c_buf) return ret_value;
ret_value = H5Sget_select_hyper_blocklist(c_space_id, c_startblock,
@ -425,7 +425,7 @@ nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint,
if (rank < 0 ) return ret_value;
c_startpoint = (hsize_t)*startpoint;
c_buf = (hsize_t*)HDmalloc(sizeof(hsize_t)*(size_t)(c_num_points*rank));
c_buf = (hsize_t*)HDmalloc(sizeof(hsize_t)*(size_t)(c_num_points*(hsize_t)rank));
if (!c_buf) return ret_value;
ret_value = H5Sget_select_elem_pointlist(c_space_id, c_startpoint,
c_num_points, c_buf);
@ -434,7 +434,7 @@ nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint,
/* and add 1 to account for array's starting at one in Fortran */
i2 = 0;
for( i = 0; i < c_num_points; i++) {
i1 = rank*(i+1);
i1 = (hsize_t)rank*(i+1);
for(j = 0; j < rank; j++) {
buf[i2] = (hsize_t_f)(c_buf[i1-1]+1);
i2 = i2 + 1;
@ -442,10 +442,6 @@ nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint,
}
}
/* for( i = 0; i < c_num_points*rank; i++) { */
/* printf("%i \n", (int)c_buf[i]+1); */
/* } */
if (ret_value >= 0 ) ret_value = 0;
HDfree(c_buf);
@ -453,8 +449,6 @@ nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint,
return ret_value;
}
/****if* H5Sf/h5sselect_all_c
* NAME
* h5sselect_all_c
@ -1230,7 +1224,8 @@ nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsi
H5S_seloper_t c_op;
herr_t status;
int rank;
int i, j;
size_t i;
int j;
hsize_t *c_coord;
size_t c_nelements;
@ -1239,11 +1234,11 @@ nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsi
c_space_id = *space_id;
rank = H5Sget_simple_extent_ndims(c_space_id);
c_coord = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank*(*nelements));
c_coord = (hsize_t *)HDmalloc(sizeof(hsize_t)*(size_t)rank*((size_t)*nelements));
if(!c_coord) return ret_value;
for (i=0; i< *nelements; i++) {
for (i=0; i< (size_t)*nelements; i++) {
for (j = 0; j < rank; j++) {
c_coord[j+i*rank] = (hsize_t)coord[j + i*rank];
c_coord[(size_t)j+i*(size_t)rank] = (hsize_t)coord[(size_t)j + i*(size_t)rank];
}
}

View File

@ -26,9 +26,9 @@
/****if* H5Tf/h5topen_c
* NAME
* h5topen_c
* h5topen_c
* PURPOSE
* Call H5Topen2 to open a datatype
* Call H5Topen2 to open a datatype
* INPUTS
* loc_id - file or group identifier
* name - name of the datatype within file or group
@ -78,9 +78,9 @@ done:
/****if* H5Tf/h5tcommit_c
* NAME
* h5tcommit_c
* h5tcommit_c
* PURPOSE
* Call H5Tcommit2 to commit a datatype
* Call H5Tcommit2 to commit a datatype
* INPUTS
* loc_id - file or group identifier
* name - name of the datatype within file or group
@ -126,9 +126,9 @@ done:
/****if* H5Tf/h5tclose_c
* NAME
* h5tclose_c
* h5tclose_c
* PURPOSE
* Call H5Tclose to close the datatype
* Call H5Tclose to close the datatype
* INPUTS
* type_id - identifier of the datatype to be closed
* RETURNS
@ -156,9 +156,9 @@ nh5tclose_c ( hid_t_f *type_id )
/****if* H5Tf/h5tcopy_c
* NAME
* h5tcopy_c
* h5tcopy_c
* PURPOSE
* Call H5Tcopy to copy a datatype
* Call H5Tcopy to copy a datatype
* INPUTS
* type_id - identifier of the datatype to be copied
* OUTPUTS
@ -190,9 +190,9 @@ nh5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id)
/****if* H5Tf/h5tequal_c
* NAME
* h5tequal_c
* h5tequal_c
* PURPOSE
* Call H5Tequal to copy a datatype
* Call H5Tequal to copy a datatype
* INPUTS
* type1_id - datatype identifier
* type2_id - datatype identifier
@ -289,9 +289,9 @@ nh5tget_class_c ( hid_t_f *type_id , int_f *classtype)
/****if* H5Tf/h5tget_order_c
* NAME
* h5tget_order_c
* h5tget_order_c
* PURPOSE
* Call H5Tget_order to determine byte order
* Call H5Tget_order to determine byte order
* INPUTS
* type_id - identifier of the dataspace
* OUTPUTS
@ -333,9 +333,9 @@ nh5tget_order_c ( hid_t_f *type_id , int_f *order)
/****if* H5Tf/h5tset_order_c
* NAME
* h5tset_order_c
* h5tset_order_c
* PURPOSE
* Call H5Tset_order to set byte order
* Call H5Tset_order to set byte order
* INPUTS
* type_id - identifier of the dataspace
* order; possible values are:
@ -374,9 +374,9 @@ nh5tset_order_c ( hid_t_f *type_id , int_f *order)
/****if* H5Tf/h5tget_size_c
* NAME
* h5tget_size_c
* h5tget_size_c
* PURPOSE
* Call H5Tget_size to get size of the datatype
* Call H5Tget_size to get size of the datatype
* INPUTS
* type_id - identifier of the dataspace
* OUTPUTS
@ -409,9 +409,9 @@ nh5tget_size_c ( hid_t_f *type_id , size_t_f *size)
/****if* H5Tf/h5tset_size_c
* NAME
* h5tset_size_c
* h5tset_size_c
* PURPOSE
* Call H5Tget_size to get size of the datatype
* Call H5Tget_size to get size of the datatype
* INPUTS
* type_id - identifier of the dataspace
* OUTPUTS
@ -445,9 +445,9 @@ nh5tset_size_c ( hid_t_f *type_id , size_t_f *size)
/****if* H5Tf/h5tget_precision_c
* NAME
* h5tget_precision_c
* h5tget_precision_c
* PURPOSE
* Call H5Tget_precision to get precision of the datatype
* Call H5Tget_precision to get precision of the datatype
* INPUTS
* type_id - identifier of the dataspace
* OUTPUTS
@ -480,9 +480,9 @@ nh5tget_precision_c ( hid_t_f *type_id , size_t_f *precision)
/****if* H5Tf/h5tset_precision_c
* NAME
* h5tset_precision_c
* h5tset_precision_c
* PURPOSE
* Call H5Tset_precision to set precision of the datatype
* Call H5Tset_precision to set precision of the datatype
* INPUTS
* type_id - identifier of the dataspace
* precision - number of significant bits
@ -515,9 +515,9 @@ nh5tset_precision_c ( hid_t_f *type_id , size_t_f *precision)
/****if* H5Tf/h5tget_offset_c
* NAME
* h5tget_offset_c
* h5tget_offset_c
* PURPOSE
* Call H5Tget_offset to get bit offset of the first
* Call H5Tget_offset to get bit offset of the first
* significant bit of the datatype
* INPUTS
* type_id - identifier of the dataspace
@ -552,9 +552,9 @@ nh5tget_offset_c ( hid_t_f *type_id , size_t_f *offset)
/****if* H5Tf/h5tset_offset_c
* NAME
* h5tset_offset_c
* h5tset_offset_c
* PURPOSE
* Call H5Tset_offset to set bit offset of the first
* Call H5Tset_offset to set bit offset of the first
* significant bit of the datatype
* INPUTS
* type_id - identifier of the dataspace
@ -588,9 +588,9 @@ nh5tset_offset_c ( hid_t_f *type_id , size_t_f *offset)
/****if* H5Tf/h5tget_pad_c
* NAME
* h5tget_pad_c
* h5tget_pad_c
* PURPOSE
* Call H5Tget_pad to get the padding type of the least and
* Call H5Tget_pad to get the padding type of the least and
* most-significant bit padding
*
* INPUTS
@ -629,11 +629,11 @@ nh5tget_pad_c ( hid_t_f *type_id , int_f * lsbpad, int_f * msbpad)
/****if* H5Tf/h5tset_pad_c
* NAME
* h5tset_pad_c
* h5tset_pad_c
* INPUTS
* type_id - identifier of the dataspace
* PURPOSE
* Call H5Tset_pad to set the padding type of the least and
* Call H5Tset_pad to set the padding type of the least and
* most-significant bit padding
*
* INPUTS
@ -670,9 +670,9 @@ nh5tset_pad_c ( hid_t_f *type_id, int_f * lsbpad, int_f* msbpad )
/****if* H5Tf/h5tget_sign_c
* NAME
* h5tget_sign_c
* h5tget_sign_c
* PURPOSE
* Call H5Tget_sign to get sign type for an integer type
* Call H5Tget_sign to get sign type for an integer type
* INPUTS
* type_id - identifier of the dataspace
* OUTPUTS
@ -705,9 +705,9 @@ nh5tget_sign_c ( hid_t_f *type_id , int_f *sign)
/****if* H5Tf/h5tset_sign_c
* NAME
* h5tset_sign_c
* h5tset_sign_c
* PURPOSE
* Call H5Tset_sign to set sign type for an integer type
* Call H5Tset_sign to set sign type for an integer type
* INPUTS
* type_id - identifier of the dataspace
* sign - sign type for an integer typ
@ -741,9 +741,9 @@ nh5tset_sign_c ( hid_t_f *type_id , int_f* sign)
/****if* H5Tf/h5tget_fields_c
* NAME
* h5tget_fields_c
* h5tget_fields_c
* PURPOSE
* Call H5Tget_fields to get floating point datatype
* Call H5Tget_fields to get floating point datatype
* bit field information
* INPUTS
* type_id - identifier of the dataspace
@ -785,9 +785,9 @@ nh5tget_fields_c ( hid_t_f *type_id , size_t_f *spos, size_t_f *epos, size_t_f*
/****if* H5Tf/h5tset_fields_c
* NAME
* h5tset_fields_c
* h5tset_fields_c
* PURPOSE
* Call H5Tset_fields to set floating point datatype
* Call H5Tset_fields to set floating point datatype
* bit field information
* INPUTS
* type_id - identifier of the dataspace
@ -829,9 +829,9 @@ nh5tset_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* e
/****if* H5Tf/h5tget_ebias_c
* NAME
* h5tget_ebias_c
* h5tget_ebias_c
* PURPOSE
* Call H5Tget_ebias to get exponent bias of a
* Call H5Tget_ebias to get exponent bias of a
* floating-point type of the datatype
* INPUTS
* type_id - identifier of the dataspace
@ -866,9 +866,9 @@ nh5tget_ebias_c ( hid_t_f *type_id , size_t_f *ebias)
/****if* H5Tf/h5tset_ebias_c
* NAME
* h5tset_ebias_c
* h5tset_ebias_c
* PURPOSE
* Call H5Tset_ebias to set exponent bias of a
* Call H5Tset_ebias to set exponent bias of a
* floating-point type of the datatype
* INPUTS
* type_id - identifier of the dataspace
@ -903,9 +903,9 @@ nh5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias)
/****if* H5Tf/h5tget_norm_c
* NAME
* h5tget_norm_c
* h5tget_norm_c
* PURPOSE
* Call H5Tget_norm to get mantissa normalization
* Call H5Tget_norm to get mantissa normalization
* of a floating-point datatype
* INPUTS
* type_id - identifier of the dataspace
@ -940,9 +940,9 @@ nh5tget_norm_c ( hid_t_f *type_id , int_f *norm)
/****if* H5Tf/h5tset_norm_c
* NAME
* h5tset_norm_c
* h5tset_norm_c
* PURPOSE
* Call H5Tset_norm to set mantissa normalization of
* Call H5Tset_norm to set mantissa normalization of
* floating-point type of the datatype
* INPUTS
* type_id - identifier of the dataspace
@ -977,9 +977,9 @@ nh5tset_norm_c ( hid_t_f *type_id , int_f *norm)
/****if* H5Tf/h5tget_inpad_c
* NAME
* h5tget_inpad_c
* h5tget_inpad_c
* PURPOSE
* Call H5Tget_inpad to get the padding type for
* Call H5Tget_inpad to get the padding type for
* unused bits in floating-point datatypes
*
* INPUTS
@ -1016,11 +1016,11 @@ nh5tget_inpad_c ( hid_t_f *type_id , int_f * padtype)
/****if* H5Tf/h5tset_inpad_c
* NAME
* h5tset_inpad_c
* h5tset_inpad_c
* INPUTS
* type_id - identifier of the dataspace
* PURPOSE
* Call H5Tset_inpad to set the padding type
* Call H5Tset_inpad to set the padding type
* unused bits in floating-point datatype
*
* INPUTS
@ -1057,9 +1057,9 @@ nh5tset_inpad_c ( hid_t_f *type_id, int_f * padtype)
/****if* H5Tf/h5tget_cset_c
* NAME
* h5tget_cset_c
* h5tget_cset_c
* PURPOSE
* Call H5Tget_cset to get character set
* Call H5Tget_cset to get character set
* type of a string datatype
*
* INPUTS
@ -1095,11 +1095,11 @@ nh5tget_cset_c ( hid_t_f *type_id , int_f * cset)
/****if* H5Tf/h5tset_cset_c
* NAME
* h5tset_cset_c
* h5tset_cset_c
* INPUTS
* type_id - identifier of the dataspace
* PURPOSE
* Call H5Tset_cset to set character set
* Call H5Tset_cset to set character set
* type of a string datatype
*
* INPUTS
@ -1135,9 +1135,9 @@ nh5tset_cset_c ( hid_t_f *type_id, int_f * cset)
/****if* H5Tf/h5tget_strpad_c
* NAME
* h5tget_strpad_c
* h5tget_strpad_c
* PURPOSE
* Call H5Tget_strpad to get string padding method
* Call H5Tget_strpad to get string padding method
* for a string datatype
* INPUTS
* type_id - identifier of the dataspace
@ -1171,11 +1171,11 @@ nh5tget_strpad_c ( hid_t_f *type_id , int_f * strpad)
/****if* H5Tf/h5tset_strpad_c
* NAME
* h5tset_strpad_c
* h5tset_strpad_c
* INPUTS
* type_id - identifier of the dataspace
* PURPOSE
* Call H5Tset_strpad to set string padding method
* Call H5Tset_strpad to set string padding method
* for a string datatype
*
* INPUTS
@ -1211,9 +1211,9 @@ nh5tset_strpad_c ( hid_t_f *type_id, int_f * strpad)
/****if* H5Tf/h5tget_nmembers_c
* NAME
* h5tget_nmembers_c
* h5tget_nmembers_c
* PURPOSE
* Call H5Tget_nmembers to get number of fields
* Call H5Tget_nmembers to get number of fields
* in a compound datatype
* INPUTS
* type_id - identifier of the dataspace
@ -1246,9 +1246,9 @@ nh5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members)
/****if* H5Tf/h5tget_member_name_c
* NAME
* h5tget_member_name_c
* h5tget_member_name_c
* PURPOSE
* Call H5Tget_member_name to get name
* Call H5Tget_member_name to get name
* of a compound datatype
* INPUTS
* type_id - identifier of the dataspace
@ -1287,9 +1287,9 @@ nh5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *n
}
/****if* H5Tf/h5tget_member_index_c
* NAME
* h5tget_member_index_c
* h5tget_member_index_c
* PURPOSE
* Call H5Tget_member_index to get an index of
* Call H5Tget_member_index to get an index of
* the specified datatype filed or member.
* INPUTS
* type_id - datatype identifier
@ -1301,7 +1301,7 @@ nh5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *n
* 0 on success, -1 on failure
* AUTHOR
* Elena Pourmal
* Thursday, September 26, 2002
* Thursday, September 26, 2002
* HISTORY
*
* SOURCE
@ -1312,15 +1312,13 @@ nh5tget_member_index_c (hid_t_f *type_id, _fcd name, int_f *namelen, int_f *idx)
{
int ret_value = -1;
char *c_name;
size_t c_namelen;
hid_t c_type_id;
int c_index;
/*
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, (size_t)*namelen);
if (c_name == NULL) return ret_value;
/*
@ -1340,9 +1338,9 @@ DONE:
/****if* H5Tf/h5tget_member_offset_c
* NAME
* h5tget_member_offset_c
* h5tget_member_offset_c
* PURPOSE
* Call H5Tget_member_offset to get byte offset of the
* Call H5Tget_member_offset to get byte offset of the
* beginning of a field within a compound datatype with
* respect to the beginning of the compound data type datum
* INPUTS
@ -1367,12 +1365,8 @@ nh5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f * offset)
{
int ret_value = -1;
size_t c_offset;
hid_t c_type_id;
unsigned c_member_no;
c_type_id = *type_id;
c_member_no = *member_no;
c_offset = H5Tget_member_offset(c_type_id, c_member_no);
c_offset = H5Tget_member_offset((hid_t)*type_id, (unsigned)*member_no);
*offset = (size_t_f)c_offset;
ret_value = 0;
return ret_value;
@ -1380,9 +1374,9 @@ nh5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f * offset)
/****if* H5Tf/h5tget_array_dims_c
* NAME
* h5tget_array_dims_c
* h5tget_array_dims_c
* PURPOSE
* Call H5Tget_array_dims2 to get
* Call H5Tget_array_dims2 to get
* dimensions of array datatype
* INPUTS
* type_id - identifier of the array datatype
@ -1423,9 +1417,9 @@ DONE:
/****if* H5Tf/h5tget_array_ndims_c
* NAME
* h5tget_array_ndims_c
* h5tget_array_ndims_c
* PURPOSE
* Call H5Tget_array_ndims to get number
* Call H5Tget_array_ndims to get number
* of dimensions of array datatype
* INPUTS
* type_id - identifier of the array datatype
@ -1460,9 +1454,9 @@ nh5tget_array_ndims_c ( hid_t_f *type_id , int_f * ndims)
/****if* H5Tf/h5tget_super_c
* NAME
* h5tget_super_c
* h5tget_super_c
* PURPOSE
* Call H5Tget_super to get base datatype from which
* Call H5Tget_super to get base datatype from which
* datatype was derived
* INPUTS
* type_id - identifier of the array datatype
@ -1498,9 +1492,9 @@ nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id)
/****if* H5Tf/h5tget_member_type_c
* NAME
* h5tget_member_type_c
* h5tget_member_type_c
* PURPOSE
* Call H5Tget_member_type to get the identifier of a copy of
* Call H5Tget_member_type to get the identifier of a copy of
* the datatype of the field
* INPUTS
* type_id - identifier of the datatype
@ -1511,7 +1505,7 @@ nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id)
* 0 on success, -1 on failure
* AUTHOR
* XIANGYANG SU
* Thursday, February 3, 2000
* Thursday, February 3, 2000
* HISTORY
*
* SOURCE
@ -1522,12 +1516,8 @@ nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype)
/******/
{
int ret_value = -1;
hid_t c_type_id;
unsigned c_field_idx;
c_type_id = *type_id;
c_field_idx = *field_idx;
*datatype = (hid_t_f)H5Tget_member_type(c_type_id, c_field_idx);
*datatype = (hid_t_f)H5Tget_member_type((hid_t)*type_id, (unsigned)*field_idx);
if(*datatype < 0) return ret_value;
ret_value = 0;
@ -1537,9 +1527,9 @@ nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype)
/****if* H5Tf/h5tcreate_c
* NAME
* h5tcreate_c
* h5tcreate_c
* PURPOSE
* Call H5Tcreate to create a datatype
* Call H5Tcreate to create a datatype
* INPUTS
* cls - class type
* size - size of the class memeber
@ -1573,20 +1563,20 @@ nh5tcreate_c(int_f *cls, size_t_f *size, hid_t_f *type_id)
/****if* H5Tf/h5tinsert_c
* NAME
* h5tinsert_c
* h5tinsert_c
* PURPOSE
* Call H5Tinsert to adds another member to the compound datatype
* Call H5Tinsert to adds another member to the compound datatype
* INPUTS
* type_id - identifier of the datatype
* name - Name of the field to insert
* namelen - length of the name
* offset - Offset in memory structure of the field to insert
* field_id - datatype identifier of the new member
* type_id - identifier of the datatype
* name - Name of the field to insert
* namelen - length of the name
* offset - Offset in memory structure of the field to insert
* field_id - datatype identifier of the new member
* RETURNS
* 0 on success, -1 on failure
* 0 on success, -1 on failure
* AUTHOR
* XIANGYANG SU
* Thursday, February 3, 2000
* Thursday, February 3, 2000
* HISTORY
*
* SOURCE
@ -1597,21 +1587,14 @@ nh5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_
/******/
{
int ret_value = -1;
hid_t c_type_id;
hid_t c_field_id;
char* c_name;
size_t c_namelen;
size_t c_offset;
herr_t error;
c_offset =(size_t) *offset;
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, (size_t)*namelen);
if (c_name == NULL) return ret_value;
c_type_id = *type_id;
c_field_id = *field_id;
error = H5Tinsert(c_type_id, c_name, c_offset, c_field_id);
error = H5Tinsert((hid_t)*type_id, c_name, (size_t)*offset, (hid_t)*field_id);
HDfree(c_name);
if(error < 0) return ret_value;
ret_value = 0;
@ -1621,18 +1604,18 @@ nh5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_
/****if* H5Tf/h5tpack_c
* NAME
* h5tpack_c
* h5tpack_c
* PURPOSE
* Call H5Tpack tor ecursively remove padding from
* within a compound datatype to make it more efficient
* (space-wise) to store that data
* Call H5Tpack tor ecursively remove padding from
* within a compound datatype to make it more efficient
* (space-wise) to store that data
* INPUTS
* type_id - identifier of the datatype
* type_id - identifier of the datatype
* RETURNS
* 0 on success, -1 on failure
* 0 on success, -1 on failure
* AUTHOR
* XIANGYANG SU
* Thursday, February 3, 2000
* Thursday, February 3, 2000
* HISTORY
*
* SOURCE
@ -1656,9 +1639,9 @@ nh5tpack_c(hid_t_f * type_id)
/****if* H5Tf/h5tarray_create_c
* NAME
* h5tarray_create_c
* h5tarray_create_c
* PURPOSE
* Call H5Tarray_create2 to create array datatype
* Call H5Tarray_create2 to create array datatype
* INPUTS
* base_id - identifier of array base datatype
* rank - array's rank
@ -1668,7 +1651,7 @@ nh5tpack_c(hid_t_f * type_id)
* 0 on success, -1 on failure
* AUTHOR
* Elena Pourmal
* Thursday, November 16, 2000
* Thursday, November 16, 2000
* HISTORY
*
* SOURCE
@ -1687,7 +1670,7 @@ nh5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* typ
* Transpose dimension arrays because of C-FORTRAN storage order
*/
for(u = 0; u < (unsigned)*rank ; u++)
c_dims[u] = (hsize_t)dims[(*rank - u) - 1];
c_dims[u] = (hsize_t)dims[((unsigned)*rank - u) - 1];
if((c_type_id = H5Tarray_create2((hid_t)*base_id, (unsigned)*rank, c_dims)) < 0)
goto DONE;
@ -1702,19 +1685,19 @@ DONE:
/****if* H5Tf/h5tenum_create_c
* NAME
* h5tenum_create_c
* h5tenum_create_c
* PURPOSE
* Call H5Tenum_create to create a new enumeration datatype
* Call H5Tenum_create to create a new enumeration datatype
* INPUTS
* parent_id - Datatype identifier for the base datatype
* parent_id - Datatype identifier for the base datatype
* OUTPUTS
* new_type_id - datatype identifier for the new
* enumeration datatype
* new_type_id - datatype identifier for the new
* enumeration datatype
* RETURNS
* 0 on success, -1 on failure
* 0 on success, -1 on failure
* AUTHOR
* Xiangyang Su
* Tuesday, February 15, 1999
* Tuesday, February 15, 1999
* HISTORY
*
* SOURCE
@ -1725,11 +1708,9 @@ nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id)
/******/
{
int ret_value = 0;
hid_t c_parent_id;
hid_t c_new_type_id;
c_parent_id = *parent_id;
c_new_type_id = H5Tenum_create(c_parent_id);
c_new_type_id = H5Tenum_create((hid_t)*parent_id);
if ( c_new_type_id < 0 ) ret_value = -1;
*new_type_id = (hid_t_f)c_new_type_id;
@ -1764,12 +1745,10 @@ nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value)
{
int ret_value = -1;
char* c_name;
size_t c_namelen;
herr_t error;
int_f c_value;
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, (size_t)*namelen);
if (c_name == NULL) return ret_value;
c_value = *value;
@ -1785,9 +1764,9 @@ nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value)
/****if* H5Tf/h5tenum_nameof_c
* NAME
* h5tenum_nameof_c
* h5tenum_nameof_c
* PURPOSE
* Call H5Tenum_nameof to find the symbol name that corresponds to
* Call H5Tenum_nameof to find the symbol name that corresponds to
* the specified value of the enumeration datatype type
* INPUTS
* type_id - identifier of the datatype
@ -1829,9 +1808,9 @@ nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen)
/****if* H5Tf/h5tenum_valueof_c
* NAME
* h5tenum_valueof_c
* h5tenum_valueof_c
* PURPOSE
* Call H5Tenum_valueof to find the value of that corresponds to
* Call H5Tenum_valueof to find the value of that corresponds to
* the specified name of the enumeration datatype type
* INPUTS
* type_id - identifier of the datatype
@ -1853,16 +1832,12 @@ nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value)
/******/
{
int ret_value = -1;
hid_t c_type_id;
char* c_name;
size_t c_namelen;
herr_t error;
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, (size_t)*namelen);
if (c_name == NULL) return ret_value;
c_type_id = *type_id;
error = H5Tenum_valueof(c_type_id, c_name, value);
error = H5Tenum_valueof((hid_t)*type_id, c_name, value);
HDfree(c_name);
if(error < 0) return ret_value;
@ -1873,9 +1848,9 @@ nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value)
/****if* H5Tf/h5tget_member_value_c
* NAME
* h5tget_member_value_c
* h5tget_member_value_c
* PURPOSE
* Call H5Tget_member_value to get the value of an
* Call H5Tget_member_value to get the value of an
* enumeration datatype member
* INPUTS
* type_id - identifier of the datatype
@ -1896,14 +1871,10 @@ nh5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value)
/******/
{
int ret_value = -1;
hid_t c_type_id;
unsigned c_member_no;
int c_value;
herr_t error;
c_type_id = *type_id;
c_member_no = *member_no;
error = H5Tget_member_value(c_type_id, c_member_no, &c_value);
error = H5Tget_member_value((hid_t)*type_id, (unsigned)*member_no, &c_value);
if(error < 0) return ret_value;
*value = (int_f)c_value;
@ -1913,11 +1884,11 @@ nh5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value)
/****if* H5Tf/h5tset_tag_c
* NAME
* h5tset_tag_c
* h5tset_tag_c
* INPUTS
* type_id - identifier of the dataspace
* PURPOSE
* Call H5Tset_tag to set an opaque datatype tag
* Call H5Tset_tag to set an opaque datatype tag
* INPUTS
* type_id - identifier of the dataspace
* tag - Unique ASCII string with which the opaque
@ -1937,16 +1908,12 @@ nh5tset_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen)
/******/
{
int ret_value = -1;
hid_t c_type_id;
herr_t status;
char* c_tag;
size_t c_namelen;
c_namelen = *namelen;
c_tag = (char *)HD5f2cstring(tag, c_namelen);
c_tag = (char *)HD5f2cstring(tag, (size_t)*namelen);
c_type_id = *type_id;
status = H5Tset_tag(c_type_id, c_tag);
status = H5Tset_tag((hid_t)*type_id, c_tag);
HDfree(c_tag);
if ( status < 0 ) return ret_value;
@ -1956,7 +1923,7 @@ nh5tset_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen)
/****if* H5Tf/h5tget_tag_c
* NAME
* h5tget_tag_c
* h5tget_tag_c
* PURPOSE
* Call H5Tset_tag to set an opaque datatype tag
* INPUTS
@ -1994,9 +1961,9 @@ nh5tget_tag_c(hid_t_f* type_id, _fcd tag, size_t_f* tag_size, int_f* taglen)
}
/****if* H5Tf/h5tvlen_create_c
* NAME
* h5tvlen_create_c
* h5tvlen_create_c
* PURPOSE
* Call H5Tvlen_create to create VL dtatype
* Call H5Tvlen_create to create VL dtatype
* INPUTS
* type_id - identifier of the base datatype
* OUTPUTS
@ -2027,9 +1994,9 @@ nh5tvlen_create_c(hid_t_f* type_id, hid_t_f *vltype_id)
}
/****if* H5Tf/h5tis_variable_str_c
* NAME
* h5tis_variable_str_c
* h5tis_variable_str_c
* PURPOSE
* Call H5Tis_variable_str to detrmine if the datatype
* Call H5Tis_variable_str to detrmine if the datatype
* is a variable string.
* INPUTS
* type_id - identifier of the dataspace
@ -2062,9 +2029,9 @@ nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag )
}
/****if* H5Tf/h5tget_member_class_c
* NAME
* h5tget_member_class_c
* h5tget_member_class_c
* PURPOSE
* Call H5Tget_member_class to detrmine ithe class of the compound
* Call H5Tget_member_class to detrmine ithe class of the compound
* datatype member
* INPUTS
* type_id - identifier of the dataspace
@ -2102,9 +2069,9 @@ nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *cls )
/****if* H5Tf/h5tcommit_anon_c
* NAME
* h5tcommit_anon_c
* h5tcommit_anon_c
* PURPOSE
* Call H5Tcommit_anon
* Call H5Tcommit_anon
* INPUTS
* loc_id - file or group identifier
* dtype_id - dataset identifier
@ -2138,9 +2105,9 @@ nh5tcommit_anon_c(hid_t_f *loc_id, hid_t_f *dtype_id,
/****if* H5Tf/h5tcommitted_c
* NAME
* h5tcommitted_c
* h5tcommitted_c
* PURPOSE
* Call H5Tcommitted
* Call H5Tcommitted
* dtype_id - dataset identifier
* RETURNS
* a positive value, for TRUE, if the datatype has been committed,
@ -2169,9 +2136,9 @@ nh5tcommitted_c(hid_t_f *dtype_id)
/****if* H5Tf/h5tdecode_c
* NAME
* h5tdecode_c
* h5tdecode_c
* PURPOSE
* Call H5Tdecode
* Call H5Tdecode
* INPUTS
*
* buf - Buffer for the data space object to be decoded.
@ -2215,9 +2182,9 @@ nh5tdecode_c ( _fcd buf, hid_t_f *obj_id )
/****if* H5Tf/h5tencode_c
* NAME
* h5tencode_c
* h5tencode_c
* PURPOSE
* Call H5Tencode
* Call H5Tencode
* INPUTS
*
* obj_id - Identifier of the object to be encoded.
@ -2285,9 +2252,9 @@ nh5tencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc )
/****if* H5Tf/h5tget_create_plist_c
* NAME
* h5tget_create_plist_c
* h5tget_create_plist_c
* PURPOSE
* Call H5Tget_create_plist
* Call H5Tget_create_plist
* INPUTS
* dtype_id - Datatype identifier
* OUTPUTS
@ -2317,9 +2284,9 @@ nh5tget_create_plist_c ( hid_t_f *dtype_id, hid_t_f *dtpl_id)
/****if* H5Tf/h5tcompiler_conv_c
* NAME
* h5tcompiler_conv_c
* h5tcompiler_conv_c
* PURPOSE
* Call H5Tcompiler_conv
* Call H5Tcompiler_conv
* INPUTS
*
* src_id - Identifier for the source datatype.
@ -2351,9 +2318,9 @@ nh5tcompiler_conv_c ( hid_t_f *src_id, hid_t_f *dst_id, int_f *c_flag)
}
/****if* H5Tf/h5tget_native_type_c
* NAME
* h5tget_native_type_c
* h5tget_native_type_c
* PURPOSE
* Call H5Tget_native_type
* Call H5Tget_native_type
* INPUTS
*
* dtype_id - Datatype identifier for the dataset datatype.
@ -2449,13 +2416,11 @@ h5tenum_insert_ptr_c(hid_t_f *type_id, _fcd name, int_f* namelen, void *value)
int ret_value = -1;
hid_t status;
char *c_name;
size_t c_namelen;
/*
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
c_name = (char *)HD5f2cstring(name, (size_t)*namelen);
if (c_name == NULL) return ret_value;
status = H5Tenum_insert( (hid_t)*type_id, c_name, value);

View File

@ -51,9 +51,7 @@ nh5zunregister_c (int_f *filter)
* Call H5Zunregister function.
*/
c_filter = (H5Z_filter_t)*filter;
printf(" filter # %d \n", (int)c_filter);
status = H5Zunregister(c_filter);
printf("From C zunregister %d \n", status);
if (status < 0) return ret_value;
ret_value = 0;
return ret_value;

View File

@ -421,12 +421,17 @@ nh5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags,
/*
* H5F flags
*
* Note that H5F_ACC_DEBUG is deprecated (nonfunctional) but retained
* for backward compatibility since it's in the public API.
*/
h5f_flags[0] = (int_f)H5F_ACC_RDWR;
h5f_flags[1] = (int_f)H5F_ACC_RDONLY;
h5f_flags[2] = (int_f)H5F_ACC_TRUNC;
h5f_flags[3] = (int_f)H5F_ACC_EXCL;
#ifndef H5_NO_DEPRECATED_SYMBOLS
h5f_flags[4] = (int_f)H5F_ACC_DEBUG;
#endif /* H5_NO_DEPRECATED_SYMBOLS */
h5f_flags[5] = (int_f)H5F_SCOPE_LOCAL;
h5f_flags[6] = (int_f)H5F_SCOPE_GLOBAL;
h5f_flags[7] = (int_f)H5F_CLOSE_DEFAULT;

View File

@ -234,6 +234,9 @@ MODULE H5GLOBAL
!
! H5F flags (DO NOT FORGET TO UPDATE WHEN NEW FLAGS ARE ADDED !)
!
! NOTE: H5F_ACC_DEBUG is deprecated (nonfunctional) but retained for
! backward compatibility since it's in the public API.
!
! H5F flags declaration
!
INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19

View File

@ -995,7 +995,7 @@ H5_FCDLL int_f nh5pcreate_c ( hid_t_f *cls, hid_t_f *prp_id );
H5_FCDLL int_f nh5pclose_c ( hid_t_f *prp_id );
H5_FCDLL int_f nh5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id);
H5_FCDLL int_f nh5pequal_c ( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f *c_flag);
H5_FCDLL int_f nh5pget_class_c ( hid_t_f *prp_id , int_f *classtype);
H5_FCDLL int_f nh5pget_class_c ( hid_t_f *prp_id , hid_t_f *classtype);
H5_FCDLL int_f nh5pset_deflate_c ( hid_t_f *prp_id , int_f *level);
H5_FCDLL int_f nh5pset_chunk_c ( hid_t_f *prp_id, int_f *rank, hsize_t_f *dims );
H5_FCDLL int_f nh5pget_chunk_c ( hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims );

View File

@ -88,7 +88,6 @@ Compilation
grpdsetexample - creates datasets in the groups
hyperslabexample - writes and reads a hyperslab
selectele - writes element selections
grpit - iterates through the members of the group
attrexample - creates and writes a dataset attribute
compound - creates, writes and reads one dim array of structures
mountexample - shows how to use mounting files to access a dataset

View File

@ -4,14 +4,14 @@ PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran)
#-----------------------------------------------------------------------------
# Setup include Directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src)
INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src)
#-----------------------------------------------------------------------------
# Add Test Lib
#-----------------------------------------------------------------------------
add_library (${HDF5_F90_C_TEST_LIB_TARGET} ${LIB_TYPE} t.c)
set_source_files_properties (t.c PROPERTIES LANGUAGE C)
TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} " " " ")
TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} ${LIB_TYPE} " " " ")
target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET}
${HDF5_F90_C_LIB_TARGET}
${HDF5_TEST_LIB_TARGET}
@ -46,8 +46,7 @@ if (WIN32)
endif (BUILD_SHARED_LIBS)
set_property (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS)
endif (WIN32)
TARGET_FORTRAN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} " " ${SHARED_LINK_FLAGS})
set_target_properties (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran)
TARGET_FORTRAN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} ${LIB_TYPE} " " ${SHARED_LINK_FLAGS})
target_link_libraries (${HDF5_F90_TEST_LIB_TARGET}
${HDF5_F90_C_TEST_LIB_TARGET}
${HDF5_F90_LIB_TARGET}
@ -58,6 +57,7 @@ set_target_properties (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES
FOLDER libraries/test/fortran
LINKER_LANGUAGE Fortran
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}
)
#-----------------------------------------------------------------------------
@ -83,7 +83,7 @@ add_executable (testhdf5_fortran
tHDF5.f90
)
TARGET_NAMING (testhdf5_fortran ${LIB_TYPE})
TARGET_FORTRAN_PROPERTIES (testhdf5_fortran " " " ")
TARGET_FORTRAN_PROPERTIES (testhdf5_fortran ${LIB_TYPE} " " " ")
target_link_libraries (testhdf5_fortran
${HDF5_F90_TEST_LIB_TARGET}
${HDF5_F90_LIB_TARGET}
@ -92,8 +92,12 @@ target_link_libraries (testhdf5_fortran
if (WIN32 AND MSVC)
target_link_libraries (testhdf5_fortran "ws2_32.lib")
endif (WIN32 AND MSVC)
set_target_properties (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran)
set_target_properties (testhdf5_fortran PROPERTIES FOLDER test/fortran)
target_include_directories (testhdf5_fortran PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
set_target_properties (testhdf5_fortran PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}
)
#-- Adding test for testhdf5_fortran_1_8
add_executable (testhdf5_fortran_1_8
@ -105,7 +109,7 @@ add_executable (testhdf5_fortran_1_8
tHDF5_1_8.f90
)
TARGET_NAMING (testhdf5_fortran_1_8 ${LIB_TYPE})
TARGET_FORTRAN_PROPERTIES (testhdf5_fortran_1_8 " " " ")
TARGET_FORTRAN_PROPERTIES (testhdf5_fortran_1_8 ${LIB_TYPE} " " " ")
target_link_libraries (testhdf5_fortran_1_8
${HDF5_F90_TEST_LIB_TARGET}
${HDF5_F90_LIB_TARGET}
@ -114,8 +118,12 @@ target_link_libraries (testhdf5_fortran_1_8
if (WIN32 AND MSVC)
target_link_libraries (testhdf5_fortran_1_8 "ws2_32.lib")
endif (WIN32 AND MSVC)
set_target_properties (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran)
set_target_properties (testhdf5_fortran_1_8 PROPERTIES FOLDER test/fortran)
target_include_directories (testhdf5_fortran_1_8 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
set_target_properties (testhdf5_fortran_1_8 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}
)
#-- Adding test for fortranlib_test_F03
if (HDF5_ENABLE_F2003)
@ -130,7 +138,7 @@ if (HDF5_ENABLE_F2003)
tHDF5_F03.f90
)
TARGET_NAMING (fortranlib_test_F03 ${LIB_TYPE})
TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03 " " " ")
TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03 ${LIB_TYPE} " " " ")
target_link_libraries (fortranlib_test_F03
${HDF5_F90_TEST_LIB_TARGET}
${HDF5_F90_LIB_TARGET}
@ -139,14 +147,18 @@ if (HDF5_ENABLE_F2003)
if (WIN32 AND MSVC)
target_link_libraries (fortranlib_test_F03 "ws2_32.lib")
endif (WIN32 AND MSVC)
set_target_properties (fortranlib_test_F03 PROPERTIES LINKER_LANGUAGE Fortran)
set_target_properties (fortranlib_test_F03 PROPERTIES FOLDER test/fortran)
target_include_directories (fortranlib_test_F03 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
set_target_properties (fortranlib_test_F03 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}
)
endif (HDF5_ENABLE_F2003)
#-- Adding test for fflush1
add_executable (fflush1 fflush1.f90)
TARGET_NAMING (fflush1 ${LIB_TYPE})
TARGET_FORTRAN_PROPERTIES (fflush1 " " " ")
TARGET_FORTRAN_PROPERTIES (fflush1 ${LIB_TYPE} " " " ")
target_link_libraries (fflush1
${HDF5_F90_LIB_TARGET}
${HDF5_F90_TEST_LIB_TARGET}
@ -155,13 +167,17 @@ target_link_libraries (fflush1
if (WIN32 AND MSVC)
target_link_libraries (fflush1 "ws2_32.lib")
endif (WIN32 AND MSVC)
set_target_properties (fflush1 PROPERTIES LINKER_LANGUAGE Fortran)
set_target_properties (fflush1 PROPERTIES FOLDER test/fortran)
target_include_directories (fflush1 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
set_target_properties (fflush1 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}
)
#-- Adding test for fflush2
add_executable (fflush2 fflush2.f90)
TARGET_NAMING (fflush2 ${LIB_TYPE})
TARGET_FORTRAN_PROPERTIES (fflush2 " " " ")
TARGET_FORTRAN_PROPERTIES (fflush2 ${LIB_TYPE} " " " ")
target_link_libraries (fflush2
${HDF5_F90_TEST_LIB_TARGET}
${HDF5_F90_LIB_TARGET}
@ -170,7 +186,11 @@ target_link_libraries (fflush2
if (WIN32 AND MSVC)
target_link_libraries (fflush2 "ws2_32.lib")
endif (WIN32 AND MSVC)
set_target_properties (fflush2 PROPERTIES LINKER_LANGUAGE Fortran)
set_target_properties (fflush2 PROPERTIES FOLDER test/fortran)
target_include_directories (fflush2 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
set_target_properties (fflush2 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}
)
include (CMakeTests.cmake)

View File

@ -89,7 +89,7 @@ PROGRAM fortranlibtest
total_error)
ret_total_error = 0
CALL test_h5s_encode(cleanup, ret_total_error)
CALL test_h5s_encode(ret_total_error)
CALL write_test_status(ret_total_error, &
' Testing dataspace encoding and decoding', &
total_error)
@ -100,6 +100,12 @@ PROGRAM fortranlibtest
' Testing scaleoffset filter', &
total_error)
ret_total_error = 0
CALL test_genprop_basic_class(ret_total_error )
CALL write_test_status(ret_total_error, &
' Testing basic generic property list class creation functionality', &
total_error)
WRITE(*,*)
WRITE(*,*) ' ============================================ '

View File

@ -34,7 +34,7 @@ H5_FCTESTDLL int_f nh5_fixname_c
H5_FCTESTDLL int_f nh5_cleanup_c
(_fcd base_name, size_t_f *base_namelen, hid_t_f *fapl);
H5_FCTESTDLL void nh5_exit_c
H5_FCTESTDLL NORETURN void nh5_exit_c
(int_f *status);
H5_FCTESTDLL void nh5_env_nocleanup_c

View File

@ -129,8 +129,6 @@ CONTAINS
!data buffers
!
INTEGER, DIMENSION(NX,NY) :: data_in
LOGICAL :: differ
!
!Initialize data_in buffer

File diff suppressed because it is too large Load Diff

View File

@ -39,11 +39,11 @@ MODULE test_my_hdf5_error_handler
CONTAINS
!/****************************************************************
!***************************************************************
!**
!** my_hdf5_error_handler: Custom error callback routine.
!**
!****************************************************************/
!***************************************************************
INTEGER FUNCTION my_hdf5_error_handler(estack_id, data_inout) bind(C)
@ -173,10 +173,10 @@ SUBROUTINE test_error(total_error)
!!$#ifdef H5_USE_16_API
!!$ if (old_func != (H5E_auto_t)H5Eprint)
!!$ TEST_ERROR;
!!$#else /* H5_USE_16_API */
!!$#else H5_USE_16_API
!!$ if (old_func != (H5E_auto2_t)H5Eprint2)
!!$ TEST_ERROR;
!!$#endif /* H5_USE_16_API */
!!$#endif H5_USE_16_API
! set the customized error handling routine

View File

@ -141,13 +141,11 @@ CONTAINS
CALL h5fcreate_f(fix_filename1, H5F_ACC_TRUNC_F, file1_id, error)
CALL check("h5fcreate_f",error,total_error)
!
!Create group "/G" inside file "mount1.h5".
!
CALL h5gcreate_f(file1_id, "/G", gid, error)
CALL check("h5gcreate_f",error,total_error)
!
!close file and group identifiers.
!

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More