From 7eca206b7771c11badb957c4fe42c8cc56f746d8 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Mon, 4 May 2015 11:56:57 -0500 Subject: [svn-r27007] Bring revisions #26843:26986 from trunk to revise_chunks. h5committested. --- CMakeInstallation.cmake | 58 ++++--- CMakeLists.txt | 38 +++-- MANIFEST | 4 + bin/cmakehdf5 | 67 +++++++- c++/examples/Makefile.am | 5 +- c++/examples/Makefile.in | 5 +- c++/src/H5File.cpp | 31 ++-- config/cmake/HDF518_Examples.cmake.in | 4 +- config/cmake/hdf5-config.cmake.in | 20 +-- config/cmake/libhdf5.settings.cmake.in | 10 +- config/cmake/scripts/CTestScript.cmake | 282 ++++++++++++++++++++++++++++++++ config/cmake/scripts/HDF518config.cmake | 169 +++++++++++++++++++ fortran/examples/Makefile.am | 1 + fortran/examples/Makefile.in | 1 + fortran/src/H5_f.c | 5 + fortran/src/H5f90global.f90 | 3 + hl/c++/examples/Makefile.am | 1 + hl/c++/examples/Makefile.in | 1 + hl/fortran/examples/Makefile.am | 1 + hl/fortran/examples/Makefile.in | 1 + release_docs/INSTALL_CMake.txt | 213 +++++++++++++++--------- release_docs/INSTALL_parallel | 50 +----- release_docs/RELEASE.txt | 12 ++ release_docs/USING_HDF5_CMake.txt | 4 +- src/CMakeLists.txt | 12 +- src/H5F.c | 8 +- src/H5FDmulti.c | 47 +----- src/H5Fpublic.h | 6 +- src/H5I.c | 65 ++------ src/H5T.c | 170 +++++++++++++++---- test/links.c | 4 - tools/h5ls/h5ls.c | 6 +- tools/h5repack/CMakeTests.cmake | 4 +- 33 files changed, 951 insertions(+), 357 deletions(-) create mode 100755 config/cmake/scripts/CTestScript.cmake create mode 100755 config/cmake/scripts/HDF518config.cmake diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 0380adc..74bf85f 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -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 ) @@ -466,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) @@ -592,24 +604,28 @@ The HDF5 data model, file format, API, library, and tools are open and distribut GROUP Applications INSTALL_TYPES Full Developer User ) - 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 - ) - CPACK_ADD_COMPONENT (hlfortlibraries - DISPLAY_NAME "HDF5 HL Fortran Libraries" - DEPENDS fortlibraries - GROUP Runtime - INSTALL_TYPES Full Developer User - ) + 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) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4135f4..1cacc5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 # @@ -795,6 +813,16 @@ if (BUILD_TESTING) 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") @@ -876,16 +904,6 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") 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" 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") - -#----------------------------------------------------------------------------- # 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. #----------------------------------------------------------------------------- diff --git a/MANIFEST b/MANIFEST index ee8b211..74b14fd 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2616,3 +2616,7 @@ ./tools/misc/CMakeTests.cmake ./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_ diff --git a/bin/cmakehdf5 b/bin/cmakehdf5 index 1f0fb7c..715d6d7 100755 --- a/bin/cmakehdf5 +++ b/bin/cmakehdf5 @@ -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/ @@ -51,6 +52,7 @@ 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 #============= @@ -80,16 +82,14 @@ Usage: $progname [] 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=INC,LIB | --without-zlib: + --with-zlib | --without-zlib: Use zlib library for external deflate I/O filter. Default is on. - INC and LIB are the include and lib directories. - --with-szlib=INC,LIB| --without-szlib: - Use szip library for external szip library I/O filter. Default is off. - INC and LIB are the include and lib directories. --help: shows details help page EOF } @@ -125,6 +125,40 @@ STEP() } +# Install the generated installation image file. Different platform uses +# different image files. +# Linux: HDF5--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 #========== @@ -166,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 ;; @@ -178,6 +218,12 @@ 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 @@ -212,20 +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 \ $with_zlib \ $with_szlib \ - $srcdir" $configlog + $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 @@ -237,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=$? diff --git a/c++/examples/Makefile.am b/c++/examples/Makefile.am index 5bb8d59..2408217 100644 --- a/c++/examples/Makefile.am +++ b/c++/examples/Makefile.am @@ -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) diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index c8d6b18..03bd135 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -627,6 +627,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 # Assume that all tests in this directory are examples, and tell # conclude.am when to build them. @@ -1020,8 +1021,8 @@ help: # 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 # How to build programs using h5c++ diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index fc802d0..84e7827 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -73,9 +73,6 @@ H5File::H5File() : H5Location(), CommonFG(), 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 @@ -133,25 +130,25 @@ 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"); + } } } diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index d767f51..febf20a 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -21,7 +21,7 @@ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_ENABLE_F2003:BOOL=ON") ############################################################################################################### 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") set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) @@ -29,7 +29,7 @@ if(WIN32) 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") set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index da5304d..667d3e6 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -105,20 +105,20 @@ endif () list (REMOVE_DUPLICATES ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS) foreach (comp IN LISTS ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS) set (hdf5_comp2) - if (${comp} MATCHES "C") + if (${comp} STREQUAL "C") set (hdf5_comp "hdf5") - elseif (${comp} MATCHES "CXX") + elseif (${comp} STREQUAL "CXX") set (hdf5_comp "hdf5_cpp") - elseif (${comp} MATCHES "HL") + elseif (${comp} STREQUAL "HL") set (hdf5_comp "hdf5_hl") - elseif (${comp} MATCHES "CXX_HL") + elseif (${comp} STREQUAL "CXX_HL") set (hdf5_comp "hdf5_hl_cpp") - elseif (${comp} MATCHES "Tools") + elseif (${comp} STREQUAL "Tools") set (hdf5_comp "hdf5_tools") - elseif (${comp} MATCHES "Fortran") + elseif (${comp} STREQUAL "Fortran") set (hdf5_comp2 "hdf5_f90cstub") set (hdf5_comp "hdf5_fortran") - elseif (${comp} MATCHES "Fortran_HL") + elseif (${comp} STREQUAL "Fortran_HL") set (hdf5_comp2 "hdf5_hl_f90cstub") set (hdf5_comp "hdf5_hl_fortran") endif () @@ -133,17 +133,15 @@ list (REMOVE_DUPLICATES ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS) else () set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 1) string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_LIBRARY COMP_LIBRARY) - set (${COMP_LIBRARY} ${${COMP_LIBRARY}} ${hdf5_comp2} ${hdf5_comp}) + 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 (${COMP_LIBRARY} ${${COMP_LIBRARY}} ${hdf5_comp}) + set (${HDF5_PACKAGE_NAME}_LIBRARIES ${${HDF5_PACKAGE_NAME}_LIBRARIES} ${hdf5_comp}) endif () endif () endforeach () check_required_components(${HDF5_PACKAGE_NAME}_FIND_COMPONENTS) - -set (${HDF5_PACKAGE_NAME}_LIBRARIES ${${COMP_LIBRARY}}) \ No newline at end of file diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index a036ff8..e2124e1 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -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@ diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake new file mode 100755 index 0000000..0cd686a --- /dev/null +++ b/config/cmake/scripts/CTestScript.cmake @@ -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) +#----------------------------------------------------------------------------- diff --git a/config/cmake/scripts/HDF518config.cmake b/config/cmake/scripts/HDF518config.cmake new file mode 100755 index 0000000..70423a3 --- /dev/null +++ b/config/cmake/scripts/HDF518config.cmake @@ -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() diff --git a/fortran/examples/Makefile.am b/fortran/examples/Makefile.am index feed32c..caaa08c 100644 --- a/fortran/examples/Makefile.am +++ b/fortran/examples/Makefile.am @@ -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 diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index dd2fb46..c894b75 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -639,6 +639,7 @@ FORTRAN_API = yes # 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 # Assume that all tests in this directory are examples, and tell # conclude.am when to build them. diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index a149109..1641989 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -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; diff --git a/fortran/src/H5f90global.f90 b/fortran/src/H5f90global.f90 index ca50e20..0e371f5 100644 --- a/fortran/src/H5f90global.f90 +++ b/fortran/src/H5f90global.f90 @@ -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 diff --git a/hl/c++/examples/Makefile.am b/hl/c++/examples/Makefile.am index c8f0305..7202a96 100644 --- a/hl/c++/examples/Makefile.am +++ b/hl/c++/examples/Makefile.am @@ -36,6 +36,7 @@ CXX_API=yes # Where to install examples # Note: no '/' after DESTDIR. Explanation in commence.am EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/c++ +EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl # How to build programs using h5c++ $(EXTRA_PROG): $(H5CPP) diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index a36886c..5bad31f 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -616,6 +616,7 @@ CXX_API = yes # Where to install examples # Note: no '/' after DESTDIR. Explanation in commence.am EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/c++ +EXAMPLETOPDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl # Assume that all tests in this directory are examples, and tell # conclude.am when to build them. diff --git a/hl/fortran/examples/Makefile.am b/hl/fortran/examples/Makefile.am index 91cb7c5..6a5032b 100644 --- a/hl/fortran/examples/Makefile.am +++ b/hl/fortran/examples/Makefile.am @@ -54,6 +54,7 @@ endif # Tell automake how to install examples # Note: no '/' after DESTDIR. Explanation in commence.am EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/fortran +EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl # List dependencies for each example. Normally, automake would take # care of this for us, but if we tell automake about the programs it diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index c8878d5..e229f12 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -623,6 +623,7 @@ FORTRAN_API = yes # Tell automake how to install examples # Note: no '/' after DESTDIR. Explanation in commence.am EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/fortran +EXAMPLETOPDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl # Assume that all tests in this directory are examples, and tell # conclude.am when to build them. diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index dc87d5a..cb5bae5 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -26,7 +26,7 @@ Obtaining HDF5 source code 2. Obtain compressed (*.tar or *.zip) HDF5 source from http://www.hdfgroup.org/ftp/HDF5/current/src/ and put it in "myhdfstuff". - Do not uncompress. + Uncompress the file. CMake version 1. We suggest you obtain the latest CMake from the Kitware web site. @@ -54,10 +54,7 @@ External compression szip and zlib libraries: ZLib.tar.gz Platform configuration files: - HDF518Windows64CMake.cmake - HDF518Windows32CMake.cmake - HDF518LinuxCMake.cmake - HDF518MacCMake.cmake + HDF518config.cmake To build HDF5 with the SZIP and ZLIB external libraries you will need to: @@ -69,14 +66,23 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to: 3. Download the CTestScript.cmake file to "myhdfstuff". CTestScript.cmake file should not be modified. - 4. Download a platform configuration file to "myhdfstuff". + 4. Download the platform configuration file to "myhdfstuff". Do not modify the file unless you want to change default build environment. 5. From the "myhdfstuff" directory execute the CTest Script with the following options: - ctest -S -C Release -VV -O hdf5.log + On 32-bit Windows with Visual Studio 2012, execute: + ctest -S HDF518config.cmake,32-VS2012 -C Release -VV -O hdf5.log + On 64-bit Windows with Visual Studio 2012, execute: + ctest -S HDF518config.cmake,64-VS2012 -C Release -VV -O hdf5.log + On 32-bit Windows with Visual Studio 2013, execute: + ctest -S HDF518config.cmake,32-VS2012 -C Release -VV -O hdf5.log + On 64-bit Windows with Visual Studio 2013, execute: + ctest -S HDF518config.cmake,64-VS2012 -C Release -VV -O hdf5.log + On Linux and Mac, execute: + ctest -S HDF518config.cmake -C Release -VV -O hdf5.log The command above will configure, build, test, and create an install package in the myhdfstuff/hdf5-1.8/build folder. @@ -94,7 +100,7 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to: 6. To install, "X" is the current release version On Windows, execute: - HDF5-1.8."X"-win32.exe or HDF5-1.8."X"-win64.exe + HDF5-1.8."X"-win32.msi or HDF5-1.8."X"-win64.msi By default this program will install the hdf5 library into the "C:\Program Files" directory and will create the following directory structure: @@ -180,7 +186,7 @@ Notes: This short set of instructions is written for users who want to 9. To install On Windows, execute: - HDF5-1.8."X"-win32.exe or HDF5-1.8."X"-win64.exe + HDF5-1.8."X"-win32.msi or HDF5-1.8."X"-win64.msi By default this program will install the hdf5 library into the "C:\Program Files" directory and will create the following directory structure: @@ -376,12 +382,8 @@ These five steps are described in detail below. set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE) set (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) - set (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE) - set (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) set (HDF5_ENABLE_F2003 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) set (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) @@ -498,7 +500,7 @@ These five steps are described in detail below. 5. Packaging HDF5 (create an install image) - To package the build into a simple installer using the NullSoft installer NSIS + To package the build into a simple installer using WiX toolset or the NullSoft installer NSIS on Windows, or into compressed files (.tar.gz, .sh, .zip), use the CPack tool. To package the build, navigate to your build directory and execute; @@ -506,6 +508,7 @@ These five steps are described in detail below. cpack -C {Debug | Release} CPackConfig.cmake NOTE: See note 8 of this document for NSIS information. + See note 9 of this document for WiX information. Also, if you are using a Visual Studio Express version or do not want to enable the packaging components, set HDF5_NO_PACKAGES to ON (on the command line add -DHDF5_NO_PACKAGES:BOOL=ON) @@ -529,6 +532,9 @@ These five steps are described in detail below. "output directory", which is where the program will be installed. These options are case-sensitive, so be sure to type them in upper case. + 9. WiX Toolset + WiX--the Windows Installer XML toolset--lets developers create installers for + Windows Installer, the Windows installation engine. See http://wixtoolset.org. ======================================================================== @@ -615,37 +621,31 @@ build and test process. VIII. Options for Platform Configuration Files ======================================================================== -Below is the HDF518LinuxCmake.cmake ctest script with extra comments. -The example is for a linux machine, but the same scripts can be used on -a Windows machine by adjusting the CTEST_CMAKE_GENERATOR option in the -platform configuration script. +Below is the HDF518config.cmake ctest script with extra comments. +Execute: + ctest -S HDF518config.cmake -C Release -V -O hdf518.log +The same scripts can be used on Linux, Mac OSX or a Windows machine by +adding an option (${CTEST_SCRIPT_ARG}) to the platform configuration script. -############################################################################ -# Product specific script, HDF518LinuxCmake.cmake, that uses the -# CTestScript.cmake file. Usage: -# "ctest -S HDF518LinuxCmake.cmake -C Release -O hdf518shared.log" -############################################################################ -cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) - -# this is the location of the source hardcoded to hdf5-1.8.13 -set(CTEST_SOURCE_NAME hdf5-1.8.13) -# this is the location of the source with ctest parameter hdf5src -# "ctest -S HDF518LinuxCmake.cmake,hdf5src -C Release -O hdf518static.log" -#set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG}) - -# this is the location of the build directory -set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) +######################################################################### +### 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 ### +######################################################################### -# this is the directory the script is executed from +cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) +set(CTEST_SOURCE_VERSION 1.8.X) +set(CTEST_SOURCE_NAME hdf5-${CTEST_SOURCE_VERSION}) +set(CTEST_BINARY_NAME "build") set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") - -# this is the full path of the source directory -set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") - -# this is the full path of the build directory -set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") - +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] ##### @@ -654,13 +654,41 @@ set(CTEST_BUILD_CONFIGURATION "Release") ################################################################### ######### Following describes compiler ############ -# this is for linux -set(CTEST_CMAKE_GENERATOR "Unix Makefiles") -# this is for windows 32 bit -#set(CTEST_CMAKE_GENERATOR "Visual Studio 11") -# this is for windows 64 bit -#set(CTEST_CMAKE_GENERATOR "Visual Studio 11 Win64") -# Visual Studio 2013 is 12, Visual Studio 2012 is 11, Visual Studio 2010 is 10 +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() ################################################################### ################################################################### @@ -668,25 +696,24 @@ set(CTEST_CMAKE_GENERATOR "Unix Makefiles") ################################################################### set(MODEL "Experimental") ######### Following describes computer ############ -## Set the following to unique id your computer ## -set(CTEST_SITE "LINUX.XXXX") -## following is optional to describe build ## -set(SITE_BUILDNAME_SUFFIX "SHARED") +## following is optional to describe build ## +set(SITE_BUILDNAME_SUFFIX "STATIC") +################################################################### -######### Following controls CDash submission ########## +################################################################### +##### Following controls CDash submission ##### #set(LOCAL_SUBMIT "TRUE") -######### Following controls test process ########## +##### Following controls test process ##### #set(LOCAL_SKIP_TEST "TRUE") #set(LOCAL_MEMCHECK_TEST "TRUE") #set(LOCAL_COVERAGE_TEST "TRUE") -######### Following controls cpack command ########## +##### Following controls cpack command ##### #set(LOCAL_NO_PACKAGE "TRUE") -######### Following controls source update ########## +##### Following controls source update ##### #set(LOCAL_UPDATE "TRUE") -######### Following controls source repository ########## -#set(REPOSITORY_URL "http://svn.${hdfgroup_url}/hdf5/branches/hdf5_1_8") -#comment to use a uncompressed source folder -set(CTEST_USE_TAR_SOURCE "hdf5-1.8.13") +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}") ################################################################### ################################################################### @@ -695,8 +722,8 @@ set(CTEST_USE_TAR_SOURCE "hdf5-1.8.13") ### uncomment/comment and change the following lines for configuration options -### uncomment the following line to build static libraries -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") +### 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 @@ -706,33 +733,65 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING ### 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 #### -### disable Fortran 2003 -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF") -### disable Fortran -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") - -### Create install package with external libraries (szip, zlib) -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") +### 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") +if(APPLE) + ### allow shared builds without fortran on MAC + set(NO_MAC_FORTRAN "TRUE") +endif() ### 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") - -### disable building examples -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_EXAMPLES:BOOL=OFF") - -### disable building tests -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF") +### 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") + ################################################################### -include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) +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(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() ======================================================================== diff --git a/release_docs/INSTALL_parallel b/release_docs/INSTALL_parallel index e4570b7..e4c540c 100644 --- a/release_docs/INSTALL_parallel +++ b/release_docs/INSTALL_parallel @@ -57,45 +57,7 @@ parallel HDF5 with one of the above, just set CC as it and configure. $ make install -2.2. IBM SP ------------ -During the build stage, the H5detect is compiled and executed to generate -the source file H5Tinit.c which is compiled as part of the HDF5 library. In -parallel mode, make sure your environment variables are set correctly to -execute a single process mpi application. Otherwise, multiple processes -attempt to write to the same H5Tinit.c file, resulting in a scrambled -source file. Unfortunately, the setting varies from machine to machine. -E.g., the following works for the IBM SP machine at LLNL. - - setenv MP_PROCS 1 - setenv MP_NODES 1 - setenv MP_LABELIO no - setenv MP_RMPOOL 0 - setenv LLNL_COMPILE_SINGLE_THREADED TRUE # for LLNL site only - -The shared library configuration is problematic. So, only static library -is supported. - -Then do the following steps: - - $ ./configure --enable-parallel --disable-shared --prefix= - $ make # build the library - $ make check # verify the correctness - # Read the Details section about parallel tests. - $ make install - -We also suggest that you add "-qxlf90=autodealloc" to FCFLAGS when building -parallel with fortran enabled. This can be done by invoking: - - setenv FCFLAGS -qxlf90=autodealloc # 32 bit build -or - setenv FCFLAGS "-q64 -qxlf90=autodealloc" # 64 bit build - -prior to running configure. Recall that the "-q64" is necessary for 64 -bit builds. - - -2.3. Linux 2.4 and greater +2.2. Linux 2.4 and greater -------------------------- Be sure that your installation of MPICH was configured with the following configuration command-line option: @@ -106,7 +68,7 @@ This allows for >2GB sized files on Linux systems and is only available with Linux kernels 2.4 and greater. -2.4. Hopper (Cray XE6) (for v1.8 and later) +2.3. Hopper (Cray XE6) (for v1.8 and later) ------------------------- The following steps are for building HDF5 for the Hopper compute @@ -178,14 +140,6 @@ For examples, $ CC=mpcc_r ./configure --enable-parallel $ CC=/usr/local/mpi/bin/mpicc ./configure --enable-parallel -If no such a compiler command is available then you must use your normal -C compiler along with the location(s) of MPI/MPI-IO files to be used. -For example, - - $ CPPFLAGS=-I/usr/local/mpi/include \ - LDFLAGS=-L/usr/local/mpi/lib/LINUX/ch_p4 \ - ./configure --enable-parallel=mpich - If a parallel library is being built then configure attempts to determine how to run a parallel application on one processor and on many processors. If the compiler is `mpicc' and the user hasn't specified values for RUNSERIAL and diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index dbc6018..e4b91cf 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -117,6 +117,18 @@ New Features Library: -------- + - H5F_ACC_DEBUG labeled "deprecated" + + The symbol was originally used to emit some extra debugging + informationi in the multi VFD. The underlying functionality + was removed due to disuse in HDF5 1.8.16 though the symbol + remained defined since it was visible in H5Fpublic.h. + + In this release, the symbol has been labeled deprecated and will + not be defined when H5_NO_DEPRECATED_SYMBOLS is defined. + + (DER - 2015-04-30, HDFFV-1074) + - The library can load filter libraries dynamically during runtime. Users can set the search path through environment variable HDF5_PLUGIN_PATH and call H5Pset_filter to enable a dynamic filter. (SLU - 2013/04/08) diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 347876c..514cced 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -107,7 +107,7 @@ These steps are described in more detail below. is: * BUILD_TESTING:BOOL=ON - * USE_SHARED_LIBS:BOOL=[ON | OFF] + * BUILD_SHARED_LIBS:BOOL=[ON | OFF] 2. Configure the cache settings @@ -131,7 +131,7 @@ These steps are described in more detail below. 2.2 Alternative command line example on Windows in c:\MyHDFstuff\hdf5\build directory: - cmake -G "Visual Studio 11" -DBUILD_TESTING:BOOL=ON -DUSE_SHARED_LIBS:BOOL=ON .. + cmake -G "Visual Studio 11" -DBUILD_TESTING:BOOL=ON .. 3. Build HDF5 Applications diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index de8cc9e..95be3f4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -783,16 +783,8 @@ set (H5_PRIVATE_HEADERS # Setup the H5Detect utility which generates H5Tinit with platform # specific type checks inside #----------------------------------------------------------------------------- -#add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c) -#TARGET_C_PROPERTIES (H5detect STATIC " " " ") -IF (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) - SET (LOCAL_OPT_FLAG "-O0") -ELSE (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) - SET (LOCAL_OPT_FLAG " ") -ENDIF (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) -ADD_EXECUTABLE (H5detect ${HDF5_SRC_DIR}/H5detect.c) -TARGET_C_PROPERTIES (H5detect STATIC ${LOCAL_OPT_FLAG} " ") - +add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c) +TARGET_C_PROPERTIES (H5detect STATIC " " " ") if (MSVC OR MINGW) target_link_libraries (H5detect "ws2_32.lib") endif (MSVC OR MINGW) diff --git a/src/H5F.c b/src/H5F.c index 3056a92..b2d767f 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -484,15 +484,15 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) /* Check/fix arguments */ if(!filename || !*filename) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file name") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file name") /* In this routine, we only accept the following flags: - * H5F_ACC_EXCL, H5F_ACC_TRUNC, H5F_ACC_DEBUG and H5F_ACC_SWMR_WRITE + * H5F_ACC_EXCL, H5F_ACC_TRUNC and H5F_ACC_SWMR_WRITE */ - if(flags & ~(H5F_ACC_EXCL | H5F_ACC_TRUNC | H5F_ACC_DEBUG | H5F_ACC_SWMR_WRITE)) + if(flags & ~(H5F_ACC_EXCL | H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid flags") /* The H5F_ACC_EXCL and H5F_ACC_TRUNC flags are mutually exclusive */ if((flags & H5F_ACC_EXCL) && (flags & H5F_ACC_TRUNC)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "mutually exclusive flags for file creation") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "mutually exclusive flags for file creation") /* Check file creation property list */ if(H5P_DEFAULT == fcpl_id) diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index b1f094c..bc61374 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -30,18 +30,11 @@ /* Disable certain warnings in PC-Lint: */ /*lint --emacro( {534, 830}, H5P_DEFAULT, H5P_FILE_ACCESS, H5P_DATASET_XFER) */ -/*lint --emacro( {534, 830}, H5F_ACC_DEBUG, H5F_ACC_RDWR) */ /*lint --emacro( {534, 830}, H5FD_MULTI) */ /*lint -esym( 534, H5Eclear2, H5Epush2) */ #include "hdf5.h" -/* - * Define H5FD_MULTI_DEBUG if you want the ability to print debugging - * messages to the standard error stream. Messages are only printed if the - * file is opened with the H5F_ACC_DEBUG flag. - */ -#define H5FD_MULTI_DEBUG #ifndef FALSE #define FALSE 0 @@ -796,19 +789,6 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) * files at the end. */ if (map_changed) { -#ifdef H5FD_MULTI_DEBUG - if (file->flags & H5F_ACC_DEBUG) { - fprintf(stderr, "H5FD_MULTI: member map override\n"); - fprintf(stderr, " old value: "); - ALL_MEMBERS(mt) { - fprintf(stderr, "%s%d", mt?", ":"", (int)(file->fa.memb_map[mt])); - } END_MEMBERS; - fprintf(stderr, "\n new value: "); - ALL_MEMBERS(mt) { - fprintf(stderr, "%s%d", mt?", ":"", (int)(map[mt])); - } END_MEMBERS; - } -#endif /* Commit map */ ALL_MEMBERS(mt) { file->fa.memb_map[mt] = map[mt]; @@ -821,11 +801,6 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) } END_MEMBERS; ALL_MEMBERS(mt) { if (!in_use[mt] && file->memb[mt]) { -#ifdef H5FD_MULTI_DEBUG - if (file->flags & H5F_ACC_DEBUG) { - fprintf(stderr, "H5FD_MULTI: close member %d\n", (int)mt); - } -#endif (void)H5FDclose(file->memb[mt]); file->memb[mt] = NULL; } @@ -1109,20 +1084,10 @@ H5FD_multi_close(H5FD_t *_file) /* Close as many members as possible */ ALL_MEMBERS(mt) { if (file->memb[mt]) { -#ifdef H5FD_MULTI_DEBUG - if (file->flags & H5F_ACC_DEBUG) { - fprintf(stderr, "H5FD_MULTI: closing member %d\n", (int)mt); - } -#endif if (H5FDclose(file->memb[mt])<0) { -#ifdef H5FD_MULTI_DEBUG - if (file->flags & H5F_ACC_DEBUG) { - fprintf(stderr, "H5FD_MULTI: close failed\n"); - } -#endif - nerrors++; + nerrors++; } else { - file->memb[mt] = NULL; + file->memb[mt] = NULL; } } } END_MEMBERS; @@ -1895,18 +1860,10 @@ open_members(H5FD_multi_t *file) */ sprintf(tmp, file->fa.memb_name[mt], file->name); -#ifdef H5FD_MULTI_DEBUG - if(file->flags & H5F_ACC_DEBUG) - fprintf(stderr, "H5FD_MULTI: open member %d \"%s\"\n", (int)mt, tmp); -#endif H5E_BEGIN_TRY { file->memb[mt] = H5FDopen(tmp, file->flags, file->fa.memb_fapl[mt], HADDR_UNDEF); } H5E_END_TRY; if(!file->memb[mt]) { -#ifdef H5FD_MULTI_DEBUG - if(file->flags & H5F_ACC_DEBUG) - fprintf(stderr, "H5FD_MULTI: open failed for member %d\n", (int)mt); -#endif if(!file->fa.relax || (file->flags & H5F_ACC_RDWR)) nerrors++; } diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index b0907e0..6686bcf 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -41,12 +41,14 @@ * We're assuming that these constants are used rather early in the hdf5 * session. * + * Note that H5F_ACC_DEBUG is deprecated (nonfuncational) but retained as a + * symbol for backward compatibility. */ #define H5F_ACC_RDONLY (H5CHECK 0x0000u) /*absence of rdwr => rd-only */ #define H5F_ACC_RDWR (H5CHECK 0x0001u) /*open for read and write */ #define H5F_ACC_TRUNC (H5CHECK 0x0002u) /*overwrite existing files */ #define H5F_ACC_EXCL (H5CHECK 0x0004u) /*fail if file already exists*/ -#define H5F_ACC_DEBUG (H5CHECK 0x0008u) /*print debug info */ +/* NOTE: 0x0008u was H5F_ACC_DEBUG, now deprecated */ #define H5F_ACC_CREAT (H5CHECK 0x0010u) /*create non-existing files */ #define H5F_ACC_SWMR_WRITE (H5CHECK 0x0020u) /*indicate that this file is * open for writing in a @@ -238,7 +240,7 @@ H5_DLL herr_t H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag); #ifndef H5_NO_DEPRECATED_SYMBOLS /* Macros */ - +#define H5F_ACC_DEBUG (H5CHECK 0x0000u) /*print debug info (deprecated)*/ /* Typedefs */ diff --git a/src/H5I.c b/src/H5I.c index a6d12c1..4924e5f 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -593,15 +593,9 @@ H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref) /* Check if we should delete this node or not */ if(delete_node) { - /* Decrement the number of IDs in the type */ - (type_ptr->id_count)--; - - /* Remove the node from the list */ - if(NULL == H5SL_remove(type_ptr->ids, &cur->id)) - HGOTO_ERROR(H5E_ATOM, H5E_CANTDELETE, FAIL, "can't remove ID node from skip list") - - /* Free the node */ - cur = H5FL_FREE(H5I_id_info_t, cur); + /* Remove the node from the type */ + if(NULL == H5I__remove_common(type_ptr, cur->id)) + HGOTO_ERROR(H5E_ATOM, H5E_CANTDELETE, FAIL, "can't remove ID node") } /* end if */ } /* end for */ @@ -1277,8 +1271,6 @@ done: int H5I_dec_ref(hid_t id) { - H5I_type_t type; /*type the object is in*/ - H5I_id_type_t *type_ptr; /*ptr to the type */ H5I_id_info_t *id_ptr; /*ptr to the new ID */ int ret_value; /* Return value */ @@ -1287,17 +1279,9 @@ H5I_dec_ref(hid_t id) /* Sanity check */ HDassert(id >= 0); - /* Check arguments */ - type = H5I_TYPE(id); - if(type <= H5I_BADID || type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") - type_ptr = H5I_id_type_list_g[type]; - if(NULL == type_ptr || type_ptr->init_count <= 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") - /* General lookup of the ID */ - if(NULL == (id_ptr = (H5I_id_info_t *)H5SL_search(type_ptr->ids, &id))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID") + if(NULL == (id_ptr = H5I__find_id(id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID") /* * If this is the last reference to the object then invoke the type's @@ -1315,6 +1299,11 @@ H5I_dec_ref(hid_t id) * file. We have to close the dataset anyway. (SLU - 2010/9/7) */ if(1 == id_ptr->count) { + H5I_id_type_t *type_ptr; /*ptr to the type */ + + /* Get the ID's type */ + type_ptr = H5I_id_type_list_g[H5I_TYPE(id)]; + /* (Casting away const OK -QAK) */ if(!type_ptr->cls->free_func || (type_ptr->cls->free_func)((void *)id_ptr->obj_ptr) >= 0) { /* Remove the node from the type */ @@ -1478,8 +1467,6 @@ done: int H5I_inc_ref(hid_t id, hbool_t app_ref) { - H5I_type_t type; /*type the object is in*/ - H5I_id_type_t *type_ptr; /*ptr to the type */ H5I_id_info_t *id_ptr; /*ptr to the ID */ int ret_value; /* Return value */ @@ -1488,16 +1475,8 @@ H5I_inc_ref(hid_t id, hbool_t app_ref) /* Sanity check */ HDassert(id >= 0); - /* Check arguments */ - type = H5I_TYPE(id); - if(type <= H5I_BADID || type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") - type_ptr = H5I_id_type_list_g[type]; - if(!type_ptr || type_ptr->init_count <= 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") - /* General lookup of the ID */ - if(NULL == (id_ptr = (H5I_id_info_t *)H5SL_search(type_ptr->ids, &id))) + if(NULL == (id_ptr = H5I__find_id(id))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID") /* Adjust reference counts */ @@ -1563,8 +1542,6 @@ done: int H5I_get_ref(hid_t id, hbool_t app_ref) { - H5I_type_t type; /*type the object is in*/ - H5I_id_type_t *type_ptr; /*ptr to the type */ H5I_id_info_t *id_ptr; /*ptr to the ID */ int ret_value; /* Return value */ @@ -1573,16 +1550,8 @@ H5I_get_ref(hid_t id, hbool_t app_ref) /* Sanity check */ HDassert(id >= 0); - /* Check arguments */ - type = H5I_TYPE(id); - if(type <= H5I_BADID || type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") - type_ptr = H5I_id_type_list_g[type]; - if(!type_ptr || type_ptr->init_count <= 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") - /* General lookup of the ID */ - if(NULL == (id_ptr = (H5I_id_info_t *)H5SL_search(type_ptr->ids, &id))) + if(NULL == (id_ptr = H5I__find_id(id))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID") /* Set return value */ @@ -2085,20 +2054,20 @@ done: static H5I_id_info_t * H5I__find_id(hid_t id) { - H5I_id_type_t *type_ptr; /*ptr to the type */ H5I_type_t type; /*ID's type */ + H5I_id_type_t *type_ptr; /*ptr to the type */ H5I_id_info_t *ret_value; /*return value */ FUNC_ENTER_STATIC_NOERR /* Check arguments */ type = H5I_TYPE(id); - if (type <= H5I_BADID || type >= H5I_next_type) - HGOTO_DONE(NULL); + if(type <= H5I_BADID || type >= H5I_next_type) + HGOTO_DONE(NULL) type_ptr = H5I_id_type_list_g[type]; - if (!type_ptr || type_ptr->init_count <= 0) - HGOTO_DONE(NULL); + if(!type_ptr || type_ptr->init_count <= 0) + HGOTO_DONE(NULL) /* Locate the ID node for the ID */ ret_value = (H5I_id_info_t *)H5SL_search(type_ptr->ids, &id); diff --git a/src/H5T.c b/src/H5T.c index fa3ad8e..2a5816f 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -1,3 +1,4 @@ + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * @@ -67,10 +68,6 @@ * */ -/* Define the code template for types which need no extra initialization for the "GUTS" in the H5T_INIT_TYPE macro */ -#define H5T_INIT_TYPE_NONE_CORE { \ -} - /* Define the code template for bitfields for the "GUTS" in the H5T_INIT_TYPE macro */ #define H5T_INIT_TYPE_BITFIELD_CORE { \ dt->shared->type = H5T_BITFIELD; \ @@ -1986,7 +1983,7 @@ H5T_detect_class(const H5T_t *dt, H5T_class_t cls, hbool_t from_api) case H5T_VLEN: case H5T_ENUM: HGOTO_DONE(H5T_detect_class(dt->shared->parent, cls, from_api)); - + break; case H5T_NO_CLASS: case H5T_INTEGER: case H5T_FLOAT: @@ -3211,7 +3208,7 @@ H5T_copy(H5T_t *old_dt, H5T_copy_t method) switch(new_dt->shared->type) { case H5T_COMPOUND: { - int accum_change = 0; /* Amount of change in the offset of the fields */ + ssize_t accum_change = 0; /* Amount of change in the offset of the fields */ /* * Copy all member fields to new type, then overwrite the @@ -3239,13 +3236,17 @@ H5T_copy(H5T_t *old_dt, H5T_copy_t method) new_dt->shared->u.compnd.memb[i].type = tmp; HDassert(tmp != NULL); + /* Range check against compound member's offset */ + if ((accum_change < 0) && ((ssize_t) new_dt->shared->u.compnd.memb[i].offset < accum_change)) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, NULL, "invalid field size in datatype"); + /* Apply the accumulated size change to the offset of the field */ - new_dt->shared->u.compnd.memb[i].offset += accum_change; + new_dt->shared->u.compnd.memb[i].offset += (size_t) accum_change; if(old_dt->shared->u.compnd.sorted != H5T_SORT_VALUE) { for(old_match = -1, j = 0; j < old_dt->shared->u.compnd.nmembs; j++) { if(!HDstrcmp(new_dt->shared->u.compnd.memb[i].name, old_dt->shared->u.compnd.memb[j].name)) { - old_match = j; + old_match = (int) j; break; } /* end if */ } /* end for */ @@ -3255,20 +3256,23 @@ H5T_copy(H5T_t *old_dt, H5T_copy_t method) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "fields in datatype corrupted"); } /* end if */ else - old_match = i; + old_match = (int) i; /* If the field changed size, add that change to the accumulated size change */ if(new_dt->shared->u.compnd.memb[i].type->shared->size != old_dt->shared->u.compnd.memb[old_match].type->shared->size) { /* Adjust the size of the member */ new_dt->shared->u.compnd.memb[i].size = (old_dt->shared->u.compnd.memb[old_match].size*tmp->shared->size)/old_dt->shared->u.compnd.memb[old_match].type->shared->size; - accum_change += (new_dt->shared->u.compnd.memb[i].type->shared->size - old_dt->shared->u.compnd.memb[old_match].type->shared->size); + accum_change += (ssize_t) (new_dt->shared->u.compnd.memb[i].type->shared->size - old_dt->shared->u.compnd.memb[old_match].type->shared->size); } /* end if */ } /* end for */ - /* Apply the accumulated size change to the size of the compound struct */ - new_dt->shared->size += accum_change; + /* Range check against datatype size */ + if ((accum_change < 0) && ((ssize_t) new_dt->shared->size < accum_change)) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, NULL, "invalid field size in datatype"); + /* Apply the accumulated size change to the size of the compound struct */ + new_dt->shared->size += (size_t) accum_change; } break; @@ -3313,6 +3317,13 @@ H5T_copy(H5T_t *old_dt, H5T_copy_t method) new_dt->shared->size=new_dt->shared->u.array.nelem*new_dt->shared->parent->shared->size; break; + case H5T_NO_CLASS: + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_NCLASSES: default: break; } /* end switch */ @@ -3530,6 +3541,16 @@ H5T__free(H5T_t *dt) H5MM_xfree(dt->shared->u.opaque.tag); break; + case H5T_NO_CLASS: + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_REFERENCE: + case H5T_VLEN: + case H5T_ARRAY: + case H5T_NCLASSES: default: break; } /* end switch */ @@ -3796,11 +3817,14 @@ H5T_set_size(H5T_t *dt, size_t size) case H5T_ARRAY: case H5T_REFERENCE: HDassert("can't happen" && 0); + break; case H5T_NO_CLASS: case H5T_NCLASSES: HDassert("invalid type" && 0); + break; default: HDassert("not implemented yet" && 0); + break; } /* Commit (if we didn't convert this type to a VL string) */ @@ -3875,7 +3899,6 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) unsigned *idx1 = NULL, *idx2 = NULL; size_t base_size; hbool_t swapped; - int i, j; unsigned u; int tmp; int ret_value = 0; @@ -3930,24 +3953,32 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) for(u = 0; u < dt1->shared->u.compnd.nmembs; u++) idx1[u] = idx2[u] = u; if(dt1->shared->u.enumer.nmembs > 1) { - for(i = dt1->shared->u.compnd.nmembs - 1, swapped = TRUE; swapped && i >= 0; --i) + int i; + + for(i = (int) dt1->shared->u.compnd.nmembs - 1, swapped = TRUE; swapped && i >= 0; --i) { + int j; + for(j = 0, swapped=FALSE; j < i; j++) if(HDstrcmp(dt1->shared->u.compnd.memb[idx1[j]].name, dt1->shared->u.compnd.memb[idx1[j + 1]].name) > 0) { - tmp = idx1[j]; + unsigned tmp_idx = idx1[j]; idx1[j] = idx1[j + 1]; - idx1[j + 1] = tmp; + idx1[j + 1] = tmp_idx; swapped = TRUE; } - for(i = dt2->shared->u.compnd.nmembs - 1, swapped = TRUE; swapped && i >= 0; --i) + } + for(i = (int) dt2->shared->u.compnd.nmembs - 1, swapped = TRUE; swapped && i >= 0; --i) { + int j; + for(j = 0, swapped = FALSE; jshared->u.compnd.memb[idx2[j]].name, dt2->shared->u.compnd.memb[idx2[j + 1]].name) > 0) { - tmp = idx2[j]; + unsigned tmp_idx = idx2[j]; idx2[j] = idx2[j + 1]; - idx2[j + 1] = tmp; + idx2[j + 1] = tmp_idx; swapped = TRUE; } + } } /* end if */ #ifdef H5T_DEBUG @@ -4007,28 +4038,39 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed"); for (u=0; ushared->u.enumer.nmembs; u++) idx1[u] = u; - if(dt1->shared->u.enumer.nmembs > 1) - for (i=dt1->shared->u.enumer.nmembs-1, swapped=TRUE; swapped && i>=0; --i) - for (j=0, swapped=FALSE; jshared->u.enumer.nmembs > 1) { + int i; + for (i = (int) dt1->shared->u.enumer.nmembs - 1, swapped = TRUE; swapped && i >= 0; --i) { + int j; + + for (j = 0, swapped = FALSE; j < i; j++) if (HDstrcmp(dt1->shared->u.enumer.name[idx1[j]], dt1->shared->u.enumer.name[idx1[j+1]]) > 0) { - tmp = idx1[j]; + unsigned tmp_idx = idx1[j]; idx1[j] = idx1[j+1]; - idx1[j+1] = tmp; + idx1[j+1] = tmp_idx; swapped = TRUE; } + } + } for (u=0; ushared->u.enumer.nmembs; u++) idx2[u] = u; - if(dt2->shared->u.enumer.nmembs > 1) - for (i=dt2->shared->u.enumer.nmembs-1, swapped=TRUE; swapped && i>=0; --i) - for (j=0, swapped=FALSE; jshared->u.enumer.nmembs > 1) { + int i; + + for (i = (int) dt2->shared->u.enumer.nmembs - 1, swapped = TRUE; swapped && i >= 0; --i) { + int j; + + for (j = 0, swapped = FALSE; j < i; j++) if (HDstrcmp(dt2->shared->u.enumer.name[idx2[j]], dt2->shared->u.enumer.name[idx2[j+1]]) > 0) { - tmp = idx2[j]; + unsigned tmp_idx = idx2[j]; idx2[j] = idx2[j+1]; - idx2[j+1] = tmp; + idx2[j+1] = tmp_idx; swapped = TRUE; } + } + } #ifdef H5T_DEBUG /* I don't quite trust the code above yet :-) --RPM */ @@ -4148,6 +4190,14 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) HGOTO_DONE(1); break; + case H5T_NO_CLASS: + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_REFERENCE: + case H5T_NCLASSES: default: /* * Atomic datatypes... @@ -4255,13 +4305,23 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) case H5R_BADTYPE: case H5R_MAXTYPE: HDassert("invalid type" && 0); + break; default: HDassert("not implemented yet" && 0); + break; } break; + case H5T_NO_CLASS: + case H5T_OPAQUE: + case H5T_COMPOUND: + case H5T_ENUM: + case H5T_VLEN: + case H5T_ARRAY: + case H5T_NCLASSES: default: HDassert("not implemented yet" && 0); + break; } break; } /* end switch */ @@ -4535,7 +4595,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, } /* end if */ if(cmp > 0) md++; - HDmemmove(H5T_g.path + md + 1, H5T_g.path + md, (H5T_g.npaths - md) * sizeof(H5T_path_t*)); + HDmemmove(H5T_g.path + md + 1, H5T_g.path + md, (size_t) (H5T_g.npaths - md) * sizeof(H5T_path_t*)); H5T_g.npaths++; H5T_g.path[md] = path; table = path; @@ -5000,6 +5060,17 @@ H5T_is_sensible(const H5T_t *dt) ret_value=FALSE; break; + case H5T_NO_CLASS: + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_REFERENCE: + case H5T_VLEN: + case H5T_ARRAY: + case H5T_NCLASSES: default: /* Assume all other datatype are sensible to store on disk */ ret_value=TRUE; @@ -5041,7 +5112,6 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) htri_t changed; /* Whether H5T_set_loc changed the type (even if the size didn't change) */ htri_t ret_value = 0; /* Indicate that success, but no location change */ unsigned i; /* Local index variable */ - int accum_change; /* Amount of change in the offset of the fields */ size_t old_size; /* Previous size of a field */ FUNC_ENTER_NOAPI(FAIL) @@ -5075,14 +5145,21 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) break; case H5T_COMPOUND: /* Check each field and recurse on VL, compound and array type */ + { + ssize_t accum_change = 0; /* Amount of change in the offset of the fields */ + /* Sort the fields based on offsets */ H5T__sort_value(dt, NULL); - for (i=0,accum_change=0; ishared->u.compnd.nmembs; i++) { + for (i=0; ishared->u.compnd.nmembs; i++) { H5T_t *memb_type; /* Member's datatype pointer */ + /* Range check against compound member's offset */ + if ((accum_change < 0) && ((ssize_t) dt->shared->u.compnd.memb[i].offset < accum_change)) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "invalid field size in datatype"); + /* Apply the accumulated size change to the offset of the field */ - dt->shared->u.compnd.memb[i].offset += accum_change; + dt->shared->u.compnd.memb[i].offset += (size_t) accum_change; /* Set the member type pointer (for convenience) */ memb_type=dt->shared->u.compnd.memb[i].type; @@ -5105,13 +5182,18 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) dt->shared->u.compnd.memb[i].size = (dt->shared->u.compnd.memb[i].size*memb_type->shared->size)/old_size; /* Add that change to the accumulated size change */ - accum_change += (memb_type->shared->size - (int)old_size); + accum_change += (ssize_t) (memb_type->shared->size - old_size); } /* end if */ } /* end if */ } /* end for */ + /* Range check against datatype size */ + if ((accum_change < 0) && ((ssize_t) dt->shared->size < accum_change)) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "invalid field size in datatype"); + /* Apply the accumulated size change to the datatype */ - dt->shared->size = (size_t)(dt->shared->size + accum_change); + dt->shared->size += (size_t) accum_change; + } break; case H5T_VLEN: /* Recurse on the VL information if it's VL, compound or array, then free VL sequence */ @@ -5145,6 +5227,15 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) } /* end if */ break; + case H5T_NO_CLASS: + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_ENUM: + case H5T_NCLASSES: default: break; } /* end switch */ @@ -5235,6 +5326,15 @@ H5T_upgrade_version_cb(H5T_t *dt, void *op_value) dt->shared->version = dt->shared->parent->shared->version; break; + case H5T_NO_CLASS: + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_REFERENCE: + case H5T_NCLASSES: default: break; } /* end switch */ diff --git a/test/links.c b/test/links.c index d02181e..27e0676 100644 --- a/test/links.c +++ b/test/links.c @@ -4023,10 +4023,6 @@ external_set_elink_acc_flags(hid_t fapl, hbool_t new_format) } H5E_END_TRY; if(ret != FAIL) TEST_ERROR H5E_BEGIN_TRY { - ret = H5Pset_elink_acc_flags(gapl, H5F_ACC_DEBUG); - } H5E_END_TRY; - if(ret != FAIL) TEST_ERROR - H5E_BEGIN_TRY { ret = H5Pset_elink_acc_flags(gapl, H5F_ACC_CREAT); } H5E_END_TRY; if(ret != FAIL) TEST_ERROR diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 263dead..62e4d00 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -1856,17 +1856,17 @@ dataset_list2(hid_t dset, const char UNUSED *name) for (i=0, total=0; i