From df1a4af96126682ea4a05c2b26bf6b7c916579ff Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Sun, 21 Feb 2021 22:05:43 -0600 Subject: HDF5 1 8 merge of recent changes and tools (#353) * Update supported platforms * Merge PR#3 changes from develop * # WARNING: head commit changed in the meantime Merge gcc 10 diagnostics option from develop Merge CMake changes from develop Merge warnings from develop Merge #318 OSX changes from develop Merge tools changes from develop Merge test macros from develop * Format updates * Fix missing semicolon and format fix * Format update * Correct actions, remove java option * Update autotools build files * Add testfiles * Fix configure issue with make flags * Init fapls to default * Update generated files and fix h5repack id closure * update format --- .github/workflows/clang-format-check.yml | 2 +- .github/workflows/main.yml | 77 +- .github/workflows/pr-check.yml | 78 +- CMakeFilters.cmake | 28 +- CMakeLists.txt | 87 +- CTestConfig.cmake | 2 +- MANIFEST | 18 +- Makefile.am | 10 +- Makefile.in | 43 +- bin/Makefile.in | 35 +- bin/genparser | 7 +- c++/Makefile.in | 35 +- c++/examples/Makefile.in | 39 +- c++/src/CMakeLists.txt | 2 +- c++/src/Makefile.in | 35 +- c++/test/Makefile.in | 35 +- config/cce-fflags | 19 +- config/cce-flags | 24 +- config/clang-cxxflags | 1 + config/clang-flags | 15 +- config/clang-warnings/noerror-general | 80 + config/cmake/ConfigureChecks.cmake | 23 +- config/cmake/H5pubconf.h.in | 29 +- config/cmake/HDF5PluginMacros.cmake | 10 +- config/cmake/HDF5UseFortran.cmake | 44 +- config/cmake/HDF5_Examples_options.cmake | 2 + config/cmake/HDFCXXCompilerFlags.cmake | 34 +- config/cmake/HDFCompilerFlags.cmake | 57 +- config/cmake/HDFFortranCompilerFlags.cmake | 16 +- config/cmake/fileCompareTest.cmake | 27 +- config/cmake/libhdf5.pc.in | 14 - config/cmake_ext_mod/ConfigureChecks.cmake | 75 +- config/cmake_ext_mod/FindSZIP.cmake | 4 +- config/cmake_ext_mod/HDFMacros.cmake | 10 +- config/cmake_ext_mod/HDFUseCXX.cmake | 12 +- config/cmake_ext_mod/HDFUseFortran.cmake | 16 +- config/cmake_ext_mod/grepTest.cmake | 10 +- config/commence.am | 31 +- config/conclude.am | 6 +- config/examples.am | 6 +- config/freebsd | 32 +- config/gnu-cxxflags | 20 +- config/gnu-fflags | 13 +- config/gnu-flags | 34 +- config/gnu-warnings/4.8 | 4 + config/gnu-warnings/7 | 1 - config/gnu-warnings/9.3 | 1 + config/gnu-warnings/cxx-4.8 | 26 + config/gnu-warnings/cxx-noerror-5 | 11 + config/gnu-warnings/cxx-noerror-general | 32 + config/gnu-warnings/developer-10 | 6 + config/gnu-warnings/developer-4.8 | 1 - config/gnu-warnings/error-general | 7 +- config/gnu-warnings/no-developer-4.8 | 1 - config/gnu-warnings/noerror-5 | 12 + config/gnu-warnings/noerror-8 | 25 + config/gnu-warnings/noerror-general | 91 + config/ibm-aix | 49 +- config/ibm-flags | 28 +- config/libhdf5.pc.in | 14 + config/linux-gnulibc1 | 22 +- config/pgi-fflags | 20 +- config/pgi-flags | 42 +- config/solaris | 107 +- configure | 316 ++- configure.ac | 323 ++- examples/Makefile.in | 39 +- fortran/Makefile.in | 35 +- fortran/examples/Makefile.in | 39 +- fortran/src/CMakeLists.txt | 2 +- fortran/src/Makefile.in | 35 +- fortran/test/Makefile.in | 35 +- fortran/testpar/Makefile.in | 35 +- hl/Makefile.in | 35 +- hl/c++/Makefile.in | 35 +- hl/c++/examples/Makefile.in | 39 +- hl/c++/src/CMakeLists.txt | 2 +- hl/c++/src/Makefile.in | 35 +- hl/c++/test/Makefile.in | 35 +- hl/examples/Makefile.in | 39 +- hl/examples/ex_ds1.c | 4 +- hl/fortran/Makefile.in | 35 +- hl/fortran/examples/Makefile.in | 39 +- hl/fortran/src/CMakeLists.txt | 6 +- hl/fortran/src/Makefile.in | 35 +- hl/fortran/test/Makefile.in | 35 +- hl/src/CMakeLists.txt | 2 +- hl/src/H5LTanalyze.c | 4 +- hl/src/H5LTparse.c | 4 +- hl/src/Makefile.in | 35 +- hl/test/Makefile.in | 35 +- hl/test/h5hltest.h | 2 +- hl/test/test_ds.c | 2 - hl/test/test_file_image.c | 2 +- hl/test/test_image.c | 4 - hl/test/test_lite.c | 2 - hl/test/test_packet.c | 2 - hl/test/test_table.c | 2 - hl/tools/Makefile.in | 35 +- hl/tools/gif2h5/Makefile.in | 35 +- release_docs/RELEASE.txt | 208 +- src/CMakeLists.txt | 7 +- src/H5Edefin.h | 208 +- src/H5Einit.h | 644 ++--- src/H5Epubgen.h | 380 +-- src/H5Eterm.h | 208 +- src/H5Ofill.c | 84 +- src/H5Olayout.c | 60 +- src/H5Spkg.h | 17 +- src/H5Spoint.c | 32 +- src/H5private.h | 8 + src/H5public.h | 10 +- src/Makefile.in | 35 +- test/H5srcdir.h | 2 +- test/Makefile.in | 35 +- test/dtransform.c | 12 +- test/fheap.c | 194 +- test/flush2.c | 4 +- test/freespace.c | 44 +- test/getname.c | 28 +- test/h5test.h | 64 +- test/hdfs.c | 38 +- test/hyperslab.c | 16 +- test/mf.c | 90 +- test/testframe.c | 2 +- testpar/Makefile.in | 35 +- testpar/t_init_term.c | 2 +- testpar/t_pflush2.c | 4 +- testpar/t_prestart.c | 2 +- testpar/t_pshutdown.c | 2 +- tools/Makefile.in | 35 +- tools/h5copy/Makefile.in | 35 +- tools/h5copy/h5copy.c | 26 +- tools/h5diff/CMakeTests.cmake | 41 +- tools/h5diff/Makefile.in | 35 +- tools/h5diff/h5diff_common.c | 330 ++- tools/h5diff/h5diff_main.c | 38 +- tools/h5diff/h5diffgentest.c | 154 +- tools/h5diff/ph5diff_main.c | 2 +- tools/h5diff/testfiles/diff_strings1.h5 | Bin 4464 -> 0 bytes tools/h5diff/testfiles/diff_strings2.h5 | Bin 4464 -> 0 bytes tools/h5diff/testfiles/h5diff_10.txt | 15 +- tools/h5diff/testfiles/h5diff_58.txt | 4 + tools/h5diff/testfiles/h5diff_600.txt | 15 +- tools/h5diff/testfiles/h5diff_603.txt | 15 +- tools/h5diff/testfiles/h5diff_606.txt | 15 +- tools/h5diff/testfiles/h5diff_612.txt | 15 +- tools/h5diff/testfiles/h5diff_615.txt | 15 +- tools/h5diff/testfiles/h5diff_621.txt | 15 +- tools/h5diff/testfiles/h5diff_622.txt | 15 +- tools/h5diff/testfiles/h5diff_623.txt | 15 +- tools/h5diff/testfiles/h5diff_624.txt | 15 +- tools/h5diff/testfiles/h5diff_70.txt | 32 + tools/h5diff/testfiles/h5diff_700.txt | 32 + tools/h5diff/testfiles/h5diff_701.txt | 32 + tools/h5diff/testfiles/h5diff_702.txt | 32 + tools/h5diff/testfiles/h5diff_703.txt | 32 + tools/h5diff/testfiles/h5diff_80.txt | 64 +- tools/h5diff/testfiles/h5diff_eps.txt | 17 + tools/h5diff/testfiles/h5diff_eps1.h5 | Bin 0 -> 2272 bytes tools/h5diff/testfiles/h5diff_eps2.h5 | Bin 0 -> 2272 bytes tools/h5diff/testfiles/h5diff_strings1.h5 | Bin 0 -> 4640 bytes tools/h5diff/testfiles/h5diff_strings2.h5 | Bin 0 -> 4640 bytes tools/h5diff/testh5diff.sh.in | 63 +- tools/h5dump/CMakeLists.txt | 2 +- tools/h5dump/Makefile.am | 7 +- tools/h5dump/Makefile.in | 42 +- tools/h5dump/h5dump.c | 504 ++-- tools/h5dump/h5dump.h | 47 +- tools/h5dump/h5dump_ddl.c | 54 +- tools/h5dump/h5dump_extern.h | 39 +- tools/h5dump/h5dump_xml.c | 52 +- tools/h5dump/h5dumpgentest.c | 63 +- tools/h5import/Makefile.in | 35 +- tools/h5import/h5import.c | 57 +- tools/h5jam/Makefile.in | 35 +- tools/h5jam/h5jam.c | 120 +- tools/h5jam/h5unjam.c | 36 +- tools/h5jam/tellub.c | 56 +- tools/h5ls/Makefile.in | 35 +- tools/h5ls/h5ls.c | 376 +-- tools/h5repack/Makefile.in | 35 +- tools/h5repack/h5repack.c | 17 +- tools/h5repack/h5repack.h | 26 +- tools/h5repack/h5repack_copy.c | 152 +- tools/h5repack/h5repack_main.c | 82 +- tools/h5repack/h5repack_parse.c | 2 +- tools/h5repack/h5repack_verify.c | 8 +- tools/h5repack/h5repacktst.c | 544 ++-- tools/h5repack/testfiles/h5repack-help.txt | 4 + tools/h5stat/Makefile.in | 35 +- tools/h5stat/h5stat.c | 214 +- tools/lib/Makefile.in | 35 +- tools/lib/h5diff.c | 164 +- tools/lib/h5diff.h | 85 +- tools/lib/h5diff_array.c | 4246 ++++++++++------------------ tools/lib/h5diff_attr.c | 172 +- tools/lib/h5diff_dset.c | 713 +++-- tools/lib/h5tools.c | 578 ++-- tools/lib/h5tools.h | 81 +- tools/lib/h5tools_dump.c | 278 +- tools/lib/h5tools_dump.h | 29 +- tools/lib/h5tools_error.h | 12 +- tools/lib/h5tools_str.c | 130 +- tools/lib/h5tools_str.h | 7 +- tools/lib/h5tools_utils.c | 291 +- tools/lib/h5tools_utils.h | 11 +- tools/lib/io_timer.c | 1 - tools/libtest/Makefile.am | 11 +- tools/libtest/Makefile.in | 151 +- tools/libtest/h5tools_test_utils.c | 1 + tools/misc/Makefile.in | 35 +- tools/misc/h5mkgrp.c | 188 +- tools/misc/h5repart.c | 2 +- tools/misc/testfiles/h5mkgrp_help.txt | 1 + tools/perform/Makefile.in | 35 +- 216 files changed, 8768 insertions(+), 7893 deletions(-) create mode 100644 config/clang-warnings/noerror-general delete mode 100644 config/cmake/libhdf5.pc.in create mode 100644 config/gnu-warnings/9.3 create mode 100644 config/gnu-warnings/cxx-4.8 create mode 100644 config/gnu-warnings/cxx-noerror-5 create mode 100644 config/gnu-warnings/cxx-noerror-general create mode 100644 config/gnu-warnings/developer-10 create mode 100644 config/gnu-warnings/noerror-5 create mode 100644 config/gnu-warnings/noerror-8 create mode 100644 config/gnu-warnings/noerror-general create mode 100644 config/libhdf5.pc.in delete mode 100644 tools/h5diff/testfiles/diff_strings1.h5 delete mode 100644 tools/h5diff/testfiles/diff_strings2.h5 create mode 100644 tools/h5diff/testfiles/h5diff_eps.txt create mode 100644 tools/h5diff/testfiles/h5diff_eps1.h5 create mode 100644 tools/h5diff/testfiles/h5diff_eps2.h5 create mode 100644 tools/h5diff/testfiles/h5diff_strings1.h5 create mode 100644 tools/h5diff/testfiles/h5diff_strings2.h5 diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml index 6bf522c..230a341 100644 --- a/.github/workflows/clang-format-check.yml +++ b/.github/workflows/clang-format-check.yml @@ -8,7 +8,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Run clang-format style check for C programs. - uses: DoozyX/clang-format-lint-action@v0.10 + uses: DoozyX/clang-format-lint-action@v0.11 with: source: '.' extensions: 'c,h,cpp,hpp' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c548000..7ce4d85 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,14 +17,18 @@ jobs: strategy: # fail-fast: false matrix: - name: ["Windows Latest MSVC", "Ubuntu Latest GCC", "Ubuntu Debug GCC", "macOS Latest Clang", "Ubuntu Autotools GCC"] + name: ["Windows Latest MSVC", "Ubuntu Latest GCC", "Ubuntu Debug GCC", "macOS Latest Clang", "Ubuntu Autotools GCC", "Windows TS MSVC", "Ubuntu TS GCC", "TS Debug GCC", "macOS TS Clang", "TS Autotools GCC"] include: - name: "Windows Latest MSVC" artifact: "Windows-MSVC.tar.xz" os: windows-latest build_type: "Release" toolchain: "" + cpp: ON fortran: OFF + ts: OFF + hl: ON + parallel: OFF generator: "-G \"Visual Studio 16 2019\" -A x64" - name: "Ubuntu Latest GCC" artifact: "Linux.tar.xz" @@ -32,6 +36,8 @@ jobs: build_type: "Release" cpp: ON fortran: OFF + ts: OFF + hl: ON parallel: OFF toolchain: "config/toolchain/GCC.cmake" generator: "-G Ninja" @@ -41,6 +47,8 @@ jobs: build_type: "Release" cpp: ON fortran: OFF + ts: OFF + hl: ON parallel: OFF toolchain: "config/toolchain/clang.cmake" generator: "-G Ninja" @@ -50,15 +58,75 @@ jobs: build_type: "Debug" cpp: ON fortran: OFF + ts: OFF + hl: ON parallel: OFF toolchain: "config/toolchain/GCC.cmake" generator: "-G Ninja" - name: "Ubuntu Autotools GCC" - artifact: "Linux.tar.xz" + artifact: "LinuxA.tar.xz" os: ubuntu-latest build_type: "Release" cpp: enable fortran: enable + ts: disable + hl: enable + parallel: disable + toolchain: "" + generator: "autogen" +# Threadsafe runs + - name: "Windows TS MSVC" + artifact: "Windows-MSVCTS.tar.xz" + os: windows-latest + build_type: "Release" + toolchain: "" + cpp: OFF + fortran: OFF + ts: ON + hl: OFF + parallel: OFF + generator: "-G \"Visual Studio 16 2019\" -A x64" + - name: "Ubuntu TS GCC" + artifact: "LinuxTS.tar.xz" + os: ubuntu-latest + build_type: "Release" + cpp: OFF + fortran: OFF + ts: ON + hl: OFF + parallel: OFF + toolchain: "config/toolchain/GCC.cmake" + generator: "-G Ninja" + - name: "macOS TS Clang" + artifact: "macOSTS.tar.xz" + os: macos-latest + build_type: "Release" + cpp: OFF + fortran: OFF + ts: ON + hl: OFF + parallel: OFF + toolchain: "config/toolchain/clang.cmake" + generator: "-G Ninja" + - name: "TS Debug GCC" + artifact: "LinuxTSDBG.tar.xz" + os: ubuntu-latest + build_type: "Debug" + cpp: OFF + fortran: OFF + ts: ON + hl: OFF + parallel: OFF + toolchain: "config/toolchain/GCC.cmake" + generator: "-G Ninja" + - name: "TS Autotools GCC" + artifact: "LinuxATS.tar.xz" + os: ubuntu-latest + build_type: "Release" + cpp: disable + fortran: disable + ts: enable + hl: disable parallel: disable toolchain: "" generator: "autogen" @@ -105,9 +173,10 @@ jobs: - name: Autotools Configure if: matrix.generator == 'autogen' run: | + sh ./bin/chkmanifest mkdir "${{ runner.workspace }}/build" cd "${{ runner.workspace }}/build" - $GITHUB_WORKSPACE/configure --enable-shared --${{ matrix.parallel }}-parallel --${{ matrix.cpp }}-cxx --${{ matrix.fortran }}-fortran --enable-java + $GITHUB_WORKSPACE/configure --enable-shared --${{ matrix.ts }}-threadsafe --${{ matrix.hl }}-hl --${{ matrix.parallel }}-parallel --${{ matrix.cpp }}-cxx --${{ matrix.fortran }}-fortran shell: bash - name: Configure @@ -115,7 +184,7 @@ jobs: run: | mkdir "${{ runner.workspace }}/build" cd "${{ runner.workspace }}/build" - cmake ${{ matrix.generator }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} -DBUILD_SHARED_LIBS=ON -DHDF5_ENABLE_ALL_WARNINGS=ON -DHDF5_ENABLE_PARALLEL:BOOL=${{ matrix.parallel }} -DHDF5_BUILD_CPP_LIB:BOOL=${{ matrix.cpp }} -DHDF5_BUILD_FORTRAN=${{ matrix.fortran }} -DHDF5_BUILD_JAVA=ON $GITHUB_WORKSPACE + cmake ${{ matrix.generator }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} -DBUILD_SHARED_LIBS=ON -DHDF5_ENABLE_ALL_WARNINGS=ON -DHDF5_ENABLE_THREADSAFE:BOOL=${{ matrix.ts }} -DHDF5_BUILD_HL_LIB:BOOL=${{ matrix.hl }} -DHDF5_ENABLE_PARALLEL:BOOL=${{ matrix.parallel }} -DHDF5_BUILD_CPP_LIB:BOOL=${{ matrix.cpp }} -DHDF5_BUILD_FORTRAN=${{ matrix.fortran }} $GITHUB_WORKSPACE shell: bash - name: Autotools Build diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index aac96dd..51dcf86 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -12,14 +12,18 @@ jobs: strategy: # fail-fast: false matrix: - name: ["Windows Latest MSVC", "Ubuntu Latest GCC", "Ubuntu Debug GCC", "macOS Latest Clang", "Ubuntu Autotools GCC"] + name: ["Windows Latest MSVC", "Ubuntu Latest GCC", "Ubuntu Debug GCC", "macOS Latest Clang", "Ubuntu Autotools GCC", "Windows TS MSVC", "Ubuntu TS GCC", "TS Debug GCC", "macOS TS Clang", "TS Autotools GCC"] include: - name: "Windows Latest MSVC" artifact: "Windows-MSVC.tar.xz" os: windows-latest build_type: "Release" toolchain: "" + cpp: ON fortran: OFF + ts: OFF + hl: ON + parallel: OFF generator: "-G \"Visual Studio 16 2019\" -A x64" - name: "Ubuntu Latest GCC" artifact: "Linux.tar.xz" @@ -27,6 +31,8 @@ jobs: build_type: "Release" cpp: ON fortran: OFF + ts: OFF + hl: ON parallel: OFF toolchain: "config/toolchain/GCC.cmake" generator: "-G Ninja" @@ -36,6 +42,8 @@ jobs: build_type: "Release" cpp: ON fortran: OFF + ts: OFF + hl: ON parallel: OFF toolchain: "config/toolchain/clang.cmake" generator: "-G Ninja" @@ -45,15 +53,75 @@ jobs: build_type: "Debug" cpp: ON fortran: OFF + ts: OFF + hl: ON parallel: OFF toolchain: "config/toolchain/GCC.cmake" generator: "-G Ninja" - name: "Ubuntu Autotools GCC" - artifact: "Linux.tar.xz" + artifact: "LinuxA.tar.xz" os: ubuntu-latest build_type: "Release" cpp: enable fortran: enable + ts: disable + hl: enable + parallel: disable + toolchain: "" + generator: "autogen" +# Threadsafe runs + - name: "Windows TS MSVC" + artifact: "Windows-MSVCTS.tar.xz" + os: windows-latest + build_type: "Release" + toolchain: "" + cpp: OFF + fortran: OFF + ts: ON + hl: OFF + parallel: OFF + generator: "-G \"Visual Studio 16 2019\" -A x64" + - name: "Ubuntu TS GCC" + artifact: "LinuxTS.tar.xz" + os: ubuntu-latest + build_type: "Release" + cpp: OFF + fortran: OFF + ts: ON + hl: OFF + parallel: OFF + toolchain: "config/toolchain/GCC.cmake" + generator: "-G Ninja" + - name: "macOS TS Clang" + artifact: "macOSTS.tar.xz" + os: macos-latest + build_type: "Release" + cpp: OFF + fortran: OFF + ts: ON + hl: OFF + parallel: OFF + toolchain: "config/toolchain/clang.cmake" + generator: "-G Ninja" + - name: "TS Debug GCC" + artifact: "LinuxTSDBG.tar.xz" + os: ubuntu-latest + build_type: "Debug" + cpp: OFF + fortran: OFF + ts: ON + hl: OFF + parallel: OFF + toolchain: "config/toolchain/GCC.cmake" + generator: "-G Ninja" + - name: "TS Autotools GCC" + artifact: "LinuxATS.tar.xz" + os: ubuntu-latest + build_type: "Release" + cpp: disable + fortran: disable + ts: enable + hl: disable parallel: disable toolchain: "" generator: "autogen" @@ -70,6 +138,7 @@ jobs: name: ${{ matrix.name }} # The type of runner that the job will run on runs-on: ${{ matrix.os }} + if: "!contains(github.event.head_commit.message, 'skip-ci')" # Steps represent a sequence of tasks that will be executed as part of the job steps: @@ -99,9 +168,10 @@ jobs: - name: Autotools Configure if: matrix.generator == 'autogen' run: | + sh ./bin/chkmanifest mkdir "${{ runner.workspace }}/build" cd "${{ runner.workspace }}/build" - $GITHUB_WORKSPACE/configure --enable-shared --${{ matrix.parallel }}-parallel --${{ matrix.cpp }}-cxx --${{ matrix.fortran }}-fortran --enable-java + $GITHUB_WORKSPACE/configure --enable-shared --${{ matrix.ts }}-threadsafe --${{ matrix.hl }}-hl --${{ matrix.parallel }}-parallel --${{ matrix.cpp }}-cxx --${{ matrix.fortran }}-fortran shell: bash - name: Configure @@ -109,7 +179,7 @@ jobs: run: | mkdir "${{ runner.workspace }}/build" cd "${{ runner.workspace }}/build" - cmake ${{ matrix.generator }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} -DBUILD_SHARED_LIBS=ON -DHDF5_ENABLE_ALL_WARNINGS=ON -DHDF5_ENABLE_PARALLEL:BOOL=${{ matrix.parallel }} -DHDF5_BUILD_CPP_LIB:BOOL=${{ matrix.cpp }} -DHDF5_BUILD_FORTRAN=${{ matrix.fortran }} -DHDF5_BUILD_JAVA=ON $GITHUB_WORKSPACE + cmake ${{ matrix.generator }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} -DBUILD_SHARED_LIBS=ON -DHDF5_ENABLE_ALL_WARNINGS=ON -DHDF5_ENABLE_THREADSAFE:BOOL=${{ matrix.ts }} -DHDF5_BUILD_HL_LIB:BOOL=${{ matrix.hl }} -DHDF5_ENABLE_PARALLEL:BOOL=${{ matrix.parallel }} -DHDF5_BUILD_CPP_LIB:BOOL=${{ matrix.cpp }} -DHDF5_BUILD_FORTRAN=${{ matrix.fortran }} $GITHUB_WORKSPACE shell: bash - name: Autotools Build diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index 97d8be1..d5f801e 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -32,7 +32,9 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT set (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_NAME}) if (NOT EXISTS "${ZLIB_URL}") set (HDF5_ENABLE_Z_LIB_SUPPORT OFF CACHE BOOL "" FORCE) - message (STATUS "Filter ZLIB file ${ZLIB_URL} not found") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Filter ZLIB file ${ZLIB_URL} not found") + endif () endif () set (SZIP_URL ${TGZPATH}/${SZIP_TGZ_NAME}) if (USE_LIBAEC) @@ -40,7 +42,9 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT endif () if (NOT EXISTS "${SZIP_URL}") set (HDF5_ENABLE_SZIP_SUPPORT OFF CACHE BOOL "" FORCE) - message (STATUS "Filter SZIP file ${SZIP_URL} not found") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Filter SZIP file ${SZIP_URL} not found") + endif () endif () else () set (ZLIB_USE_EXTERNAL 0) @@ -76,7 +80,9 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) set (H5_HAVE_FILTER_DEFLATE 1) set (H5_HAVE_ZLIB_H 1) set (H5_HAVE_LIBZ 1) - message (STATUS "Filter ZLIB is built") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Filter ZLIB is built") + endif () else () message (FATAL_ERROR " ZLib is Required for ZLib support in HDF5") endif () @@ -92,7 +98,9 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) endif () set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS}) - message (STATUS "Filter ZLIB is ON") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Filter ZLIB is ON") + endif () endif () #----------------------------------------------------------------------------- @@ -122,9 +130,13 @@ if (HDF5_ENABLE_SZIP_SUPPORT) set (H5_HAVE_FILTER_SZIP 1) set (H5_HAVE_SZLIB_H 1) set (H5_HAVE_LIBSZ 1) - message (STATUS "Filter SZIP is built") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Filter SZIP is built") + endif () if (USE_LIBAEC) - message (STATUS "... with library AEC") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "... with library AEC") + endif () set (SZ_PACKAGE_NAME ${LIBAEC_PACKAGE_NAME}) else () set (SZ_PACKAGE_NAME ${SZIP_PACKAGE_NAME}) @@ -135,7 +147,9 @@ if (HDF5_ENABLE_SZIP_SUPPORT) endif () set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) - message (STATUS "Filter SZIP is ON") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Filter SZIP is ON") + endif () if (H5_HAVE_FILTER_SZIP) set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DECODE") endif () diff --git a/CMakeLists.txt b/CMakeLists.txt index 5715da6..f49b49d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,9 +42,8 @@ set (CMAKE_IGNORE_EOL "--ignore-eol") if (CMAKE_VERSION VERSION_LESS "3.14.0") set (CMAKE_IGNORE_EOL "") if (WIN32) - message (FATAL_ERROR "Windows builds requires a minimum of CMake 3.14") + message (FATAL_ERROR "Windows builds require a minimum of CMake 3.14") endif() -else () endif () #----------------------------------------------------------------------------- @@ -191,6 +190,7 @@ set (HDF5_HL_F90_C_LIBSH_TARGET "${HDF5_HL_F90_C_LIB_CORENAME}-shared") #----------------------------------------------------------------------------- # Define some CMake variables for use later in the project #----------------------------------------------------------------------------- +set (HDF_CONFIG_DIR ${HDF5_SOURCE_DIR}/config) set (HDF_RESOURCES_DIR ${HDF5_SOURCE_DIR}/config/cmake) set (HDF_RESOURCES_EXT_DIR ${HDF5_SOURCE_DIR}/config/cmake_ext_mod) set (HDF5_SRC_DIR ${HDF5_SOURCE_DIR}/src) @@ -204,6 +204,7 @@ set (HDF5_TOOLS_DIR ${HDF5_SOURCE_DIR}/tools) set (HDF5_TOOLS_SRC_DIR ${HDF5_SOURCE_DIR}/tools) set (HDF5_PERFORM_SRC_DIR ${HDF5_SOURCE_DIR}/tools/perform) set (HDF5_F90_SRC_DIR ${HDF5_SOURCE_DIR}/fortran) +set (HDF5_DOXYGEN_DIR ${HDF5_SOURCE_DIR}/doxygen) #----------------------------------------------------------------------------- # parse the full version number from H5public.h and include in H5_VERS_INFO @@ -215,9 +216,11 @@ string (REGEX REPLACE ".*#define[ \t]+H5_VERS_MINOR[ \t]+([0-9]*).*$" "\\1" H5_VERS_MINOR ${_h5public_h_contents}) string (REGEX REPLACE ".*#define[ \t]+H5_VERS_RELEASE[ \t]+([0-9]*).*$" "\\1" H5_VERS_RELEASE ${_h5public_h_contents}) -string (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._\-]*)\".*$" +string (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._-]*)\".*$" "\\1" H5_VERS_SUBRELEASE ${_h5public_h_contents}) -#message (STATUS "VERSION: ${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}") +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "VERSION: ${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}") +endif () #----------------------------------------------------------------------------- # parse the full soversion number from config/lt_vers.am and include in H5_SOVERS_INFO @@ -230,55 +233,69 @@ string (REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" string (REGEX REPLACE ".*LT_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_LIB_SOVERS_RELEASE ${_lt_vers_am_contents}) math (EXPR H5_LIB_SOVERS_MAJOR ${H5_LIB_SOVERS_INTERFACE}-${H5_LIB_SOVERS_RELEASE}) -message (STATUS "SOVERSION: ${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}") +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "SOVERSION: ${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}") +endif () string (REGEX REPLACE ".*LT_TOOLS_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_TOOLS_SOVERS_INTERFACE ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_TOOLS_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_TOOLS_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_TOOLS_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_TOOLS_SOVERS_RELEASE ${_lt_vers_am_contents}) - math (EXPR H5_TOOLS_SOVERS_MAJOR ${H5_TOOLS_SOVERS_INTERFACE}-${H5_TOOLS_SOVERS_RELEASE}) -message (STATUS "SOVERSION_TOOLS: ${H5_TOOLS_SOVERS_MAJOR}.${H5_TOOLS_SOVERS_RELEASE}.${H5_TOOLS_SOVERS_MINOR}") +math (EXPR H5_TOOLS_SOVERS_MAJOR ${H5_TOOLS_SOVERS_INTERFACE}-${H5_TOOLS_SOVERS_RELEASE}) +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "SOVERSION_TOOLS: ${H5_TOOLS_SOVERS_MAJOR}.${H5_TOOLS_SOVERS_RELEASE}.${H5_TOOLS_SOVERS_MINOR}") +endif () string (REGEX REPLACE ".*LT_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_CXX_SOVERS_INTERFACE ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_CXX_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_CXX_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_CXX_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_CXX_SOVERS_RELEASE ${_lt_vers_am_contents}) - math (EXPR H5_CXX_SOVERS_MAJOR ${H5_CXX_SOVERS_INTERFACE}-${H5_CXX_SOVERS_RELEASE}) -message (STATUS "SOVERSION_CXX: ${H5_CXX_SOVERS_MAJOR}.${H5_CXX_SOVERS_RELEASE}.${H5_CXX_SOVERS_MINOR}") +math (EXPR H5_CXX_SOVERS_MAJOR ${H5_CXX_SOVERS_INTERFACE}-${H5_CXX_SOVERS_RELEASE}) +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "SOVERSION_CXX: ${H5_CXX_SOVERS_MAJOR}.${H5_CXX_SOVERS_RELEASE}.${H5_CXX_SOVERS_MINOR}") +endif () string (REGEX REPLACE ".*LT_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_F_SOVERS_INTERFACE ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_F_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_F_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_F_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_F_SOVERS_RELEASE ${_lt_vers_am_contents}) - math (EXPR H5_F_SOVERS_MAJOR ${H5_F_SOVERS_INTERFACE}-${H5_F_SOVERS_RELEASE}) -message (STATUS "SOVERSION_F: ${H5_F_SOVERS_MAJOR}.${H5_F_SOVERS_RELEASE}.${H5_F_SOVERS_MINOR}") +math (EXPR H5_F_SOVERS_MAJOR ${H5_F_SOVERS_INTERFACE}-${H5_F_SOVERS_RELEASE}) +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "SOVERSION_F: ${H5_F_SOVERS_MAJOR}.${H5_F_SOVERS_RELEASE}.${H5_F_SOVERS_MINOR}") +endif () string (REGEX REPLACE ".*LT_HL_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_SOVERS_INTERFACE ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_SOVERS_RELEASE ${_lt_vers_am_contents}) - math (EXPR H5_HL_SOVERS_MAJOR ${H5_HL_SOVERS_INTERFACE}-${H5_HL_SOVERS_RELEASE}) -message (STATUS "SOVERSION_HL: ${H5_HL_SOVERS_MAJOR}.${H5_HL_SOVERS_RELEASE}.${H5_HL_SOVERS_MINOR}") +math (EXPR H5_HL_SOVERS_MAJOR ${H5_HL_SOVERS_INTERFACE}-${H5_HL_SOVERS_RELEASE}) +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "SOVERSION_HL: ${H5_HL_SOVERS_MAJOR}.${H5_HL_SOVERS_RELEASE}.${H5_HL_SOVERS_MINOR}") +endif () string (REGEX REPLACE ".*LT_HL_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_CXX_SOVERS_INTERFACE ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_CXX_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_CXX_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_CXX_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_CXX_SOVERS_RELEASE ${_lt_vers_am_contents}) - math (EXPR H5_HL_CXX_SOVERS_MAJOR ${H5_HL_CXX_SOVERS_INTERFACE}-${H5_HL_CXX_SOVERS_RELEASE}) -message (STATUS "SOVERSION_HL_CXX: ${H5_HL_CXX_SOVERS_MAJOR}.${H5_HL_CXX_SOVERS_RELEASE}.${H5_HL_CXX_SOVERS_MINOR}") +math (EXPR H5_HL_CXX_SOVERS_MAJOR ${H5_HL_CXX_SOVERS_INTERFACE}-${H5_HL_CXX_SOVERS_RELEASE}) +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "SOVERSION_HL_CXX: ${H5_HL_CXX_SOVERS_MAJOR}.${H5_HL_CXX_SOVERS_RELEASE}.${H5_HL_CXX_SOVERS_MINOR}") +endif () string (REGEX REPLACE ".*LT_HL_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_F_SOVERS_INTERFACE ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_F_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_F_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_HL_F_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_F_SOVERS_RELEASE ${_lt_vers_am_contents}) - math (EXPR H5_HL_F_SOVERS_MAJOR ${H5_HL_F_SOVERS_INTERFACE}-${H5_HL_F_SOVERS_RELEASE}) -message (STATUS "SOVERSION_HL_F: ${H5_HL_F_SOVERS_MAJOR}.${H5_HL_F_SOVERS_RELEASE}.${H5_HL_F_SOVERS_MINOR}") +math (EXPR H5_HL_F_SOVERS_MAJOR ${H5_HL_F_SOVERS_INTERFACE}-${H5_HL_F_SOVERS_RELEASE}) +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "SOVERSION_HL_F: ${H5_HL_F_SOVERS_MAJOR}.${H5_HL_F_SOVERS_RELEASE}.${H5_HL_F_SOVERS_MINOR}") +endif () #----------------------------------------------------------------------------- # Basic HDF5 stuff here @@ -484,7 +501,7 @@ if (MSVC) endif () set (MAKE_SYSTEM) -if (CMAKE_BUILD_TOOL MATCHES "make") +if (CMAKE_MAKE_PROGRAM MATCHES "make") set (MAKE_SYSTEM 1) endif () @@ -630,39 +647,51 @@ option (HDF5_ENABLE_THREADSAFE "Enable thread-safety" OFF) if (HDF5_ENABLE_THREADSAFE) # check for unsupported options if (WIN32) - message (STATUS " **** thread-safety option not supported with static library **** ") - message (STATUS " **** thread-safety option will not be used building static library **** ") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE " **** thread-safety option not supported with static library **** ") + message (VERBOSE " **** thread-safety option will not be used building static library **** ") + endif () endif () if (HDF5_ENABLE_PARALLEL) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** parallel and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ") else () - message (STATUS " **** Allowing unsupported parallel and thread-safety options **** ") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE " **** Allowing unsupported parallel and thread-safety options **** ") + endif () endif () endif () if (HDF5_BUILD_FORTRAN) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** Fortran and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ") else () - message (STATUS " **** Allowing unsupported Fortran and thread-safety options **** ") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE " **** Allowing unsupported Fortran and thread-safety options **** ") + endif () endif () endif () if (HDF5_BUILD_CPP_LIB) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** C++ and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ") else () - message (STATUS " **** Allowing unsupported C++ and thread-safety options **** ") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE " **** Allowing unsupported C++ and thread-safety options **** ") + endif () endif () endif () if (HDF5_BUILD_HL_LIB) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** HL and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ") else () - message (STATUS " **** Allowing unsupported HL and thread-safety options **** ") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE " **** Allowing unsupported HL and thread-safety options **** ") + endif () endif () endif () if (H5_HAVE_IOEO) - message (STATUS " **** Win32 threads requires WINVER>=0x600 (Windows Vista/7/8) **** ") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE " **** Win32 threads requires WINVER>=0x600 (Windows Vista/7/8) **** ") + endif () set (H5_HAVE_WIN_THREADS 1) else () if (NOT H5_HAVE_PTHREAD_H) @@ -834,7 +863,9 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake) - message (STATUS "Fortran compiler ID is ${CMAKE_Fortran_COMPILER_ID}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Fortran compiler ID is ${CMAKE_Fortran_COMPILER_ID}") + endif () include (${HDF_RESOURCES_DIR}/HDFFortranCompilerFlags.cmake) include (${HDF_RESOURCES_DIR}/HDF5UseFortran.cmake) set (LINK_Fortran_LIBS ${LINK_LIBS}) @@ -886,7 +917,9 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive, override with ALLOW_UNSUPPORTED option **** ") else () - message (STATUS " **** Allowing unsupported Parallel and C++ options **** ") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE " **** Allowing unsupported Parallel and C++ options **** ") + endif () endif () endif () diff --git a/CTestConfig.cmake b/CTestConfig.cmake index f302097..00f6bb1 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -18,7 +18,7 @@ set (CTEST_PROJECT_NAME "HDF5") set (CTEST_NIGHTLY_START_TIME "18:00:00 CST") -set (CTEST_DROP_METHOD "http") +set (CTEST_DROP_METHOD "https") if (CTEST_DROP_SITE_INIT) set (CTEST_DROP_SITE "${CTEST_DROP_SITE_INIT}") else () diff --git a/MANIFEST b/MANIFEST index 1abe835..ae8747f 100644 --- a/MANIFEST +++ b/MANIFEST @@ -132,6 +132,7 @@ ./config/ibm-flags ./config/intel-fflags ./config/intel-flags +./config/libhdf5.pc.in ./config/linux-gnu ./config/linux-gnuaout ./config/linux-gnueabihf @@ -151,6 +152,7 @@ ./config/clang-warnings/error-general ./config/clang-warnings/general ./config/clang-warnings/no-developer-general +./config/clang-warnings/noerror-general ./config/gnu-warnings/4.8-4.last ./config/gnu-warnings/4.8 ./config/gnu-warnings/4.9 @@ -159,14 +161,19 @@ ./config/gnu-warnings/7 ./config/gnu-warnings/8 ./config/gnu-warnings/9 +./config/gnu-warnings/9.3 ./config/gnu-warnings/cxx-general +./config/gnu-warnings/cxx-4.8 ./config/gnu-warnings/cxx-4.9 ./config/gnu-warnings/cxx-5 ./config/gnu-warnings/cxx-error-5 ./config/gnu-warnings/cxx-error-general +./config/gnu-warnings/cxx-noerror-5 +./config/gnu-warnings/cxx-noerror-general ./config/gnu-warnings/developer-4.8 ./config/gnu-warnings/developer-7 ./config/gnu-warnings/developer-8 +./config/gnu-warnings/developer-10 ./config/gnu-warnings/developer-general ./config/gnu-warnings/error-5 ./config/gnu-warnings/error-8 @@ -180,6 +187,9 @@ ./config/gnu-warnings/no-developer-4.8 ./config/gnu-warnings/no-developer-8 ./config/gnu-warnings/no-developer-general +./config/gnu-warnings/noerror-5 +./config/gnu-warnings/noerror-8 +./config/gnu-warnings/noerror-general ./config/intel-warnings/ifort-general ./config/intel-warnings/general @@ -2122,11 +2132,14 @@ ./tools/h5diff/testfiles/h5diff_8639.txt ./tools/h5diff/testfiles/tudfilter.h5 ./tools/h5diff/testfiles/tudfilter2.h5 +./tools/h5diff/testfiles/h5diff_eps.txt +./tools/h5diff/testfiles/h5diff_eps1.h5 +./tools/h5diff/testfiles/h5diff_eps2.h5 ./tools/h5diff/testfiles/h5diff_ud.txt ./tools/h5diff/testfiles/h5diff_udfail.err ./tools/h5diff/testfiles/h5diff_udfail.txt -./tools/h5diff/testfiles/diff_strings1.h5 -./tools/h5diff/testfiles/diff_strings2.h5 +./tools/h5diff/testfiles/h5diff_strings1.h5 +./tools/h5diff/testfiles/h5diff_strings2.h5 ./tools/h5diff/testfiles/h5diff_vlstr.txt #test files for h5repack @@ -2453,7 +2466,6 @@ ./config/cmake/HDF5PluginCache.cmake ./config/cmake/HDF5UseFortran.cmake ./config/cmake/libh5cc.in -./config/cmake/libhdf5.pc.in ./config/cmake/libhdf5.settings.cmake.in ./config/cmake/mccacheinit.cmake ./config/cmake/patch.xml diff --git a/Makefile.am b/Makefile.am index 0af782b..8e7fbf5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,7 +13,7 @@ ## Makefile.am ## Run automake to generate a Makefile.in from this file. ## -# +# # This makefile mostly just reinvokes make in the various subdirectories # but does so in the correct order. You can alternatively invoke make from # each subdirectory manually. @@ -45,7 +45,7 @@ include $(top_srcdir)/config/commence.am # Since we're explicitly listing DIST_SUBDIRS, we also need to list # directories that are only conditionally built (so that their Makefiles # are cleaned as well). -# Note that `make clean' will not affect the examples or doc directories. +# Note that `make clean' will not affect the examples or doc directories. # Conditionals. These conditionals are defined during configure # Define each variable to empty if it is not used to placate pmake @@ -107,7 +107,7 @@ tests: if test $$d != .; then \ (cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \ fi; \ - done + done # Check-clean also recurses into examples directory check-clean: @@ -128,7 +128,7 @@ mostlyclean-local: # 'make install' will now install examples, the same as 'make install-all'. # 'make-install-all' will be redundant but will still work. install: install-recursive install-examples -uninstall: uninstall-recursive uninstall-examples +uninstall: uninstall-recursive uninstall-examples # 'make install-all' also installs examples install-all: @@ -149,7 +149,7 @@ install-doc: uninstall-doc: @echo "docs no longer live in this tree. Use install-examples to install examples." -# `make check-install' or `make installcheck' checks that examples can +# `make check-install' or `make installcheck' checks that examples can # be successfully built installcheck-local: if test -n "${DESTDIR}"; then \ diff --git a/Makefile.in b/Makefile.in index b0f79b3..cd0b0a1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -25,7 +25,7 @@ # distribution tree, or in https://www.hdfgroup.org/licenses. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. -# +# # This makefile mostly just reinvokes make in the various subdirectories # but does so in the correct order. You can alternatively invoke make from # each subdirectory manually. @@ -240,16 +240,15 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -280,6 +279,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -307,8 +307,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -487,15 +485,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -525,7 +523,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *-tmp # Since we're explicitly listing DIST_SUBDIRS, we also need to list # directories that are only conditionally built (so that their Makefiles # are cleaned as well). -# Note that `make clean' will not affect the examples or doc directories. +# Note that `make clean' will not affect the examples or doc directories. # Conditionals. These conditionals are defined during configure # Define each variable to empty if it is not used to placate pmake @@ -1017,8 +1015,9 @@ uninstall-am: # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp @@ -1040,7 +1039,7 @@ tests: if test $$d != .; then \ (cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \ fi; \ - done + done # Check-clean also recurses into examples directory check-clean: @@ -1061,7 +1060,7 @@ mostlyclean-local: # 'make install' will now install examples, the same as 'make install-all'. # 'make-install-all' will be redundant but will still work. install: install-recursive install-examples -uninstall: uninstall-recursive uninstall-examples +uninstall: uninstall-recursive uninstall-examples # 'make install-all' also installs examples install-all: @@ -1082,7 +1081,7 @@ install-doc: uninstall-doc: @echo "docs no longer live in this tree. Use install-examples to install examples." -# `make check-install' or `make installcheck' checks that examples can +# `make check-install' or `make installcheck' checks that examples can # be successfully built installcheck-local: if test -n "${DESTDIR}"; then \ diff --git a/bin/Makefile.in b/bin/Makefile.in index 3c5b1bf..1c11c8a 100644 --- a/bin/Makefile.in +++ b/bin/Makefile.in @@ -349,19 +349,18 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ # Include src directory AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/tools/lib -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -392,6 +391,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -419,8 +419,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -599,15 +597,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -656,7 +654,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1058,8 +1056,9 @@ uninstall-am: uninstall-binSCRIPTS uninstall-local # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/bin/genparser b/bin/genparser index d333c6d..462c2c2 100755 --- a/bin/genparser +++ b/bin/genparser @@ -219,13 +219,15 @@ perl -0777 -pi -e 's/int H5LTyyparse/hid_t H5LTyyparse/igs' ${path_to_hl_src}/H5 # # Note that the GCC pragmas did not exist until gcc 4.2. Earlier versions # will simply ignore them, but we want to avoid those warnings. +# +# Note also that although clang defines __GNUC__, it doesn't support every +# warning that GCC does. for f in ${path_to_hl_src}/H5LTparse.c ${path_to_hl_src}/H5LTanalyze.c do echo '#if defined (__GNUC__) ' >> tmp.out echo '#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402 ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wconversion" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" ' >> tmp.out - echo '#pragma GCC diagnostic ignored "-Wlarger-than=" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wmissing-prototypes" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wnested-externs" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wold-style-definition" ' >> tmp.out @@ -234,8 +236,11 @@ do echo '#pragma GCC diagnostic ignored "-Wsign-conversion" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wstrict-overflow" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wstrict-prototypes" ' >> tmp.out + echo '#if !defined (__clang__) ' >> tmp.out + echo '#pragma GCC diagnostic ignored "-Wlarger-than=" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wsuggest-attribute=const" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" ' >> tmp.out + echo '#endif ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wswitch-default" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wunused-function" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wunused-macros" ' >> tmp.out diff --git a/c++/Makefile.in b/c++/Makefile.in index 1e16e4f..576793a 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -403,16 +403,15 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -443,6 +442,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -470,8 +470,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -650,15 +648,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -694,7 +692,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1173,8 +1171,9 @@ uninstall-am: # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index 40d4d7c..0c54211 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -350,16 +350,15 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -390,6 +389,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -417,8 +417,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -597,15 +595,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -672,7 +670,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1038,8 +1036,9 @@ uninstall-am: uninstall-local # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp @@ -1090,7 +1089,7 @@ install-data-local: uninstall-local: @$(MAKE) $(AM_MAKEFLAGS) uninstall-examples -install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) +install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ @@ -1137,7 +1136,7 @@ installcheck-local: H5CCFLAGS="-shlib" $(MAKE) $(AM_MAKEFLAGS) check; \ else \ $(MAKE) $(AM_MAKEFLAGS) check; \ - fi + fi @if test "$(INSTALL_FILES)" -a $(TEST_EXAMPLES_SCRIPT) -a -d $(EXAMPLEDIR); then \ echo "============================"; \ echo "Testing $(TEST_EXAMPLES_SCRIPT)"; \ diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index ba08f16..65d1d43 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -200,7 +200,7 @@ set (_PKG_CONFIG_REQUIRES "${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") configure_file ( - ${HDF_RESOURCES_DIR}/libhdf5.pc.in + ${HDF_CONFIG_DIR}/libhdf5.pc.in ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_CPP_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc @ONLY ) diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 523217a..dd46f7a 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -414,18 +414,17 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ # Include src directory AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -456,6 +455,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -483,8 +483,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -663,15 +661,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -771,7 +769,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1346,8 +1344,9 @@ uninstall-am: uninstall-binSCRIPTS uninstall-includeHEADERS \ # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in index aa5352f..25f7fb6 100644 --- a/c++/test/Makefile.in +++ b/c++/test/Makefile.in @@ -402,19 +402,18 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ # Include src, test, and c++/src directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/test -I$(top_srcdir)/c++/src -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -445,6 +444,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -472,8 +472,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -652,15 +650,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -710,7 +708,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1186,8 +1184,9 @@ uninstall-am: # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/config/cce-fflags b/config/cce-fflags index 2e93b36..813d4c7 100644 --- a/config/cce-fflags +++ b/config/cce-fflags @@ -50,15 +50,24 @@ if test "X-cce" = "X-$f9x_vendor"; then H5_FCFLAGS="${H5_FCFLAGS} -hnocaf" # Production - # -Wl,-s to remove all symbols for smaller file - PROD_FCFLAGS="-O3 -Wl,-s" + PROD_FCFLAGS= # Debug - DEBUG_FCFLAGS="-g -O0" + DEBUG_FCFLAGS= + + # Symbols + # -Wl,-s to remove all symbols for smaller file + SYMBOLS_FCFLAGS="-g" + NO_SYMBOLS_FCFLAGS="-Wl,-s" - # Profile + # Profiling # Use this for profiling with gprof - PROFILE_FCFLAGS="-g -p" + PROFILE_FCFLAGS="-p" + + # Optimization + HIGH_OPT_FCFLAGS="-O3" + DEBUG_OPT_FCFLAGS="-O0" + NO_OPT_FCFLAGS="-O0" # Flags are set f9x_flags_set=yes diff --git a/config/cce-flags b/config/cce-flags index d6d6085..0903dec 100644 --- a/config/cce-flags +++ b/config/cce-flags @@ -52,18 +52,25 @@ if test "X-cce" = "X-$cc_vendor"; then H5_CFLAGS="${H5_CFLAGS:--hc99 $arch}" # Production - # -Wl,-s to remove all symbols for smaller file - PROD_CFLAGS="-O3 -Wl,-s" - PROD_CPPFLAGS= + PROD_CFLAGS= # Debug - DEBUG_CFLAGS="-g -O0" - DEBUG_CPPFLAGS= + # NDEBUG is handled explicitly in configure + DEBUG_CFLAGS= + + # Symbols + # -Wl,-s to remove all symbols for smaller file + SYMBOLS_CFLAGS="-g" + NO_SYMBOLS_CFLAGS="-Wl,-s" - # Profile + # Profiling # Use this for profiling with gprof - PROFILE_CFLAGS="-g -p" - PROFILE_CPPFLAGS= + PROFILE_CFLAGS="-p" + + # Optimization + HIGH_OPT_CFLAGS="-O3" + DEBUG_OPT_CFLAGS="-O0" + NO_OPT_CFLAGS="-O0" # Flags are set cc_flags_set=yes @@ -75,3 +82,4 @@ if test "X-$cc_flags_set" = "X-"; then cc_vendor= cc_version= fi + diff --git a/config/clang-cxxflags b/config/clang-cxxflags index bd8ce2d..e7ab6d8 100644 --- a/config/clang-cxxflags +++ b/config/clang-cxxflags @@ -173,6 +173,7 @@ if test "X-clang" = "X-$cxx_vendor" -o "X-Apple LLVM" = "X-$cxx_vendor"; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_clang_arguments general)" H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_clang_arguments error-general)" + H5_NECXXFLAGS="$H5_NECXXFLAGS $(load_clang_arguments noerror-general)" ###################### # Developer warnings # diff --git a/config/clang-flags b/config/clang-flags index ab37749..92a8973 100644 --- a/config/clang-flags +++ b/config/clang-flags @@ -56,7 +56,10 @@ load_clang_arguments() # if test "X-" = "X-$cc_flags_set"; then # clang -v will return version number following "clang" on Linux machines, - # but on Macs the version number will follow "Apple LLVM version" + # but on Xcode the version number will follow "Apple LLVM version" + # Note that the Xcode reported LLVM version doesn't match the canonical + # LLVM version, so you'll need to do different version checks for + # Xcode. cc_version="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 |\ grep 'clang version' | sed 's/.*clang version \([-a-z0-9\.]*\).*/\1/'`" if test -n "$cc_version"; then @@ -160,9 +163,16 @@ if test "X-clang" = "X-$cc_vendor" -o "X-Apple LLVM" = "X-$cc_vendor"; then ################ HIGH_OPT_CFLAGS="-O3" - DEBUG_OPT_CFLAGS="-g" NO_OPT_CFLAGS="-O0" + # -Og is only understood by clang 4+ and Xcode 9+ + # Otherwise use -O1 (which is what -Og usually equates to) + if test "X-clang" = "X-$cc_vendor" -a $cc_vers_major -ge 4 -o "X-Apple LLVM" = "X-$cc_vendor" -a $cc_vers_major -ge 9; then + DEBUG_OPT_CFLAGS="-Og" + else + DEBUG_OPT_CFLAGS="-O1" + fi + ############ # Warnings # ############ @@ -173,6 +183,7 @@ if test "X-clang" = "X-$cc_vendor" -o "X-Apple LLVM" = "X-$cc_vendor"; then H5_CFLAGS="$H5_CFLAGS $(load_clang_arguments general)" H5_ECFLAGS="$H5_ECFLAGS $(load_clang_arguments error-general)" + H5_NECFLAGS="$H5_NECFLAGS $(load_clang_arguments noerror-general)" ###################### # Developer warnings # diff --git a/config/clang-warnings/noerror-general b/config/clang-warnings/noerror-general new file mode 100644 index 0000000..ad50dfc --- /dev/null +++ b/config/clang-warnings/noerror-general @@ -0,0 +1,80 @@ +# +# HDF5 code should not trigger the following warnings under any +# circumstances, so ask the compiler to treat them as errors: +# +-Wbad-function-cast +-Wimplicit-function-declaration +-Wincompatible-pointer-types +-Wmissing-declarations +-Wpacked +-Wshadow +-Wswitch +# +# NOTE: Following files are not compatible with incompatible-pointer-types as errors +# src/H5Dchunk.c,src/H5Dint.c,src/H5Gint.c,src/H5HFcache.c,src/H5I.c,src/H5T.c +-Wno-error=incompatible-pointer-types-discards-qualifiers +# +# +# NOTE: File Driver files are not compatible with these warnings as errors +# H5FDdirect.c,H5FDmpio.c,H5FDros3.c, +# -Werror=unused-function +# +-Wunused-function +# +# H5FDdrvr_module.h +# -Werror=unused-variable +# +-Wunused-variable +# +# H5VLpassthru.c +# -Werror=unused-parameter +# +-Wunused-parameter +# +# +# +# NOTE: Tools files are not compatible with these warnings as errors +# lib/h5tools.c +# -Werror=cast-align +# +-Wcast-align +# +# lib/h5tools_utils.c +# -Werror=unused-parameter +# +# +# NOTE: JNI files are not compatible with these warnings as errors +# jni/h5pDCPLImp.c,jni/nativeData.c,jni/h5util.c,jni/h5rImp.c +# jni/h5sImp.c,jni/h5tImp.c +# -Werror=cast-align +# jni/h5util.c +# -Werror=format(-overflow) +# +-Wformat +# +# +#Examples and tests do not use the same set of extensive warning flags as libraries +# Here is a list of tests and examples that have issues with the stricter warnings as error +# +# NOTE: Test files are not compatible with these warnings as errors +# thread_id.c, +# -Werror=unused-function +# dsets.c +# -Werror=unused-parameter +# +# +# NOTE: Examples files are not compatible with these warnings as errors +# h5_vds-eiger.c,h5_vds-exclim.c,h5_vds.c,h5_vds-exc.c,h5_vds-percival-unlim-maxmin.c +# h5_vds-percival.c,h5_read.c,h5_rdwt.c,h5_mount.c,h5_extend.c,h5_extend_write.c +# h5_write.c,h5_vds-simpleIO.c,h5_ref2reg_deprec.c,h5_crtgrp.c,h5_select.c +# h5_vds-percival-unlim.c,h5_crtatt.c,h5_group.c,h5_attribute.c,h5_crtdat.c +# h5_reference_deprec.c +# h5_rdwt.c,h5_crtgrp.c,h5_crtatt.c,h5_crtdat.c +# -Werror=strict-prototypes +# h5_rdwt.c,h5_crtgrp.c,h5_crtatt.c,h5_crtdat.c +# -Werror=old-style-definition +# h5_vds-exclim.c,h5_vds.c,h5_vds-exc.c, +# -Werror=unused-variable +# h5_elink_unix2win.c,h5_extlink.c,h5_attribute.c +# -Werror=unused-parameter + diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index a4d6070..b437266 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -154,14 +154,18 @@ if (NOT WINDOWS) add_definitions ("-D_GNU_SOURCE") else () set (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_DIRECT_VFD_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" ) endif () else () set (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_DIRECT_VFD_WORKS Compile failed with the following output:\n ${OUTPUT}\n" ) @@ -181,7 +185,7 @@ option (HDF5_ENABLE_ROS3_VFD "Build the ROS3 Virtual File Driver" OFF) list (APPEND LINK_LIBS ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES}) INCLUDE_DIRECTORIES (${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR}) else () - message (STATUS "The Read-Only S3 VFD was requested but cannot be built.\nPlease check that openssl and cURL are available on your\nsystem, and/or re-configure without option HDF5_ENABLE_ROS3_VFD.") + message (WARNING "The Read-Only S3 VFD was requested but cannot be built.\nPlease check that openssl and cURL are available on your\nsystem, and/or re-configure without option HDF5_ENABLE_ROS3_VFD.") endif () endif () @@ -190,7 +194,6 @@ endif () #----------------------------------------------------------------------------- macro (H5ConversionTests TEST msg) if (NOT DEFINED ${TEST}) - # message (STATUS "===> ${TEST}") TRY_RUN (${TEST}_RUN ${TEST}_COMPILE ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_DIR}/ConversionTests.c @@ -200,17 +203,23 @@ macro (H5ConversionTests TEST msg) if (${TEST}_COMPILE) if (${TEST}_RUN MATCHES 0) set (${TEST} 1 CACHE INTERNAL ${msg}) - message (STATUS "${msg}... yes") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... yes") + endif () else () set (${TEST} "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Run failed with the following output and exit code:\n ${OUTPUT}\n" ) endif () else () set (${TEST} "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Compile failed with the following output:\n ${OUTPUT}\n" ) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index e7fc0fc..a1c1dd1 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -26,13 +26,6 @@ /* Define if using a Windows compiler (i.e. Visual Studio) */ #cmakedefine H5_HAVE_VISUAL_STUDIO @H5_HAVE_VISUAL_STUDIO@ -/* Define if building universal (internal helper macro) */ -#cmakedefine H5_AC_APPLE_UNIVERSAL_BUILD @H5_AC_APPLE_UNIVERSAL_BUILD@ - -/* Define if the memory buffers being written to disk should be cleared before - writing. */ -#cmakedefine H5_CLEAR_MEMORY @H5_CLEAR_MEMORY@ - /* Define if C++ compiler recognizes offsetof */ #cmakedefine H5_CXX_HAVE_OFFSETOF @CXX_HAVE_OFFSETOF@ @@ -555,8 +548,17 @@ /* The size of `long', as computed by sizeof. */ #cmakedefine H5_SIZEOF_LONG @H5_SIZEOF_LONG@ +/* The size of `long double', as computed by sizeof. */ +#cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@ + #else - # if defined(__LP64__) && __LP64__ + + /* On Apple, to support Universal Binaries (where multiple CPU + architectures exist in one library/executable), we can't assume + the machine doing the compiling has the same endianness or type + sizes as all the various architectures (PowerPC, Intel, ARM). */ + + # if defined(__LP64__) && __LP64__ #define H5_SIZEOF_LONG 8 #define H5_SIZEOF_SIZE_T 8 #define H5_SIZEOF_SSIZE_T 8 @@ -566,10 +568,15 @@ #define H5_SIZEOF_SSIZE_T 4 # endif -#endif + # if defined(__i386__) || defined(__x86_64__) + #define H5_SIZEOF_LONG_DOUBLE 16 + # elif defined(__aarch64__) + #define H5_SIZEOF_LONG_DOUBLE 8 + # else + #cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@ + # endif -/* The size of `long double', as computed by sizeof. */ -#cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@ +#endif /* Define size of long long and/or __int64 bit integer type only if the type exists. */ diff --git a/config/cmake/HDF5PluginMacros.cmake b/config/cmake/HDF5PluginMacros.cmake index a858353..4e05399 100644 --- a/config/cmake/HDF5PluginMacros.cmake +++ b/config/cmake/HDF5PluginMacros.cmake @@ -14,7 +14,9 @@ macro (EXTERNAL_PLUGIN_LIBRARY compress_type) ) endif () FetchContent_GetProperties(PLUGIN) - message (STATUS "HDF5_INCLUDE_DIR=${HDF5_INCLUDE_DIR}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "HDF5_INCLUDE_DIR=${HDF5_INCLUDE_DIR}") + endif () if(NOT PLUGIN_POPULATED) FetchContent_Populate(PLUGIN) include (${HDF_RESOURCES_DIR}/HDF5PluginCache.cmake) @@ -65,8 +67,10 @@ macro (EXTERNAL_PLUGIN_LIBRARY compress_type) add_dependencies (h5ex_d_zfp ${HDF5_LIBSH_TARGET}) target_include_directories (h5ex_d_zfp PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") endif () - endif() - message (STATUS "HDF5_INCLUDE_DIR=${HDF5_INCLUDE_DIR}") + endif () + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "HDF5_INCLUDE_DIR=${HDF5_INCLUDE_DIR}") + endif () set (PLUGIN_BINARY_DIR "${plugin_BINARY_DIR}") set (PLUGIN_SOURCE_DIR "${plugin_SOURCE_DIR}") set (PLUGIN_LIBRARY "PLUGIN") diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index e616984..913b6e1 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -41,7 +41,9 @@ else () # so this one is used. #----------------------------------------------------------------------------- macro (FORTRAN_RUN FUNCTION_NAME SOURCE_CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR1 RETURN_VAR) - message (STATUS "Detecting Fortran ${FUNCTION_NAME}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Detecting Fortran ${FUNCTION_NAME}") + endif () file (WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler1.f90 "${SOURCE_CODE}" @@ -55,18 +57,24 @@ macro (FORTRAN_RUN FUNCTION_NAME SOURCE_CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR1 if (${COMPILE_RESULT_VAR}) set(${RETURN_VAR} ${RUN_RESULT_VAR}) if (${RUN_RESULT_VAR} MATCHES 0) - message (STATUS "Testing Fortran ${FUNCTION_NAME} - OK") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing Fortran ${FUNCTION_NAME} - OK") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Fortran ${FUNCTION_NAME} exists passed\n" ) else () - message (STATUS "Testing Fortran ${FUNCTION_NAME} - Fail") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing Fortran ${FUNCTION_NAME} - Fail") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Fortran ${FUNCTION_NAME} exists failed: ${RUN_RESULT_VAR}\n" ) endif () else () - message (STATUS "Compiling Fortran ${FUNCTION_NAME} - Fail") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Compiling Fortran ${FUNCTION_NAME} - Fail") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Fortran ${FUNCTION_NAME} compiles failed: ${COMPILE_RESULT_VAR}\n" ) @@ -281,7 +289,9 @@ string (REGEX REPLACE " " "" pack_int_sizeof "${pack_int_sizeof}") set (PAC_FC_ALL_INTEGER_KINDS_SIZEOF "\{${pack_int_sizeof}\}") -message (STATUS "....FOUND SIZEOF for INTEGER KINDs ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF}") +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "....FOUND SIZEOF for INTEGER KINDs ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF}") +endif () # ********** # REALS # ********** @@ -426,7 +436,9 @@ else () # so this one is used. #----------------------------------------------------------------------------- macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR) - message (STATUS "Detecting C ${FUNCTION_NAME}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Detecting C ${FUNCTION_NAME}") + endif () if (HDF5_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${HDF5_REQUIRED_LIBRARIES}") @@ -446,22 +458,28 @@ macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR) set (${RETURN_VAR} ${OUTPUT_VAR}) - #message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - #message (STATUS "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ") - #message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - #message (STATUS "Test RUN_RESULT_VAR ${RUN_RESULT_VAR} ") - #message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + #if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + # message (TRACE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + # message (TRACE "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ") + # message (TRACE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + # message (TRACE "Test RUN_RESULT_VAR ${RUN_RESULT_VAR} ") + # message (TRACE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + #endif () if (${COMPILE_RESULT_VAR}) if (${RUN_RESULT_VAR} MATCHES 1) set (${RUN_RESULT_VAR} 1 CACHE INTERNAL "Have C function ${FUNCTION_NAME}") - message (STATUS "Testing C ${FUNCTION_NAME} - OK") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing C ${FUNCTION_NAME} - OK") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the C ${FUNCTION_NAME} exists passed with the following output:\n" "${OUTPUT_VAR}\n\n" ) else () - message (STATUS "Testing C ${FUNCTION_NAME} - Fail") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing C ${FUNCTION_NAME} - Fail") + endif () set (${RUN_RESULT_VAR} 0 CACHE INTERNAL "Have C function ${FUNCTION_NAME}") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the C ${FUNCTION_NAME} exists failed with the following output:\n" diff --git a/config/cmake/HDF5_Examples_options.cmake b/config/cmake/HDF5_Examples_options.cmake index b042c06..d318aac 100644 --- a/config/cmake/HDF5_Examples_options.cmake +++ b/config/cmake/HDF5_Examples_options.cmake @@ -38,6 +38,8 @@ ### enable Fortran builds #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") +### enable FILTERS builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FILTERS:BOOL=ON") ############################################################################################# ### enable parallel program builds diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake index b0f9e23..12dec20 100644 --- a/config/cmake/HDFCXXCompilerFlags.cmake +++ b/config/cmake/HDFCXXCompilerFlags.cmake @@ -14,7 +14,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED TRUE) set(CMAKE_CXX_EXTENSIONS OFF) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_SANITIZER_FLAGS} ${CMAKE_CXX_FLAGS}") -message (STATUS "Warnings Configuration: CXX default: ${CMAKE_CXX_FLAGS}") +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Warnings Configuration: CXX default: ${CMAKE_CXX_FLAGS}") +endif () #----------------------------------------------------------------------------- # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- @@ -28,6 +30,14 @@ if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstdarg-opt") endif () + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0) + if (HDF5_ENABLE_BUILD_DIAGS) + message (STATUS "... default color and URL extended diagnostic messages enabled") + else () + message (STATUS "... disable color and URL extended diagnostic messages") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color") + endif () + endif () endif () endif () @@ -89,14 +99,20 @@ if (NOT MSVC AND NOT MINGW) AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) # add the general CXX flags for g++ compiler versions 4.8 and above. ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-general") - ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-general") + if (HDF5_ENABLE_WARNINGS_AS_ERRORS) + ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-general") + else () + ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-noerror-general") + endif () endif () elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general") elseif (CMAKE_CXX_COMPILER_ID STREQUAL "PGI") list (APPEND HDF5_CMAKE_CXX_FLAGS "-Minform=inform") endif () - message (STATUS "CMAKE_CXX_FLAGS_GENERAL=${HDF5_CMAKE_CXX_FLAGS}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "CMAKE_CXX_FLAGS_GENERAL=${HDF5_CMAKE_CXX_FLAGS}") + endif () endif () #----------------------------------------------------------------------------- @@ -152,7 +168,11 @@ if (NOT MSVC AND NOT MINGW) if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) # autotools always add the C flags with the CXX flags ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-5") - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-5") + if (HDF5_ENABLE_WARNINGS_AS_ERRORS) + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-5") + else () + ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-noerror-5") + endif () endif () # Append more extra warning flags that only gcc 6.x+ know about @@ -177,7 +197,11 @@ if (NOT MSVC AND NOT MINGW) if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0) # autotools always add the C flags with the CXX flags ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/8") - #ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8") + #if (HDF5_ENABLE_WARNINGS_AS_ERRORS) + # ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8") + #else () + # ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/noerror-8") + #endif () if (HDF5_ENABLE_DEV_WARNINGS) # autotools always add the C flags with the CXX flags ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8") diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index e4808d2..bce906d 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -15,7 +15,9 @@ set(CMAKE_C_STANDARD_REQUIRED TRUE) set (CMAKE_C_FLAGS "${CMAKE_C99_STANDARD_COMPILE_OPTION} ${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_SANITIZER_FLAGS} ${CMAKE_C_FLAGS}") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_SANITIZER_FLAGS} ${CMAKE_CXX_FLAGS}") -message (STATUS "Warnings Configuration: default: ${CMAKE_C_FLAGS} : ${CMAKE_CXX_FLAGS}") +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Warnings Configuration: default: ${CMAKE_C_FLAGS} : ${CMAKE_CXX_FLAGS}") +endif () #----------------------------------------------------------------------------- # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- @@ -29,6 +31,20 @@ if (CMAKE_COMPILER_IS_GNUCC) if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt") endif () + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0) + #----------------------------------------------------------------------------- + # Option to allow the user to enable build extended diagnostics + # + # This should NOT be on by default as it can cause process issues. + #----------------------------------------------------------------------------- + option (HDF5_ENABLE_BUILD_DIAGS "Enable color and URL extended diagnostic messages" OFF) + if (HDF5_ENABLE_BUILD_DIAGS) + message (STATUS "... default color and URL extended diagnostic messages enabled") + else () + message (STATUS "... disable color and URL extended diagnostic messages") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color") + endif () + endif () endif () endif () @@ -69,6 +85,18 @@ endif () # break into groups (from the config/gnu-flags file) #----------------------------------------------------------------------------- if (NOT MSVC AND NOT MINGW) + #----------------------------------------------------------------------------- + # Option to allow the user to interpret certain warnings as errors + # + # This should NOT be on by default as it can cause a lot of conflicts with + # new operating systems and compiler versions. Header files that are out of + # our control (MPI, HDFS, etc.) can also raise warnings. + #----------------------------------------------------------------------------- + option (HDF5_ENABLE_WARNINGS_AS_ERRORS "Interpret some warnings as errors" OFF) + if (HDF5_ENABLE_WARNINGS_AS_ERRORS) + message (STATUS "...some warnings will be interpreted as errors") + endif () + if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") list (APPEND HDF5_CMAKE_C_FLAGS "-erroff=%none -DBSD_COMP") else () @@ -96,18 +124,28 @@ if (NOT MSVC AND NOT MINGW) # Add general CFlags for GCC versions 4.8 and above if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8) ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/general") - ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general") + if (HDF5_ENABLE_WARNINGS_AS_ERRORS) + ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-general") + else () + ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/noerror-general") + endif () endif () # gcc automatically inlines based on the optimization level # this is just a failsafe list (APPEND H5_CFLAGS0 "-finline-functions") elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang") ADD_H5_FLAGS (HDF5_CMAKE_C_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general") - ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/error-general") + if (HDF5_ENABLE_WARNINGS_AS_ERRORS) + ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/error-general") + else () + ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/noerror-general") + endif () elseif (CMAKE_C_COMPILER_ID STREQUAL "PGI") list (APPEND HDF5_CMAKE_C_FLAGS "-Minform=inform") endif () - message (STATUS "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "CMAKE_C_FLAGS_GENERAL=${HDF5_CMAKE_C_FLAGS}") + endif () endif () #----------------------------------------------------------------------------- @@ -132,7 +170,6 @@ if (NOT MSVC AND NOT MINGW) endif () endif () - if (CMAKE_C_COMPILER_ID STREQUAL "GNU") # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... Only needed for gcc 4.X @@ -158,7 +195,11 @@ if (NOT MSVC AND NOT MINGW) # Append more extra warning flags that only gcc 5.x+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/5") - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5") + if (HDF5_ENABLE_WARNINGS_AS_ERRORS) + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5") + else () + ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-5") + endif () endif () # Append more extra warning flags that only gcc 6.x+ know about @@ -179,7 +220,9 @@ if (NOT MSVC AND NOT MINGW) # Append more extra warning flags that only gcc 8.x+ know about if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.0) ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/8") - ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8") + if (HDF5_ENABLE_WARNINGS_AS_ERRORS) + ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-8") + endif () if (HDF5_ENABLE_DEV_WARNINGS) ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/developer-8") else () diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake index d133069..8b631ad 100644 --- a/config/cmake/HDFFortranCompilerFlags.cmake +++ b/config/cmake/HDFFortranCompilerFlags.cmake @@ -10,7 +10,9 @@ # help@hdfgroup.org. # -message (STATUS "Warnings Configuration: default Fortran: ${CMAKE_Fortran_FLAGS}") +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Warnings Configuration: default Fortran: ${CMAKE_Fortran_FLAGS}") +endif () #----------------------------------------------------------------------------- # Option to allow the user to disable compiler warnings @@ -43,6 +45,14 @@ endif () #----------------------------------------------------------------------------- # HDF5 library compile options #----------------------------------------------------------------------------- +if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 10.0) + if (HDF5_ENABLE_BUILD_DIAGS) + message (STATUS "... default color and URL extended diagnostic messages enabled") + else () + message (STATUS "... disable color and URL extended diagnostic messages") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdiagnostics-urls=never -fno-diagnostics-color") + endif () +endif () #----------------------------------------------------------------------------- # CDash is configured to only allow 3000 warnings, so @@ -64,7 +74,9 @@ if (NOT MSVC AND NOT MINGW) elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "PGI") list (APPEND HDF5_CMAKE_Fortran_FLAGS "-Mfreeform" "-Mdclchk" "-Mstandard" "-Mallocatable=03") endif () - message (STATUS "HDF5_CMAKE_Fortran_FLAGS=${HDF5_CMAKE_Fortran_FLAGS}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "HDF5_CMAKE_Fortran_FLAGS=${HDF5_CMAKE_Fortran_FLAGS}") + endif () if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") diff --git a/config/cmake/fileCompareTest.cmake b/config/cmake/fileCompareTest.cmake index 2bbeecc..4a8dc09 100644 --- a/config/cmake/fileCompareTest.cmake +++ b/config/cmake/fileCompareTest.cmake @@ -24,9 +24,6 @@ endif () if (NOT TEST_FUNCTION) message (FATAL_ERROR "Require TEST_FUNCTION (LT,LTEQ,EQ,GTEQ,GT) to be defined") endif () -#if (NOT TEST_EXPECT) -# message (STATUS "Require TEST_EXPECT to be defined") -#endif () set (TEST_ONE_SIZE 0) set (TEST_TWO_SIZE 0) @@ -53,7 +50,9 @@ if (TEST_STRINGS STREQUAL "YES") RESULT_VARIABLE TEST_RESULT ) - message (STATUS "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}-${TEST_O_STRING_LEN}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}-${TEST_O_STRING_LEN}") + endif () # if the return value is !=${TEST_EXPECT} bail out if (NOT TEST_RESULT EQUAL TEST_EXPECT) message (FATAL_ERROR "Failed: The output of ${TEST_FOLDER}/${TEST_ONEFILE} did not match ${TEST_FOLDER}/${TEST_TWOFILE}.\n${TEST_ERROR}") @@ -66,31 +65,41 @@ else () file (SIZE ${TEST_FOLDER}/${TEST_TWOFILE} TEST_TWO_SIZE) if (TEST_FUNCTION MATCHES "LT") if (TEST_ONE_SIZE LESS TEST_TWO_SIZE) - message (STATUS "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was less ${TEST_FOLDER}/${TEST_TWOFILE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was less ${TEST_FOLDER}/${TEST_TWOFILE}") + endif () else () message (FATAL_ERROR "The size of ${TEST_FOLDER}/${TEST_ONEFILE} was NOT less ${TEST_FOLDER}/${TEST_TWOFILE}") endif () elseif (TEST_FUNCTION MATCHES "LTEQ") if (TEST_ONE_SIZE LESS_EQUAL TEST_TWO_SIZE) - message (STATUS "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was less or equal ${TEST_FOLDER}/${TEST_TWOFILE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSES "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was less or equal ${TEST_FOLDER}/${TEST_TWOFILE}") + endif () else () message (FATAL_ERROR "The size of ${TEST_FOLDER}/${TEST_ONEFILE} was NOT less or equal ${TEST_FOLDER}/${TEST_TWOFILE}") endif () elseif (TEST_FUNCTION MATCHES "EQ") if (TEST_ONE_SIZE LESS_EQUAL TEST_TWO_SIZE) - message (STATUS "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was equal ${TEST_FOLDER}/${TEST_TWOFILE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was equal ${TEST_FOLDER}/${TEST_TWOFILE}") + endif () else () message (FATAL_ERROR "The size of ${TEST_FOLDER}/${TEST_ONEFILE} was NOT equal ${TEST_FOLDER}/${TEST_TWOFILE}") endif () elseif (TEST_FUNCTION MATCHES "GTEQ") if (TEST_ONE_SIZE LESS_EQUAL TEST_TWO_SIZE) - message (STATUS "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was greater or equal ${TEST_FOLDER}/${TEST_TWOFILE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was greater or equal ${TEST_FOLDER}/${TEST_TWOFILE}") + endif () else () message (FATAL_ERROR "The size of ${TEST_FOLDER}/${TEST_ONEFILE} was NOT greater or equal ${TEST_FOLDER}/${TEST_TWOFILE}") endif () elseif (TEST_FUNCTION MATCHES "GT") if (TEST_ONE_SIZE LESS_EQUAL TEST_TWO_SIZE) - message (STATUS "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was greater ${TEST_FOLDER}/${TEST_TWOFILE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Passed: The size of ${TEST_FOLDER}/${TEST_ONEFILE} was greater ${TEST_FOLDER}/${TEST_TWOFILE}") + endif () else () message (FATAL_ERROR "The size of ${TEST_FOLDER}/${TEST_ONEFILE} was NOT greater ${TEST_FOLDER}/${TEST_TWOFILE}") endif () diff --git a/config/cmake/libhdf5.pc.in b/config/cmake/libhdf5.pc.in deleted file mode 100644 index 4a2ebaa..0000000 --- a/config/cmake/libhdf5.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -prefix=@_PKG_CONFIG_PREFIX@ -exec_prefix=@_PKG_CONFIG_EXEC_PREFIX@ -libdir=@_PKG_CONFIG_LIBDIR@ -includedir=@_PKG_CONFIG_INCLUDEDIR@ - -Name: @_PKG_CONFIG_LIBNAME@ -Description: HDF5 (Hierarchical Data Format 5) Software Library -Version: @_PKG_CONFIG_VERSION@ - -Cflags: -I${includedir} -Libs: -L${libdir} @_PKG_CONFIG_SH_LIBS@ -Requires: @_PKG_CONFIG_REQUIRES@ -Libs.private: @_PKG_CONFIG_LIBS_PRIVATE@ @_PKG_CONFIG_LIBS@ -Requires.private: @_PKG_CONFIG_REQUIRES_PRIVATE@ diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index c654702..61a47be 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -22,21 +22,6 @@ include (CheckVariableExists) include (TestBigEndian) include (CheckStructHasMember) -#----------------------------------------------------------------------------- -# APPLE/Darwin setup -#----------------------------------------------------------------------------- -if (APPLE) - list (LENGTH CMAKE_OSX_ARCHITECTURES ARCH_LENGTH) - if (ARCH_LENGTH GREATER 1) - set (CMAKE_OSX_ARCHITECTURES "" CACHE STRING "" FORCE) - message (FATAL_ERROR "Building Universal Binaries on OS X is NOT supported by the HDF5 project. This is" - "due to technical reasons. The best approach would be build each architecture in separate directories" - "and use the 'lipo' tool to combine them into a single executable or library. The 'CMAKE_OSX_ARCHITECTURES'" - "variable has been set to a blank value which will build the default architecture for this system.") - endif () - set (${HDF_PREFIX}_AC_APPLE_UNIVERSAL_BUILD 0) -endif () - # Check for Darwin (not just Apple - we also want to catch OpenDarwin) if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set (${HDF_PREFIX}_HAVE_DARWIN 1) @@ -226,7 +211,9 @@ macro (HDF_FUNCTION_TEST OTHER_TEST) ) endif () - #message (STATUS "Performing ${OTHER_TEST}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "Performing ${OTHER_TEST}") + endif () try_compile (${OTHER_TEST} ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFTests.c @@ -236,9 +223,13 @@ macro (HDF_FUNCTION_TEST OTHER_TEST) ) if (${OTHER_TEST}) set (${HDF_PREFIX}_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}") - message (STATUS "Performing Other Test ${OTHER_TEST} - Success") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing Other Test ${OTHER_TEST} - Success") + endif () else () - message (STATUS "Performing Other Test ${OTHER_TEST} - Failed") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing Other Test ${OTHER_TEST} - Failed") + endif () set (${HDF_PREFIX}_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}") file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing Other Test ${OTHER_TEST} failed with the following output:\n" @@ -299,17 +290,23 @@ if (MINGW OR NOT WINDOWS) set (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg}) set (LARGEFILE 1) set (HDF_EXTRA_FLAGS ${HDF_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) - message (STATUS "${msg}... yes") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... yes") + endif () else () set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Test TEST_LFS_WORKS Run failed with the following exit code:\n ${TEST_LFS_WORKS_RUN}\n" ) endif () else () set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) - message (STATUS "${msg}... no") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${msg}... no") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Test TEST_LFS_WORKS Compile failed\n" ) @@ -342,11 +339,15 @@ endif () macro (HDF_CHECK_TYPE_SIZE type var) set (aType ${type}) set (aVar ${var}) -# message (STATUS "Checking size of ${aType} and storing into ${aVar}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "Checking size of ${aType} and storing into ${aVar}") + endif () CHECK_TYPE_SIZE (${aType} ${aVar}) if (NOT ${aVar}) set (${aVar} 0 CACHE INTERNAL "SizeOf for ${aType}") -# message (STATUS "Size of ${aType} was NOT Found") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "Size of ${aType} was NOT Found") + endif () endif () endmacro () @@ -576,7 +577,9 @@ endif () #----------------------------------------------------------------------------- if (WINDOWS) if (NOT HDF_NO_IOEO_TEST) - message (STATUS "Checking for InitOnceExecuteOnce:") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Checking for InitOnceExecuteOnce:") + endif () if (NOT DEFINED ${HDF_PREFIX}_HAVE_IOEO) if (LARGEFILE) set (CMAKE_REQUIRED_DEFINITIONS @@ -605,7 +608,9 @@ if (WINDOWS) # if the return value was 0 then it worked if ("${HAVE_IOEO_EXITCODE}" EQUAL 0) set (${HDF_PREFIX}_HAVE_IOEO 1 CACHE INTERNAL "Test InitOnceExecuteOnce") - message (STATUS "Performing Test InitOnceExecuteOnce - Success") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing Test InitOnceExecuteOnce - Success") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing C SOURCE FILE Test InitOnceExecuteOnce succeded with the following output:\n" "${OUTPUT}\n" @@ -617,7 +622,9 @@ if (WINDOWS) set (${HDF_PREFIX}_HAVE_IOEO "" CACHE INTERNAL "Test InitOnceExecuteOnce") endif () - message (STATUS "Performing Test InitOnceExecuteOnce - Failed") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing Test InitOnceExecuteOnce - Failed") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing InitOnceExecuteOnce Test failed with the following output:\n" "${OUTPUT}\n" @@ -640,7 +647,9 @@ endforeach () #----------------------------------------------------------------------------- if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES "unknown") set (PRINT_LL_FOUND 0) - message (STATUS "Checking for appropriate format for 64 bit long:") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Checking for appropriate format for 64 bit long:") + endif () set (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH") if (${HDF_PREFIX}_SIZEOF_LONG_LONG) set (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG") @@ -657,7 +666,9 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES " set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"${${HDF_PREFIX}_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll") set (PRINT_LL_FOUND 1) else () - message (STATUS "Width test failed with result: ${${HDF_PREFIX}_PRINTF_LL_TEST_RUN}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Width test failed with result: ${${HDF_PREFIX}_PRINTF_LL_TEST_RUN}") + endif () endif () else () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log @@ -666,9 +677,13 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES " endif () if (PRINT_LL_FOUND) - message (STATUS "Checking for appropriate format for 64 bit long: found ${${HDF_PREFIX}_PRINTF_LL_WIDTH}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Checking for appropriate format for 64 bit long: found ${${HDF_PREFIX}_PRINTF_LL_WIDTH}") + endif () else () - message (STATUS "Checking for appropriate format for 64 bit long: not found") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Checking for appropriate format for 64 bit long: not found") + endif () set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll" ) diff --git a/config/cmake_ext_mod/FindSZIP.cmake b/config/cmake_ext_mod/FindSZIP.cmake index c3dc04a..846a3d1 100644 --- a/config/cmake_ext_mod/FindSZIP.cmake +++ b/config/cmake_ext_mod/FindSZIP.cmake @@ -118,7 +118,9 @@ if (NOT SZIP_FOUND) "SZip was not found. Make sure SZIP_LIBRARY and SZIP_INCLUDE_DIR are set or set the SZIP_INSTALL environment variable." ) if (NOT SZIP_FIND_QUIETLY) - message (STATUS "${SZIP_DIR_MESSAGE}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "${SZIP_DIR_MESSAGE}") + endif () else () if (SZIP_FIND_REQUIRED) message (FATAL_ERROR "SZip was NOT found and is Required by this project") diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index c26956b..c84c842 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -28,7 +28,9 @@ macro (SET_HDF_BUILD_TYPE) endif() endif() if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - message (STATUS "Setting build type to 'RelWithDebInfo' as none was specified.") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Setting build type to 'RelWithDebInfo' as none was specified.") + endif() set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE) # Set the possible values of build type for cmake-gui set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" @@ -458,19 +460,19 @@ endmacro () macro (ADD_H5_FLAGS h5_flag_var infile) file (STRINGS ${infile} TEST_FLAG_STREAM) - #message (STATUS "TEST_FLAG_STREAM=${TEST_FLAG_STREAM}") + #message (TRACE "TEST_FLAG_STREAM=${TEST_FLAG_STREAM}") list (LENGTH TEST_FLAG_STREAM len_flag) if (len_flag GREATER 0) math (EXPR _FP_LEN "${len_flag} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET TEST_FLAG_STREAM ${line} str_flag) string (REGEX REPLACE "^#.*" "" str_flag "${str_flag}") - #message (STATUS "str_flag=${str_flag}") + #message (TRACE "str_flag=${str_flag}") if (str_flag) list (APPEND ${h5_flag_var} "${str_flag}") endif () endforeach () endif () - #message (STATUS "h5_flag_var=${${h5_flag_var}}") + #message (TRACE "h5_flag_var=${${h5_flag_var}}") endmacro () diff --git a/config/cmake_ext_mod/HDFUseCXX.cmake b/config/cmake_ext_mod/HDFUseCXX.cmake index 9b4b138..28e7f8a 100644 --- a/config/cmake_ext_mod/HDFUseCXX.cmake +++ b/config/cmake_ext_mod/HDFUseCXX.cmake @@ -70,7 +70,9 @@ macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) ) endif () - #message (STATUS "Performing ${OTHER_TEST}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "Performing ${OTHER_TEST}") + endif () TRY_COMPILE (${OTHER_TEST} ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFCXXTests.cpp @@ -80,9 +82,13 @@ macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) ) if (${OTHER_TEST} EQUAL 0) set (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}") - message (STATUS "Performing CXX Test ${OTHER_TEST} - Success") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing CXX Test ${OTHER_TEST} - Success") + endif () else () - message (STATUS "Performing CXX Test ${OTHER_TEST} - Failed") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Performing CXX Test ${OTHER_TEST} - Failed") + endif () set (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}") file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Performing CXX Test ${OTHER_TEST} failed with the following output:\n" diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake index 17fdefb..9cbcd76 100644 --- a/config/cmake_ext_mod/HDFUseFortran.cmake +++ b/config/cmake_ext_mod/HDFUseFortran.cmake @@ -135,7 +135,9 @@ else () # so this one is used for a sizeof test. #----------------------------------------------------------------------------- macro (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) - message (STATUS "Testing Fortran ${FUNCTION}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing Fortran ${FUNCTION}") + endif () if (HDF5_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${HDF5_REQUIRED_LIBRARIES}") @@ -153,13 +155,17 @@ else () OUTPUT_VARIABLE OUTPUT ) - # message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - # message (STATUS "Test result ${OUTPUT}") - # message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + # if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + # message (TRACE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + # message (TRACE "Test result ${OUTPUT}") + # message (TRACE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + # endif () if (${RESULT_VAR}) set (${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}") - message (STATUS "Testing Fortran ${FUNCTION} - OK") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (VERBOSE "Testing Fortran ${FUNCTION} - OK") + endif () file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n" "${OUTPUT}\n\n" diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake index 8538f32..631fca6 100644 --- a/config/cmake_ext_mod/grepTest.cmake +++ b/config/cmake_ext_mod/grepTest.cmake @@ -16,18 +16,12 @@ if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM to be defined") endif () -#if (NOT TEST_ARGS) -# message (STATUS "Require TEST_ARGS to be defined") -#endif () if (NOT TEST_FOLDER) message (FATAL_ERROR "Require TEST_FOLDER to be defined") endif () if (NOT TEST_OUTPUT) message (FATAL_ERROR "Require TEST_OUTPUT to be defined") endif () -#if (NOT TEST_EXPECT) -# message (STATUS "Require TEST_EXPECT to be defined") -#endif () if (NOT TEST_FILTER) message (STATUS "Optional TEST_FILTER to be defined") endif () @@ -55,7 +49,9 @@ endif () if (TEST_ENV_VAR) set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") - #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") + message (TRACE "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}") + endif () endif () # run the test program, capture the stdout/stderr and the result var diff --git a/config/commence.am b/config/commence.am index 731ad43..385da06 100644 --- a/config/commence.am +++ b/config/commence.am @@ -43,15 +43,15 @@ LIBH5CPP_HL=$(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la # Install directories that automake doesn't know about docdir = $(exec_prefix)/doc -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -61,17 +61,17 @@ H5CC_PP=${DESTDIR}$(bindir)/h5pcc H5FC=${DESTDIR}$(bindir)/h5fc H5FC_PP=${DESTDIR}$(bindir)/h5pfc H5CPP=${DESTDIR}$(bindir)/h5c++ - + # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS=@AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS=@AM_CFLAGS@ @H5_CFLAGS@ AM_FCFLAGS=@AM_FCFLAGS@ @H5_FCFLAGS@ -AM_CXXFLAGS=@AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS=@AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_CPPFLAGS=@AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_LDFLAGS=@AM_LDFLAGS@ @H5_LDFLAGS@ @@ -95,8 +95,9 @@ CHECK_CLEANFILES=*.chkexe *.chklog *.clog *.clog2 # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/config/conclude.am b/config/conclude.am index 2abc6e3..8412057 100644 --- a/config/conclude.am +++ b/config/conclude.am @@ -25,8 +25,8 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ $(noinst_LTLIBRARIES) $(check_LIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LIB) PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) -TESTS = $(TEST_PROG) $(TEST_SCRIPT) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +TESTS = $(TEST_PROG) $(TEST_SCRIPT) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) @@ -183,7 +183,7 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: fi; \ fi; \ fi - + # The dummysh.chkexe here prevents the target from being # empty if there are no tests in the current directory. # $${log} is the log file. diff --git a/config/examples.am b/config/examples.am index 1cdee34..03108ef 100644 --- a/config/examples.am +++ b/config/examples.am @@ -33,7 +33,7 @@ ## INSTALL_TOP_FILES ## ## EXAMPLEDIR -## The directory into which examples should be installed. +## The directory into which examples should be installed. ## ## Build rules for $(EXTRA_PROG). ## Dependencies for example programs. @@ -62,7 +62,7 @@ install-data-local: uninstall-local: @$(MAKE) $(AM_MAKEFLAGS) uninstall-examples -install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) +install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ @@ -109,7 +109,7 @@ installcheck-local: H5CCFLAGS="-shlib" $(MAKE) $(AM_MAKEFLAGS) check; \ else \ $(MAKE) $(AM_MAKEFLAGS) check; \ - fi + fi @if test "$(INSTALL_FILES)" -a $(TEST_EXAMPLES_SCRIPT) -a -d $(EXAMPLEDIR); then \ echo "============================"; \ echo "Testing $(TEST_EXAMPLES_SCRIPT)"; \ diff --git a/config/freebsd b/config/freebsd index 5ac3de5..7f25ba8 100644 --- a/config/freebsd +++ b/config/freebsd @@ -18,24 +18,31 @@ # # See BlankForm in this directory for details. -# The default compiler is `gcc' +# The default compiler is 'cc' if test "X-" = "X-$CC"; then - CC=gcc - CC_BASENAME=gcc + CC=cc + CC_BASENAME=cc fi -# Figure out C compiler flags +# Figure out clang C compiler flags +. $srcdir/config/clang-flags + +# Figure out GNU C compiler flags . $srcdir/config/gnu-flags # Figure out Intel C compiler flags . $srcdir/config/intel-flags # The default Fortran 90 compiler +# No default Fortran compiler for clang. flang exists on +# FreeBSD as a port, but this is tied to an ancient LLVM +# and lacks Fortran 2003 features which causes configure +# to fail. if test "X-" = "X-$FC"; then case $CC_BASENAME in gcc*|pgcc*) - FC=gfortran40 - FC_BASENAME=gfortran40 + FC=gfortran + FC_BASENAME=gfortran ;; icc*) FC=ifort @@ -54,3 +61,16 @@ fi # Figure out Intel F90 compiler flags . $srcdir/config/intel-fflags +# The default C++ compiler + +# The default compiler is 'c++'. +if test -z "$CXX"; then + CXX=c++ + CXX_BASENAME=c++ +fi + +# Figure out Clang CXX compiler flags +. $srcdir/config/clang-cxxflags + +# Figure out GNU CXX compiler flags +. $srcdir/config/gnu-cxxflags diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags index b8cac77..3fe13d8 100644 --- a/config/gnu-cxxflags +++ b/config/gnu-cxxflags @@ -144,6 +144,15 @@ if test "X-g++" = "X-$cxx_vendor"; then DEBUG_CXXFLAGS="-ftrapv -fno-common" fi + ######################## + # Enhanced Diagnostics # + ######################## + + if test $cc_vers_major -ge 10; then + NO_DIAGS_CXXFLAGS="-fdiagnostics-urls=never -fno-diagnostics-color" + fi + DIAGS_CXXFLAGS= + ########### # Symbols # ########### @@ -184,10 +193,11 @@ if test "X-g++" = "X-$cxx_vendor"; then if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8 -o $cxx_vers_major -ge 5; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-general)" H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments cxx-error-general)" + H5_NECXXFLAGS="$H5_NECXXFLAGS $(load_gnu_arguments cxx-noerror-general)" - ###################### - # Developer warnings # - ###################### + ###################### + # Developer warnings # + ###################### NO_DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments no-developer-general) DEVELOPER_WARNING_CXXFLAGS=$(load_gnu_arguments developer-general) @@ -209,7 +219,7 @@ if test "X-g++" = "X-$cxx_vendor"; then # gcc >= 4.8 if test $cxx_vers_major -ge 5 -o $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8; then - H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 4.8)" + H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-4.8)" DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-4.8)" NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-4.8)" fi @@ -224,6 +234,7 @@ if test "X-g++" = "X-$cxx_vendor"; then if test $cxx_vers_major -ge 5; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-5)" H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments cxx-error-5)" + H5_NECXXFLAGS="$H5_NECXXFLAGS $(load_gnu_arguments cxx-noerror-5)" fi # gcc >= 6 @@ -241,6 +252,7 @@ if test "X-g++" = "X-$cxx_vendor"; then if test $cxx_vers_major -ge 8; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments 8)" #H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments error-8)" + #H5_NECXXFLAGS="$H5_NECXXFLAGS $(load_gnu_arguments noerror-8)" DEVELOPER_WARNING_CXXFLAGS="$DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments developer-8)" NO_DEVELOPER_WARNING_CXXFLAGS="$NO_DEVELOPER_WARNING_CXXFLAGS $(load_gnu_arguments no-developer-8)" fi diff --git a/config/gnu-fflags b/config/gnu-fflags index 09c96ce..d4f876d 100644 --- a/config/gnu-fflags +++ b/config/gnu-fflags @@ -100,11 +100,20 @@ if test "X-gfortran" = "X-$f9x_vendor"; then ######### if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 5; then - DEBUG_FCFLAGS=$DEBUG_OPT_FCFLAGS "-fcheck=all" + DEBUG_FCFLAGS="-fcheck=all" else - DEBUG_FCFLAGS=$DEBUG_OPT_FCFLAGS "-fbounds-check" + DEBUG_FCFLAGS="-fbounds-check" fi + ######################## + # Enhanced Diagnostics # + ######################## + + if test $cc_vers_major -ge 10; then + NO_DIAGS_FCFLAGS="-fdiagnostics-urls=never -fno-diagnostics-color" + fi + DIAGS_FCFLAGS= + ########### # Symbols # ########### diff --git a/config/gnu-flags b/config/gnu-flags index ee570c5..01533de 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -118,12 +118,16 @@ if test "X-gcc" = "X-$cc_vendor"; then esac case "$host_os-$host_cpu" in - # cygwin needs the "-std=c99" flag removed, so make - # a specific case for Cygwin without the flag and a default - # case to add the flag everywhere else + # Cygwin needs the "-std=c99" flag removed. cygwin-*) ;; - + # On Solaris, gcc needs the gnu99 standard to pick up certain POSIX + # things. Do NOT use this as the gcc norm as this encourages the use + # of non-standard gcc extensions. + *solaris*) + H5_CFLAGS="$H5_CFLAGS -std=gnu99" + ;; + # Everybody else gets c99 as the standard. *) H5_CFLAGS="$H5_CFLAGS -std=c99" ;; @@ -154,6 +158,15 @@ if test "X-gcc" = "X-$cc_vendor"; then DEBUG_CFLAGS="-ftrapv -fno-common" fi + ######################## + # Enhanced Diagnostics # + ######################## + + if test $cc_vers_major -ge 10; then + NO_DIAGS_CFLAGS="-fdiagnostics-urls=never -fno-diagnostics-color" + fi + DIAGS_CFLAGS= + ########### # Symbols # ########### @@ -192,6 +205,7 @@ if test "X-gcc" = "X-$cc_vendor"; then if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8 -o $cc_vers_major -gt 4; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments general)" H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-general)" + H5_NECFLAGS="$H5_NECFLAGS $(load_gnu_arguments noerror-general)" ###################### # Developer warnings # @@ -231,6 +245,7 @@ if test "X-gcc" = "X-$cc_vendor"; then if test $cc_vers_major -ge 5; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 5)" H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-5)" + H5_NECFLAGS="$H5_NECFLAGS $(load_gnu_arguments noerror-5)" fi # gcc >= 6 @@ -248,6 +263,7 @@ if test "X-gcc" = "X-$cc_vendor"; then if test $cc_vers_major -ge 8; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 8)" H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-8)" + H5_NECFLAGS="$H5_NECFLAGS $(load_gnu_arguments noerror-8)" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-8)" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-8)" fi @@ -257,6 +273,16 @@ if test "X-gcc" = "X-$cc_vendor"; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 9)" fi + # gcc >= 9.3 + if test $cc_vers_major -ge 10 -o $cc_vers_major -eq 9 -a $cc_vers_minor -ge 3; then + H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 9.3)" + fi + + # gcc >= 10 + if test $cc_vers_major -ge 10; then + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-10)" + fi + ################# # Flags are set # ################# diff --git a/config/gnu-warnings/4.8 b/config/gnu-warnings/4.8 index c7e3dd1..fa678ff 100644 --- a/config/gnu-warnings/4.8 +++ b/config/gnu-warnings/4.8 @@ -10,6 +10,10 @@ # warning flag added for GCC >= 4.5 -Wstrict-overflow=5 +# This warning can only be truly addressed using the gcc extension of +# using D to indicate doubles (e.g., 1.23D). +-Wno-unsuffixed-float-constants + # warning flags added for GCC >= 4.6 -Wdouble-promotion -Wtrampolines diff --git a/config/gnu-warnings/7 b/config/gnu-warnings/7 index 266f5c1..9d5b44d 100644 --- a/config/gnu-warnings/7 +++ b/config/gnu-warnings/7 @@ -3,5 +3,4 @@ -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=1 --Wimplicit-fallthrough=5 -Wrestrict diff --git a/config/gnu-warnings/9.3 b/config/gnu-warnings/9.3 new file mode 100644 index 0000000..f37fdd6 --- /dev/null +++ b/config/gnu-warnings/9.3 @@ -0,0 +1 @@ +-Wc11-c2x-compat diff --git a/config/gnu-warnings/cxx-4.8 b/config/gnu-warnings/cxx-4.8 new file mode 100644 index 0000000..744ebdc --- /dev/null +++ b/config/gnu-warnings/cxx-4.8 @@ -0,0 +1,26 @@ +# warning flags added for GCC >= 4.3 +-Wlarger-than=2560 +-Wlogical-op + +# warning flags added for GCC >= 4.4 +-Wframe-larger-than=16384 +-Wpacked-bitfield-compat +-Wsync-nand + +# warning flag added for GCC >= 4.5 +-Wstrict-overflow=5 + +# warning flags added for GCC >= 4.6 +-Wdouble-promotion +-Wtrampolines + +# warning flag added for GCC >= 4.7 +# +# -Wstack-usage=8192 warnings need to be swept up on a branch so +# that we can stop burdening the whole development team. +# +-Wstack-usage=8192 + +# warning flag added for GCC >= 4.8 +-Wmaybe-uninitialized + diff --git a/config/gnu-warnings/cxx-noerror-5 b/config/gnu-warnings/cxx-noerror-5 new file mode 100644 index 0000000..7bce3e8 --- /dev/null +++ b/config/gnu-warnings/cxx-noerror-5 @@ -0,0 +1,11 @@ +# +# In GCC 4.4.7, the compiler gripes about shadowed global +# declarations when a local variable uses the name of a +# function that's in a system header file. For some reason, +# later versions of GCC (e.g., 5.2.0) don't complain about +# the shadowed globals. Maybe later versions are less fussy? +# Anyway, the shadowing seems to be harmless, and GCC 4.4.7 +# is not a supported compiler, so let us promote shadowed globals +# warnings to errors only for GCC 5 and later. +# +-Wshadow diff --git a/config/gnu-warnings/cxx-noerror-general b/config/gnu-warnings/cxx-noerror-general new file mode 100644 index 0000000..8cc1d94 --- /dev/null +++ b/config/gnu-warnings/cxx-noerror-general @@ -0,0 +1,32 @@ +# +# HDF5 code should not trigger the following warnings under any +# circumstances, so ask the compiler to treat them as errors: +# +# NOTE: c++/test files are not compatible with these warnings as errors +# c++/test/tcompound.cpp +# -Werror=cast-align +-Wcast-align +# NOTE: c++/src files are not compatible with these warnings as errors +# c++/src/H5Object.cpp +# -Werror=missing-declarations +-Wmissing-declarations +-Wpacked +-Wredundant-decls +-Wswitch +# NOTE: c++/test files are not compatible with these warnings as errors +# c++/test/tattr.cpp +# -Werror=unused-but-set-variable +-Wunused-but-set-variable +-Wunused-function +-Wunused-variable +# NOTE: c++/src files are not compatible with these warnings as errors +# c++/src/H5Object.cpp,c++/src/H5StrType.cpp,c++/src/H5PredType.cpp +# -Werror=unused-parameter +-Wunused-parameter +# +# Other files not compatible +# NOTE: c++/test files are not compatible with these warnings as errors +# c++/test/titerate.cpp,c++/test/tarray.cpp +# -Werror=missing-declarations +# c++/test/titerate.cpp,c++/test/tarray.cpp,c++/test/tlinks.cpp,c++/test/ttypes.cpp,c++/test/dsets.cpp +# -Werror=unused-parameter diff --git a/config/gnu-warnings/developer-10 b/config/gnu-warnings/developer-10 new file mode 100644 index 0000000..fcd460d --- /dev/null +++ b/config/gnu-warnings/developer-10 @@ -0,0 +1,6 @@ +# New warning +-Warith-conversion + +# Enable static analysis of program flow +-fanalyzer +-fdiagnostics-path-format=none diff --git a/config/gnu-warnings/developer-4.8 b/config/gnu-warnings/developer-4.8 index fd76f6c..bfd15a1 100644 --- a/config/gnu-warnings/developer-4.8 +++ b/config/gnu-warnings/developer-4.8 @@ -5,7 +5,6 @@ # the variable is never *used* before it has been initialized? # -Wjump-misses-init --Wunsuffixed-float-constants # developer warning flag added for GCC >= 4.6 -Wsuggest-attribute=const diff --git a/config/gnu-warnings/error-general b/config/gnu-warnings/error-general index 4b822a5..4358b20 100644 --- a/config/gnu-warnings/error-general +++ b/config/gnu-warnings/error-general @@ -12,15 +12,12 @@ -Werror=packed -Werror=pointer-sign -Werror=pointer-to-int-cast +-Werror=redundant-decls -Werror=strict-prototypes -Werror=switch # #-Werror=discarded-qualifiers # -# NOTE: hl/src/H5LTparse.c file is not compatible with these warnings as errors -# -Werror=redundant-decls -# --Wredundant-decls # # NOTE: File Driver files are not compatible with these warnings as errors # H5FDdirect.c,H5FDmpio.c,H5FDros3.c, @@ -62,7 +59,7 @@ # jni/h5util.c # -Werror=format(-overflow) # --Wformat +-Werror=format # # #Examples and tests do not use the same set of extensive warning flags as libraries diff --git a/config/gnu-warnings/no-developer-4.8 b/config/gnu-warnings/no-developer-4.8 index 1e29c78..09a9a96 100644 --- a/config/gnu-warnings/no-developer-4.8 +++ b/config/gnu-warnings/no-developer-4.8 @@ -1,6 +1,5 @@ # no-developer warning flag added for GCC >= 4.5 -Wno-jump-misses-init --Wno-unsuffixed-float-constants # no-developer warning flag added for GCC >= 4.6 -Wno-suggest-attribute=const diff --git a/config/gnu-warnings/noerror-5 b/config/gnu-warnings/noerror-5 new file mode 100644 index 0000000..a7d40dd --- /dev/null +++ b/config/gnu-warnings/noerror-5 @@ -0,0 +1,12 @@ +-Wincompatible-pointer-types +# +# In GCC 4.4.7, the compiler gripes about shadowed global +# declarations when a local variable uses the name of a +# function that's in a system header file. For some reason, +# later versions of GCC (e.g., 5.2.0) don't complain about +# the shadowed globals. Maybe later versions are less fussy? +# Anyway, the shadowing seems to be harmless, and GCC 4.4.7 +# is not a supported compiler, so let us promote shadowed globals +# warnings to errors only for GCC 5 and later. +# +-Wshadow diff --git a/config/gnu-warnings/noerror-8 b/config/gnu-warnings/noerror-8 new file mode 100644 index 0000000..2f54a4d --- /dev/null +++ b/config/gnu-warnings/noerror-8 @@ -0,0 +1,25 @@ +# NOTE: src/ files are not compatible with these warnings as errors +# src/H5Dchunk.c +# -Werror=cast-function-type +-Wcast-function-type +# +# For GCC 8, promote maybe-initialized warnings to an error. GCC 8 +# reports 0 maybe-uninitialized warnings where earlier versions +# make many false reports. GCC 8 seems to analyze calls to static +# in order to detect initializations that occur there. It's possible +# that GCC 8 only performs that analysis at -O3, though. +# +# +# NOTE: File Driver files are not compatible with these warnings as errors +# H5FDlog.c, +# -Werror=maybe-uninitialized +-Wmaybe-uninitialized +# NOTE: src/ files are not compatible with these warnings as errors +# src/H5Shyper.c,src/H5SL.c,src/H5Shyper.c +# -Werror=maybe-uninitialized +# NOTE: Test files are not compatible with these warnings as errors +# test/cache_common.c, +# -Werror=maybe-uninitialized +# NOTE: hl/src/ files are not compatible with these warnings as errors +# hl/src/H5DS.c, +# -Werror=maybe-uninitialized diff --git a/config/gnu-warnings/noerror-general b/config/gnu-warnings/noerror-general new file mode 100644 index 0000000..e19014f --- /dev/null +++ b/config/gnu-warnings/noerror-general @@ -0,0 +1,91 @@ +# +# HDF5 code should not trigger the following warnings under any +# circumstances, so ask the compiler to treat them as errors: +# +-Wbad-function-cast +-Wdeclaration-after-statement +-Wimplicit-function-declaration +-Wmissing-declarations +-Wmissing-prototypes +-Wnested-externs +-Wold-style-definition +-Wpacked +-Wpointer-sign +-Wpointer-to-int-cast +-Wredundant-decls +-Wstrict-prototypes +-Wswitch +# +#-Werror=discarded-qualifiers +# +# +# NOTE: File Driver files are not compatible with these warnings as errors +# H5FDdirect.c,H5FDmpio.c,H5FDros3.c, +# -Werror=unused-function +# +-Wunused-function +# +# H5FDdrvr_module.h +# -Werror=unused-variable +# +-Wunused-variable +# +# H5VLpassthru.c +# -Werror=unused-parameter +# +-Wunused-parameter +# +# +# +# NOTE: Tools files are not compatible with these warnings as errors +# lib/h5tools.c +# -Werror=cast-align +# +-Wcast-align +# +# lib/h5diff_array.c +# -Werror=unused-but-set-variable +# +-Wunused-but-set-variable +# +# lib/h5tools_utils.c +# -Werror=unused-parameter +# +# +# NOTE: JNI files are not compatible with these warnings as errors +# jni/h5pDCPLImp.c,jni/nativeData.c,jni/h5util.c,jni/h5rImp.c +# jni/h5sImp.c,jni/h5tImp.c +# -Werror=cast-align +# jni/h5util.c +# -Werror=format(-overflow) +# +-Wformat +# +# +#Examples and tests do not use the same set of extensive warning flags as libraries +# Here is a list of tests and examples that have issues with the stricter warnings as error +# +# NOTE: Test files are not compatible with these warnings as errors +# thread_id.c, +# -Werror=unused-function +# dsets.c +# -Werror=unused-parameter +# external.c,perform/sio_engine.c +# -Werror=format(-truncation) +# +# +# NOTE: Examples files are not compatible with these warnings as errors +# h5_vds-eiger.c,h5_vds-exclim.c,h5_vds.c,h5_vds-exc.c,h5_vds-percival-unlim-maxmin.c +# h5_vds-percival.c,h5_read.c,h5_rdwt.c,h5_mount.c,h5_extend.c,h5_extend_write.c +# h5_write.c,h5_vds-simpleIO.c,h5_ref2reg_deprec.c,h5_crtgrp.c,h5_select.c +# h5_vds-percival-unlim.c,h5_crtatt.c,h5_group.c,h5_attribute.c,h5_crtdat.c +# h5_reference_deprec.c +# h5_rdwt.c,h5_crtgrp.c,h5_crtatt.c,h5_crtdat.c +# -Werror=strict-prototypes +# h5_rdwt.c,h5_crtgrp.c,h5_crtatt.c,h5_crtdat.c +# -Werror=old-style-definition +# h5_vds-exclim.c,h5_vds.c,h5_vds-exc.c, +# -Werror=unused-variable +# h5_elink_unix2win.c,h5_extlink.c,h5_attribute.c +# -Werror=unused-parameter + diff --git a/config/ibm-aix b/config/ibm-aix index c046b83..b4a558d 100644 --- a/config/ibm-aix +++ b/config/ibm-aix @@ -57,9 +57,25 @@ if test "X-" = "X-$f9x_flags_set"; then FCFLAGS="$FCFLAGS ${F9XSUFFIXFLAG}" H5_FCFLAGS="$H5_FCFLAGS ${F9XSUFFIXFLAG}" FSEARCH_DIRS="-I./ -I../src" - DEBUG_FCFLAGS="-g" - PROD_FCFLAGS="-O" - PROFILE_FCFLAGS="-g -pg" + + # Produciton + PROD_FCFLAGS= + + # Debug + DEBUG_FCFLAGS= + + # Symbols + SYMBOLS_FCFLAGS="-g" + NO_SYMBOLS_FCFLAGS= + + # Profiling + PROFILE_FCFLAGS="-pg" + + # Optimization + HIGH_OPT_FCFLAGS="-O" + DEBUG_OPT_FCFLAGS= + NO_OPT_FCFLAGS= + f9x_flags_set=yes fi @@ -89,13 +105,30 @@ case $CC_BASENAME in ;; *) + # Undetermined compiler + # Use very generic flags H5_CFLAGS="$H5_CFLAGS -ansi" - DEBUG_CFLAGS="-g" - DEBUG_CPPFLAGS= - PROD_CFLAGS="-O" - PROD_CPPFLAGS= + + # Produciton + PROD_CFLAGS= + + # Debug + DEBUG_CFLAGS= + + # Symbols + SYMBOLS_CFLAGS="-g" + NO_SYMBOLS_CFLAGS= + + # Profiling PROFILE_CFLAGS="-pg" - PROFILE_CPPFLAGS= + + # Optimization + HIGH_OPT_CFLAGS="-O" + DEBUG_OPT_CFLAGS= + NO_OPT_CFLAGS= + + # Flags are set + cc_flags_set=yes ;; esac diff --git a/config/ibm-flags b/config/ibm-flags index 5c12b79..85fdb88 100644 --- a/config/ibm-flags +++ b/config/ibm-flags @@ -55,17 +55,32 @@ if test "XL" = "$cc_vendor"; then enable_shared="${enable_shared:-no}" # Make sure this is applied to other API compile options such as C++. AM_CFLAGS="$AM_CFLAGS" + # -qflag=w:w makes the lowest level of reported compile issues to be "warning" # instead of "information". This suppresses a very large number of messages # concerning the portability of __inline__. H5_CFLAGS="-qlanglvl=stdc99 -qflag=w:w $H5_CFLAGS" - DEBUG_CFLAGS="-g -qfullpath" - DEBUG_CPPFLAGS= + + # Produciton + PROD_CFLAGS= + + # Debug + # NDEBUG is handled explicitly in configure + DEBUG_CFLAGS="-qfullpath" + + # Symbols + SYMBOLS_CFLAGS="-g" + NO_SYMBOLS_CFLAGS= + + # Profiling + PROFILE_CFLAGS="-pg" + + # Optimization # -O causes test/dtypes to fail badly. Turn it off for now. - PROD_CFLAGS="" - PROD_CPPFLAGS= - PROFILE_CFLAGS="-g -qfullpath -pg" - PROFILE_CPPFLAGS= + HIGH_OPT_CFLAGS= + DEBUG_OPT_CFLAGS= + NO_OPT_CFLAGS= + # Flags are set cc_flags_set=yes fi @@ -104,3 +119,4 @@ if test X != X$CXX; then fi fi + diff --git a/config/libhdf5.pc.in b/config/libhdf5.pc.in new file mode 100644 index 0000000..4a2ebaa --- /dev/null +++ b/config/libhdf5.pc.in @@ -0,0 +1,14 @@ +prefix=@_PKG_CONFIG_PREFIX@ +exec_prefix=@_PKG_CONFIG_EXEC_PREFIX@ +libdir=@_PKG_CONFIG_LIBDIR@ +includedir=@_PKG_CONFIG_INCLUDEDIR@ + +Name: @_PKG_CONFIG_LIBNAME@ +Description: HDF5 (Hierarchical Data Format 5) Software Library +Version: @_PKG_CONFIG_VERSION@ + +Cflags: -I${includedir} +Libs: -L${libdir} @_PKG_CONFIG_SH_LIBS@ +Requires: @_PKG_CONFIG_REQUIRES@ +Libs.private: @_PKG_CONFIG_LIBS_PRIVATE@ @_PKG_CONFIG_LIBS@ +Requires.private: @_PKG_CONFIG_REQUIRES_PRIVATE@ diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index a02b08a..0fef161 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -136,9 +136,25 @@ case $FC_BASENAME in # (just in case since this should be a default EIP) H5_FCFLAGS="$H5_FCFLAGS" FSEARCH_DIRS="" - DEBUG_FCFLAGS="-g" - PROD_FCFLAGS="-O" - PROFILE_FCFLAGS="-g -pg" + + # Production + PROD_FCFLAGS= + + # Debug + DEBUG_FCFLAGS= + + # Symbols + SYMBOLS_FCFLAGS="-g" + NO_SYMBOLS_FCFLAGS="-s" + + # Profiling + PROFILE_FCFLAGS="-pg" + + # Optimization + HIGH_OPT_FCFLAGS="-O" + DEBUG_OPT_FCFLAGS= + NO_OPT_FCFLAGS= + f9x_flags_set=yes ;; # diff --git a/config/pgi-fflags b/config/pgi-fflags index 3e5529d..3171695 100644 --- a/config/pgi-fflags +++ b/config/pgi-fflags @@ -67,6 +67,7 @@ if test "X-pgf90" = "X-$f9x_vendor"; then # General FC_BASENAME=pgf90 + Fortran_COMPILER_ID=PGI F9XSUFFIXFLAG="" FSEARCH_DIRS="" # Uncomment the following to add something specific for FCFLAGS. @@ -81,15 +82,24 @@ if test "X-pgf90" = "X-$f9x_vendor"; then #else # PROD_FCFLAGS="-O2 -s" #fi - PROD_FCFLAGS="-fast -s -Mnoframe" + PROD_FCFLAGS="-fast -Mnoframe" # Debug - DEBUG_FCFLAGS="-g -Mbounds -Mchkptr -Mdclchk" + DEBUG_FCFLAGS="-Mbounds -Mchkptr -Mdclchk" - # Profile - PROFILE_FCFLAGS="-g -Mprof=func,line" + # Symbols + SYMBOLS_FCFLAGS="-g" + NO_SYMBOLS_FCFLAGS="-s" + + # Profiling + PROFILE_FCFLAGS="-Mprof=func,line" # Use this for profiling with gprof - #PROFILE_FCFLAGS="-g -pg" + #PROFILE_FCFLAGS="-pg" + + # Optimization + HIGH_OPT_FCFLAGS= + DEBUG_OPT_FCFLAGS= + NO_OPT_FCFLAGS= # Flags are set f9x_flags_set=yes diff --git a/config/pgi-flags b/config/pgi-flags index b426558..e1bec00 100644 --- a/config/pgi-flags +++ b/config/pgi-flags @@ -70,33 +70,49 @@ if test "X-pgcc" = "X-$cc_vendor"; then # Production case "$cc_vendor-$cc_version" in - # Tweak down compiler optimizations for v10.6, it has a bug pgcc-10.6*) - PROD_CFLAGS="-O1 -s" + PROD_CFLAGS= ;; - # Tweak down compiler optimizations for v9.x pgcc-9.*) - PROD_CFLAGS="-O1 -s" + PROD_CFLAGS= ;; *) - PROD_CFLAGS="-fast -s" + PROD_CFLAGS="-fast" ;; esac - PROD_CPPFLAGS= # Debug - DEBUG_CFLAGS="-g -Mbounds" - DEBUG_CPPFLAGS= + # NDEBUG is handled explicitly by the configure script + DEBUG_CFLAGS="-Mbounds" - # Profile - PROFILE_CFLAGS="-g -Mprof=func,line" + # Symbols + SYMBOLS_CFLAGS="-g" + NO_SYMBOLS_CFLAGS="-s" + + # Profiling + PROFILE_CFLAGS="-Mprof=func,line" # Use this for profiling with gprof - #PROFILE_CFLAGS="-g -pg" - PROFILE_CPPFLAGS= + #PROFILE_CFLAGS="-pg" + + # Optimization + case "$cc_vendor-$cc_version" in + # Tweak down compiler optimizations for v10.6, it has a bug + pgcc-10.6*) + HIGH_OPT_CFLAGS="-O1" + ;; + # Tweak down compiler optimizations for v9.x + pgcc-9.*) + HIGH_OPT_CFLAGS="-O1" + ;; + *) + HIGH_OPT_CFLAGS= + ;; + esac + DEBUG_OPT_CFLAGS= + NO_OPT_CFLAGS= # Flags are set cc_flags_set=yes - fi # Clear cc info if no flags set diff --git a/config/solaris b/config/solaris index 1b63f42..b7c7963 100644 --- a/config/solaris +++ b/config/solaris @@ -29,17 +29,44 @@ fi # Try solaris native compiler flags if test "X-" = "X-$cc_flags_set"; then - H5_CFLAGS="$H5_CFLAGS -erroff=%none -DBSD_COMP" - # -g produces rather slow code. "-g -O" produces much faster code with some - # loss of debugger functions such as not able to print local variables. - DEBUG_CFLAGS="-g -O" - DEBUG_CPPFLAGS= - PROD_CFLAGS="-O -s" - PROD_CPPFLAGS= - PROFILE_CFLAGS=-xpg - PROFILE_CPPFLAGS= + # HDF5 must be built with a C99 compiler on Solaris + # -erroff=%none turns on all warnings + H5_CFLAGS="$H5_CFLAGS -xc99=all -erroff=%none" + + # Production + # NDEBUG is handled explicitly by the configure script + PROD_CFLAGS= + + # Debug + # NDEBUG is handled explicitly by the configure script + # -g is hanled by the symbols flags + DEBUG_CFLAGS= + + # Symbols + # -g produces output for dbx, NOT gdb. You can use "gdb on" from + # inside gdb to use gdb commands if you need to debug. + # If you want a LOT of debugging information (at the expense of + # really slow code), try using -g3. That will even let you debug + # into macros. + # -s strips symbols, as in gcc + NO_SYMBOLS_CFLAGS="-s" + SYMBOLS_CFLAGS="-g" + + # Profile + # This produces profiling output for gprof. If you want to use + # the Solaris profiler, use -xprofile instead. + PROFILE_CFLAGS="-xpg" + + # Optimization + # -O has switched to -xO{1|2|3|4|5}. -xO3 is probably a good compromise + # for the daily tests, but you might want to switch to -xO2 or lower + # if you are actively debugging. + HIGH_OPT_CFLAGS="-xO5" + DEBUG_OPT_CFLAGS="-xO3" + NO_OPT_CFLAGS= + cc_flags_set=yes -# Special linking flag is needed to build with Fortran on Solaris 5.9 + # Special linking flag is needed to build with Fortran on Solaris 5.9 system_version="`uname -r`" case "$system_version" in 5.9*) @@ -50,10 +77,6 @@ if test "X-" = "X-$cc_flags_set"; then ;; esac - # Turn off optimization flag for SUNpro compiler versions 4.x which - # have an optimization bug. Version 5.0 works. - ($CC -V 2>&1) | grep -s 'cc: .* C 4\.' >/dev/null 2>&1 \ - && PROD_CFLAGS="`echo $PROD_CFLAGS | sed -e 's/-O//'`" fi LIBS="$LIBS" @@ -69,11 +92,32 @@ if test "X-" = "X-$f9x_flags_set"; then FSEARCH_DIRS="" H5_FCFLAGS="$H5_FCFLAGS" + + # TODO: Revisit these flags. + + # Production + # NDEBUG is handled explicitly by the configure script + PROD_FCFLAGS= + + # Debug + # NDEBUG is handled explicitly by the configure script + # -g is hanled by the symbols flags + DEBUG_FCFLAGS= + + # Symbols + NO_SYMBOLS_FCFLAGS= + SYMBOLS_FCFLAGS="-g" + + # Profile + PROFILE_FCFLAGS= + + # Optimization # -g produces rather slow code. "-g -O" produces much faster code with some # loss of debugger functions such as not able to print local variables. - DEBUG_FCFLAGS="-g -O" - PROD_FCFLAGS="-O2" - PROFILE_FCFLAGS="" + HIGH_OPT_FCFLAGS="-O2" + DEBUG_OPT_FCFLAGS="-O" + NO_OPT_FCFLAGS= + f9x_flags_set=yes fi @@ -106,14 +150,30 @@ fi if test -z "$cxx_flags_set"; then H5_CXXFLAGS="$H5_CXXFLAGS -instances=static" H5_CPPFLAGS="$H5_CPPFLAGS -LANG:std" + + # Production + # NDEBUG is handled explicitly by the configure script + PROD_CXXFLAGS= + + # Debug + # NDEBUG is handled explicitly by the configure script + # -g is hanled by the symbols flags + DEBUG_CXXFLAGS= + + # Symbols + NO_SYMBOLS_CXXFLAGS="-s" + SYMBOLS_CXXFLAGS="-g" + + # Profile + PROFILE_CXXFLAGS="-xpg" + + # Optimization # -g produces rather slow code. "-g -O" produces much faster code with some # loss of debugger functions such as not able to print local variables. - DEBUG_CXXFLAGS="-g -O" - DEBUG_CPPFLAGS= - PROD_CXXFLAGS="-O -s" - PROD_CPPFLAGS= - PROFILE_CXXFLAGS=-xpg - PROFILE_CPPFLAGS= + HIGH_OPT_CXXFLAGS="-O" + DEBUG_OPT_CXXFLAGS="-O" + NO_OPT_CXXFLAGS= + cxx_flags_set=yes fi @@ -155,4 +215,3 @@ case $CXX in ;; esac - diff --git a/configure b/configure index 58d3da1..ae02e63 100755 --- a/configure +++ b/configure @@ -689,6 +689,7 @@ OPTIMIZATION PROFILING DEV_WARNINGS SYMBOLS +DIAGS HAVE_PTHREAD BUILD_SHARED_SZIP_CONDITIONAL_FALSE BUILD_SHARED_SZIP_CONDITIONAL_TRUE @@ -698,7 +699,6 @@ USE_FILTER_DEFLATE NOT_UNAME_CYGWIN_FALSE NOT_UNAME_CYGWIN_TRUE UNAME_CYGWIN -AM_MAKEFLAGS LT_STATIC_EXEC USE_PLUGINS_CONDITIONAL_FALSE USE_PLUGINS_CONDITIONAL_TRUE @@ -815,11 +815,9 @@ AM_CXXFLAGS AM_FCFLAGS AM_CFLAGS H5_LDFLAGS -H5_ECXXFLAGS H5_CXXFLAGS H5_FCFLAGS H5_CPPFLAGS -H5_ECFLAGS H5_CFLAGS CPPFLAGS host_os @@ -929,8 +927,10 @@ with_zlib with_szlib enable_threadsafe with_pthread +enable_diags enable_symbols enable_developer_warnings +enable_warnings_as_errors enable_profiling enable_optimization enable_debug @@ -1625,6 +1625,10 @@ Optional Features: --enable-threadsafe Enable thread-safe capability. Not compatible with the high-level library, Fortran, or C++ wrappers. [default=no] + --enable-diags=(yes|no|) + Allow default enhanced diagnostics to the build. + This is independent of the build mode and + optimization level. [default=no] --enable-symbols=(yes|no|) Add debug symbols to the library (e.g.: build with -g). This is independent of the build mode and @@ -1636,6 +1640,10 @@ Optional Features: emitted. These are usually performance suggestions (e.g. -Wsuggest-attribute) and do not flag poor code quality. [default=no] + --enable-warnings-as-errors + Determines whether certain warnings will be + considered errors. This is mainly for use by HDF5 + library developers. [default=no] --enable-profiling=(yes|no|) Enable profiling flags (e.g.: -pg). This can be set independently from the build mode. The custom @@ -1663,7 +1671,7 @@ Optional Features: is most packages if production is disabled; no if it is enabled. --enable-codestack Enable the function stack tracing (for developer - debugging). + debugging). [default=no] --enable-metadata-trace-file Enable metadata trace file collection. --enable-trace Enable API tracing capability. Default=no if debug @@ -1726,7 +1734,7 @@ Optional Packages: --with-szlib=DIR Use szlib library for external szlib I/O filter [default=no] --with-pthread=DIR Specify alternative path to Pthreads library when - thread-safe capability is built + thread-safe capability is built. --with-mpe=DIR Use MPE instrumentation [default=no] --with-libhdfs=DIR Provide libhdfs library to enable HDFS virtual file driver (VFD) [default=no] @@ -3940,10 +3948,6 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac ## H5_CFLAGS (and company) are for CFLAGS that should be used on HDF5, but ## not exported to h5cc (or h5fc, etc.) ## -## H5_ECFLAGS (and company) are for warnings that should be treated as errors. -## - - @@ -3969,6 +3973,7 @@ CXXFLAGS="${CXXFLAGS}" FCFLAGS="${FCFLAGS}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" +AR_FLAGS="${AR_FLAGS}" ## Configure may need to alter any of the *FLAGS variables in order for ## various checks to work correctly. Save the user's value here so it @@ -7659,6 +7664,12 @@ test -n "$AR" || AR=":" fi +# Set the default ar flags to cr +# The Automake default is to use cru and the 'u' causes ar +# to emit warnings on some platforms. +AR_FLAGS=cr + + ## Export the AR macro so that it will be placed in the libtool file ## correctly. export AR @@ -7881,7 +7892,12 @@ fi if test "X$HDF5_TESTS" = "Xno"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } echo "Building HDF5 tests is disabled" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi ## ---------------------------------------------------------------------- @@ -7904,7 +7920,12 @@ fi if test "X$HDF5_TOOLS" = "Xno"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } echo "Building HDF5 tools is disabled" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi ## ---------------------------------------------------------------------- @@ -22436,6 +22457,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ## This check needs to occur after libtool is initialized because ## we check a libtool cache value and may issue a warning based ## on its result. + + +## Default is no +STATIC_EXEC=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should install only statically linked executables" >&5 $as_echo_n "checking if we should install only statically linked executables... " >&6; } # Check whether --enable-static_exec was given. @@ -22510,35 +22536,6 @@ $as_echo "error" >&6; } esac ## ---------------------------------------------------------------------- -## pmake will throw an error if variables are undefined in a Makefile. -## These errors can be changed to warnings using the -V flag. -## - AM_MAKEFLAGS="" - -## Don't run test if MAKE is defined but is the empty string -if test -n "${MAKE-make}"; then - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether make will build with undefined variables" >&5 -$as_echo_n "checking whether make will build with undefined variables... " >&6; } - - cat >maketest </dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, setting -V flag" >&5 -$as_echo "no, setting -V flag" >&6; } - AM_MAKEFLAGS="\-V" - fi - - rm maketest -fi - -## ---------------------------------------------------------------------- ## Production flags? Save the value in $CONFIG_MODE so we have it for ## the record. ## To switch the default between production and development, move X-| @@ -23295,16 +23292,18 @@ case "$host_cpu-$host_vendor-$host_os" in ## functionality so clock_gettime and CLOCK_MONOTONIC are defined ## correctly. This was later updated to 200112L so that ## posix_memalign() is visible for the direct VFD code on Linux - ## systems. + ## systems. Even later, this was changed to 200809L to support + ## pread/pwrite in VFDs. ## ## POSIX feature information can be found in the gcc manual at: ## http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html - H5_CPPFLAGS="-D_POSIX_C_SOURCE=200112L $H5_CPPFLAGS" + H5_CPPFLAGS="-D_POSIX_C_SOURCE=200809L $H5_CPPFLAGS" ## Need to add this so that O_DIRECT is visible for the direct ## VFD on Linux systems. H5_CPPFLAGS="-D_GNU_SOURCE $H5_CPPFLAGS" ;; + esac ## Need to add the AM_ and H5_ into CFLAGS/CPPFLAGS to make them visible @@ -25714,7 +25713,6 @@ $as_echo "suppressed" >&6; } AM_CPPFLAGS="$AM_CPPFLAGS -I$szlib_inc" fi - if test -n "$szlib_lib"; then LDFLAGS="$LDFLAGS -L$szlib_lib" AM_LDFLAGS="$AM_LDFLAGS -L$szlib_lib" @@ -26011,6 +26009,10 @@ if test "${enable_threadsafe+set}" = set; then : fi +## The high-level, C++, Fortran and Java interfaces are not compatible +## with the thread-safety option because the lock is not hoisted +## into the higher-level API calls. + ## --enable-threadsafe is incompatible with --enable-hl unless ## --enable-unsupported has been specified on the configure line. ## @@ -26069,7 +26071,7 @@ $as_echo "#define HAVE_THREADSAFE 1" >>confdefs.h ## be preceded by a comma. ## ## Thread-safety in HDF5 only uses Pthreads via configure, so the - ## default is "yes", though this only has an effect when + ## default is "check", though this only has an effect when ## --enable-threadsafe is specified. HAVE_PTHREAD=yes @@ -26077,12 +26079,12 @@ $as_echo "#define HAVE_THREADSAFE 1" >>confdefs.h if test "${with_pthread+set}" = set; then : withval=$with_pthread; else - withval=yes + withval=check fi case "$withval" in - yes) + check | yes) for ac_header in pthread.h do : ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" @@ -26156,11 +26158,7 @@ fi fi ;; no) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread" >&5 -$as_echo_n "checking for pthread... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5 -$as_echo "suppressed" >&6; } - unset HAVE_PTHREAD + as_fn_error $? "Must use Pthreads with thread safety" "$LINENO" 5 ;; *) case "$withval" in @@ -26333,6 +26331,82 @@ fi fi ;; esac + + ## ---------------------------------------------------------------------- + ## Check if pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM) + ## is supported on this system + ## + ## Unfortunately, this probably needs to be an AC_RUN_IFELSE since + ## it's impossible to determine if PTHREAD_SCOPE_SYSTEM is + ## supported a priori. POSIX.1-2001 requires that a conformant + ## system need only support one of SYSTEM or PROCESS scopes. + ## + ## For cross-compiling, we've added a pessimistic 'no'. You can + ## hand-hack the config file if you know otherwise. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Pthreads supports system scope" >&5 +$as_echo_n "checking Pthreads supports system scope... " >&6; } + if ${hdf5_cv_system_scope_threads+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + hdf5_cv_system_scope_threads=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if STDC_HEADERS + #include + #include + #endif + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ + + pthread_attr_t attribute; + int ret; + + pthread_attr_init(&attribute); + ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM); + exit(ret==0 ? 0 : 1); + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + hdf5_cv_system_scope_threads=yes +else + hdf5_cv_system_scope_threads=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + + + if test ${hdf5_cv_system_scope_threads} = "yes"; then + +$as_echo "#define SYSTEM_SCOPE_THREADS 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: Always 'no' if cross-compiling. Edit the config file if your platform supports pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM)." >&5 +$as_echo "$as_me: Always 'no' if cross-compiling. Edit the config file if your platform supports pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM)." >&6;} + fi fi ## ---------------------------------------------------------------------- @@ -27108,7 +27182,7 @@ if ${hdf5_cv_printf_ll+:} false; then : else -for hdf5_cv_printf_ll in l ll L q unknown; do +for hdf5_cv_printf_ll in ll l L q unknown; do if test "$cross_compiling" = yes; then : continue else @@ -27161,61 +27235,50 @@ _ACEOF ## ---------------------------------------------------------------------- -## Check if pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM) -## is supported on this system +## Check if the compiler should include build diagnostics ## -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Threads support system scope" >&5 -$as_echo_n "checking Threads support system scope... " >&6; } -if ${hdf5_cv_system_scope_threads+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #if STDC_HEADERS - #include - #include - #endif - - int main(void) - { - pthread_attr_t attribute; - int ret; - - pthread_attr_init(&attribute); - ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM); - exit(ret==0 ? 0 : 1); - } - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - hdf5_cv_system_scope_threads=yes -else - hdf5_cv_system_scope_threads=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking enable build diagnostics" >&5 +$as_echo_n "checking enable build diagnostics... " >&6; } +# Check whether --enable-diags was given. +if test "${enable_diags+set}" = set; then : + enableval=$enable_diags; DIAGS=$enableval fi -fi +## Set default +if test "X-$DIAGS" = X- ; then + DIAGS=no +fi -if test ${hdf5_cv_system_scope_threads} = "yes"; then +## Allow this variable to be substituted in +## other files (src/libhdf5.settings.in, etc.) -$as_echo "#define SYSTEM_SCOPE_THREADS 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +case "X-$DIAGS" in + X-yes) + H5_CFLAGS="$H5_CFLAGS $DIAGS_CFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $DIAGS_CXXFLAGS" + H5_FCFLAGS="$H5_FCFLAGS $DIAGS_FCFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + ;; + X-no) + H5_CFLAGS="$H5_CFLAGS $NO_DIAGS_CFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $NO_DIAGS_CXXFLAGS" + H5_FCFLAGS="$H5_FCFLAGS $NO_DIAGS_FCFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } -fi + ;; + *) + H5_CFLAGS="$H5_CFLAGS $DIAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $DIAGS" + H5_FCFLAGS="$H5_FCFLAGS $DIAGS" + DIAGS="custom ($DIAGS)" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DIAGS" >&5 +$as_echo "$DIAGS" >&6; } + ;; +esac + ## ---------------------------------------------------------------------- ## Check if the compiler should include symbols @@ -27308,6 +27371,45 @@ $as_echo "no" >&6; } esac ## ---------------------------------------------------------------------- +## Check if we should consider certain compiler warnings as errors +## +## These should NOT be on by default as the risk of breakage is high +## when compiling HDF5 on new (or new versions) of platforms and +## compilers. It can also cause failures when header files we have no +## control over (e.g. MPI, HDFS) raise warnings. +## +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking enable warnings as errors" >&5 +$as_echo_n "checking enable warnings as errors... " >&6; } +# Check whether --enable-warnings-as-errors was given. +if test "${enable_warnings_as_errors+set}" = set; then : + enableval=$enable_warnings_as_errors; WARNINGS_AS_ERRORS=$enableval +fi + + +## Set default +if test "X-$WARNINGS_AS_ERRORS" = X- ; then + WARNINGS_AS_ERRORS=no +fi + +case "X-$WARNINGS_AS_ERRORS" in + X-yes) + H5_CFLAGS="$H5_CFLAGS $H5_ECFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $H5_ECXXFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ;; + X-no) + H5_CFLAGS="$H5_CFLAGS $H5_NECFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $H5_NECXXFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + *) + as_fn_error $? "Unrecognized value: $WARNINGS_AS_ERRORS" "$LINENO" 5 + ;; +esac + +## ---------------------------------------------------------------------- ## Check if the compiler should use profiling flags/settings ## { $as_echo "$as_me:${as_lineno-$LINENO}: checking profiling" >&5 @@ -27426,9 +27528,9 @@ fi ## Default to no if production is enabled if test "X-$DEBUG_PKG" = X- ; then if test "$enable_production" = yes ; then - DEBUG_PKG=no + DEBUG_PKG=no else - DEBUG_PKG=yes + DEBUG_PKG=yes fi fi @@ -27476,20 +27578,30 @@ if test "${enable_codestack+set}" = set; then : fi +## Set the default level. +if test "X-$CODESTACK" = X- ; then + CODESTACK=no +fi + +## Allow this variable to be substituted in +## other files (src/libhdf5.settings.in, etc.) + + case "X-$CODESTACK" in X-yes) - CODESTACK=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_CODESTACK 1" >>confdefs.h ;; - *) - CODESTACK=no + X-no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; + *) + as_fn_error $? "Unrecognized value: $CODESTACK" "$LINENO" 5 + ;; esac ## ---------------------------------------------------------------------- @@ -29506,7 +29618,7 @@ CXX_NOFLAGS=`echo $CXX | sed 's/ -.*//'` if `echo $CXX_NOFLAGS | grep ^/ >/dev/null 2>&1`; then CXX_VERSION="$CXX" else - CXX_VERSION="$FC"; + CXX_VERSION="$CXX"; for x in `echo $PATH | sed -e 's/:/ /g'`; do if test -x $x/$CXX_NOFLAGS; then CXX_VERSION="$x/$CXX" diff --git a/configure.ac b/configure.ac index 72c4333..b71e215 100644 --- a/configure.ac +++ b/configure.ac @@ -135,14 +135,10 @@ AC_SUBST([CPPFLAGS]) ## H5_CFLAGS (and company) are for CFLAGS that should be used on HDF5, but ## not exported to h5cc (or h5fc, etc.) ## -## H5_ECFLAGS (and company) are for warnings that should be treated as errors. -## AC_SUBST([H5_CFLAGS]) -AC_SUBST([H5_ECFLAGS]) AC_SUBST([H5_CPPFLAGS]) AC_SUBST([H5_FCFLAGS]) AC_SUBST([H5_CXXFLAGS]) -AC_SUBST([H5_ECXXFLAGS]) AC_SUBST([H5_LDFLAGS]) ## AM_CFLAGS (and company) are for CFLAGS that should be used on HDF5, @@ -164,6 +160,7 @@ CXXFLAGS="${CXXFLAGS}" FCFLAGS="${FCFLAGS}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" +AR_FLAGS="${AR_FLAGS}" ## Configure may need to alter any of the *FLAGS variables in order for ## various checks to work correctly. Save the user's value here so it @@ -346,7 +343,7 @@ AC_MSG_CHECKING([for clang sanitizer checks]) AC_ARG_ENABLE([sanitize-checks], [AS_HELP_STRING([--enable-sanitize-checks=address], [(clang/clang++ compilers only) Enable sanitize checks. - Address is useful for detecting issues dealing with + Address is useful for detecting issues dealing with memory. See AddressSanitizer in config/sanitizer/README.md for more information. [default=none] @@ -361,7 +358,7 @@ fi if test "X$CC_BASENAME" = "Xclang"; then AC_SUBST([CLANG_SANITIZE_CHECKS]) - # There are several sanitizer tools. At present we are testing + # There are several sanitizer tools. At present we are testing # and describing only -fsanitizer=address with autotools. case "X-$CLANG_SANITIZE_CHECKS" in X-no|X-none) @@ -378,8 +375,8 @@ if test "X$CC_BASENAME" = "Xclang"; then # The clang compiler doesn't support some of them; they should be # checked before adding them to the list in the help message. # The sanitizers/sanitizers.cmake file lists these options: - # address, memory, memoryWithOrigins, undefined, thread, leak, - # 'address;undefined'. Which and which combinations of these are + # address, memory, memoryWithOrigins, undefined, thread, leak, + # 'address;undefined'. Which and which combinations of these are # supported varies by compiler version, but unsupported options # or combinations will result in configure errors reported in config.log. # Comma separated lists of sanitize options wil be entered intact in @@ -470,7 +467,7 @@ AC_ARG_ENABLE([fortran2003], [HDF_FORTRAN2003=$enableval]) ## ---------------------------------------------------------------------- -## Check to make sure --enable-fortran is present if --enable-fortran2003 +## Check to make sure --enable-fortran is present if --enable-fortran2003 ## was specified if test "X$HDF_FORTRAN2003" = "Xyes" && test "X$HDF_FORTRAN" = "Xno"; then @@ -488,7 +485,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then AC_SUBST([FC]) HDF_FORTRAN=yes AC_SUBST([HAVE_FORTRAN_2003]) - + HDF5_INTERFACES="$HDF5_INTERFACES fortran" ## -------------------------------------------------------------------- @@ -537,14 +534,14 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ## Check to see if -r8 was specified to determine if we need to ## compile the DOUBLE PRECISION interfaces. - PAC_PROG_FC_DEFAULT_REALisDBLE + PAC_PROG_FC_DEFAULT_REALisDBLE if test "X$HDF_FORTRAN2003" = "Xyes"; then ## Checking if the compiler supports the required Fortran 2003 features and ## disable Fortran 2003 if it does not. PAC_PROG_FC_HAVE_F2003_REQUIREMENTS - + if test "X$HAVE_F2003_REQUIREMENTS" = "Xno"; then AC_MSG_ERROR([Fortran compiler lacks required Fortran 2003 features; unsupported Fortran 2003 compiler, remove --enable-fortran2003]) else @@ -661,6 +658,12 @@ if test -z "$AR"; then fi AC_SUBST([AR]) +# Set the default ar flags to cr +# The Automake default is to use cru and the 'u' causes ar +# to emit warnings on some platforms. +AR_FLAGS=cr + + ## Export the AR macro so that it will be placed in the libtool file ## correctly. export AR @@ -795,7 +798,10 @@ AC_ARG_ENABLE([tests], [HDF5_TESTS=$enableval]) if test "X$HDF5_TESTS" = "Xno"; then + AC_MSG_RESULT([yes]) echo "Building HDF5 tests is disabled" +else + AC_MSG_RESULT([no]) fi ## ---------------------------------------------------------------------- @@ -816,7 +822,10 @@ AC_ARG_ENABLE([tools], [HDF5_TOOLS=$enableval]) if test "X$HDF5_TOOLS" = "Xno"; then + AC_MSG_RESULT([yes]) echo "Building HDF5 tools is disabled" +else + AC_MSG_RESULT([no]) fi ## ---------------------------------------------------------------------- @@ -834,6 +843,11 @@ LT_INIT([dlopen,win32-dll]) ## This check needs to occur after libtool is initialized because ## we check a libtool cache value and may issue a warning based ## on its result. +AC_SUBST([STATIC_EXEC]) + +## Default is no +STATIC_EXEC=no + AC_MSG_CHECKING([if we should install only statically linked executables]) AC_ARG_ENABLE([static_exec], [AS_HELP_STRING([--enable-static-exec], @@ -895,32 +909,6 @@ case "X-$RPATH" in esac ## ---------------------------------------------------------------------- -## pmake will throw an error if variables are undefined in a Makefile. -## These errors can be changed to warnings using the -V flag. -## -AC_SUBST([AM_MAKEFLAGS]) AM_MAKEFLAGS="" - -## Don't run test if MAKE is defined but is the empty string -if test -n "${MAKE-make}"; then - - AC_MSG_CHECKING([whether make will build with undefined variables]) - - cat >maketest </dev/null 2>&1; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no, setting -V flag]) - AM_MAKEFLAGS="\-V" - fi - - rm maketest -fi - -## ---------------------------------------------------------------------- ## Production flags? Save the value in $CONFIG_MODE so we have it for ## the record. ## To switch the default between production and development, move X-| @@ -1079,16 +1067,18 @@ case "$host_cpu-$host_vendor-$host_os" in ## functionality so clock_gettime and CLOCK_MONOTONIC are defined ## correctly. This was later updated to 200112L so that ## posix_memalign() is visible for the direct VFD code on Linux - ## systems. + ## systems. Even later, this was changed to 200809L to support + ## pread/pwrite in VFDs. ## ## POSIX feature information can be found in the gcc manual at: ## http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html - H5_CPPFLAGS="-D_POSIX_C_SOURCE=200112L $H5_CPPFLAGS" + H5_CPPFLAGS="-D_POSIX_C_SOURCE=200809L $H5_CPPFLAGS" ## Need to add this so that O_DIRECT is visible for the direct ## VFD on Linux systems. H5_CPPFLAGS="-D_GNU_SOURCE $H5_CPPFLAGS" ;; + esac ## Need to add the AM_ and H5_ into CFLAGS/CPPFLAGS to make them visible @@ -1430,7 +1420,6 @@ case "X-$withval" in AM_CPPFLAGS="$AM_CPPFLAGS -I$szlib_inc" fi - if test -n "$szlib_lib"; then LDFLAGS="$LDFLAGS -L$szlib_lib" AM_LDFLAGS="$AM_LDFLAGS -L$szlib_lib" @@ -1441,8 +1430,8 @@ case "X-$withval" in [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"; LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_SZLIB]) if test -n "$HAVE_SZLIB"; then AC_CHECK_HEADERS([szlib.h], - [HAVE_SZLIB_H="yes"], - [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_SZLIB]) + [HAVE_SZLIB_H="yes"], + [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_SZLIB]) else AC_MSG_RESULT([Using SZ_BufftoBuffCompress from libsz in $szlib_lib failed. Szip not enabled.]) fi @@ -1530,6 +1519,10 @@ AC_ARG_ENABLE([threadsafe], [default=no]])], [THREADSAFE=$enableval]) +## The high-level, C++, Fortran and Java interfaces are not compatible +## with the thread-safety option because the lock is not hoisted +## into the higher-level API calls. + ## --enable-threadsafe is incompatible with --enable-hl unless ## --enable-unsupported has been specified on the configure line. ## @@ -1583,25 +1576,24 @@ if test "X$THREADSAFE" = "Xyes"; then ## be preceded by a comma. ## ## Thread-safety in HDF5 only uses Pthreads via configure, so the - ## default is "yes", though this only has an effect when + ## default is "check", though this only has an effect when ## --enable-threadsafe is specified. AC_SUBST([HAVE_PTHREAD]) HAVE_PTHREAD=yes AC_ARG_WITH([pthread], [AS_HELP_STRING([--with-pthread=DIR], - [Specify alternative path to Pthreads library when thread-safe capability is built])],, - [withval=yes]) + [Specify alternative path to Pthreads library when + thread-safe capability is built.])],, + [withval=check]) case "$withval" in - yes) + check | yes) AC_CHECK_HEADERS([pthread.h],, [unset HAVE_PTHREAD]) if test "x$HAVE_PTHREAD" = "xyes"; then AC_CHECK_LIB([pthread], [pthread_self],, [unset HAVE_PTHREAD]) fi ;; no) - AC_MSG_CHECKING([for pthread]) - AC_MSG_RESULT([suppressed]) - unset HAVE_PTHREAD + AC_MSG_ERROR([Must use Pthreads with thread safety]) ;; *) case "$withval" in @@ -1641,6 +1633,44 @@ if test "X$THREADSAFE" = "Xyes"; then fi ;; esac + + ## ---------------------------------------------------------------------- + ## Check if pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM) + ## is supported on this system + ## + ## Unfortunately, this probably needs to be an AC_RUN_IFELSE since + ## it's impossible to determine if PTHREAD_SCOPE_SYSTEM is + ## supported a priori. POSIX.1-2001 requires that a conformant + ## system need only support one of SYSTEM or PROCESS scopes. + ## + ## For cross-compiling, we've added a pessimistic 'no'. You can + ## hand-hack the config file if you know otherwise. + AC_MSG_CHECKING([Pthreads supports system scope]) + AC_CACHE_VAL([hdf5_cv_system_scope_threads], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM([ + #if STDC_HEADERS + #include + #include + #endif + ],[ + pthread_attr_t attribute; + int ret; + + pthread_attr_init(&attribute); + ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM); + exit(ret==0 ? 0 : 1); + ])] + , [hdf5_cv_system_scope_threads=yes], [hdf5_cv_system_scope_threads=no], [hdf5_cv_system_scope_threads=no])]) + + if test ${hdf5_cv_system_scope_threads} = "yes"; then + AC_DEFINE([SYSTEM_SCOPE_THREADS], [1], + [Define if your system supports pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM) call.]) + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + AC_MSG_NOTICE([Always 'no' if cross-compiling. Edit the config file if your platform supports pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM).]) + fi fi ## ---------------------------------------------------------------------- @@ -1823,7 +1853,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ AC_MSG_CHECKING([how to print long long]) AC_CACHE_VAL([hdf5_cv_printf_ll], [ -for hdf5_cv_printf_ll in l ll L q unknown; do +for hdf5_cv_printf_ll in ll l L q unknown; do AC_RUN_IFELSE( [AC_LANG_PROGRAM([ #include @@ -1843,35 +1873,49 @@ AC_DEFINE_UNQUOTED([PRINTF_LL_WIDTH], ["$hdf5_cv_printf_ll"], [Width for printf() for type `long long' or `__int64', use `ll']) ## ---------------------------------------------------------------------- -## Check if pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM) -## is supported on this system +## Check if the compiler should include build diagnostics ## -AC_MSG_CHECKING([Threads support system scope]) -AC_CACHE_VAL([hdf5_cv_system_scope_threads], - [AC_TRY_RUN([ - #if STDC_HEADERS - #include - #include - #endif +AC_MSG_CHECKING([enable build diagnostics]) +AC_ARG_ENABLE([diags], + [AS_HELP_STRING([--enable-diags=(yes|no|)], + [Allow default enhanced diagnostics to the build. + This is independent of the build mode and optimization + level. + [default=no] + ])], + [DIAGS=$enableval]) - int main(void) - { - pthread_attr_t attribute; - int ret; +## Set default +if test "X-$DIAGS" = X- ; then + DIAGS=no +fi - pthread_attr_init(&attribute); - ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM); - exit(ret==0 ? 0 : 1); - } - ], [hdf5_cv_system_scope_threads=yes], [hdf5_cv_system_scope_threads=no],)]) +## Allow this variable to be substituted in +## other files (src/libhdf5.settings.in, etc.) +AC_SUBST([DIAGS]) + +case "X-$DIAGS" in + X-yes) + H5_CFLAGS="$H5_CFLAGS $DIAGS_CFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $DIAGS_CXXFLAGS" + H5_FCFLAGS="$H5_FCFLAGS $DIAGS_FCFLAGS" + AC_MSG_RESULT([yes]) + ;; + X-no) + H5_CFLAGS="$H5_CFLAGS $NO_DIAGS_CFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $NO_DIAGS_CXXFLAGS" + H5_FCFLAGS="$H5_FCFLAGS $NO_DIAGS_FCFLAGS" + AC_MSG_RESULT([no]) + ;; + *) + H5_CFLAGS="$H5_CFLAGS $DIAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $DIAGS" + H5_FCFLAGS="$H5_FCFLAGS $DIAGS" + DIAGS="custom ($DIAGS)" + AC_MSG_RESULT([$DIAGS]) + ;; +esac -if test ${hdf5_cv_system_scope_threads} = "yes"; then - AC_DEFINE([SYSTEM_SCOPE_THREADS], [1], - [Define if your system supports pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM) call.]) - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi ## ---------------------------------------------------------------------- ## Check if the compiler should include symbols @@ -1965,6 +2009,45 @@ case "X-$DEV_WARNINGS" in esac ## ---------------------------------------------------------------------- +## Check if we should consider certain compiler warnings as errors +## +## These should NOT be on by default as the risk of breakage is high +## when compiling HDF5 on new (or new versions) of platforms and +## compilers. It can also cause failures when header files we have no +## control over (e.g. MPI, HDFS) raise warnings. +## +AC_MSG_CHECKING([enable warnings as errors]) +AC_ARG_ENABLE([warnings-as-errors], + [AS_HELP_STRING([--enable-warnings-as-errors], + [Determines whether certain warnings will be + considered errors. This is mainly for use + by HDF5 library developers. + [default=no] + ])], + [WARNINGS_AS_ERRORS=$enableval]) + +## Set default +if test "X-$WARNINGS_AS_ERRORS" = X- ; then + WARNINGS_AS_ERRORS=no +fi + +case "X-$WARNINGS_AS_ERRORS" in + X-yes) + H5_CFLAGS="$H5_CFLAGS $H5_ECFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $H5_ECXXFLAGS" + AC_MSG_RESULT([yes]) + ;; + X-no) + H5_CFLAGS="$H5_CFLAGS $H5_NECFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $H5_NECXXFLAGS" + AC_MSG_RESULT([no]) + ;; + *) + AC_MSG_ERROR([Unrecognized value: $WARNINGS_AS_ERRORS]) + ;; +esac + +## ---------------------------------------------------------------------- ## Check if the compiler should use profiling flags/settings ## AC_MSG_CHECKING([profiling]) @@ -2088,16 +2171,16 @@ AC_ARG_ENABLE([debug], also specify a comma-separated list of package names without the leading H5 or the word no. The default is most packages - if production is disabled; no if it is enabled. + if production is disabled; no if it is enabled. ])], [DEBUG_PKG=$enableval]) ## Default to no if production is enabled if test "X-$DEBUG_PKG" = X- ; then if test "$enable_production" = yes ; then - DEBUG_PKG=no + DEBUG_PKG=no else - DEBUG_PKG=yes + DEBUG_PKG=yes fi fi @@ -2136,20 +2219,32 @@ fi AC_MSG_CHECKING([whether function stack tracking is enabled]) AC_ARG_ENABLE([codestack], [AS_HELP_STRING([--enable-codestack], - [Enable the function stack tracing (for developer debugging).])], + [Enable the function stack tracing (for developer debugging). + [default=no] + ])], [CODESTACK=$enableval]) +## Set the default level. +if test "X-$CODESTACK" = X- ; then + CODESTACK=no +fi + +## Allow this variable to be substituted in +## other files (src/libhdf5.settings.in, etc.) +AC_SUBST([CODESTACK]) + case "X-$CODESTACK" in X-yes) - CODESTACK=yes AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_CODESTACK], [1], [Define if the function stack tracing code is to be compiled in]) ;; - *) - CODESTACK=no + X-no) AC_MSG_RESULT([no]) ;; + *) + AC_MSG_ERROR([Unrecognized value: $CODESTACK]) + ;; esac ## ---------------------------------------------------------------------- @@ -2804,12 +2899,12 @@ else unsigned char s[16]; unsigned char s2[8]; int ret = 1; - + if(sizeof(long double) == 16 && sizeof(long) == 8) { - /*make sure the long double type has 16 bytes in size and + /*make sure the long double type has 16 bytes in size and * 11 bits of exponent. If it is, - *the bit sequence should be like below. It's not - *a decent way to check but this info isn't available. */ + *the bit sequence should be like below. It's not + *a decent way to check but this info isn't available. */ memcpy(s, &ld, 16); if(s[0]==0x43 && s[1]==0x51 && s[2]==0xcc && s[3]==0xf3 && s[4]==0x85 && s[5]==0xeb && s[6]==0xc8 && s[7]==0xa0 && @@ -2843,8 +2938,8 @@ else if(s2[0]==0x00 && s2[1]==0x47 && s2[2]==0x33 && s2[3]==0xce && s2[4]==0x17 && s2[5]==0xaf && s2[6]==0x22 && s2[7]==0x7f) ret = 0; - } - } + } + } exit(ret); ]])] , [hdf5_cv_ldouble_to_long_special=yes], [hdf5_cv_ldouble_to_long_special=no],)]) @@ -2881,17 +2976,17 @@ else unsigned long ull; unsigned char s[16]; int flag=0, ret=1; - + /*Determine if long double has 16 byte in size, 11 bit exponent, and - *the bias is 0x3ff */ - if(sizeof(long double) == 16) { + *the bias is 0x3ff */ + if(sizeof(long double) == 16) { ld = 1.0L; memcpy(s, &ld, 16); if(s[0]==0x3f && s[1]==0xf0 && s[2]==0x00 && s[3]==0x00 && - s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00) - flag = 1; + s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00) + flag = 1; } - + if(flag==1 && sizeof(long)==8) { ll = 0x003fffffffffffffL; ld = (long double)ll; @@ -2907,7 +3002,7 @@ else s[8]==0xbf && s[9]==0xf0 && s[10]==0x00 && s[11]==0x00 && s[12]==0x00 && s[13]==0x00 && s[14]==0x00 && s[15]==0x00) ret = 0; - } + } if(flag==1 && sizeof(unsigned long)==8) { ull = 0xffffffffffffffffUL; ld = (long double)ull; @@ -2925,7 +3020,7 @@ else s[8]==0xbf && s[9]==0xf0 && s[10]==0x00 && s[11]==0x00 && s[12]==0x00 && s[13]==0x00 && s[14]==0x00 && s[15]==0x00) ret = 0; - } + } exit(ret); ]])] , [hdf5_cv_long_to_ldouble_special=yes], [hdf5_cv_long_to_ldouble_special=no],)]) @@ -2966,19 +3061,19 @@ else unsigned long long ull; unsigned char s[16]; int ret = 0; - + if(sizeof(long double) == 16) { - /*make sure the long double type is the same as the failing type + /*make sure the long double type is the same as the failing type *which has 16 bytes in size and 11 bits of exponent. If it is, - *the bit sequence should be like below. It's not - *a decent way to check but this info isn't available. */ + *the bit sequence should be like below. It's not + *a decent way to check but this info isn't available. */ memcpy(s, &ld, 16); if(s[0]==0x43 && s[1]==0x51 && s[2]==0xcc && s[3]==0xf3 && s[4]==0x85 && s[5]==0xeb && s[6]==0xc8 && s[7]==0xa0 && s[8]==0xbf && s[9]==0xcc && s[10]==0x2a && s[11]==0x3c) { /*slightly adjust the bit sequence (s[8]=0xdf). The converted - *values will go wild on Mac OS 10.4 and IRIX64 6.5.*/ + *values will go wild on Mac OS 10.4 and IRIX64 6.5.*/ s[0]=0x43; s[1]=0x51; s[2]=0xcc; s[3]=0xf3; s[4]=0x85; s[5]=0xeb; s[6]=0xc8; s[7]=0xa0; s[8]=0xdf; s[9]=0xcc; s[10]=0x2a; s[11]=0x3c; @@ -2987,11 +3082,11 @@ else memcpy(&ld, s, 16); ll = (long long)ld; ull = (unsigned long long)ld; - + if(ll != 20041683600089728 || ull != 20041683600089728) ret = 1; - } - } + } + } done: exit(ret); } @@ -3031,17 +3126,17 @@ else unsigned long long ull; unsigned char s[16]; int flag=0, ret=0; - + /*Determine if long double has 16 byte in size, 11 bit exponent, and - *the bias is 0x3ff */ - if(sizeof(long double) == 16) { + *the bias is 0x3ff */ + if(sizeof(long double) == 16) { ld = 1.0L; memcpy(s, &ld, 16); if(s[0]==0x3f && s[1]==0xf0 && s[2]==0x00 && s[3]==0x00 && - s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00) - flag = 1; + s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00) + flag = 1; } - + if(flag==1 && sizeof(long long)==8) { ll = 0x01ffffffffffffffLL; ld = (long double)ll; @@ -3051,7 +3146,7 @@ else s[4]!=0xff || s[5]!=0xff || s[6]!=0xff || s[7]!=0xff || s[8]!=0xf0 || s[9]!=0x00 || s[10]!=0x00 || s[11]!=0x00) ret = 1; - } + } if(flag==1 && sizeof(unsigned long long)==8) { ull = 0x01ffffffffffffffULL; ld = (long double)ull; @@ -3060,7 +3155,7 @@ else s[4]!=0xff || s[5]!=0xff || s[6]!=0xff || s[7]!=0xff || s[8]!=0xf0 || s[9]!=0x00 || s[10]!=0x00 || s[11]!=0x00) ret = 1; - } + } done: exit(ret); } @@ -3162,7 +3257,7 @@ CXX_NOFLAGS=`echo $CXX | sed 's/ -.*//'` if `echo $CXX_NOFLAGS | grep ^/ >/dev/null 2>&1`; then CXX_VERSION="$CXX" else - CXX_VERSION="$FC"; + CXX_VERSION="$CXX"; for x in `echo $PATH | sed -e 's/:/ /g'`; do if test -x $x/$CXX_NOFLAGS; then CXX_VERSION="$x/$CXX" diff --git a/examples/Makefile.in b/examples/Makefile.in index dfe4e14..11be6b2 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -350,16 +350,15 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -390,6 +389,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -417,8 +417,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -597,15 +595,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -683,7 +681,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1049,8 +1047,9 @@ uninstall-am: uninstall-local # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp @@ -1120,7 +1119,7 @@ install-data-local: uninstall-local: @$(MAKE) $(AM_MAKEFLAGS) uninstall-examples -install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) +install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ @@ -1167,7 +1166,7 @@ installcheck-local: H5CCFLAGS="-shlib" $(MAKE) $(AM_MAKEFLAGS) check; \ else \ $(MAKE) $(AM_MAKEFLAGS) check; \ - fi + fi @if test "$(INSTALL_FILES)" -a $(TEST_EXAMPLES_SCRIPT) -a -d $(EXAMPLEDIR); then \ echo "============================"; \ echo "Testing $(TEST_EXAMPLES_SCRIPT)"; \ diff --git a/fortran/Makefile.in b/fortran/Makefile.in index 5d941ab..f1c9734 100644 --- a/fortran/Makefile.in +++ b/fortran/Makefile.in @@ -407,16 +407,15 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -447,6 +446,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -474,8 +474,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -654,15 +652,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -704,7 +702,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1183,8 +1181,9 @@ uninstall-am: # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index e67bfda..23d1462 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -358,16 +358,15 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -398,6 +397,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -425,8 +425,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -605,15 +603,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -684,7 +682,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1050,8 +1048,9 @@ uninstall-am: uninstall-local # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp @@ -1111,7 +1110,7 @@ install-data-local: uninstall-local: @$(MAKE) $(AM_MAKEFLAGS) uninstall-examples -install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) +install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ @@ -1158,7 +1157,7 @@ installcheck-local: H5CCFLAGS="-shlib" $(MAKE) $(AM_MAKEFLAGS) check; \ else \ $(MAKE) $(AM_MAKEFLAGS) check; \ - fi + fi @if test "$(INSTALL_FILES)" -a $(TEST_EXAMPLES_SCRIPT) -a -d $(EXAMPLEDIR); then \ echo "============================"; \ echo "Testing $(TEST_EXAMPLES_SCRIPT)"; \ diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 9172033..dd03439 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -584,7 +584,7 @@ set (_PKG_CONFIG_REQUIRES "${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") configure_file ( - ${HDF_RESOURCES_DIR}/libhdf5.pc.in + ${HDF_CONFIG_DIR}/libhdf5.pc.in ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_F90_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc @ONLY ) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 9e42607..e3c69eb 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -463,20 +463,19 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ # Include src directory in both Fortran and C flags (C compiler is used # for linking). AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/fortran/src AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ $(am__append_1) -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -507,6 +506,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -534,8 +534,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -714,15 +712,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -853,7 +851,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1392,8 +1390,9 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-local # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index 68017e7..d2b8475 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -471,20 +471,19 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_builddir)/fortran/src -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ # Include files AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ -I$(top_builddir)/fortran/src \ $(F9XMODFLAG)$(top_builddir)/fortran/src AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ $(am__append_1) -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -515,6 +514,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -542,8 +542,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -722,15 +720,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -817,7 +815,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1455,8 +1453,9 @@ uninstall-am: # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in index 4dbe754..cdf6e06 100644 --- a/fortran/testpar/Makefile.in +++ b/fortran/testpar/Makefile.in @@ -398,12 +398,12 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ # Include files @@ -412,7 +412,6 @@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ -I$(top_srcdir)/fortran/src \ $(F9XMODFLAG)$(top_builddir)/fortran/src \ $(F9XMODFLAG)$(top_builddir)/fortran/test AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ $(am__append_1) -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -443,6 +442,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -470,8 +470,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -650,15 +648,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -704,7 +702,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1141,8 +1139,9 @@ uninstall-am: # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/hl/Makefile.in b/hl/Makefile.in index d286069..577fa58 100644 --- a/hl/Makefile.in +++ b/hl/Makefile.in @@ -407,16 +407,15 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -447,6 +446,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -474,8 +474,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -654,15 +652,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -702,7 +700,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1181,8 +1179,9 @@ uninstall-am: # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in index d355ef4..5369271 100644 --- a/hl/c++/Makefile.in +++ b/hl/c++/Makefile.in @@ -403,16 +403,15 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -443,6 +442,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -470,8 +470,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -650,15 +648,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -694,7 +692,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1173,8 +1171,9 @@ uninstall-am: # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index 62bb996..e2daf43 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -350,16 +350,15 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -390,6 +389,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -417,8 +417,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -597,15 +595,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -662,7 +660,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1026,8 +1024,9 @@ uninstall-am: uninstall-local # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp @@ -1055,7 +1054,7 @@ install-data-local: uninstall-local: @$(MAKE) $(AM_MAKEFLAGS) uninstall-examples -install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) +install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ @@ -1102,7 +1101,7 @@ installcheck-local: H5CCFLAGS="-shlib" $(MAKE) $(AM_MAKEFLAGS) check; \ else \ $(MAKE) $(AM_MAKEFLAGS) check; \ - fi + fi @if test "$(INSTALL_FILES)" -a $(TEST_EXAMPLES_SCRIPT) -a -d $(EXAMPLEDIR); then \ echo "============================"; \ echo "Testing $(TEST_EXAMPLES_SCRIPT)"; \ diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 0c9b04b..1eac9fe 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -109,7 +109,7 @@ set (_PKG_CONFIG_REQUIRES "${HDF5_HL_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_HL_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") configure_file ( - ${HDF_RESOURCES_DIR}/libhdf5.pc.in + ${HDF_CONFIG_DIR}/libhdf5.pc.in ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_CPP_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc @ONLY ) diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index aea6f3f..08cc122 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -403,19 +403,18 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ # Include src directory AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/hl/src -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -446,6 +445,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -473,8 +473,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -653,15 +651,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -735,7 +733,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1238,8 +1236,9 @@ uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in index 33c2829..3025729 100644 --- a/hl/c++/test/Makefile.in +++ b/hl/c++/test/Makefile.in @@ -398,21 +398,20 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ # Include directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/c++/src -I$(top_srcdir)/hl/src \ -I$(top_srcdir)/hl/c++/src -I$(top_srcdir)/test \ -I$(top_builddir)/hl/test -I$(top_srcdir)/hl/test -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -443,6 +442,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -470,8 +470,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -650,15 +648,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -701,7 +699,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1161,8 +1159,9 @@ uninstall-am: # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index cb2d0fc..8341e54 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -350,16 +350,15 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -390,6 +389,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -417,8 +417,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -597,15 +595,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -677,7 +675,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1041,8 +1039,9 @@ uninstall-am: uninstall-local # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp @@ -1094,7 +1093,7 @@ install-data-local: uninstall-local: @$(MAKE) $(AM_MAKEFLAGS) uninstall-examples -install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) +install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ @@ -1141,7 +1140,7 @@ installcheck-local: H5CCFLAGS="-shlib" $(MAKE) $(AM_MAKEFLAGS) check; \ else \ $(MAKE) $(AM_MAKEFLAGS) check; \ - fi + fi @if test "$(INSTALL_FILES)" -a $(TEST_EXAMPLES_SCRIPT) -a -d $(EXAMPLEDIR); then \ echo "============================"; \ echo "Testing $(TEST_EXAMPLES_SCRIPT)"; \ diff --git a/hl/examples/ex_ds1.c b/hl/examples/ex_ds1.c index 73578f1..d6890fa 100644 --- a/hl/examples/ex_ds1.c +++ b/hl/examples/ex_ds1.c @@ -91,9 +91,11 @@ main(void) if (H5DSattach_scale(did, dsid, DIM1) < 0) goto out; - /* close DS id */ + /* close DS ids */ if (H5Dclose(dsid) < 0) goto out; + if (H5Dclose(did) < 0) + goto out; /* close file */ H5Fclose(fid); diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in index 0430998..d6f8686 100644 --- a/hl/fortran/Makefile.in +++ b/hl/fortran/Makefile.in @@ -407,16 +407,15 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -447,6 +446,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -474,8 +474,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -654,15 +652,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -698,7 +696,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1177,8 +1175,9 @@ uninstall-am: # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index 9140339..e7ffc85 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -351,16 +351,15 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -391,6 +390,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -418,8 +418,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -598,15 +596,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -670,7 +668,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1034,8 +1032,9 @@ uninstall-am: uninstall-local # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp @@ -1059,7 +1058,7 @@ install-data-local: uninstall-local: @$(MAKE) $(AM_MAKEFLAGS) uninstall-examples -install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) +install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ @@ -1106,7 +1105,7 @@ installcheck-local: H5CCFLAGS="-shlib" $(MAKE) $(AM_MAKEFLAGS) check; \ else \ $(MAKE) $(AM_MAKEFLAGS) check; \ - fi + fi @if test "$(INSTALL_FILES)" -a $(TEST_EXAMPLES_SCRIPT) -a -d $(EXAMPLEDIR); then \ echo "============================"; \ echo "Testing $(TEST_EXAMPLES_SCRIPT)"; \ diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 929d867..b309e92 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -245,11 +245,11 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_HL_F90_LIB_CORENAME}") endif () -set (_PKG_CONFIG_REQUIRES "${HDF5_HL_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") -set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_HL_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") +set (_PKG_CONFIG_REQUIRES "${HDF5_F90_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") +set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_F90_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") configure_file ( - ${HDF_RESOURCES_DIR}/libhdf5.pc.in + ${HDF_CONFIG_DIR}/libhdf5.pc.in ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_F90_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc @ONLY ) diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index c02d331..0c32660 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -421,19 +421,18 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ -I$(top_builddir)/fortran/src \ $(F9XMODFLAG)$(top_builddir)/fortran/src AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ $(am__append_1) -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -464,6 +463,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -491,8 +491,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -671,15 +669,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -756,7 +754,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1255,8 +1253,9 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-local # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in index 3d1c6ab..5074d5e 100644 --- a/hl/fortran/test/Makefile.in +++ b/hl/fortran/test/Makefile.in @@ -411,20 +411,19 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_builddir)/src -I$(top_srcdir)/hl/src -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ -I$(top_builddir)/fortran/src \ -I$(top_builddir)/hl/fortran/src \ $(F9XMODFLAG)$(top_builddir)/fortran/src \ $(F9XMODFLAG)$(top_builddir)/hl/fortran/src AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ $(am__append_1) -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -455,6 +454,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -482,8 +482,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -662,15 +660,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -719,7 +717,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1196,8 +1194,9 @@ uninstall-am: # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index bb10088..cc5aca5 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -137,7 +137,7 @@ set (_PKG_CONFIG_REQUIRES "${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}") configure_file ( - ${HDF_RESOURCES_DIR}/libhdf5.pc.in + ${HDF_CONFIG_DIR}/libhdf5.pc.in ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_HL_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc @ONLY ) diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index e35f20b..6673f5f 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -2,7 +2,6 @@ #if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402 #pragma GCC diagnostic ignored "-Wconversion" #pragma GCC diagnostic ignored "-Wimplicit-function-declaration" -#pragma GCC diagnostic ignored "-Wlarger-than=" #pragma GCC diagnostic ignored "-Wmissing-prototypes" #pragma GCC diagnostic ignored "-Wnested-externs" #pragma GCC diagnostic ignored "-Wold-style-definition" @@ -11,8 +10,11 @@ #pragma GCC diagnostic ignored "-Wsign-conversion" #pragma GCC diagnostic ignored "-Wstrict-overflow" #pragma GCC diagnostic ignored "-Wstrict-prototypes" +#if !defined (__clang__) +#pragma GCC diagnostic ignored "-Wlarger-than=" #pragma GCC diagnostic ignored "-Wsuggest-attribute=const" #pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" +#endif #pragma GCC diagnostic ignored "-Wswitch-default" #pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wunused-macros" diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 80de0a2..2ef133f 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -2,7 +2,6 @@ #if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402 #pragma GCC diagnostic ignored "-Wconversion" #pragma GCC diagnostic ignored "-Wimplicit-function-declaration" -#pragma GCC diagnostic ignored "-Wlarger-than=" #pragma GCC diagnostic ignored "-Wmissing-prototypes" #pragma GCC diagnostic ignored "-Wnested-externs" #pragma GCC diagnostic ignored "-Wold-style-definition" @@ -11,8 +10,11 @@ #pragma GCC diagnostic ignored "-Wsign-conversion" #pragma GCC diagnostic ignored "-Wstrict-overflow" #pragma GCC diagnostic ignored "-Wstrict-prototypes" +#if !defined (__clang__) +#pragma GCC diagnostic ignored "-Wlarger-than=" #pragma GCC diagnostic ignored "-Wsuggest-attribute=const" #pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" +#endif #pragma GCC diagnostic ignored "-Wswitch-default" #pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wunused-macros" diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 609b35f..5ef5545 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -403,18 +403,17 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ # Add include directories to the C preprocessor flags AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -445,6 +444,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -472,8 +472,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -652,15 +650,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -733,7 +731,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1243,8 +1241,9 @@ uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index 3b60254..9f6ffde 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -436,21 +436,20 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ # Add include directories to C preprocessor flags AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I. -I$(srcdir) \ -I$(top_builddir)/src -I$(top_srcdir)/src \ -I$(top_builddir)/test -I$(top_srcdir)/test \ -I$(top_srcdir)/hl/src -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -481,6 +480,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -508,8 +508,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -688,15 +686,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -752,7 +750,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1302,8 +1300,9 @@ uninstall-am: # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/hl/test/h5hltest.h b/hl/test/h5hltest.h index d286c00..7d9c5d1 100644 --- a/hl/test/h5hltest.h +++ b/hl/test/h5hltest.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, April 28, 2006 * * Purpose: Test support stuff. diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index a2568cd..90110a4 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "h5hltest.h" #include "H5srcdir.h" #include "H5DSpublic.h" diff --git a/hl/test/test_file_image.c b/hl/test/test_file_image.c index 34d52a5..d56a8b9 100644 --- a/hl/test/test_file_image.c +++ b/hl/test/test_file_image.c @@ -445,7 +445,7 @@ test_file_image(size_t open_images, size_t nflags, unsigned *flags) FAIL_PUTS_ERROR("H5Dclose() failed"); } /* end for */ - PASSED() + PASSED(); HL_TESTING2("close file images"); diff --git a/hl/test/test_image.c b/hl/test/test_image.c index ff53d4f..b71531e 100644 --- a/hl/test/test_image.c +++ b/hl/test/test_image.c @@ -11,10 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include - #include "h5hltest.h" #include "H5srcdir.h" #include "H5LTpublic.h" diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 69a1fe5..3ecc79a 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "h5hltest.h" #include "H5srcdir.h" #include "H5LTpublic.h" diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c index 6ff70dc..1d3a569 100644 --- a/hl/test/test_packet.c +++ b/hl/test/test_packet.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "h5hltest.h" #include "H5PTpublic.h" #include "H5TBpublic.h" diff --git a/hl/test/test_table.c b/hl/test/test_table.c index bbd4888..0d4a72a 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "h5hltest.h" #include "H5srcdir.h" #include "H5TBpublic.h" diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in index e0976b6..1a85080 100644 --- a/hl/tools/Makefile.in +++ b/hl/tools/Makefile.in @@ -404,16 +404,15 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -444,6 +443,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -471,8 +471,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -651,15 +649,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -694,7 +692,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1173,8 +1171,9 @@ uninstall-am: # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in index 27fe474..9f27702 100644 --- a/hl/tools/gif2h5/Makefile.in +++ b/hl/tools/gif2h5/Makefile.in @@ -416,19 +416,18 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ # Include src and tools/lib directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/tools/lib -I$(top_srcdir)/hl/src -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -459,6 +458,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -486,8 +486,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -666,15 +664,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -719,7 +717,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1243,8 +1241,9 @@ uninstall-am: uninstall-binPROGRAMS # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index c6990ec..625ad24 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,6 +1,7 @@ HDF5 version 1.8.23-1 currently under development ================================================================================ + INTRODUCTION ============ @@ -48,55 +49,167 @@ New Features Configuration: ------------- - - None + - On macOS, Universal Binaries can now be built, allowing native execution on + both Intel and Apple Silicon (ARM) based Macs. + To do so, set CMAKE_OSX_ARCHITECTURES="x86_64;arm64" - Library - ------- + (SAM - 2021/02/07, https://github.com/HDFGroup/hdf5/issues/311) + + - Added a configure-time option to control certain compiler warnings + diagnostics + + A new configure-time option was added that allows some compiler warnings + diagnostics to have the default operation. This is mainly intended for + library developers and currently only works for gcc 10 and above. The + diagnostics flags apply to C, C++ and Fortran compilers and will appear + in "H5 C Flags", H5 C++ Flags" and H5 Fortran Flags, respectively. They + will NOT be exported to h5cc, etc. + + The default is OFF, which will disable the warnings URL and color attributes + for the warnings output. ON will not add the flags and allow default behavior. + + Autotools: --enable-diags + + CMake: HDF5_ENABLE_BUILD_DIAGS + + (ADB - 2021/02/05, HDFFV-11213) + + - FreeBSD Autotools configuration now defaults to 'cc' and 'c++' compilers + + On FreeBSD, the autotools defaulted to 'gcc' as the C compiler and did + not process C++ options. Since FreeBSD 10, the default compiler has + been clang (via 'cc'). + + The default compilers have been set to 'cc' for C and 'c++' for C++, + which will pick up clang and clang++ respectively on FreeBSD 10+. + Additionally, clang options are now set correctly for both C and C++ + and g++ options will now be set if that compiler is being used (an + omission from the former functionality). + + (DER - 2021/02/16, HDFFV-11193) + + - Fixed POSIX problems when building w/ gcc on Solaris + + When building on Solaris using gcc, the POSIX symbols were not + being set correctly, which could lead to issues like clock_gettime() + not being found. + + The standard is now set to gnu99 when building with gcc on Solaris, + which allows POSIX things to be #defined and linked correctly. This + differs slightly from the gcc norm, where we set the standard to c99 + and manually set POSIX #define symbols. + + (DER - 2021/02/16, HDFFV-11191) + + - Added a configure-time option to consider certain compiler warnings + as errors + + A new configure-time option was added that converts some compiler warnings + to errors. This is mainly intended for library developers and currently + only works for gcc and clang. The warnings that are considered errors + will appear in the generated libhdf5.settings file. These warnings apply + to C and C++ code and will appear in "H5 C Flags" and H5 C++ Flags", + respectively. They will NOT be exported to h5cc, etc. + + The default is OFF. Building with this option may fail when compiling + on operating systems and with compiler versions not commonly used by + the library developers. Compilation may also fail when headers not + under the control of the library developers (e.g., mpi.h, hdfs.h) raise + warnings. + + Autotools: --enable-warnings-as-errors + + CMake: HDF5_ENABLE_WARNINGS_AS_ERRORS + + (DER - 2021/02/16, HDFFV-11189) + + + Library: + -------- - None - Parallel Library + Fortran Library: ---------------- - None - Tools - ----- + C++ Library: + ------------ - None - High-Level APIs - --------------- + Parallel Library: + ---------------- - None - Fortran API - ----------- - - None + Tools: + ------ + - h5repack added help text for user-defined filters. + Added help text line that states the valid values of the filter flag + for user-defined filters; + filter_flag: 1 is OPTIONAL or 0 is MANDATORY - C++ API - ------- - - None + (ADB - 2021/02/16, HDFFV-11099) + + - h5repack added options to control how external links are handled. + + Currently h5repack preserves external links and cannot copy and merge + data from the external files. Two options, merge and prune, were added to + control how to merge data from an external link into the resulting file. + --merge Follow external soft link recursively and merge data. + --prune Do not follow external soft links and remove link. + --merge --prune Follow external link, merge data and remove dangling link. + (ADB - 2021/02/16, HDFFV-9984) - High-Level APIs + + High-Level APIs: --------------- - None + Documentation + ------------- + - None + + Support for New Platforms, Languages, and Compilers =================================================== + - None -Bug Fixes since HDF5-1.8.21 +Bug Fixes since HDF5-1.8.22 =========================== Configuration ------------- - - None + - Reclassify CMake messages, to allow new modes and --log-level option + + CMake message commands have a mode argument. By default, STATUS mode + was chosen for any non-error message. CMake version 3.15 added additional + modes, NOTICE, VERBOSE, DEBUG and TRACE. All message commands with a mode + of STATUS were reviewed and most were reclassified as VERBOSE. The new + mode was protected by a check for a CMake version of at least 3.15. If CMake + version 3.17 or above is used, the user can use the command line option + of "--log-level" to further restrict which message commands are displayed. + + (ADB - 2021/02/16, HDFFV-11144) + + - Fixes Autotools determination of the stat struct having an st_blocks field + + A missing parenthesis in an autoconf macro prevented building the test + code used to determine if the stat struct contains the st_blocks field. + Now that the test functions correctly, the H5_HAVE_STAT_ST_BLOCKS #define + found in H5pubconf.h will be defined correctly on both the Autotools and + CMake. This #define is only used in the tests and does not affect the + HDF5 C library. + + (DER - 2021/02/16, HDFFV-11201) Library @@ -105,13 +218,68 @@ Bug Fixes since HDF5-1.8.21 Performance - ------------- + ----------- - None Tools ----- - - None + - Fixed tools argument parsing. + + Tools parsing used the length of the option from the long array to match + the option from the command line. This incorrectly matched a shorter long + name option that was happened to be a subset of another long option. + Changed to match whole names. + + (ADB - 2021/02/16, HDFFV-11106) + + - The tools library was updated by standardizing the error stack process. + + General sequence is: + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + h5tools_init(); + ... process the command-line (check for error-stack enable) ... + h5tools_error_report(); + ... (do work) ... + h5diff_exit(ret); + + (ADB - 2021/02/16, HDFFV-11066) + + - h5diff fixed a command line parsing error. + + h5diff would ignore the argument to -d (delta) if it is smaller than DBL_EPSILON. + The macro H5_DBL_ABS_EQUAL was removed and a direct value comparision was used. + + (ADB - 2021/02/16, HDFFV-10897) + + - h5diff added a command line option to ignore attributes. + + h5diff would ignore all objects with a supplied path if the exclude-path argument is used. + Adding the exclude-attribute argument will only eclude attributes, with the supplied path, + from comparision. + + (ADB - 2021/02/16, HDFFV-5935) + + - h5diff added another level to the verbose argument to print filenames. + + Added verbose level 3 that is level 2 plus the filenames. The levels are: + 0 : Identical to '-v' or '--verbose' + 1 : All level 0 information plus one-line attribute status summary + 2 : All level 1 information plus extended attribute status report + 3 : All level 2 information plus file names + + (ADB - 2021/02/16, HDFFV-10005) + + - h5repack was fixed to repack the reference attributes properly. + The code line that checks if the update of reference inside a compound + datatype is misplaced outside the code block loop that carries out the + check. In consequence, the next attribute that is not the reference + type was repacked again as the reference type and caused the failure of + repacking. The fix is to move the corresponding code line to the correct + code block. + + (KY -2021/02/16, HDFFV-11014) Fortran API @@ -143,7 +311,7 @@ Supported Platforms Linux 2.6.32-573.18.1.el6 IBM XL C/C++ V13.1 #1 SMP ppc64 GNU/Linux IBM XL Fortran V15.1 - (ostrich) + (ostrich) Linux 3.10.0-327.10.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) #1 SMP x86_64 GNU/Linux compilers: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 181e15c..217c55d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -787,7 +787,7 @@ if (HDF5_GENERATE_HEADERS) ) message(STATUS ${SCRIPT_OUTPUT}) else () - message (STATUS "Cannot generate headers - perl not found") + message (WARNING "Cannot generate headers - perl not found") endif () endif () @@ -905,7 +905,8 @@ else () ) if (BUILD_SHARED_LIBS) add_custom_command ( - OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1 + OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c + ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1 COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" "${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c" COMMAND ${CMAKE_COMMAND} @@ -1117,7 +1118,7 @@ set (_PKG_CONFIG_REQUIRES) set (_PKG_CONFIG_REQUIRES_PRIVATE) configure_file ( - ${HDF_RESOURCES_DIR}/libhdf5.pc.in + ${HDF_CONFIG_DIR}/libhdf5.pc.in ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc @ONLY ) diff --git a/src/H5Edefin.h b/src/H5Edefin.h index 5b5165c..b580fc0 100644 --- a/src/H5Edefin.h +++ b/src/H5Edefin.h @@ -19,37 +19,37 @@ #define _H5Edefin_H /* Major error IDs */ -hid_t H5E_DATASET_g = FAIL; /* Dataset */ -hid_t H5E_FUNC_g = FAIL; /* Function entry/exit */ +hid_t H5E_RESOURCE_g = FAIL; /* Resource unavailable */ +hid_t H5E_IO_g = FAIL; /* Low-level I/O */ +hid_t H5E_CACHE_g = FAIL; /* Object cache */ +hid_t H5E_BTREE_g = FAIL; /* B-Tree node */ +hid_t H5E_ATOM_g = FAIL; /* Object atom */ +hid_t H5E_RS_g = FAIL; /* Reference Counted Strings */ hid_t H5E_STORAGE_g = FAIL; /* Data storage */ hid_t H5E_FILE_g = FAIL; /* File accessibility */ -hid_t H5E_SOHM_g = FAIL; /* Shared Object Header Messages */ -hid_t H5E_SYM_g = FAIL; /* Symbol table */ -hid_t H5E_PLUGIN_g = FAIL; /* Plugin for dynamically loaded library */ -hid_t H5E_VFL_g = FAIL; /* Virtual File Layer */ -hid_t H5E_INTERNAL_g = FAIL; /* Internal error (too specific to document in detail) */ -hid_t H5E_BTREE_g = FAIL; /* B-Tree node */ +hid_t H5E_PLINE_g = FAIL; /* Data filters */ hid_t H5E_REFERENCE_g = FAIL; /* References */ -hid_t H5E_DATASPACE_g = FAIL; /* Dataspace */ -hid_t H5E_RESOURCE_g = FAIL; /* Resource unavailable */ -hid_t H5E_PLIST_g = FAIL; /* Property lists */ -hid_t H5E_LINK_g = FAIL; /* Links */ +hid_t H5E_ERROR_g = FAIL; /* Error API */ hid_t H5E_DATATYPE_g = FAIL; /* Datatype */ -hid_t H5E_RS_g = FAIL; /* Reference Counted Strings */ -hid_t H5E_HEAP_g = FAIL; /* Heap */ -hid_t H5E_OHDR_g = FAIL; /* Object header */ -hid_t H5E_ATOM_g = FAIL; /* Object atom */ hid_t H5E_ATTR_g = FAIL; /* Attribute */ -hid_t H5E_NONE_MAJOR_g = FAIL; /* No error */ -hid_t H5E_IO_g = FAIL; /* Low-level I/O */ +hid_t H5E_OHDR_g = FAIL; /* Object header */ +hid_t H5E_FUNC_g = FAIL; /* Function entry/exit */ +hid_t H5E_VFL_g = FAIL; /* Virtual File Layer */ +hid_t H5E_SYM_g = FAIL; /* Symbol table */ hid_t H5E_SLIST_g = FAIL; /* Skip Lists */ -hid_t H5E_EFL_g = FAIL; /* External file list */ +hid_t H5E_LINK_g = FAIL; /* Links */ +hid_t H5E_NONE_MAJOR_g = FAIL; /* No error */ +hid_t H5E_HEAP_g = FAIL; /* Heap */ hid_t H5E_TST_g = FAIL; /* Ternary Search Trees */ -hid_t H5E_ARGS_g = FAIL; /* Invalid arguments to routine */ -hid_t H5E_ERROR_g = FAIL; /* Error API */ -hid_t H5E_PLINE_g = FAIL; /* Data filters */ hid_t H5E_FSPACE_g = FAIL; /* Free Space Manager */ -hid_t H5E_CACHE_g = FAIL; /* Object cache */ +hid_t H5E_INTERNAL_g = FAIL; /* Internal error (too specific to document in detail) */ +hid_t H5E_EFL_g = FAIL; /* External file list */ +hid_t H5E_PLUGIN_g = FAIL; /* Plugin for dynamically loaded library */ +hid_t H5E_DATASET_g = FAIL; /* Dataset */ +hid_t H5E_SOHM_g = FAIL; /* Shared Object Header Messages */ +hid_t H5E_PLIST_g = FAIL; /* Property lists */ +hid_t H5E_DATASPACE_g = FAIL; /* Dataspace */ +hid_t H5E_ARGS_g = FAIL; /* Invalid arguments to routine */ /* Minor error IDs */ @@ -61,41 +61,29 @@ hid_t H5E_CLOSEERROR_g = FAIL; /* Close failed */ hid_t H5E_OVERFLOW_g = FAIL; /* Address overflowed */ hid_t H5E_FCNTL_g = FAIL; /* File control (fcntl) failed */ -/* Resource errors */ -hid_t H5E_NOSPACE_g = FAIL; /* No space available for allocation */ -hid_t H5E_CANTALLOC_g = FAIL; /* Can't allocate space */ -hid_t H5E_CANTCOPY_g = FAIL; /* Unable to copy object */ -hid_t H5E_CANTFREE_g = FAIL; /* Unable to free object */ -hid_t H5E_ALREADYEXISTS_g = FAIL; /* Object already exists */ -hid_t H5E_CANTLOCK_g = FAIL; /* Unable to lock object */ -hid_t H5E_CANTUNLOCK_g = FAIL; /* Unable to unlock object */ -hid_t H5E_CANTGC_g = FAIL; /* Unable to garbage collect */ -hid_t H5E_CANTGETSIZE_g = FAIL; /* Unable to compute size */ -hid_t H5E_OBJOPEN_g = FAIL; /* Object is already open */ - -/* Heap errors */ -hid_t H5E_CANTRESTORE_g = FAIL; /* Can't restore condition */ -hid_t H5E_CANTCOMPUTE_g = FAIL; /* Can't compute value */ -hid_t H5E_CANTEXTEND_g = FAIL; /* Can't extend heap's space */ -hid_t H5E_CANTATTACH_g = FAIL; /* Can't attach object */ -hid_t H5E_CANTUPDATE_g = FAIL; /* Can't update object */ -hid_t H5E_CANTOPERATE_g = FAIL; /* Can't operate on object */ - -/* Function entry/exit interface errors */ -hid_t H5E_CANTINIT_g = FAIL; /* Unable to initialize object */ -hid_t H5E_ALREADYINIT_g = FAIL; /* Object already initialized */ -hid_t H5E_CANTRELEASE_g = FAIL; /* Unable to release object */ +/* B-tree related errors */ +hid_t H5E_NOTFOUND_g = FAIL; /* Object not found */ +hid_t H5E_EXISTS_g = FAIL; /* Object already exists */ +hid_t H5E_CANTENCODE_g = FAIL; /* Unable to encode value */ +hid_t H5E_CANTDECODE_g = FAIL; /* Unable to decode value */ +hid_t H5E_CANTSPLIT_g = FAIL; /* Unable to split node */ +hid_t H5E_CANTREDISTRIBUTE_g = FAIL; /* Unable to redistribute records */ +hid_t H5E_CANTSWAP_g = FAIL; /* Unable to swap records */ +hid_t H5E_CANTINSERT_g = FAIL; /* Unable to insert object */ +hid_t H5E_CANTLIST_g = FAIL; /* Unable to list node */ +hid_t H5E_CANTMODIFY_g = FAIL; /* Unable to modify record */ +hid_t H5E_CANTREMOVE_g = FAIL; /* Unable to remove object */ -/* Property list errors */ -hid_t H5E_CANTGET_g = FAIL; /* Can't get value */ -hid_t H5E_CANTSET_g = FAIL; /* Can't set value */ -hid_t H5E_DUPCLASS_g = FAIL; /* Duplicate class name in parent class */ -hid_t H5E_SETDISALLOWED_g = FAIL; /* Disallowed operation */ +/* System level errors */ +hid_t H5E_SYSERRSTR_g = FAIL; /* System error message */ -/* Free space errors */ -hid_t H5E_CANTMERGE_g = FAIL; /* Can't merge objects */ -hid_t H5E_CANTREVIVE_g = FAIL; /* Can't revive object */ -hid_t H5E_CANTSHRINK_g = FAIL; /* Can't shrink container */ +/* Dataspace errors */ +hid_t H5E_CANTCLIP_g = FAIL; /* Can't clip hyperslab region */ +hid_t H5E_CANTCOUNT_g = FAIL; /* Can't count elements */ +hid_t H5E_CANTSELECT_g = FAIL; /* Can't select hyperslab */ +hid_t H5E_CANTNEXT_g = FAIL; /* Can't move to next iterator location */ +hid_t H5E_BADSELECT_g = FAIL; /* Invalid selection */ +hid_t H5E_CANTCOMPARE_g = FAIL; /* Can't compare objects */ /* Object header related errors */ hid_t H5E_LINKCOUNT_g = FAIL; /* Bad object header link count */ @@ -108,16 +96,12 @@ hid_t H5E_CANTPACK_g = FAIL; /* Can't pack messages */ hid_t H5E_CANTRESET_g = FAIL; /* Can't reset object */ hid_t H5E_CANTRENAME_g = FAIL; /* Unable to rename object */ -/* System level errors */ -hid_t H5E_SYSERRSTR_g = FAIL; /* System error message */ +/* No error */ +hid_t H5E_NONE_MINOR_g = FAIL; /* No error */ -/* I/O pipeline errors */ -hid_t H5E_NOFILTER_g = FAIL; /* Requested filter is not available */ -hid_t H5E_CALLBACK_g = FAIL; /* Callback failed */ -hid_t H5E_CANAPPLY_g = FAIL; /* Error from filter 'can apply' callback */ -hid_t H5E_SETLOCAL_g = FAIL; /* Error from filter 'set local' callback */ -hid_t H5E_NOENCODER_g = FAIL; /* Filter present but encoding disabled */ -hid_t H5E_CANTFILTER_g = FAIL; /* Filter operation failed */ +/* Datatype conversion errors */ +hid_t H5E_CANTCONVERT_g = FAIL; /* Can't convert datatypes */ +hid_t H5E_BADSIZE_g = FAIL; /* Bad size for object */ /* Group related errors */ hid_t H5E_CANTOPENOBJ_g = FAIL; /* Can't open object */ @@ -125,12 +109,6 @@ hid_t H5E_CANTCLOSEOBJ_g = FAIL; /* Can't close object */ hid_t H5E_COMPLEN_g = FAIL; /* Name component is too long */ hid_t H5E_PATH_g = FAIL; /* Problem with path to object */ -/* No error */ -hid_t H5E_NONE_MINOR_g = FAIL; /* No error */ - -/* Plugin errors */ -hid_t H5E_OPENERROR_g = FAIL; /* Can't open directory or file */ - /* File accessibility errors */ hid_t H5E_FILEEXISTS_g = FAIL; /* File already exists */ hid_t H5E_FILEOPEN_g = FAIL; /* File already open */ @@ -142,13 +120,13 @@ hid_t H5E_BADFILE_g = FAIL; /* Bad file ID accessed */ hid_t H5E_TRUNCATED_g = FAIL; /* File has been truncated */ hid_t H5E_MOUNT_g = FAIL; /* File mount error */ -/* Object atom related errors */ -hid_t H5E_BADATOM_g = FAIL; /* Unable to find atom information (already closed?) */ -hid_t H5E_BADGROUP_g = FAIL; /* Unable to find ID group information */ -hid_t H5E_CANTREGISTER_g = FAIL; /* Unable to register new atom */ -hid_t H5E_CANTINC_g = FAIL; /* Unable to increment reference count */ -hid_t H5E_CANTDEC_g = FAIL; /* Unable to decrement reference count */ -hid_t H5E_NOIDS_g = FAIL; /* Out of IDs for group */ +/* Heap errors */ +hid_t H5E_CANTRESTORE_g = FAIL; /* Can't restore condition */ +hid_t H5E_CANTCOMPUTE_g = FAIL; /* Can't compute value */ +hid_t H5E_CANTEXTEND_g = FAIL; /* Can't extend heap's space */ +hid_t H5E_CANTATTACH_g = FAIL; /* Can't attach object */ +hid_t H5E_CANTUPDATE_g = FAIL; /* Can't update object */ +hid_t H5E_CANTOPERATE_g = FAIL; /* Can't operate on object */ /* Cache related errors */ hid_t H5E_CANTFLUSH_g = FAIL; /* Unable to flush data from cache */ @@ -167,6 +145,11 @@ hid_t H5E_CANTDIRTY_g = FAIL; /* Unable to mark metadata as dirty */ hid_t H5E_CANTEXPUNGE_g = FAIL; /* Unable to expunge a metadata cache entry */ hid_t H5E_CANTRESIZE_g = FAIL; /* Unable to resize a metadata cache entry */ +/* Parallel MPI errors */ +hid_t H5E_MPI_g = FAIL; /* Some MPI function failed */ +hid_t H5E_MPIERRSTR_g = FAIL; /* MPI Error String */ +hid_t H5E_CANTRECV_g = FAIL; /* Can't receive data */ + /* Link related errors */ hid_t H5E_TRAVERSE_g = FAIL; /* Link traversal failure */ hid_t H5E_NLINKS_g = FAIL; /* Too many soft links in path */ @@ -174,18 +157,20 @@ hid_t H5E_NOTREGISTERED_g = FAIL; /* Link class not registered */ hid_t H5E_CANTMOVE_g = FAIL; /* Can't move object */ hid_t H5E_CANTSORT_g = FAIL; /* Can't sort objects */ -/* Parallel MPI errors */ -hid_t H5E_MPI_g = FAIL; /* Some MPI function failed */ -hid_t H5E_MPIERRSTR_g = FAIL; /* MPI Error String */ -hid_t H5E_CANTRECV_g = FAIL; /* Can't receive data */ +/* Resource errors */ +hid_t H5E_NOSPACE_g = FAIL; /* No space available for allocation */ +hid_t H5E_CANTALLOC_g = FAIL; /* Can't allocate space */ +hid_t H5E_CANTCOPY_g = FAIL; /* Unable to copy object */ +hid_t H5E_CANTFREE_g = FAIL; /* Unable to free object */ +hid_t H5E_ALREADYEXISTS_g = FAIL; /* Object already exists */ +hid_t H5E_CANTLOCK_g = FAIL; /* Unable to lock object */ +hid_t H5E_CANTUNLOCK_g = FAIL; /* Unable to unlock object */ +hid_t H5E_CANTGC_g = FAIL; /* Unable to garbage collect */ +hid_t H5E_CANTGETSIZE_g = FAIL; /* Unable to compute size */ +hid_t H5E_OBJOPEN_g = FAIL; /* Object is already open */ -/* Dataspace errors */ -hid_t H5E_CANTCLIP_g = FAIL; /* Can't clip hyperslab region */ -hid_t H5E_CANTCOUNT_g = FAIL; /* Can't count elements */ -hid_t H5E_CANTSELECT_g = FAIL; /* Can't select hyperslab */ -hid_t H5E_CANTNEXT_g = FAIL; /* Can't move to next iterator location */ -hid_t H5E_BADSELECT_g = FAIL; /* Invalid selection */ -hid_t H5E_CANTCOMPARE_g = FAIL; /* Can't compare objects */ +/* Plugin errors */ +hid_t H5E_OPENERROR_g = FAIL; /* Can't open directory or file */ /* Argument errors */ hid_t H5E_UNINITIALIZED_g = FAIL; /* Information is uinitialized */ @@ -194,21 +179,36 @@ hid_t H5E_BADTYPE_g = FAIL; /* Inappropriate type */ hid_t H5E_BADRANGE_g = FAIL; /* Out of range */ hid_t H5E_BADVALUE_g = FAIL; /* Bad value */ -/* B-tree related errors */ -hid_t H5E_NOTFOUND_g = FAIL; /* Object not found */ -hid_t H5E_EXISTS_g = FAIL; /* Object already exists */ -hid_t H5E_CANTENCODE_g = FAIL; /* Unable to encode value */ -hid_t H5E_CANTDECODE_g = FAIL; /* Unable to decode value */ -hid_t H5E_CANTSPLIT_g = FAIL; /* Unable to split node */ -hid_t H5E_CANTREDISTRIBUTE_g = FAIL; /* Unable to redistribute records */ -hid_t H5E_CANTSWAP_g = FAIL; /* Unable to swap records */ -hid_t H5E_CANTINSERT_g = FAIL; /* Unable to insert object */ -hid_t H5E_CANTLIST_g = FAIL; /* Unable to list node */ -hid_t H5E_CANTMODIFY_g = FAIL; /* Unable to modify record */ -hid_t H5E_CANTREMOVE_g = FAIL; /* Unable to remove object */ +/* Object atom related errors */ +hid_t H5E_BADATOM_g = FAIL; /* Unable to find atom information (already closed?) */ +hid_t H5E_BADGROUP_g = FAIL; /* Unable to find ID group information */ +hid_t H5E_CANTREGISTER_g = FAIL; /* Unable to register new atom */ +hid_t H5E_CANTINC_g = FAIL; /* Unable to increment reference count */ +hid_t H5E_CANTDEC_g = FAIL; /* Unable to decrement reference count */ +hid_t H5E_NOIDS_g = FAIL; /* Out of IDs for group */ -/* Datatype conversion errors */ -hid_t H5E_CANTCONVERT_g = FAIL; /* Can't convert datatypes */ -hid_t H5E_BADSIZE_g = FAIL; /* Bad size for object */ +/* Function entry/exit interface errors */ +hid_t H5E_CANTINIT_g = FAIL; /* Unable to initialize object */ +hid_t H5E_ALREADYINIT_g = FAIL; /* Object already initialized */ +hid_t H5E_CANTRELEASE_g = FAIL; /* Unable to release object */ + +/* I/O pipeline errors */ +hid_t H5E_NOFILTER_g = FAIL; /* Requested filter is not available */ +hid_t H5E_CALLBACK_g = FAIL; /* Callback failed */ +hid_t H5E_CANAPPLY_g = FAIL; /* Error from filter 'can apply' callback */ +hid_t H5E_SETLOCAL_g = FAIL; /* Error from filter 'set local' callback */ +hid_t H5E_NOENCODER_g = FAIL; /* Filter present but encoding disabled */ +hid_t H5E_CANTFILTER_g = FAIL; /* Filter operation failed */ + +/* Property list errors */ +hid_t H5E_CANTGET_g = FAIL; /* Can't get value */ +hid_t H5E_CANTSET_g = FAIL; /* Can't set value */ +hid_t H5E_DUPCLASS_g = FAIL; /* Duplicate class name in parent class */ +hid_t H5E_SETDISALLOWED_g = FAIL; /* Disallowed operation */ + +/* Free space errors */ +hid_t H5E_CANTMERGE_g = FAIL; /* Can't merge objects */ +hid_t H5E_CANTREVIVE_g = FAIL; /* Can't revive object */ +hid_t H5E_CANTSHRINK_g = FAIL; /* Can't shrink container */ #endif /* H5Edefin_H */ diff --git a/src/H5Einit.h b/src/H5Einit.h index db522d0..56b9662 100644 --- a/src/H5Einit.h +++ b/src/H5Einit.h @@ -22,15 +22,35 @@ /* Major error codes */ /*********************/ -HDassert(H5E_DATASET_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Dataset"))==NULL) +HDassert(H5E_RESOURCE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Resource unavailable"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_DATASET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_RESOURCE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_FUNC_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Function entry/exit"))==NULL) +HDassert(H5E_IO_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Low-level I/O"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_FUNC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_IO_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CACHE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object cache"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CACHE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_BTREE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "B-Tree node"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_BTREE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_ATOM_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object atom"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_ATOM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_RS_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Reference Counted Strings"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_RS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") HDassert(H5E_STORAGE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Data storage"))==NULL) @@ -42,140 +62,120 @@ if((msg = H5E_create_msg(cls, H5E_MAJOR, "File accessibility"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_FILE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_SOHM_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Shared Object Header Messages"))==NULL) +HDassert(H5E_PLINE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Data filters"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SOHM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_PLINE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_SYM_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Symbol table"))==NULL) +HDassert(H5E_REFERENCE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "References"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SYM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_REFERENCE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_PLUGIN_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Plugin for dynamically loaded library"))==NULL) +HDassert(H5E_ERROR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Error API"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_PLUGIN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_ERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_VFL_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Virtual File Layer"))==NULL) +HDassert(H5E_DATATYPE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Datatype"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_VFL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_DATATYPE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_INTERNAL_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Internal error (too specific to document in detail)"))==NULL) +HDassert(H5E_ATTR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Attribute"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_INTERNAL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_ATTR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_BTREE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "B-Tree node"))==NULL) +HDassert(H5E_OHDR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object header"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BTREE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_OHDR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_REFERENCE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "References"))==NULL) +HDassert(H5E_FUNC_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Function entry/exit"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_REFERENCE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_FUNC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_DATASPACE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Dataspace"))==NULL) +HDassert(H5E_VFL_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Virtual File Layer"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_DATASPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_VFL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_RESOURCE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Resource unavailable"))==NULL) +HDassert(H5E_SYM_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Symbol table"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_RESOURCE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_SYM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_PLIST_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Property lists"))==NULL) +HDassert(H5E_SLIST_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Skip Lists"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_PLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_SLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") HDassert(H5E_LINK_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Links"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_LINK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_DATATYPE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Datatype"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_DATATYPE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_RS_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Reference Counted Strings"))==NULL) +HDassert(H5E_NONE_MAJOR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "No error"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_RS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_NONE_MAJOR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") HDassert(H5E_HEAP_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Heap"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_HEAP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_OHDR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object header"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_OHDR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_ATOM_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object atom"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ATOM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_ATTR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Attribute"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ATTR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_NONE_MAJOR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "No error"))==NULL) +HDassert(H5E_TST_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Ternary Search Trees"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NONE_MAJOR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_TST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_IO_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Low-level I/O"))==NULL) +HDassert(H5E_FSPACE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Free Space Manager"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_IO_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_FSPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_SLIST_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Skip Lists"))==NULL) +HDassert(H5E_INTERNAL_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Internal error (too specific to document in detail)"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_INTERNAL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") HDassert(H5E_EFL_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "External file list"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_EFL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_TST_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Ternary Search Trees"))==NULL) +HDassert(H5E_PLUGIN_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Plugin for dynamically loaded library"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_TST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_PLUGIN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_ARGS_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Invalid arguments to routine"))==NULL) +HDassert(H5E_DATASET_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Dataset"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ARGS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_DATASET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_ERROR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Error API"))==NULL) +HDassert(H5E_SOHM_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Shared Object Header Messages"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_SOHM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_PLINE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Data filters"))==NULL) +HDassert(H5E_PLIST_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Property lists"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_PLINE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_PLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_FSPACE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Free Space Manager"))==NULL) +HDassert(H5E_DATASPACE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Dataspace"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_FSPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_DATASPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CACHE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object cache"))==NULL) +HDassert(H5E_ARGS_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Invalid arguments to routine"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CACHE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_ARGS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /*********************/ @@ -215,144 +215,100 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "File control (fcntl) failed"))==NULL) if((H5E_FCNTL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* Resource errors */ -HDassert(H5E_NOSPACE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "No space available for allocation"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOSPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTALLOC_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't allocate space"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTALLOC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTCOPY_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to copy object"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCOPY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTFREE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to free object"))==NULL) +/* B-tree related errors */ +HDassert(H5E_NOTFOUND_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Object not found"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTFREE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_NOTFOUND_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_ALREADYEXISTS_g==(-1)); +HDassert(H5E_EXISTS_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Object already exists"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ALREADYEXISTS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTLOCK_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to lock object"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTLOCK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTUNLOCK_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to unlock object"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTUNLOCK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_EXISTS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTGC_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to garbage collect"))==NULL) +HDassert(H5E_CANTENCODE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to encode value"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTGC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTENCODE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTGETSIZE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to compute size"))==NULL) +HDassert(H5E_CANTDECODE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to decode value"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTGETSIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTDECODE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_OBJOPEN_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Object is already open"))==NULL) +HDassert(H5E_CANTSPLIT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to split node"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_OBJOPEN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTSPLIT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - -/* Heap errors */ -HDassert(H5E_CANTRESTORE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't restore condition"))==NULL) +HDassert(H5E_CANTREDISTRIBUTE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to redistribute records"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTRESTORE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTREDISTRIBUTE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTCOMPUTE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't compute value"))==NULL) +HDassert(H5E_CANTSWAP_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to swap records"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCOMPUTE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTSWAP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTEXTEND_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't extend heap's space"))==NULL) +HDassert(H5E_CANTINSERT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to insert object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTEXTEND_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTINSERT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTATTACH_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't attach object"))==NULL) +HDassert(H5E_CANTLIST_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to list node"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTATTACH_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTUPDATE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't update object"))==NULL) +HDassert(H5E_CANTMODIFY_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to modify record"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTUPDATE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTMODIFY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTOPERATE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't operate on object"))==NULL) +HDassert(H5E_CANTREMOVE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to remove object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTOPERATE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTREMOVE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* Function entry/exit interface errors */ -HDassert(H5E_CANTINIT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to initialize object"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTINIT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_ALREADYINIT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Object already initialized"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ALREADYINIT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTRELEASE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to release object"))==NULL) +/* System level errors */ +HDassert(H5E_SYSERRSTR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "System error message"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTRELEASE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_SYSERRSTR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* Property list errors */ -HDassert(H5E_CANTGET_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't get value"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTGET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTSET_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't set value"))==NULL) +/* Dataspace errors */ +HDassert(H5E_CANTCLIP_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't clip hyperslab region"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTSET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTCLIP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_DUPCLASS_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Duplicate class name in parent class"))==NULL) +HDassert(H5E_CANTCOUNT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't count elements"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_DUPCLASS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTCOUNT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_SETDISALLOWED_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Disallowed operation"))==NULL) +HDassert(H5E_CANTSELECT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't select hyperslab"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SETDISALLOWED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTSELECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - -/* Free space errors */ -HDassert(H5E_CANTMERGE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't merge objects"))==NULL) +HDassert(H5E_CANTNEXT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't move to next iterator location"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTMERGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTNEXT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTREVIVE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't revive object"))==NULL) +HDassert(H5E_BADSELECT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Invalid selection"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTREVIVE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_BADSELECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTSHRINK_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't shrink container"))==NULL) +HDassert(H5E_CANTCOMPARE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't compare objects"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTSHRINK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTCOMPARE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Object header related errors */ @@ -402,43 +358,23 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to rename object"))==NULL) if((H5E_CANTRENAME_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* System level errors */ -HDassert(H5E_SYSERRSTR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "System error message"))==NULL) +/* No error */ +HDassert(H5E_NONE_MINOR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "No error"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SYSERRSTR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_NONE_MINOR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* I/O pipeline errors */ -HDassert(H5E_NOFILTER_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Requested filter is not available"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOFILTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CALLBACK_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Callback failed"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CALLBACK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANAPPLY_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Error from filter 'can apply' callback"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANAPPLY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_SETLOCAL_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Error from filter 'set local' callback"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SETLOCAL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_NOENCODER_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Filter present but encoding disabled"))==NULL) +/* Datatype conversion errors */ +HDassert(H5E_CANTCONVERT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't convert datatypes"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOENCODER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTCONVERT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTFILTER_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Filter operation failed"))==NULL) +HDassert(H5E_BADSIZE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad size for object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTFILTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_BADSIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Group related errors */ @@ -463,20 +399,6 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Problem with path to object"))==NULL) if((H5E_PATH_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* No error */ -HDassert(H5E_NONE_MINOR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "No error"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NONE_MINOR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - -/* Plugin errors */ -HDassert(H5E_OPENERROR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't open directory or file"))==NULL) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_OPENERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - /* File accessibility errors */ HDassert(H5E_FILEEXISTS_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "File already exists"))==NULL) @@ -523,37 +445,37 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "File mount error"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_MOUNT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - -/* Object atom related errors */ -HDassert(H5E_BADATOM_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to find atom information (already closed?)"))==NULL) + +/* Heap errors */ +HDassert(H5E_CANTRESTORE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't restore condition"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADATOM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTRESTORE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_BADGROUP_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to find ID group information"))==NULL) +HDassert(H5E_CANTCOMPUTE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't compute value"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADGROUP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTCOMPUTE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTREGISTER_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to register new atom"))==NULL) +HDassert(H5E_CANTEXTEND_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't extend heap's space"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTREGISTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTEXTEND_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTINC_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to increment reference count"))==NULL) +HDassert(H5E_CANTATTACH_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't attach object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTINC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTATTACH_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTDEC_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to decrement reference count"))==NULL) +HDassert(H5E_CANTUPDATE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't update object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTDEC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTUPDATE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_NOIDS_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Out of IDs for group"))==NULL) +HDassert(H5E_CANTOPERATE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't operate on object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOIDS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTOPERATE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Cache related errors */ @@ -633,6 +555,23 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to resize a metadata cache entr if((H5E_CANTRESIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +/* Parallel MPI errors */ +HDassert(H5E_MPI_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Some MPI function failed"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_MPI_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_MPIERRSTR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "MPI Error String"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_MPIERRSTR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CANTRECV_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't receive data"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTRECV_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") + /* Link related errors */ HDassert(H5E_TRAVERSE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Link traversal failure"))==NULL) @@ -660,53 +599,63 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't sort objects"))==NULL) if((H5E_CANTSORT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* Parallel MPI errors */ -HDassert(H5E_MPI_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Some MPI function failed"))==NULL) +/* Resource errors */ +HDassert(H5E_NOSPACE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "No space available for allocation"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_MPI_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_NOSPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_MPIERRSTR_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "MPI Error String"))==NULL) +HDassert(H5E_CANTALLOC_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't allocate space"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_MPIERRSTR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTALLOC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTRECV_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't receive data"))==NULL) +HDassert(H5E_CANTCOPY_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to copy object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTRECV_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTCOPY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") - -/* Dataspace errors */ -HDassert(H5E_CANTCLIP_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't clip hyperslab region"))==NULL) +HDassert(H5E_CANTFREE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to free object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCLIP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTFREE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTCOUNT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't count elements"))==NULL) +HDassert(H5E_ALREADYEXISTS_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Object already exists"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCOUNT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_ALREADYEXISTS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTSELECT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't select hyperslab"))==NULL) +HDassert(H5E_CANTLOCK_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to lock object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTSELECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTLOCK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTNEXT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't move to next iterator location"))==NULL) +HDassert(H5E_CANTUNLOCK_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to unlock object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTNEXT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTUNLOCK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_BADSELECT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Invalid selection"))==NULL) +HDassert(H5E_CANTGC_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to garbage collect"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADSELECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTGC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTCOMPARE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't compare objects"))==NULL) +HDassert(H5E_CANTGETSIZE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to compute size"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCOMPARE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTGETSIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_OBJOPEN_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Object is already open"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_OBJOPEN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") + +/* Plugin errors */ +HDassert(H5E_OPENERROR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't open directory or file"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_OPENERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Argument errors */ @@ -736,73 +685,124 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad value"))==NULL) if((H5E_BADVALUE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* B-tree related errors */ -HDassert(H5E_NOTFOUND_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Object not found"))==NULL) +/* Object atom related errors */ +HDassert(H5E_BADATOM_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to find atom information (already closed?)"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOTFOUND_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_BADATOM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_EXISTS_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Object already exists"))==NULL) +HDassert(H5E_BADGROUP_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to find ID group information"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_EXISTS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_BADGROUP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTENCODE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to encode value"))==NULL) +HDassert(H5E_CANTREGISTER_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to register new atom"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTENCODE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTREGISTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTDECODE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to decode value"))==NULL) +HDassert(H5E_CANTINC_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to increment reference count"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTDECODE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTINC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTSPLIT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to split node"))==NULL) +HDassert(H5E_CANTDEC_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to decrement reference count"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTSPLIT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTDEC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTREDISTRIBUTE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to redistribute records"))==NULL) +HDassert(H5E_NOIDS_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Out of IDs for group"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTREDISTRIBUTE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_NOIDS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTSWAP_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to swap records"))==NULL) + +/* Function entry/exit interface errors */ +HDassert(H5E_CANTINIT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to initialize object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTSWAP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTINIT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTINSERT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to insert object"))==NULL) +HDassert(H5E_ALREADYINIT_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Object already initialized"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTINSERT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_ALREADYINIT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTLIST_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to list node"))==NULL) +HDassert(H5E_CANTRELEASE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to release object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTRELEASE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTMODIFY_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to modify record"))==NULL) + +/* I/O pipeline errors */ +HDassert(H5E_NOFILTER_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Requested filter is not available"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTMODIFY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_NOFILTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_CANTREMOVE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to remove object"))==NULL) +HDassert(H5E_CALLBACK_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Callback failed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTREMOVE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CALLBACK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CANAPPLY_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Error from filter 'can apply' callback"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANAPPLY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_SETLOCAL_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Error from filter 'set local' callback"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_SETLOCAL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_NOENCODER_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Filter present but encoding disabled"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_NOENCODER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CANTFILTER_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Filter operation failed"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTFILTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -/* Datatype conversion errors */ -HDassert(H5E_CANTCONVERT_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't convert datatypes"))==NULL) +/* Property list errors */ +HDassert(H5E_CANTGET_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't get value"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCONVERT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTGET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") -HDassert(H5E_BADSIZE_g==(-1)); -if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad size for object"))==NULL) +HDassert(H5E_CANTSET_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't set value"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADSIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) +if((H5E_CANTSET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_DUPCLASS_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Duplicate class name in parent class"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_DUPCLASS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_SETDISALLOWED_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Disallowed operation"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_SETDISALLOWED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") + +/* Free space errors */ +HDassert(H5E_CANTMERGE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't merge objects"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTMERGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CANTREVIVE_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't revive object"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTREVIVE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +HDassert(H5E_CANTSHRINK_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't shrink container"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_CANTSHRINK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") #endif /* H5Einit_H */ diff --git a/src/H5Epubgen.h b/src/H5Epubgen.h index 324da8f..dd07c76 100644 --- a/src/H5Epubgen.h +++ b/src/H5Epubgen.h @@ -26,68 +26,68 @@ extern "C" { /* Major error codes */ /*********************/ -#define H5E_DATASET (H5OPEN H5E_DATASET_g) -#define H5E_FUNC (H5OPEN H5E_FUNC_g) +#define H5E_RESOURCE (H5OPEN H5E_RESOURCE_g) +#define H5E_IO (H5OPEN H5E_IO_g) +#define H5E_CACHE (H5OPEN H5E_CACHE_g) +#define H5E_BTREE (H5OPEN H5E_BTREE_g) +#define H5E_ATOM (H5OPEN H5E_ATOM_g) +#define H5E_RS (H5OPEN H5E_RS_g) #define H5E_STORAGE (H5OPEN H5E_STORAGE_g) #define H5E_FILE (H5OPEN H5E_FILE_g) -#define H5E_SOHM (H5OPEN H5E_SOHM_g) -#define H5E_SYM (H5OPEN H5E_SYM_g) -#define H5E_PLUGIN (H5OPEN H5E_PLUGIN_g) -#define H5E_VFL (H5OPEN H5E_VFL_g) -#define H5E_INTERNAL (H5OPEN H5E_INTERNAL_g) -#define H5E_BTREE (H5OPEN H5E_BTREE_g) +#define H5E_PLINE (H5OPEN H5E_PLINE_g) #define H5E_REFERENCE (H5OPEN H5E_REFERENCE_g) -#define H5E_DATASPACE (H5OPEN H5E_DATASPACE_g) -#define H5E_RESOURCE (H5OPEN H5E_RESOURCE_g) -#define H5E_PLIST (H5OPEN H5E_PLIST_g) -#define H5E_LINK (H5OPEN H5E_LINK_g) +#define H5E_ERROR (H5OPEN H5E_ERROR_g) #define H5E_DATATYPE (H5OPEN H5E_DATATYPE_g) -#define H5E_RS (H5OPEN H5E_RS_g) -#define H5E_HEAP (H5OPEN H5E_HEAP_g) -#define H5E_OHDR (H5OPEN H5E_OHDR_g) -#define H5E_ATOM (H5OPEN H5E_ATOM_g) #define H5E_ATTR (H5OPEN H5E_ATTR_g) -#define H5E_NONE_MAJOR (H5OPEN H5E_NONE_MAJOR_g) -#define H5E_IO (H5OPEN H5E_IO_g) +#define H5E_OHDR (H5OPEN H5E_OHDR_g) +#define H5E_FUNC (H5OPEN H5E_FUNC_g) +#define H5E_VFL (H5OPEN H5E_VFL_g) +#define H5E_SYM (H5OPEN H5E_SYM_g) #define H5E_SLIST (H5OPEN H5E_SLIST_g) -#define H5E_EFL (H5OPEN H5E_EFL_g) +#define H5E_LINK (H5OPEN H5E_LINK_g) +#define H5E_NONE_MAJOR (H5OPEN H5E_NONE_MAJOR_g) +#define H5E_HEAP (H5OPEN H5E_HEAP_g) #define H5E_TST (H5OPEN H5E_TST_g) -#define H5E_ARGS (H5OPEN H5E_ARGS_g) -#define H5E_ERROR (H5OPEN H5E_ERROR_g) -#define H5E_PLINE (H5OPEN H5E_PLINE_g) #define H5E_FSPACE (H5OPEN H5E_FSPACE_g) -#define H5E_CACHE (H5OPEN H5E_CACHE_g) -H5_DLLVAR hid_t H5E_DATASET_g; /* Dataset */ -H5_DLLVAR hid_t H5E_FUNC_g; /* Function entry/exit */ +#define H5E_INTERNAL (H5OPEN H5E_INTERNAL_g) +#define H5E_EFL (H5OPEN H5E_EFL_g) +#define H5E_PLUGIN (H5OPEN H5E_PLUGIN_g) +#define H5E_DATASET (H5OPEN H5E_DATASET_g) +#define H5E_SOHM (H5OPEN H5E_SOHM_g) +#define H5E_PLIST (H5OPEN H5E_PLIST_g) +#define H5E_DATASPACE (H5OPEN H5E_DATASPACE_g) +#define H5E_ARGS (H5OPEN H5E_ARGS_g) +H5_DLLVAR hid_t H5E_RESOURCE_g; /* Resource unavailable */ +H5_DLLVAR hid_t H5E_IO_g; /* Low-level I/O */ +H5_DLLVAR hid_t H5E_CACHE_g; /* Object cache */ +H5_DLLVAR hid_t H5E_BTREE_g; /* B-Tree node */ +H5_DLLVAR hid_t H5E_ATOM_g; /* Object atom */ +H5_DLLVAR hid_t H5E_RS_g; /* Reference Counted Strings */ H5_DLLVAR hid_t H5E_STORAGE_g; /* Data storage */ H5_DLLVAR hid_t H5E_FILE_g; /* File accessibility */ -H5_DLLVAR hid_t H5E_SOHM_g; /* Shared Object Header Messages */ -H5_DLLVAR hid_t H5E_SYM_g; /* Symbol table */ -H5_DLLVAR hid_t H5E_PLUGIN_g; /* Plugin for dynamically loaded library */ -H5_DLLVAR hid_t H5E_VFL_g; /* Virtual File Layer */ -H5_DLLVAR hid_t H5E_INTERNAL_g; /* Internal error (too specific to document in detail) */ -H5_DLLVAR hid_t H5E_BTREE_g; /* B-Tree node */ +H5_DLLVAR hid_t H5E_PLINE_g; /* Data filters */ H5_DLLVAR hid_t H5E_REFERENCE_g; /* References */ -H5_DLLVAR hid_t H5E_DATASPACE_g; /* Dataspace */ -H5_DLLVAR hid_t H5E_RESOURCE_g; /* Resource unavailable */ -H5_DLLVAR hid_t H5E_PLIST_g; /* Property lists */ -H5_DLLVAR hid_t H5E_LINK_g; /* Links */ +H5_DLLVAR hid_t H5E_ERROR_g; /* Error API */ H5_DLLVAR hid_t H5E_DATATYPE_g; /* Datatype */ -H5_DLLVAR hid_t H5E_RS_g; /* Reference Counted Strings */ -H5_DLLVAR hid_t H5E_HEAP_g; /* Heap */ -H5_DLLVAR hid_t H5E_OHDR_g; /* Object header */ -H5_DLLVAR hid_t H5E_ATOM_g; /* Object atom */ H5_DLLVAR hid_t H5E_ATTR_g; /* Attribute */ -H5_DLLVAR hid_t H5E_NONE_MAJOR_g; /* No error */ -H5_DLLVAR hid_t H5E_IO_g; /* Low-level I/O */ +H5_DLLVAR hid_t H5E_OHDR_g; /* Object header */ +H5_DLLVAR hid_t H5E_FUNC_g; /* Function entry/exit */ +H5_DLLVAR hid_t H5E_VFL_g; /* Virtual File Layer */ +H5_DLLVAR hid_t H5E_SYM_g; /* Symbol table */ H5_DLLVAR hid_t H5E_SLIST_g; /* Skip Lists */ -H5_DLLVAR hid_t H5E_EFL_g; /* External file list */ +H5_DLLVAR hid_t H5E_LINK_g; /* Links */ +H5_DLLVAR hid_t H5E_NONE_MAJOR_g; /* No error */ +H5_DLLVAR hid_t H5E_HEAP_g; /* Heap */ H5_DLLVAR hid_t H5E_TST_g; /* Ternary Search Trees */ -H5_DLLVAR hid_t H5E_ARGS_g; /* Invalid arguments to routine */ -H5_DLLVAR hid_t H5E_ERROR_g; /* Error API */ -H5_DLLVAR hid_t H5E_PLINE_g; /* Data filters */ H5_DLLVAR hid_t H5E_FSPACE_g; /* Free Space Manager */ -H5_DLLVAR hid_t H5E_CACHE_g; /* Object cache */ +H5_DLLVAR hid_t H5E_INTERNAL_g; /* Internal error (too specific to document in detail) */ +H5_DLLVAR hid_t H5E_EFL_g; /* External file list */ +H5_DLLVAR hid_t H5E_PLUGIN_g; /* Plugin for dynamically loaded library */ +H5_DLLVAR hid_t H5E_DATASET_g; /* Dataset */ +H5_DLLVAR hid_t H5E_SOHM_g; /* Shared Object Header Messages */ +H5_DLLVAR hid_t H5E_PLIST_g; /* Property lists */ +H5_DLLVAR hid_t H5E_DATASPACE_g; /* Dataspace */ +H5_DLLVAR hid_t H5E_ARGS_g; /* Invalid arguments to routine */ /*********************/ /* Minor error codes */ @@ -107,67 +107,47 @@ H5_DLLVAR hid_t H5E_CLOSEERROR_g; /* Close failed */ H5_DLLVAR hid_t H5E_OVERFLOW_g; /* Address overflowed */ H5_DLLVAR hid_t H5E_FCNTL_g; /* File control (fcntl) failed */ -/* Resource errors */ -#define H5E_NOSPACE (H5OPEN H5E_NOSPACE_g) -#define H5E_CANTALLOC (H5OPEN H5E_CANTALLOC_g) -#define H5E_CANTCOPY (H5OPEN H5E_CANTCOPY_g) -#define H5E_CANTFREE (H5OPEN H5E_CANTFREE_g) -#define H5E_ALREADYEXISTS (H5OPEN H5E_ALREADYEXISTS_g) -#define H5E_CANTLOCK (H5OPEN H5E_CANTLOCK_g) -#define H5E_CANTUNLOCK (H5OPEN H5E_CANTUNLOCK_g) -#define H5E_CANTGC (H5OPEN H5E_CANTGC_g) -#define H5E_CANTGETSIZE (H5OPEN H5E_CANTGETSIZE_g) -#define H5E_OBJOPEN (H5OPEN H5E_OBJOPEN_g) -H5_DLLVAR hid_t H5E_NOSPACE_g; /* No space available for allocation */ -H5_DLLVAR hid_t H5E_CANTALLOC_g; /* Can't allocate space */ -H5_DLLVAR hid_t H5E_CANTCOPY_g; /* Unable to copy object */ -H5_DLLVAR hid_t H5E_CANTFREE_g; /* Unable to free object */ -H5_DLLVAR hid_t H5E_ALREADYEXISTS_g; /* Object already exists */ -H5_DLLVAR hid_t H5E_CANTLOCK_g; /* Unable to lock object */ -H5_DLLVAR hid_t H5E_CANTUNLOCK_g; /* Unable to unlock object */ -H5_DLLVAR hid_t H5E_CANTGC_g; /* Unable to garbage collect */ -H5_DLLVAR hid_t H5E_CANTGETSIZE_g; /* Unable to compute size */ -H5_DLLVAR hid_t H5E_OBJOPEN_g; /* Object is already open */ - -/* Heap errors */ -#define H5E_CANTRESTORE (H5OPEN H5E_CANTRESTORE_g) -#define H5E_CANTCOMPUTE (H5OPEN H5E_CANTCOMPUTE_g) -#define H5E_CANTEXTEND (H5OPEN H5E_CANTEXTEND_g) -#define H5E_CANTATTACH (H5OPEN H5E_CANTATTACH_g) -#define H5E_CANTUPDATE (H5OPEN H5E_CANTUPDATE_g) -#define H5E_CANTOPERATE (H5OPEN H5E_CANTOPERATE_g) -H5_DLLVAR hid_t H5E_CANTRESTORE_g; /* Can't restore condition */ -H5_DLLVAR hid_t H5E_CANTCOMPUTE_g; /* Can't compute value */ -H5_DLLVAR hid_t H5E_CANTEXTEND_g; /* Can't extend heap's space */ -H5_DLLVAR hid_t H5E_CANTATTACH_g; /* Can't attach object */ -H5_DLLVAR hid_t H5E_CANTUPDATE_g; /* Can't update object */ -H5_DLLVAR hid_t H5E_CANTOPERATE_g; /* Can't operate on object */ - -/* Function entry/exit interface errors */ -#define H5E_CANTINIT (H5OPEN H5E_CANTINIT_g) -#define H5E_ALREADYINIT (H5OPEN H5E_ALREADYINIT_g) -#define H5E_CANTRELEASE (H5OPEN H5E_CANTRELEASE_g) -H5_DLLVAR hid_t H5E_CANTINIT_g; /* Unable to initialize object */ -H5_DLLVAR hid_t H5E_ALREADYINIT_g; /* Object already initialized */ -H5_DLLVAR hid_t H5E_CANTRELEASE_g; /* Unable to release object */ +/* B-tree related errors */ +#define H5E_NOTFOUND (H5OPEN H5E_NOTFOUND_g) +#define H5E_EXISTS (H5OPEN H5E_EXISTS_g) +#define H5E_CANTENCODE (H5OPEN H5E_CANTENCODE_g) +#define H5E_CANTDECODE (H5OPEN H5E_CANTDECODE_g) +#define H5E_CANTSPLIT (H5OPEN H5E_CANTSPLIT_g) +#define H5E_CANTREDISTRIBUTE (H5OPEN H5E_CANTREDISTRIBUTE_g) +#define H5E_CANTSWAP (H5OPEN H5E_CANTSWAP_g) +#define H5E_CANTINSERT (H5OPEN H5E_CANTINSERT_g) +#define H5E_CANTLIST (H5OPEN H5E_CANTLIST_g) +#define H5E_CANTMODIFY (H5OPEN H5E_CANTMODIFY_g) +#define H5E_CANTREMOVE (H5OPEN H5E_CANTREMOVE_g) +H5_DLLVAR hid_t H5E_NOTFOUND_g; /* Object not found */ +H5_DLLVAR hid_t H5E_EXISTS_g; /* Object already exists */ +H5_DLLVAR hid_t H5E_CANTENCODE_g; /* Unable to encode value */ +H5_DLLVAR hid_t H5E_CANTDECODE_g; /* Unable to decode value */ +H5_DLLVAR hid_t H5E_CANTSPLIT_g; /* Unable to split node */ +H5_DLLVAR hid_t H5E_CANTREDISTRIBUTE_g; /* Unable to redistribute records */ +H5_DLLVAR hid_t H5E_CANTSWAP_g; /* Unable to swap records */ +H5_DLLVAR hid_t H5E_CANTINSERT_g; /* Unable to insert object */ +H5_DLLVAR hid_t H5E_CANTLIST_g; /* Unable to list node */ +H5_DLLVAR hid_t H5E_CANTMODIFY_g; /* Unable to modify record */ +H5_DLLVAR hid_t H5E_CANTREMOVE_g; /* Unable to remove object */ -/* Property list errors */ -#define H5E_CANTGET (H5OPEN H5E_CANTGET_g) -#define H5E_CANTSET (H5OPEN H5E_CANTSET_g) -#define H5E_DUPCLASS (H5OPEN H5E_DUPCLASS_g) -#define H5E_SETDISALLOWED (H5OPEN H5E_SETDISALLOWED_g) -H5_DLLVAR hid_t H5E_CANTGET_g; /* Can't get value */ -H5_DLLVAR hid_t H5E_CANTSET_g; /* Can't set value */ -H5_DLLVAR hid_t H5E_DUPCLASS_g; /* Duplicate class name in parent class */ -H5_DLLVAR hid_t H5E_SETDISALLOWED_g; /* Disallowed operation */ +/* System level errors */ +#define H5E_SYSERRSTR (H5OPEN H5E_SYSERRSTR_g) +H5_DLLVAR hid_t H5E_SYSERRSTR_g; /* System error message */ -/* Free space errors */ -#define H5E_CANTMERGE (H5OPEN H5E_CANTMERGE_g) -#define H5E_CANTREVIVE (H5OPEN H5E_CANTREVIVE_g) -#define H5E_CANTSHRINK (H5OPEN H5E_CANTSHRINK_g) -H5_DLLVAR hid_t H5E_CANTMERGE_g; /* Can't merge objects */ -H5_DLLVAR hid_t H5E_CANTREVIVE_g; /* Can't revive object */ -H5_DLLVAR hid_t H5E_CANTSHRINK_g; /* Can't shrink container */ +/* Dataspace errors */ +#define H5E_CANTCLIP (H5OPEN H5E_CANTCLIP_g) +#define H5E_CANTCOUNT (H5OPEN H5E_CANTCOUNT_g) +#define H5E_CANTSELECT (H5OPEN H5E_CANTSELECT_g) +#define H5E_CANTNEXT (H5OPEN H5E_CANTNEXT_g) +#define H5E_BADSELECT (H5OPEN H5E_BADSELECT_g) +#define H5E_CANTCOMPARE (H5OPEN H5E_CANTCOMPARE_g) +H5_DLLVAR hid_t H5E_CANTCLIP_g; /* Can't clip hyperslab region */ +H5_DLLVAR hid_t H5E_CANTCOUNT_g; /* Can't count elements */ +H5_DLLVAR hid_t H5E_CANTSELECT_g; /* Can't select hyperslab */ +H5_DLLVAR hid_t H5E_CANTNEXT_g; /* Can't move to next iterator location */ +H5_DLLVAR hid_t H5E_BADSELECT_g; /* Invalid selection */ +H5_DLLVAR hid_t H5E_CANTCOMPARE_g; /* Can't compare objects */ /* Object header related errors */ #define H5E_LINKCOUNT (H5OPEN H5E_LINKCOUNT_g) @@ -189,23 +169,15 @@ H5_DLLVAR hid_t H5E_CANTPACK_g; /* Can't pack messages */ H5_DLLVAR hid_t H5E_CANTRESET_g; /* Can't reset object */ H5_DLLVAR hid_t H5E_CANTRENAME_g; /* Unable to rename object */ -/* System level errors */ -#define H5E_SYSERRSTR (H5OPEN H5E_SYSERRSTR_g) -H5_DLLVAR hid_t H5E_SYSERRSTR_g; /* System error message */ +/* No error */ +#define H5E_NONE_MINOR (H5OPEN H5E_NONE_MINOR_g) +H5_DLLVAR hid_t H5E_NONE_MINOR_g; /* No error */ -/* I/O pipeline errors */ -#define H5E_NOFILTER (H5OPEN H5E_NOFILTER_g) -#define H5E_CALLBACK (H5OPEN H5E_CALLBACK_g) -#define H5E_CANAPPLY (H5OPEN H5E_CANAPPLY_g) -#define H5E_SETLOCAL (H5OPEN H5E_SETLOCAL_g) -#define H5E_NOENCODER (H5OPEN H5E_NOENCODER_g) -#define H5E_CANTFILTER (H5OPEN H5E_CANTFILTER_g) -H5_DLLVAR hid_t H5E_NOFILTER_g; /* Requested filter is not available */ -H5_DLLVAR hid_t H5E_CALLBACK_g; /* Callback failed */ -H5_DLLVAR hid_t H5E_CANAPPLY_g; /* Error from filter 'can apply' callback */ -H5_DLLVAR hid_t H5E_SETLOCAL_g; /* Error from filter 'set local' callback */ -H5_DLLVAR hid_t H5E_NOENCODER_g; /* Filter present but encoding disabled */ -H5_DLLVAR hid_t H5E_CANTFILTER_g; /* Filter operation failed */ +/* Datatype conversion errors */ +#define H5E_CANTCONVERT (H5OPEN H5E_CANTCONVERT_g) +#define H5E_BADSIZE (H5OPEN H5E_BADSIZE_g) +H5_DLLVAR hid_t H5E_CANTCONVERT_g; /* Can't convert datatypes */ +H5_DLLVAR hid_t H5E_BADSIZE_g; /* Bad size for object */ /* Group related errors */ #define H5E_CANTOPENOBJ (H5OPEN H5E_CANTOPENOBJ_g) @@ -217,14 +189,6 @@ H5_DLLVAR hid_t H5E_CANTCLOSEOBJ_g; /* Can't close object */ H5_DLLVAR hid_t H5E_COMPLEN_g; /* Name component is too long */ H5_DLLVAR hid_t H5E_PATH_g; /* Problem with path to object */ -/* No error */ -#define H5E_NONE_MINOR (H5OPEN H5E_NONE_MINOR_g) -H5_DLLVAR hid_t H5E_NONE_MINOR_g; /* No error */ - -/* Plugin errors */ -#define H5E_OPENERROR (H5OPEN H5E_OPENERROR_g) -H5_DLLVAR hid_t H5E_OPENERROR_g; /* Can't open directory or file */ - /* File accessibility errors */ #define H5E_FILEEXISTS (H5OPEN H5E_FILEEXISTS_g) #define H5E_FILEOPEN (H5OPEN H5E_FILEOPEN_g) @@ -245,19 +209,19 @@ H5_DLLVAR hid_t H5E_BADFILE_g; /* Bad file ID accessed */ H5_DLLVAR hid_t H5E_TRUNCATED_g; /* File has been truncated */ H5_DLLVAR hid_t H5E_MOUNT_g; /* File mount error */ -/* Object atom related errors */ -#define H5E_BADATOM (H5OPEN H5E_BADATOM_g) -#define H5E_BADGROUP (H5OPEN H5E_BADGROUP_g) -#define H5E_CANTREGISTER (H5OPEN H5E_CANTREGISTER_g) -#define H5E_CANTINC (H5OPEN H5E_CANTINC_g) -#define H5E_CANTDEC (H5OPEN H5E_CANTDEC_g) -#define H5E_NOIDS (H5OPEN H5E_NOIDS_g) -H5_DLLVAR hid_t H5E_BADATOM_g; /* Unable to find atom information (already closed?) */ -H5_DLLVAR hid_t H5E_BADGROUP_g; /* Unable to find ID group information */ -H5_DLLVAR hid_t H5E_CANTREGISTER_g; /* Unable to register new atom */ -H5_DLLVAR hid_t H5E_CANTINC_g; /* Unable to increment reference count */ -H5_DLLVAR hid_t H5E_CANTDEC_g; /* Unable to decrement reference count */ -H5_DLLVAR hid_t H5E_NOIDS_g; /* Out of IDs for group */ +/* Heap errors */ +#define H5E_CANTRESTORE (H5OPEN H5E_CANTRESTORE_g) +#define H5E_CANTCOMPUTE (H5OPEN H5E_CANTCOMPUTE_g) +#define H5E_CANTEXTEND (H5OPEN H5E_CANTEXTEND_g) +#define H5E_CANTATTACH (H5OPEN H5E_CANTATTACH_g) +#define H5E_CANTUPDATE (H5OPEN H5E_CANTUPDATE_g) +#define H5E_CANTOPERATE (H5OPEN H5E_CANTOPERATE_g) +H5_DLLVAR hid_t H5E_CANTRESTORE_g; /* Can't restore condition */ +H5_DLLVAR hid_t H5E_CANTCOMPUTE_g; /* Can't compute value */ +H5_DLLVAR hid_t H5E_CANTEXTEND_g; /* Can't extend heap's space */ +H5_DLLVAR hid_t H5E_CANTATTACH_g; /* Can't attach object */ +H5_DLLVAR hid_t H5E_CANTUPDATE_g; /* Can't update object */ +H5_DLLVAR hid_t H5E_CANTOPERATE_g; /* Can't operate on object */ /* Cache related errors */ #define H5E_CANTFLUSH (H5OPEN H5E_CANTFLUSH_g) @@ -291,6 +255,14 @@ H5_DLLVAR hid_t H5E_CANTDIRTY_g; /* Unable to mark metadata as dirty */ H5_DLLVAR hid_t H5E_CANTEXPUNGE_g; /* Unable to expunge a metadata cache entry */ H5_DLLVAR hid_t H5E_CANTRESIZE_g; /* Unable to resize a metadata cache entry */ +/* Parallel MPI errors */ +#define H5E_MPI (H5OPEN H5E_MPI_g) +#define H5E_MPIERRSTR (H5OPEN H5E_MPIERRSTR_g) +#define H5E_CANTRECV (H5OPEN H5E_CANTRECV_g) +H5_DLLVAR hid_t H5E_MPI_g; /* Some MPI function failed */ +H5_DLLVAR hid_t H5E_MPIERRSTR_g; /* MPI Error String */ +H5_DLLVAR hid_t H5E_CANTRECV_g; /* Can't receive data */ + /* Link related errors */ #define H5E_TRAVERSE (H5OPEN H5E_TRAVERSE_g) #define H5E_NLINKS (H5OPEN H5E_NLINKS_g) @@ -303,27 +275,31 @@ H5_DLLVAR hid_t H5E_NOTREGISTERED_g; /* Link class not registered */ H5_DLLVAR hid_t H5E_CANTMOVE_g; /* Can't move object */ H5_DLLVAR hid_t H5E_CANTSORT_g; /* Can't sort objects */ -/* Parallel MPI errors */ -#define H5E_MPI (H5OPEN H5E_MPI_g) -#define H5E_MPIERRSTR (H5OPEN H5E_MPIERRSTR_g) -#define H5E_CANTRECV (H5OPEN H5E_CANTRECV_g) -H5_DLLVAR hid_t H5E_MPI_g; /* Some MPI function failed */ -H5_DLLVAR hid_t H5E_MPIERRSTR_g; /* MPI Error String */ -H5_DLLVAR hid_t H5E_CANTRECV_g; /* Can't receive data */ +/* Resource errors */ +#define H5E_NOSPACE (H5OPEN H5E_NOSPACE_g) +#define H5E_CANTALLOC (H5OPEN H5E_CANTALLOC_g) +#define H5E_CANTCOPY (H5OPEN H5E_CANTCOPY_g) +#define H5E_CANTFREE (H5OPEN H5E_CANTFREE_g) +#define H5E_ALREADYEXISTS (H5OPEN H5E_ALREADYEXISTS_g) +#define H5E_CANTLOCK (H5OPEN H5E_CANTLOCK_g) +#define H5E_CANTUNLOCK (H5OPEN H5E_CANTUNLOCK_g) +#define H5E_CANTGC (H5OPEN H5E_CANTGC_g) +#define H5E_CANTGETSIZE (H5OPEN H5E_CANTGETSIZE_g) +#define H5E_OBJOPEN (H5OPEN H5E_OBJOPEN_g) +H5_DLLVAR hid_t H5E_NOSPACE_g; /* No space available for allocation */ +H5_DLLVAR hid_t H5E_CANTALLOC_g; /* Can't allocate space */ +H5_DLLVAR hid_t H5E_CANTCOPY_g; /* Unable to copy object */ +H5_DLLVAR hid_t H5E_CANTFREE_g; /* Unable to free object */ +H5_DLLVAR hid_t H5E_ALREADYEXISTS_g; /* Object already exists */ +H5_DLLVAR hid_t H5E_CANTLOCK_g; /* Unable to lock object */ +H5_DLLVAR hid_t H5E_CANTUNLOCK_g; /* Unable to unlock object */ +H5_DLLVAR hid_t H5E_CANTGC_g; /* Unable to garbage collect */ +H5_DLLVAR hid_t H5E_CANTGETSIZE_g; /* Unable to compute size */ +H5_DLLVAR hid_t H5E_OBJOPEN_g; /* Object is already open */ -/* Dataspace errors */ -#define H5E_CANTCLIP (H5OPEN H5E_CANTCLIP_g) -#define H5E_CANTCOUNT (H5OPEN H5E_CANTCOUNT_g) -#define H5E_CANTSELECT (H5OPEN H5E_CANTSELECT_g) -#define H5E_CANTNEXT (H5OPEN H5E_CANTNEXT_g) -#define H5E_BADSELECT (H5OPEN H5E_BADSELECT_g) -#define H5E_CANTCOMPARE (H5OPEN H5E_CANTCOMPARE_g) -H5_DLLVAR hid_t H5E_CANTCLIP_g; /* Can't clip hyperslab region */ -H5_DLLVAR hid_t H5E_CANTCOUNT_g; /* Can't count elements */ -H5_DLLVAR hid_t H5E_CANTSELECT_g; /* Can't select hyperslab */ -H5_DLLVAR hid_t H5E_CANTNEXT_g; /* Can't move to next iterator location */ -H5_DLLVAR hid_t H5E_BADSELECT_g; /* Invalid selection */ -H5_DLLVAR hid_t H5E_CANTCOMPARE_g; /* Can't compare objects */ +/* Plugin errors */ +#define H5E_OPENERROR (H5OPEN H5E_OPENERROR_g) +H5_DLLVAR hid_t H5E_OPENERROR_g; /* Can't open directory or file */ /* Argument errors */ #define H5E_UNINITIALIZED (H5OPEN H5E_UNINITIALIZED_g) @@ -337,35 +313,59 @@ H5_DLLVAR hid_t H5E_BADTYPE_g; /* Inappropriate type */ H5_DLLVAR hid_t H5E_BADRANGE_g; /* Out of range */ H5_DLLVAR hid_t H5E_BADVALUE_g; /* Bad value */ -/* B-tree related errors */ -#define H5E_NOTFOUND (H5OPEN H5E_NOTFOUND_g) -#define H5E_EXISTS (H5OPEN H5E_EXISTS_g) -#define H5E_CANTENCODE (H5OPEN H5E_CANTENCODE_g) -#define H5E_CANTDECODE (H5OPEN H5E_CANTDECODE_g) -#define H5E_CANTSPLIT (H5OPEN H5E_CANTSPLIT_g) -#define H5E_CANTREDISTRIBUTE (H5OPEN H5E_CANTREDISTRIBUTE_g) -#define H5E_CANTSWAP (H5OPEN H5E_CANTSWAP_g) -#define H5E_CANTINSERT (H5OPEN H5E_CANTINSERT_g) -#define H5E_CANTLIST (H5OPEN H5E_CANTLIST_g) -#define H5E_CANTMODIFY (H5OPEN H5E_CANTMODIFY_g) -#define H5E_CANTREMOVE (H5OPEN H5E_CANTREMOVE_g) -H5_DLLVAR hid_t H5E_NOTFOUND_g; /* Object not found */ -H5_DLLVAR hid_t H5E_EXISTS_g; /* Object already exists */ -H5_DLLVAR hid_t H5E_CANTENCODE_g; /* Unable to encode value */ -H5_DLLVAR hid_t H5E_CANTDECODE_g; /* Unable to decode value */ -H5_DLLVAR hid_t H5E_CANTSPLIT_g; /* Unable to split node */ -H5_DLLVAR hid_t H5E_CANTREDISTRIBUTE_g; /* Unable to redistribute records */ -H5_DLLVAR hid_t H5E_CANTSWAP_g; /* Unable to swap records */ -H5_DLLVAR hid_t H5E_CANTINSERT_g; /* Unable to insert object */ -H5_DLLVAR hid_t H5E_CANTLIST_g; /* Unable to list node */ -H5_DLLVAR hid_t H5E_CANTMODIFY_g; /* Unable to modify record */ -H5_DLLVAR hid_t H5E_CANTREMOVE_g; /* Unable to remove object */ +/* Object atom related errors */ +#define H5E_BADATOM (H5OPEN H5E_BADATOM_g) +#define H5E_BADGROUP (H5OPEN H5E_BADGROUP_g) +#define H5E_CANTREGISTER (H5OPEN H5E_CANTREGISTER_g) +#define H5E_CANTINC (H5OPEN H5E_CANTINC_g) +#define H5E_CANTDEC (H5OPEN H5E_CANTDEC_g) +#define H5E_NOIDS (H5OPEN H5E_NOIDS_g) +H5_DLLVAR hid_t H5E_BADATOM_g; /* Unable to find atom information (already closed?) */ +H5_DLLVAR hid_t H5E_BADGROUP_g; /* Unable to find ID group information */ +H5_DLLVAR hid_t H5E_CANTREGISTER_g; /* Unable to register new atom */ +H5_DLLVAR hid_t H5E_CANTINC_g; /* Unable to increment reference count */ +H5_DLLVAR hid_t H5E_CANTDEC_g; /* Unable to decrement reference count */ +H5_DLLVAR hid_t H5E_NOIDS_g; /* Out of IDs for group */ -/* Datatype conversion errors */ -#define H5E_CANTCONVERT (H5OPEN H5E_CANTCONVERT_g) -#define H5E_BADSIZE (H5OPEN H5E_BADSIZE_g) -H5_DLLVAR hid_t H5E_CANTCONVERT_g; /* Can't convert datatypes */ -H5_DLLVAR hid_t H5E_BADSIZE_g; /* Bad size for object */ +/* Function entry/exit interface errors */ +#define H5E_CANTINIT (H5OPEN H5E_CANTINIT_g) +#define H5E_ALREADYINIT (H5OPEN H5E_ALREADYINIT_g) +#define H5E_CANTRELEASE (H5OPEN H5E_CANTRELEASE_g) +H5_DLLVAR hid_t H5E_CANTINIT_g; /* Unable to initialize object */ +H5_DLLVAR hid_t H5E_ALREADYINIT_g; /* Object already initialized */ +H5_DLLVAR hid_t H5E_CANTRELEASE_g; /* Unable to release object */ + +/* I/O pipeline errors */ +#define H5E_NOFILTER (H5OPEN H5E_NOFILTER_g) +#define H5E_CALLBACK (H5OPEN H5E_CALLBACK_g) +#define H5E_CANAPPLY (H5OPEN H5E_CANAPPLY_g) +#define H5E_SETLOCAL (H5OPEN H5E_SETLOCAL_g) +#define H5E_NOENCODER (H5OPEN H5E_NOENCODER_g) +#define H5E_CANTFILTER (H5OPEN H5E_CANTFILTER_g) +H5_DLLVAR hid_t H5E_NOFILTER_g; /* Requested filter is not available */ +H5_DLLVAR hid_t H5E_CALLBACK_g; /* Callback failed */ +H5_DLLVAR hid_t H5E_CANAPPLY_g; /* Error from filter 'can apply' callback */ +H5_DLLVAR hid_t H5E_SETLOCAL_g; /* Error from filter 'set local' callback */ +H5_DLLVAR hid_t H5E_NOENCODER_g; /* Filter present but encoding disabled */ +H5_DLLVAR hid_t H5E_CANTFILTER_g; /* Filter operation failed */ + +/* Property list errors */ +#define H5E_CANTGET (H5OPEN H5E_CANTGET_g) +#define H5E_CANTSET (H5OPEN H5E_CANTSET_g) +#define H5E_DUPCLASS (H5OPEN H5E_DUPCLASS_g) +#define H5E_SETDISALLOWED (H5OPEN H5E_SETDISALLOWED_g) +H5_DLLVAR hid_t H5E_CANTGET_g; /* Can't get value */ +H5_DLLVAR hid_t H5E_CANTSET_g; /* Can't set value */ +H5_DLLVAR hid_t H5E_DUPCLASS_g; /* Duplicate class name in parent class */ +H5_DLLVAR hid_t H5E_SETDISALLOWED_g; /* Disallowed operation */ + +/* Free space errors */ +#define H5E_CANTMERGE (H5OPEN H5E_CANTMERGE_g) +#define H5E_CANTREVIVE (H5OPEN H5E_CANTREVIVE_g) +#define H5E_CANTSHRINK (H5OPEN H5E_CANTSHRINK_g) +H5_DLLVAR hid_t H5E_CANTMERGE_g; /* Can't merge objects */ +H5_DLLVAR hid_t H5E_CANTREVIVE_g; /* Can't revive object */ +H5_DLLVAR hid_t H5E_CANTSHRINK_g; /* Can't shrink container */ #ifdef __cplusplus } diff --git a/src/H5Eterm.h b/src/H5Eterm.h index 7ae28f9..e6b2f07 100644 --- a/src/H5Eterm.h +++ b/src/H5Eterm.h @@ -20,37 +20,37 @@ /* Reset major error IDs */ -H5E_DATASET_g= -H5E_FUNC_g= +H5E_RESOURCE_g= +H5E_IO_g= +H5E_CACHE_g= +H5E_BTREE_g= +H5E_ATOM_g= +H5E_RS_g= H5E_STORAGE_g= H5E_FILE_g= -H5E_SOHM_g= -H5E_SYM_g= -H5E_PLUGIN_g= -H5E_VFL_g= -H5E_INTERNAL_g= -H5E_BTREE_g= +H5E_PLINE_g= H5E_REFERENCE_g= -H5E_DATASPACE_g= -H5E_RESOURCE_g= -H5E_PLIST_g= -H5E_LINK_g= +H5E_ERROR_g= H5E_DATATYPE_g= -H5E_RS_g= -H5E_HEAP_g= -H5E_OHDR_g= -H5E_ATOM_g= H5E_ATTR_g= -H5E_NONE_MAJOR_g= -H5E_IO_g= +H5E_OHDR_g= +H5E_FUNC_g= +H5E_VFL_g= +H5E_SYM_g= H5E_SLIST_g= -H5E_EFL_g= +H5E_LINK_g= +H5E_NONE_MAJOR_g= +H5E_HEAP_g= H5E_TST_g= -H5E_ARGS_g= -H5E_ERROR_g= -H5E_PLINE_g= H5E_FSPACE_g= -H5E_CACHE_g= (-1); +H5E_INTERNAL_g= +H5E_EFL_g= +H5E_PLUGIN_g= +H5E_DATASET_g= +H5E_SOHM_g= +H5E_PLIST_g= +H5E_DATASPACE_g= +H5E_ARGS_g= (-1); /* Reset minor error IDs */ @@ -63,41 +63,29 @@ H5E_CLOSEERROR_g= H5E_OVERFLOW_g= H5E_FCNTL_g= -/* Resource errors */ -H5E_NOSPACE_g= -H5E_CANTALLOC_g= -H5E_CANTCOPY_g= -H5E_CANTFREE_g= -H5E_ALREADYEXISTS_g= -H5E_CANTLOCK_g= -H5E_CANTUNLOCK_g= -H5E_CANTGC_g= -H5E_CANTGETSIZE_g= -H5E_OBJOPEN_g= - -/* Heap errors */ -H5E_CANTRESTORE_g= -H5E_CANTCOMPUTE_g= -H5E_CANTEXTEND_g= -H5E_CANTATTACH_g= -H5E_CANTUPDATE_g= -H5E_CANTOPERATE_g= - -/* Function entry/exit interface errors */ -H5E_CANTINIT_g= -H5E_ALREADYINIT_g= -H5E_CANTRELEASE_g= +/* B-tree related errors */ +H5E_NOTFOUND_g= +H5E_EXISTS_g= +H5E_CANTENCODE_g= +H5E_CANTDECODE_g= +H5E_CANTSPLIT_g= +H5E_CANTREDISTRIBUTE_g= +H5E_CANTSWAP_g= +H5E_CANTINSERT_g= +H5E_CANTLIST_g= +H5E_CANTMODIFY_g= +H5E_CANTREMOVE_g= -/* Property list errors */ -H5E_CANTGET_g= -H5E_CANTSET_g= -H5E_DUPCLASS_g= -H5E_SETDISALLOWED_g= +/* System level errors */ +H5E_SYSERRSTR_g= -/* Free space errors */ -H5E_CANTMERGE_g= -H5E_CANTREVIVE_g= -H5E_CANTSHRINK_g= +/* Dataspace errors */ +H5E_CANTCLIP_g= +H5E_CANTCOUNT_g= +H5E_CANTSELECT_g= +H5E_CANTNEXT_g= +H5E_BADSELECT_g= +H5E_CANTCOMPARE_g= /* Object header related errors */ H5E_LINKCOUNT_g= @@ -110,16 +98,12 @@ H5E_CANTPACK_g= H5E_CANTRESET_g= H5E_CANTRENAME_g= -/* System level errors */ -H5E_SYSERRSTR_g= +/* No error */ +H5E_NONE_MINOR_g= -/* I/O pipeline errors */ -H5E_NOFILTER_g= -H5E_CALLBACK_g= -H5E_CANAPPLY_g= -H5E_SETLOCAL_g= -H5E_NOENCODER_g= -H5E_CANTFILTER_g= +/* Datatype conversion errors */ +H5E_CANTCONVERT_g= +H5E_BADSIZE_g= /* Group related errors */ H5E_CANTOPENOBJ_g= @@ -127,12 +111,6 @@ H5E_CANTCLOSEOBJ_g= H5E_COMPLEN_g= H5E_PATH_g= -/* No error */ -H5E_NONE_MINOR_g= - -/* Plugin errors */ -H5E_OPENERROR_g= - /* File accessibility errors */ H5E_FILEEXISTS_g= H5E_FILEOPEN_g= @@ -144,13 +122,13 @@ H5E_BADFILE_g= H5E_TRUNCATED_g= H5E_MOUNT_g= -/* Object atom related errors */ -H5E_BADATOM_g= -H5E_BADGROUP_g= -H5E_CANTREGISTER_g= -H5E_CANTINC_g= -H5E_CANTDEC_g= -H5E_NOIDS_g= +/* Heap errors */ +H5E_CANTRESTORE_g= +H5E_CANTCOMPUTE_g= +H5E_CANTEXTEND_g= +H5E_CANTATTACH_g= +H5E_CANTUPDATE_g= +H5E_CANTOPERATE_g= /* Cache related errors */ H5E_CANTFLUSH_g= @@ -169,6 +147,11 @@ H5E_CANTDIRTY_g= H5E_CANTEXPUNGE_g= H5E_CANTRESIZE_g= +/* Parallel MPI errors */ +H5E_MPI_g= +H5E_MPIERRSTR_g= +H5E_CANTRECV_g= + /* Link related errors */ H5E_TRAVERSE_g= H5E_NLINKS_g= @@ -176,18 +159,20 @@ H5E_NOTREGISTERED_g= H5E_CANTMOVE_g= H5E_CANTSORT_g= -/* Parallel MPI errors */ -H5E_MPI_g= -H5E_MPIERRSTR_g= -H5E_CANTRECV_g= +/* Resource errors */ +H5E_NOSPACE_g= +H5E_CANTALLOC_g= +H5E_CANTCOPY_g= +H5E_CANTFREE_g= +H5E_ALREADYEXISTS_g= +H5E_CANTLOCK_g= +H5E_CANTUNLOCK_g= +H5E_CANTGC_g= +H5E_CANTGETSIZE_g= +H5E_OBJOPEN_g= -/* Dataspace errors */ -H5E_CANTCLIP_g= -H5E_CANTCOUNT_g= -H5E_CANTSELECT_g= -H5E_CANTNEXT_g= -H5E_BADSELECT_g= -H5E_CANTCOMPARE_g= +/* Plugin errors */ +H5E_OPENERROR_g= /* Argument errors */ H5E_UNINITIALIZED_g= @@ -196,21 +181,36 @@ H5E_BADTYPE_g= H5E_BADRANGE_g= H5E_BADVALUE_g= -/* B-tree related errors */ -H5E_NOTFOUND_g= -H5E_EXISTS_g= -H5E_CANTENCODE_g= -H5E_CANTDECODE_g= -H5E_CANTSPLIT_g= -H5E_CANTREDISTRIBUTE_g= -H5E_CANTSWAP_g= -H5E_CANTINSERT_g= -H5E_CANTLIST_g= -H5E_CANTMODIFY_g= -H5E_CANTREMOVE_g= +/* Object atom related errors */ +H5E_BADATOM_g= +H5E_BADGROUP_g= +H5E_CANTREGISTER_g= +H5E_CANTINC_g= +H5E_CANTDEC_g= +H5E_NOIDS_g= -/* Datatype conversion errors */ -H5E_CANTCONVERT_g= -H5E_BADSIZE_g= (-1); +/* Function entry/exit interface errors */ +H5E_CANTINIT_g= +H5E_ALREADYINIT_g= +H5E_CANTRELEASE_g= + +/* I/O pipeline errors */ +H5E_NOFILTER_g= +H5E_CALLBACK_g= +H5E_CANAPPLY_g= +H5E_SETLOCAL_g= +H5E_NOENCODER_g= +H5E_CANTFILTER_g= + +/* Property list errors */ +H5E_CANTGET_g= +H5E_CANTSET_g= +H5E_DUPCLASS_g= +H5E_SETDISALLOWED_g= + +/* Free space errors */ +H5E_CANTMERGE_g= +H5E_CANTREVIVE_g= +H5E_CANTSHRINK_g= (-1); #endif /* H5Eterm_H */ diff --git a/src/H5Ofill.c b/src/H5Ofill.c index c0938b7..e699a70 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -18,7 +18,7 @@ * uninitialized data points of a dataset. */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#define H5O_PACKAGE /*suppress error about including H5Opkg */ #include "H5private.h" /* Generic Functions */ #include "H5Dprivate.h" /* Datasets */ @@ -110,43 +110,43 @@ const H5O_msg_class_t H5O_MSG_FILL[1] = {{ H5O_fill_shared_decode, /*decode message */ H5O_fill_shared_encode, /*encode message */ H5O_fill_copy, /*copy the native value */ - H5O_fill_shared_size, /*raw message size */ - H5O_fill_reset, /*free internal memory */ - H5O_fill_free, /* free method */ - H5O_fill_shared_delete, /* file delete method */ - H5O_fill_shared_link, /* link method */ - NULL, /* set share method */ - NULL, /*can share method */ - NULL, /* pre copy native value to file */ - H5O_fill_shared_copy_file, /* copy native value to file */ - H5O_fill_shared_post_copy_file, /* post copy native value to file */ - NULL, /* get creation index */ - NULL, /* set creation index */ - H5O_fill_shared_debug /*debug the message */ + H5O_fill_shared_size, /*raw message size */ + H5O_fill_reset, /*free internal memory */ + H5O_fill_free, /* free method */ + H5O_fill_shared_delete, /* file delete method */ + H5O_fill_shared_link, /* link method */ + NULL, /* set share method */ + NULL, /*can share method */ + NULL, /* pre copy native value to file */ + H5O_fill_shared_copy_file, /* copy native value to file */ + H5O_fill_shared_post_copy_file, /* post copy native value to file */ + NULL, /* get creation index */ + NULL, /* set creation index */ + H5O_fill_shared_debug /*debug the message */ }}; /* This message derives from H5O message class, for new fill value after version 1.4 */ const H5O_msg_class_t H5O_MSG_FILL_NEW[1] = {{ - H5O_FILL_NEW_ID, /*message id number */ - "fill_new", /*message name for debugging */ - sizeof(H5O_fill_t), /*native message size */ + H5O_FILL_NEW_ID, /*message id number */ + "fill_new", /*message name for debugging */ + sizeof(H5O_fill_t), /*native message size */ H5O_SHARE_IS_SHARABLE | H5O_SHARE_IN_OHDR, /* messages are sharable? */ - H5O_fill_new_shared_decode, /*decode message */ - H5O_fill_new_shared_encode, /*encode message */ - H5O_fill_copy, /*copy the native value */ - H5O_fill_new_shared_size, /*raw message size */ - H5O_fill_reset, /*free internal memory */ - H5O_fill_free, /* free method */ - H5O_fill_new_shared_delete, /* file delete method */ - H5O_fill_new_shared_link, /* link method */ - NULL, /* set share method */ - NULL, /*can share method */ - NULL, /* pre copy native value to file */ - H5O_fill_new_shared_copy_file, /* copy native value to file */ - H5O_fill_new_shared_post_copy_file, /* post copy native value to file */ - NULL, /* get creation index */ - NULL, /* set creation index */ - H5O_fill_new_shared_debug /*debug the message */ + H5O_fill_new_shared_decode, /*decode message */ + H5O_fill_new_shared_encode, /*encode message */ + H5O_fill_copy, /*copy the native value */ + H5O_fill_new_shared_size, /*raw message size */ + H5O_fill_reset, /*free internal memory */ + H5O_fill_free, /* free method */ + H5O_fill_new_shared_delete, /* file delete method */ + H5O_fill_new_shared_link, /* link method */ + NULL, /* set share method */ + NULL, /*can share method */ + NULL, /* pre copy native value to file */ + H5O_fill_new_shared_copy_file, /* copy native value to file */ + H5O_fill_new_shared_post_copy_file, /* post copy native value to file */ + NULL, /* get creation index */ + NULL, /* set creation index */ + H5O_fill_new_shared_debug /*debug the message */ }}; /* Masks, shift values & flags for fill value message */ @@ -183,12 +183,12 @@ H5FL_BLK_EXTERN(type_conv); */ static void * H5O_fill_new_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, - size_t p_size, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, + const uint8_t *p) { - H5O_fill_t *fill = NULL; - const uint8_t * p_end = p + p_size - 1; /* End of the p buffer */ - void * ret_value = NULL; /* Return value */ + H5O_fill_t * fill = NULL; + const uint8_t *p_end = p + p_size - 1; /* End of the p buffer */ + void * ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -304,12 +304,12 @@ done: */ static void * H5O_fill_old_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, - size_t p_size, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, + const uint8_t *p) { - H5O_fill_t *fill = NULL; /* Decoded fill value message */ + H5O_fill_t * fill = NULL; /* Decoded fill value message */ const uint8_t *p_end = p + p_size - 1; /* End of the p buffer */ - void * ret_value; /* Return value */ + void * ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 43d01a5..5f92e60 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -17,17 +17,17 @@ * Purpose: Messages related to data layout. */ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#define H5D_PACKAGE /*suppress error about including H5Dpkg */ +#define H5O_PACKAGE /*suppress error about including H5Opkg */ -#include "H5private.h" /* Generic Functions */ -#include "H5Dpkg.h" /* Dataset functions */ -#include "H5Eprivate.h" /* Error handling */ +#include "H5private.h" /* Generic Functions */ +#include "H5Dpkg.h" /* Dataset functions */ +#include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5MFprivate.h" /* File space management */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Opkg.h" /* Object headers */ -#include "H5Pprivate.h" /* Property lists */ +#include "H5MFprivate.h" /* File space management */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Opkg.h" /* Object headers */ +#include "H5Pprivate.h" /* Property lists */ /* Local macros */ @@ -56,16 +56,16 @@ const H5O_msg_class_t H5O_MSG_LAYOUT[1] = {{ H5O_layout_copy, /*copy the native value */ H5O_layout_size, /*size of message on disk */ H5O_layout_reset, /*reset method */ - H5O_layout_free, /*free the struct */ - H5O_layout_delete, /* file delete method */ - NULL, /* link method */ - NULL, /*set share method */ - NULL, /*can share method */ + H5O_layout_free, /*free the struct */ + H5O_layout_delete, /* file delete method */ + NULL, /* link method */ + NULL, /*set share method */ + NULL, /*can share method */ NULL, /* pre copy native value to file */ H5O_layout_copy_file, /* copy native value to file */ NULL, /* post copy native value to file */ - NULL, /* get creation index */ - NULL, /* set creation index */ + NULL, /* get creation index */ + NULL, /* set creation index */ H5O_layout_debug /*debug the message */ }}; @@ -89,13 +89,13 @@ H5FL_DEFINE(H5O_layout_t); */ static void * H5O_layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, - size_t p_size, const uint8_t *p) + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, + const uint8_t *p) { - H5O_layout_t *mesg = NULL; - unsigned u; + H5O_layout_t * mesg = NULL; + unsigned u; const uint8_t *p_end = p + p_size - 1; /* End of the p buffer */ - void * ret_value = NULL; /* Return value */ + void * ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -278,12 +278,12 @@ done: * We write out version 3 messages by default now. * * Modifications: - * Robb Matzke, 1998-07-20 - * Rearranged the message to add a version number at the beginning. + * Robb Matzke, 1998-07-20 + * Rearranged the message to add a version number at the beginning. * - * Raymond Lu, 2002-2-26 - * Added version number 2 case depends on if space has been allocated - * at the moment when layout header message is updated. + * Raymond Lu, 2002-2-26 + * Added version number 2 case depends on if space has been allocated + * at the moment when layout header message is updated. * * Quincey Koziol, 2004-5-21 * Added version number 3 case to straighten out problems with contiguous @@ -484,13 +484,13 @@ H5O_layout_reset(void *_mesg) } /* end H5O_layout_reset() */ /*------------------------------------------------------------------------- - * Function: H5O_layout_free + * Function: H5O_layout_free * - * Purpose: Free's the message + * Purpose: Free's the message * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, March 11, 2000 * *------------------------------------------------------------------------- diff --git a/src/H5Spkg.h b/src/H5Spkg.h index 24c85ba..0c390cc 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -12,12 +12,12 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Thursday, September 28, 2000 + * Programmer: Quincey Koziol + * Thursday, September 28, 2000 * - * Purpose: This file contains declarations which are visible only within - * the H5S package. Source files outside the H5S package should - * include H5Sprivate.h instead. + * Purpose: This file contains declarations which are visible only within + * the H5S package. Source files outside the H5S package should + * include H5Sprivate.h instead. */ #ifndef H5S_PACKAGE #error "Do not include this file outside the H5S package!" @@ -95,11 +95,10 @@ struct H5S_pnt_node_t { /* Information about point selection list */ typedef struct { H5S_pnt_node_t *head; /* Pointer to head of point list */ - - hsize_t last_idx; /* Index of the point after the last returned from H5S__get_select_elem_pointlist() */ + hsize_t last_idx; /* Index of the point after the last returned from H5S__get_select_elem_pointlist() */ H5S_pnt_node_t *last_idx_pnt; /* Point after the last returned from H5S__get_select_elem_pointlist(). - * If we ever add a way to remove points or add points in the middle of - * the pointlist we will need to invalidate these fields. */ + * If we ever add a way to remove points or add points in the middle of + * the pointlist we will need to invalidate these fields. */ } H5S_pnt_list_t; /* Information about new-style hyperslab spans */ diff --git a/src/H5Spoint.c b/src/H5Spoint.c index d1702e7..3cc0a84 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -18,14 +18,14 @@ * Purpose: Point selection dataspace I/O functions. */ -#define H5S_PACKAGE /*suppress error about including H5Spkg */ - -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* ID Functions */ -#include "H5MMprivate.h" /* Memory Management functions */ -#include "H5Spkg.h" /* Dataspace functions */ +#define H5S_PACKAGE /*suppress error about including H5Spkg */ + +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Iprivate.h" /* ID Functions */ +#include "H5MMprivate.h" /* Memory Management functions */ +#include "H5Spkg.h" /* Dataspace functions */ #include "H5VMprivate.h" /* Vector functions */ /* Static function prototypes */ @@ -619,7 +619,7 @@ H5S_point_copy(H5S_t *dst, const H5S_t *src, hbool_t H5_ATTR_UNUSED share_select } /* end while */ /* Clear cached iteration point */ - dst->select.sel_info.pnt_lst->last_idx = 0; + dst->select.sel_info.pnt_lst->last_idx = 0; dst->select.sel_info.pnt_lst->last_idx_pnt = NULL; done: @@ -961,8 +961,8 @@ static herr_t H5S_get_select_elem_pointlist(H5S_t *space, hsize_t startpoint, hsize_t numpoints, hsize_t *buf) { const hsize_t endpoint = startpoint + numpoints; /* Index of last point in iteration */ - H5S_pnt_node_t *node; /* Point node */ - unsigned rank; /* Dataspace rank */ + H5S_pnt_node_t *node; /* Point node */ + unsigned rank; /* Dataspace rank */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -973,8 +973,8 @@ H5S_get_select_elem_pointlist(H5S_t *space, hsize_t startpoint, hsize_t numpoint rank = space->extent.rank; /* Check for cached point at the correct index */ - if(space->select.sel_info.pnt_lst->last_idx_pnt - && startpoint == space->select.sel_info.pnt_lst->last_idx) + if (space->select.sel_info.pnt_lst->last_idx_pnt && + startpoint == space->select.sel_info.pnt_lst->last_idx) node = space->select.sel_info.pnt_lst->last_idx_pnt; else { /* Get the head of the point list */ @@ -985,7 +985,7 @@ H5S_get_select_elem_pointlist(H5S_t *space, hsize_t startpoint, hsize_t numpoint startpoint--; node = node->next; } /* end while */ - } /* end else */ + } /* end else */ /* Iterate through the node, copying each point's information */ while (node != NULL && numpoints > 0) { @@ -996,7 +996,7 @@ H5S_get_select_elem_pointlist(H5S_t *space, hsize_t startpoint, hsize_t numpoint } /* end while */ /* Cached next point in iteration */ - space->select.sel_info.pnt_lst->last_idx = endpoint; + space->select.sel_info.pnt_lst->last_idx = endpoint; space->select.sel_info.pnt_lst->last_idx_pnt = node; FUNC_LEAVE_NOAPI(SUCCEED) @@ -1510,7 +1510,7 @@ H5S_point_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *off } /* end else */ /* Clear cached iteration point */ - new_space->select.sel_info.pnt_lst->last_idx = 0; + new_space->select.sel_info.pnt_lst->last_idx = 0; new_space->select.sel_info.pnt_lst->last_idx_pnt = NULL; /* Number of elements selected will be the same */ diff --git a/src/H5private.h b/src/H5private.h index 8df48ca..d37d2cd 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -307,6 +307,14 @@ #define FAIL (-1) #define UFAIL (unsigned)(-1) +/* The HDF5 library uses the symbol `ERR` frequently. So do + * header files for libraries such as curses(3), terminfo(3), etc. + * Remove its definition here to avoid clashes with HDF5. + */ +#ifdef ERR +#undef ERR +#endif + /* number of members in an array */ #ifndef NELMTS #define NELMTS(X) (sizeof(X) / sizeof(X[0])) diff --git a/src/H5public.h b/src/H5public.h index 87ba81a..c3ea8ef 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -92,11 +92,11 @@ extern "C" { #endif /* Version numbers */ -#define H5_VERS_MAJOR 1 /* For major interface/format changes */ -#define H5_VERS_MINOR 8 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 23 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "1" /* For pre-releases like snap0 */ - /* Empty string for real releases. */ +#define H5_VERS_MAJOR 1 /* For major interface/format changes */ +#define H5_VERS_MINOR 8 /* For minor interface/format changes */ +#define H5_VERS_RELEASE 23 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_SUBRELEASE "1" /* For pre-releases like snap0 */ + /* Empty string for real releases. */ #define H5_VERS_INFO "HDF5 library version: 1.8.23-1" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 5563d1c..89d13d1 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -512,16 +512,15 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -552,6 +551,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -579,8 +579,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -759,15 +757,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -901,7 +899,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1710,8 +1708,9 @@ uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \ # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/test/H5srcdir.h b/test/H5srcdir.h index 6741dd9..97d1ae7 100644 --- a/test/H5srcdir.h +++ b/test/H5srcdir.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, March 17, 2010 * * Purpose: srcdir querying support. diff --git a/test/Makefile.in b/test/Makefile.in index 968c9b2..64950c3 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -804,17 +804,16 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_builddir)/src -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -845,6 +844,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -872,8 +872,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -1052,15 +1050,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -1193,7 +1191,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -2447,8 +2445,9 @@ uninstall-am: # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/test/dtransform.c b/test/dtransform.c index d2f53fe..3bbbcef 100644 --- a/test/dtransform.c +++ b/test/dtransform.c @@ -766,7 +766,7 @@ test_trivial(const hid_t dxpl_id_simple) FAIL_PUTS_ERROR(" ERROR: Conversion failed to match computed data\n"); } - PASSED() + PASSED(); TESTING("data transform, trivial transform, with type conversion") if (H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_simple, windchillFintread) < 0) @@ -777,7 +777,7 @@ test_trivial(const hid_t dxpl_id_simple) FAIL_PUTS_ERROR(" ERROR: Conversion failed to match computed data\n") } - PASSED() + PASSED(); return 0; error: @@ -804,7 +804,7 @@ test_getset(const hid_t dxpl_id_c_to_f) if (HDstrcmp(c_to_f, ptrgetTest) != 0) FAIL_PUTS_ERROR(" ERROR: Data transform failed to match what was set\n") - PASSED() + PASSED(); HDfree(ptrgetTest); ptrgetTest = NULL; @@ -823,7 +823,7 @@ test_getset(const hid_t dxpl_id_c_to_f) FAIL_PUTS_ERROR(" ERROR: Conversion failed to match computed data\n") } - PASSED() + PASSED(); TESTING("H5Pget_data_transform, after resetting transform property") @@ -834,7 +834,7 @@ test_getset(const hid_t dxpl_id_c_to_f) if (HDstrcmp(simple, ptrgetTest) != 0) FAIL_PUTS_ERROR(" ERROR: Data transform failed to match what was set\n") - PASSED() + PASSED(); HDfree(ptrgetTest); ptrgetTest = NULL; @@ -870,7 +870,7 @@ test_set(void) H5Eset_auto2(H5E_DEFAULT, NULL, NULL); if (H5Pget_data_transform(dxpl_id, ptrgetTest, HDstrlen(str) + 1) < 0) - PASSED() + PASSED(); else FAIL_PUTS_ERROR(" ERROR: Data transform get before set succeeded (it shouldn't have)\n"); diff --git a/test/fheap.c b/test/fheap.c index 6d436ff..714a7fd 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -1858,7 +1858,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t H5_ATTR_UNUSED HDmemset(&state, 0, sizeof(fheap_heap_state_t)); if (check_stats(fh, &state)) TEST_ERROR - PASSED() + PASSED(); /* Query the type of address mapping */ TESTING("query heap creation parameters"); @@ -1890,7 +1890,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t H5_ATTR_UNUSED TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return 0; @@ -1988,7 +1988,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t H5_ATTR_UNUSED FAIL_STACK_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -2120,7 +2120,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t H5_ATTR_UN FAIL_STACK_ERROR /* All tests passed */ - PASSED() + PASSED(); return 0; @@ -2258,7 +2258,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t H5_ATTR_U TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return 0; @@ -2589,7 +2589,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam) FAIL_STACK_ERROR /* All tests passed */ - PASSED() + PASSED(); return 0; @@ -2704,7 +2704,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam) H5O_msg_reset(H5O_PLINE_ID, &test_cparam.pline); /* All tests passed */ - PASSED() + PASSED(); return 0; @@ -2836,7 +2836,7 @@ test_size(hid_t fapl, H5HF_create_t *cparam) FAIL_STACK_ERROR /* All tests passed */ - PASSED() + PASSED(); return 0; @@ -2963,7 +2963,7 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam) FAIL_STACK_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -3072,7 +3072,7 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa FAIL_STACK_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -3172,7 +3172,7 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -3264,7 +3264,7 @@ test_man_insert_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -3359,7 +3359,7 @@ test_man_insert_root_mult(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -3462,7 +3462,7 @@ test_man_insert_force_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_par TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -3565,7 +3565,7 @@ test_man_insert_fill_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -3674,7 +3674,7 @@ test_man_insert_third_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -3767,7 +3767,7 @@ test_man_fill_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -3867,7 +3867,7 @@ test_man_start_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -3964,7 +3964,7 @@ test_man_fill_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -4072,7 +4072,7 @@ test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -4167,7 +4167,7 @@ test_man_fill_fourth_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -4260,7 +4260,7 @@ test_man_fill_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -4358,7 +4358,7 @@ test_man_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_ TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -4465,7 +4465,7 @@ test_man_second_direct_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhe TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -4564,7 +4564,7 @@ test_man_fill_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_ TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -4671,7 +4671,7 @@ test_man_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -4776,7 +4776,7 @@ test_man_fill_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -4877,7 +4877,7 @@ test_man_fill_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_te TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -4983,7 +4983,7 @@ test_man_start_2nd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -5082,7 +5082,7 @@ test_man_recursive_indirect_two_deep(hid_t fapl, H5HF_create_t *cparam, fheap_te TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -5189,7 +5189,7 @@ test_man_start_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -5297,7 +5297,7 @@ test_man_fill_first_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -5402,7 +5402,7 @@ test_man_fill_3rd_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -5507,7 +5507,7 @@ test_man_fill_all_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -5619,7 +5619,7 @@ test_man_start_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -5737,7 +5737,7 @@ test_man_fill_first_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -5846,7 +5846,7 @@ test_man_fill_4th_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -5955,7 +5955,7 @@ test_man_fill_all_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -6088,7 +6088,7 @@ test_man_start_5th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -6238,7 +6238,7 @@ test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -6396,7 +6396,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -6582,7 +6582,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -6744,7 +6744,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -6981,7 +6981,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -7278,7 +7278,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -7387,7 +7387,7 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ TEST_ERROR /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -7461,7 +7461,7 @@ test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -7550,7 +7550,7 @@ test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -7621,7 +7621,7 @@ test_man_remove_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -7694,7 +7694,7 @@ test_man_remove_first_two_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_par H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -7771,7 +7771,7 @@ test_man_remove_first_four_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -7842,7 +7842,7 @@ test_man_remove_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -7917,7 +7917,7 @@ test_man_remove_2nd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -7996,7 +7996,7 @@ test_man_remove_3rd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -8081,7 +8081,7 @@ test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -8180,7 +8180,7 @@ test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -8291,7 +8291,7 @@ test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_t H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -8386,7 +8386,7 @@ test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -8530,7 +8530,7 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -8699,7 +8699,7 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t * H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -8830,7 +8830,7 @@ test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -8960,7 +8960,7 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -9085,7 +9085,7 @@ test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_crea H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -9217,7 +9217,7 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_ H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -9364,7 +9364,7 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_ H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -9542,7 +9542,7 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5 H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -9697,7 +9697,7 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -9883,7 +9883,7 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -10013,7 +10013,7 @@ test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -10156,7 +10156,7 @@ test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -10312,7 +10312,7 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -10479,7 +10479,7 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped( H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -10646,7 +10646,7 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -10820,7 +10820,7 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -10985,7 +10985,7 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5 H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -11169,7 +11169,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -11390,7 +11390,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_ H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -11595,7 +11595,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -11836,7 +11836,7 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_ H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -11973,7 +11973,7 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -12143,7 +12143,7 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -12258,7 +12258,7 @@ test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -12379,7 +12379,7 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -12535,7 +12535,7 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -12768,7 +12768,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -13076,7 +13076,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -13503,7 +13503,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -13721,7 +13721,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam H5MM_xfree(heap_id); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -13875,7 +13875,7 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -14108,7 +14108,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -14714,7 +14714,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -14903,7 +14903,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para H5O_msg_reset(H5O_PLINE_ID, &tmp_cparam.pline); /* Release the I/O pipeline filter information */ /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -15215,7 +15215,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa H5O_msg_reset(H5O_PLINE_ID, &tmp_cparam.pline); /* Release the I/O pipeline filter information */ /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -15423,7 +15423,7 @@ test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_pa H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -15648,7 +15648,7 @@ test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_te H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -15930,7 +15930,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) H5MM_xfree(rewrite_obj); /* All tests passed */ - PASSED() + PASSED(); return (0); @@ -16099,7 +16099,7 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) H5MM_xfree(keep_ids.offs); /* All tests passed */ - PASSED() + PASSED(); return (0); diff --git a/test/flush2.c b/test/flush2.c index b2e0ac8..356dc6f 100644 --- a/test/flush2.c +++ b/test/flush2.c @@ -179,7 +179,7 @@ main(void) h5_fixname(FILENAME[1], fapl, name, sizeof name); if (check_file(name, fapl, FALSE)) - PASSED() + PASSED(); else { #if defined H5_HAVE_WIN32_API && !defined(hdf5_EXPORTS) SKIPPED(); @@ -199,7 +199,7 @@ main(void) h5_fixname(FILENAME[2], fapl, name, sizeof name); if (check_file(name, fapl, TRUE)) - PASSED() + PASSED(); else { #if defined H5_HAVE_WIN32_API && !defined(hdf5_EXPORTS) SKIPPED(); diff --git a/test/freespace.c b/test/freespace.c index 8d14f25..cbc8b84 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -530,7 +530,7 @@ test_fs_create(hid_t fapl) if (file_size != empty_size) TEST_ERROR - PASSED() + PASSED(); return 0; @@ -656,7 +656,7 @@ test_fs_sect_add(hid_t fapl) if (tmp_file_size <= (file_size + fr_meta_size)) TEST_ERROR - PASSED() + PASSED(); TESTING("adding a section via H5FS_sect_add() to free-space with H5FS_CLS_GHOST_OBJ: test 2"); @@ -718,7 +718,7 @@ test_fs_sect_add(hid_t fapl) if (tmp_file_size != (file_size + fr_meta_size)) TEST_ERROR - PASSED() + PASSED(); TESTING("adding a section via H5FS_sect_add() to free-space: test 3"); @@ -788,7 +788,7 @@ test_fs_sect_add(hid_t fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); TESTING("adding a section via H5FS_sect_add() to free-space: test 4"); @@ -868,7 +868,7 @@ test_fs_sect_add(hid_t fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); return 0; @@ -965,7 +965,7 @@ test_fs_sect_find(hid_t fapl) FAIL_STACK_ERROR frsp = NULL; - PASSED() + PASSED(); TESTING("H5FS_sect_find() a section equal to requested-size from free-space"); @@ -1097,7 +1097,7 @@ test_fs_sect_find(hid_t fapl) FAIL_STACK_ERROR frsp = NULL; - PASSED() + PASSED(); TESTING("H5FS_sect_find() a section greater than requested-size from free-space"); @@ -1179,7 +1179,7 @@ test_fs_sect_find(hid_t fapl) FAIL_STACK_ERROR frsp = NULL; - PASSED() + PASSED(); TESTING("H5FS_sect_find(): cannot find a section with requested-size from free-space"); @@ -1244,7 +1244,7 @@ test_fs_sect_find(hid_t fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); return 0; @@ -1448,7 +1448,7 @@ test_fs_sect_merge(hid_t fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); /* * TEST 2 @@ -1554,7 +1554,7 @@ test_fs_sect_merge(hid_t fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); /* * TEST 3 @@ -1733,7 +1733,7 @@ test_fs_sect_merge(hid_t fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); return 0; @@ -1907,7 +1907,7 @@ test_fs_sect_shrink(hid_t fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); TESTING("shrinking of sections when H5FS_sect_add() to free-space: test 2"); @@ -2010,7 +2010,7 @@ test_fs_sect_shrink(hid_t fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); TESTING("shrinking of sections when H5FS_sect_add() to free-space: test 3"); @@ -2104,7 +2104,7 @@ test_fs_sect_shrink(hid_t fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); return 0; @@ -2258,7 +2258,7 @@ test_fs_sect_change_class(hid_t fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); /* * TEST 2 @@ -2383,7 +2383,7 @@ test_fs_sect_change_class(hid_t fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); return 0; @@ -2537,7 +2537,7 @@ test_fs_sect_extend(hid_t fapl) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; - PASSED() + PASSED(); /* * TEST 2 @@ -2613,7 +2613,7 @@ test_fs_sect_extend(hid_t fapl) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; - PASSED() + PASSED(); /* * Test 3 @@ -2690,7 +2690,7 @@ test_fs_sect_extend(hid_t fapl) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; - PASSED() + PASSED(); /* * TEST 4 @@ -2766,7 +2766,7 @@ test_fs_sect_extend(hid_t fapl) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; - PASSED() + PASSED(); /* Close the file */ if (H5Fclose(file) < 0) @@ -2872,7 +2872,7 @@ test_fs_sect_iterate(hid_t fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); return 0; diff --git a/test/getname.c b/test/getname.c index 159ff24..25f6ed6 100644 --- a/test/getname.c +++ b/test/getname.c @@ -3317,7 +3317,7 @@ test_obj_ref(hid_t fapl) namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], (char *)buf, sizeof(buf)); if (!((HDstrcmp(buf, "/Dataset3") == 0) && (namelen == 9))) TEST_ERROR - PASSED() + PASSED(); HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to dataset in /Group1"); @@ -3333,7 +3333,7 @@ test_obj_ref(hid_t fapl) namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[1], (char *)buf, sizeof(buf)); if (!((HDstrcmp(buf, "/Group1/Dataset2") == 0) && (namelen == 16))) TEST_ERROR - PASSED() + PASSED(); HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to /Group1"); @@ -3349,7 +3349,7 @@ test_obj_ref(hid_t fapl) namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[2], (char *)buf, sizeof(buf)); if (!((HDstrcmp(buf, "/Group1") == 0) && (namelen == 7))) TEST_ERROR - PASSED() + PASSED(); HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to datatype in /Group1"); @@ -3365,7 +3365,7 @@ test_obj_ref(hid_t fapl) namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[3], (char *)buf, sizeof(buf)); if (!((HDstrcmp(buf, "/Group1/Datatype1") == 0) && (namelen == 17))) TEST_ERROR - PASSED() + PASSED(); HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to dataset in nested group"); @@ -3381,7 +3381,7 @@ test_obj_ref(hid_t fapl) namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[4], (char *)buf, sizeof(buf)); if (!((HDstrcmp(buf, "/Group1/Group2/Dataset4") == 0) && (namelen == 23))) TEST_ERROR - PASSED() + PASSED(); HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to nested group"); @@ -3397,7 +3397,7 @@ test_obj_ref(hid_t fapl) namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[5], (char *)buf, sizeof(buf)); if (!((HDstrcmp(buf, "/Group1/Group2") == 0) && (namelen == 14))) TEST_ERROR - PASSED() + PASSED(); HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to dataset created via hard link"); @@ -3413,7 +3413,7 @@ test_obj_ref(hid_t fapl) namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[6], (char *)buf, sizeof(buf)); if (!((HDstrcmp(buf, "/Group1/Dataset5") == 0) && (namelen == 16))) TEST_ERROR - PASSED() + PASSED(); HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to root group"); @@ -3429,7 +3429,7 @@ test_obj_ref(hid_t fapl) namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[7], (char *)buf, sizeof(buf)); if (!((HDstrcmp(buf, "/") == 0) && (namelen == 1))) TEST_ERROR - PASSED() + PASSED(); /* Now we mount fid2 at /Group2 and look for dataset4. It shouldn't be found */ if (H5Fmount(fid1, "/Group1/Group2", fid2, H5P_DEFAULT) < 0) @@ -3448,7 +3448,7 @@ test_obj_ref(hid_t fapl) namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[4], (char *)buf, sizeof(buf)); if (namelen != 0) TEST_ERROR - PASSED() + PASSED(); /* Now we try unlinking dataset2 from the file and searching for it. It shouldn't be found */ if ((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[1])) < 0) @@ -3467,7 +3467,7 @@ test_obj_ref(hid_t fapl) namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[1], (char *)buf, sizeof(buf)); if (namelen != 0) TEST_ERROR - PASSED() + PASSED(); /* Close disk dataspace */ if (H5Sclose(sid1) < 0) @@ -3591,7 +3591,7 @@ test_reg_ref(hid_t fapl) name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], (char *)buf1, NAME_BUF_SIZE); if (!((HDstrcmp(buf1, "/MATRIX") == 0) && (name_size1 == 7))) TEST_ERROR - PASSED() + PASSED(); TESTING("H5Iget_name to get name from region reference(hyperslab)"); @@ -3607,7 +3607,7 @@ test_reg_ref(hid_t fapl) if (H5Dclose(dsetv_id) < 0) TEST_ERROR - PASSED() + PASSED(); /* Get name of the dataset the second region reference points to using H5Rget_name */ TESTING("H5Rget_name to get name from region reference(pnt selec)"); @@ -3615,7 +3615,7 @@ test_reg_ref(hid_t fapl) name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[1], (char *)buf1, NAME_BUF_SIZE); if (!((HDstrcmp(buf1, "/MATRIX") == 0) && (name_size1 == 7))) TEST_ERROR - PASSED() + PASSED(); TESTING("H5Iget_name to get name from region reference(pnt selec)"); @@ -3632,7 +3632,7 @@ test_reg_ref(hid_t fapl) if (H5Dclose(dsetv_id) < 0) TEST_ERROR - PASSED() + PASSED(); if (H5Dclose(dsetr_id) < 0) TEST_ERROR diff --git a/test/h5test.h b/test/h5test.h index e4def42..cec2822 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, November 20, 1998 * * Purpose: Test support stuff. @@ -111,10 +111,10 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ HDfflush(stdout); \ } #define PASSED() \ - { \ + do { \ HDputs(" PASSED"); \ HDfflush(stdout); \ - } + } while (0) #define H5_FAILED() \ { \ HDputs("*FAILED*"); \ @@ -172,6 +172,64 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ /* Flags for h5_fileaccess_flags() */ #define H5_FILEACCESS_VFD 0x01 +/* Macros to create and fill 2D arrays with a single heap allocation. + * These can be used to replace large stack and global arrays which raise + * warnings. + * + * The macros make a single heap allocation large enough to hold all the + * pointers and the data elements. The first part of the allocation holds + * the pointers, and the second part holds the data as a contiguous block + * in row-major order. + * + * To pass the data block to calls like H5Dread(), pass a pointer to the + * first array element as the data pointer (e.g., array[0] in a 2D array). + * + * The fill macro just fills the array with an increasing count value. + * + * Usage: + * + * int **array; + * + * H5TEST_ALLOCATE_2D_ARRAY(array, int, 5, 10); + * + * H5TEST_FILL_2D_ARRAY(array, int, 5, 10); + * + * (do stuff) + * + * HDfree(array); + */ +#define H5TEST_ALLOCATE_2D_ARRAY(ARR, TYPE, DIMS_I, DIMS_J) \ + do { \ + /* Prefix with h5taa to avoid shadow warnings */ \ + size_t h5taa_pointers_size = 0; \ + size_t h5taa_data_size = 0; \ + int h5taa_i; \ + \ + h5taa_pointers_size = (DIMS_I) * sizeof(TYPE *); \ + h5taa_data_size = (DIMS_I) * (DIMS_J) * sizeof(TYPE); \ + \ + ARR = (TYPE **)HDmalloc(h5taa_pointers_size + h5taa_data_size); \ + \ + ARR[0] = (TYPE *)(ARR + (DIMS_I)); \ + \ + for (h5taa_i = 1; h5taa_i < (DIMS_I); h5taa_i++) \ + ARR[h5taa_i] = ARR[h5taa_i - 1] + (DIMS_J); \ + } while (0) + +#define H5TEST_FILL_2D_ARRAY(ARR, TYPE, DIMS_I, DIMS_J) \ + do { \ + /* Prefix with h5tfa to avoid shadow warnings */ \ + int h5tfa_i = 0; \ + int h5tfa_j = 0; \ + TYPE h5tfa_count = 0; \ + \ + for (h5tfa_i = 0; h5tfa_i < (DIMS_I); h5tfa_i++) \ + for (h5tfa_j = 0; h5tfa_j < (DIMS_J); h5tfa_j++) { \ + ARR[h5tfa_i][h5tfa_j] = h5tfa_count; \ + h5tfa_count++; \ + } \ + } while (0) + /* * The methods to compare the equality of floating-point values: * 1. XXX_ABS_EQUAL - check if the difference is smaller than the diff --git a/test/hdfs.c b/test/hdfs.c index e652e25..839f327 100644 --- a/test/hdfs.c +++ b/test/hdfs.c @@ -608,10 +608,10 @@ test_hdfs_fapl(void) * test-local variables * ************************/ - hid_t fapl_id = -1; /* file access property list ID */ - hid_t driver_id = -1; /* ID for this VFD */ - unsigned long driver_flags = 0; /* VFD feature flags */ - H5FD_hdfs_fapl_t hdfs_fa_0 = { + hid_t fapl_id = -1; /* file access property list ID */ + hid_t driver_id = -1; /* ID for this VFD */ + unsigned long driver_flags = 0; /* VFD feature flags */ + H5FD_hdfs_fapl_t hdfs_fa_0 = { 1, /* version*/ "", /* node name */ 9000, /* node port */ @@ -694,10 +694,10 @@ test_vfd_open(void) struct test_condition { const char *message; const char *url; - unsigned flags; - int which_fapl; - haddr_t maxaddr; - hbool_t might_use_other_driver; + unsigned flags; + int which_fapl; + haddr_t maxaddr; + hbool_t might_use_other_driver; }; /************************ @@ -786,11 +786,11 @@ test_vfd_open(void) FALSE, }, }; - unsigned i = 0; + unsigned i = 0; unsigned failing_conditions_count = 10; - H5FD_t *fd = NULL; - hid_t fapl_hdfs = -1; - hid_t fapl_unconfigured = -1; + H5FD_t * fd = NULL; + hid_t fapl_hdfs = -1; + hid_t fapl_unconfigured = -1; TESTING("HDFS VFD-level open"); @@ -808,8 +808,8 @@ test_vfd_open(void) /* all the test cases that will _not_ open */ for (i = 0; i < failing_conditions_count; i++) { - struct test_condition T = failing_conditions[i]; - hid_t fapl_id = H5P_DEFAULT; + struct test_condition T = failing_conditions[i]; + hid_t fapl_id = H5P_DEFAULT; fd = NULL; @@ -933,7 +933,7 @@ test_eof_eoa(void) ************************/ H5FD_t *fd_shakespeare = NULL; - hid_t fapl_id = -1; + hid_t fapl_id = -1; TESTING("HDFS eof/eoa gets and sets"); @@ -1016,10 +1016,10 @@ error: static int test_H5FDread_without_eoa_set_fails(void) { - char buffer[HDFS_TEST_MAX_BUF_SIZE]; - unsigned int i = 0; - H5FD_t *file_shakespeare = NULL; - hid_t fapl_id = -1; + char buffer[HDFS_TEST_MAX_BUF_SIZE]; + unsigned int i = 0; + H5FD_t * file_shakespeare = NULL; + hid_t fapl_id = -1; TESTING("HDFS VFD read-eoa temporal coupling library limitation"); diff --git a/test/hyperslab.c b/test/hyperslab.c index b0816cf..4427e0b 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -11,7 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke +/* Programmer: Robb Matzke * Friday, October 10, 1997 * * Purpose: Hyperslab operations are rather complex, so this file @@ -257,7 +257,7 @@ test_fill(size_t nx, size_t ny, size_t nz, size_t di, size_t dj, size_t dk, size } /* end for */ } /* end for */ - PASSED() + PASSED(); HDfree(dst); @@ -526,7 +526,7 @@ test_copy(int mode, size_t nx, size_t ny, size_t nz, size_t di, size_t dj, size_ } /* end for */ } /* end for */ - PASSED() + PASSED(); HDfree(src); HDfree(dst); @@ -644,7 +644,7 @@ test_multifill(size_t nx) } /* end if */ } /* end for */ - PASSED() + PASSED(); HDfree(src); HDfree(dst); @@ -730,7 +730,7 @@ test_endian(size_t nx) } /* end for */ } /* end for */ - PASSED() + PASSED(); HDfree(src); HDfree(dst); @@ -827,7 +827,7 @@ test_transpose(size_t nx, size_t ny) } /* end for */ } /* end for */ - PASSED() + PASSED(); HDfree(src); HDfree(dst); @@ -916,7 +916,7 @@ test_sub_super(size_t nx, size_t ny) } /* end if */ } /* end for */ } /* end for */ - PASSED() + PASSED(); /* * Test replicating pixels to produce an image twice as large in each @@ -974,7 +974,7 @@ test_sub_super(size_t nx, size_t ny) } /* end for */ } /* end for */ - PASSED() + PASSED(); HDfree(full); HDfree(half); diff --git a/test/mf.c b/test/mf.c index e218904..1e58e18 100644 --- a/test/mf.c +++ b/test/mf.c @@ -265,7 +265,7 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl) if (H5Pclose(fapl_new) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -412,7 +412,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) if (new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -462,7 +462,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) if (new_file_size != (file_size + TEST_BLOCK_SIZE30)) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -507,7 +507,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) if (new_file_size != (file_size + TEST_BLOCK_SIZE30)) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -556,7 +556,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) if (H5Pclose(fapl_new) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -698,7 +698,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) if (new_file_size != (file_size + TEST_BLOCK_SIZE30 + TEST_BLOCK_SIZE50)) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -762,7 +762,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) if (H5Pclose(fapl_new) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -951,7 +951,7 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl) if (new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -1047,7 +1047,7 @@ test_mf_fs_start(hid_t fapl) if (H5Pclose(fapl_new) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); return (0); @@ -1211,7 +1211,7 @@ test_mf_fs_alloc_free(hid_t fapl) if (new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); TESTING("H5MF_alloc()/H5MF_xfree() of free-space manager:test 2"); @@ -1297,7 +1297,7 @@ test_mf_fs_alloc_free(hid_t fapl) if (new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); TESTING("H5MF_alloc()/H5MF_xfree() of free-space manager:test 3"); @@ -1395,7 +1395,7 @@ test_mf_fs_alloc_free(hid_t fapl) if (H5Pclose(fapl_new) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); return (0); @@ -1605,7 +1605,7 @@ test_mf_fs_extend(hid_t fapl) if (new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); TESTING("H5MF_try_extend() of free-space manager:test 2"); @@ -1721,7 +1721,7 @@ test_mf_fs_extend(hid_t fapl) if (new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); TESTING("H5MF_try_extend() of free-space manager:test 3"); @@ -1837,7 +1837,7 @@ test_mf_fs_extend(hid_t fapl) if (new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); TESTING("H5MF_try_extend() of free-space manager:test 4"); @@ -1965,7 +1965,7 @@ test_mf_fs_extend(hid_t fapl) if (H5Pclose(fapl_new) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); return (0); @@ -2098,7 +2098,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -2176,7 +2176,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -2301,7 +2301,7 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) if (new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -2442,7 +2442,7 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) if (new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -2603,7 +2603,7 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) if (new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -2768,7 +2768,7 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) if (new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -2889,7 +2889,7 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl) if (new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -3047,7 +3047,7 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl) if (new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -3236,7 +3236,7 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) if (file_size != empty_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -3393,7 +3393,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) if (file_size != empty_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -3464,7 +3464,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) if (file_size != empty_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -3535,7 +3535,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) if (file_size != empty_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -3646,7 +3646,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) if (file_size != empty_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -3711,7 +3711,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) if (file_size != empty_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -3776,7 +3776,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) if (file_size != empty_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -3945,7 +3945,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if (new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -4002,7 +4002,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if (new_file_size != (file_size - TEST_BLOCK_SIZE50)) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -4062,7 +4062,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if (new_file_size != (file_size + TEST_BLOCK_SIZE30)) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -4212,7 +4212,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); TESTING("H5MF_alloc() of free-space manager with alignment: test 2"); @@ -4297,7 +4297,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); TESTING("H5MF_alloc() of free-space manager with alignment: test 3"); @@ -4381,7 +4381,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -4651,7 +4651,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -4943,7 +4943,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -5328,7 +5328,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -5538,7 +5538,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -5766,7 +5766,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -6079,7 +6079,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); @@ -6249,7 +6249,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl) if ((addr2 - addr1) != (3 * align)) TEST_ERROR - PASSED() + PASSED(); /* Close file */ if (H5Fclose(file) < 0) @@ -6343,7 +6343,7 @@ test_dichotomy(const char *env_h5_drvr, hid_t fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { SKIPPED(); diff --git a/test/testframe.c b/test/testframe.c index f44404e..016f208 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, January 6, 2004 * * Purpose: Provides support functions for the testing framework. diff --git a/testpar/Makefile.in b/testpar/Makefile.in index dfc1c85..38650de 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -435,17 +435,16 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/test -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -476,6 +475,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -503,8 +503,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -683,15 +681,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -747,7 +745,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1251,8 +1249,9 @@ uninstall-am: # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/testpar/t_init_term.c b/testpar/t_init_term.c index 5fc3074..1533765 100644 --- a/testpar/t_init_term.c +++ b/testpar/t_init_term.c @@ -62,7 +62,7 @@ main(int argc, char **argv) if (MAINPROCESS) { if (0 == nerrors) - PASSED() + PASSED(); else H5_FAILED() } diff --git a/testpar/t_pflush2.c b/testpar/t_pflush2.c index 95f54a1..c96233a 100644 --- a/testpar/t_pflush2.c +++ b/testpar/t_pflush2.c @@ -187,7 +187,7 @@ main(int argc, char *argv[]) goto error; } else if (mpi_rank == 0) { - PASSED() + PASSED(); } /* Check the case where the file was not flushed. This should give an error @@ -201,7 +201,7 @@ main(int argc, char *argv[]) h5_fixname(FILENAME[1], fapl_id2, name, sizeof(name)); if (check_test_file(name, fapl_id2)) { if (mpi_rank == 0) - PASSED() + PASSED(); } else { H5_FAILED() diff --git a/testpar/t_prestart.c b/testpar/t_prestart.c index 38eed4a..8c88d47 100644 --- a/testpar/t_prestart.c +++ b/testpar/t_prestart.c @@ -122,7 +122,7 @@ main(int argc, char **argv) if (MAINPROCESS) { if (0 == nerrors) - PASSED() + PASSED(); else H5_FAILED() } diff --git a/testpar/t_pshutdown.c b/testpar/t_pshutdown.c index 698c01f..a426c09 100644 --- a/testpar/t_pshutdown.c +++ b/testpar/t_pshutdown.c @@ -112,7 +112,7 @@ main(int argc, char **argv) if (MAINPROCESS) { if (0 == nerrors) - PASSED() + PASSED(); else H5_FAILED() } diff --git a/tools/Makefile.in b/tools/Makefile.in index 04e8140..cdf3233 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -405,16 +405,15 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -445,6 +444,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -472,8 +472,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -652,15 +650,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -700,7 +698,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1179,8 +1177,9 @@ uninstall-am: # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in index c3f9812..216399e 100644 --- a/tools/h5copy/Makefile.in +++ b/tools/h5copy/Makefile.in @@ -401,19 +401,18 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ # Include src and tools/lib directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/tools/lib -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -444,6 +443,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -471,8 +471,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -651,15 +649,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -702,7 +700,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1211,8 +1209,9 @@ uninstall-am: uninstall-binPROGRAMS # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c index 3144950..f618914 100644 --- a/tools/h5copy/h5copy.c +++ b/tools/h5copy/h5copy.c @@ -214,17 +214,13 @@ parse_flag(const char *s_flag, unsigned *flag) int main(int argc, const char *argv[]) { - H5E_auto2_t func; - H5E_auto2_t tools_func; - void * edata; - void * tools_edata; hid_t fid_src = H5I_INVALID_HID; hid_t fid_dst = H5I_INVALID_HID; unsigned flag = 0; unsigned verbose = 0; unsigned parents = 0; - hid_t ocpl_id = (-1); /* Object copy property list */ - hid_t lcpl_id = (-1); /* Link creation property list */ + hid_t ocpl_id = H5I_INVALID_HID; /* Object copy property list */ + hid_t lcpl_id = H5I_INVALID_HID; /* Link creation property list */ int opt; int li_ret; h5tool_link_info_t linkinfo; @@ -233,17 +229,9 @@ main(int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ h5tools_init(); - /* Disable tools error reporting */ - H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); - H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); - /* init linkinfo struct */ HDmemset(&linkinfo, 0, sizeof(h5tool_link_info_t)); @@ -337,10 +325,8 @@ main(int argc, const char *argv[]) leave(EXIT_FAILURE); } - if (enable_error_stack > 0) { - H5Eset_auto2(H5E_DEFAULT, func, edata); - H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); - } + /* enable error reporting if command line option */ + h5tools_error_report(); /*------------------------------------------------------------------------- * open output file @@ -349,13 +335,13 @@ main(int argc, const char *argv[]) /* Attempt to open an existing HDF5 file first. Need to open the dst file before the src file just in case that the dst and src are the same file */ - fid_dst = h5tools_fopen(fname_dst, H5F_ACC_RDWR, H5P_DEFAULT, NULL, NULL, 0); + fid_dst = h5tools_fopen(fname_dst, H5F_ACC_RDWR, H5P_DEFAULT, FALSE, NULL, 0); /*------------------------------------------------------------------------- * open input file *-------------------------------------------------------------------------*/ - fid_src = h5tools_fopen(fname_src, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, 0); + fid_src = h5tools_fopen(fname_src, H5F_ACC_RDONLY, H5P_DEFAULT, FALSE, NULL, 0); /*------------------------------------------------------------------------- * test for error in opening input file diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index 1af805e..ca321a4 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -59,14 +59,17 @@ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_comp_vl_strs.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr_v_level1.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr_v_level2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_enum_invalid_values.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/compounds_array_vlen1.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/compounds_array_vlen2.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/non_comparables1.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/non_comparables2.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/tudfilter.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/tudfilter2.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/diff_strings1.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/diff_strings2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_strings1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_strings2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_eps1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_eps2.h5 # tools/testfiles ${HDF5_TOOLS_DIR}/testfiles/tvlstr.h5 ) @@ -110,6 +113,7 @@ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_26.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_27.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_28.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_30.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_300.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_400.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_401.txt @@ -260,6 +264,8 @@ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_udfail.err ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_udfail.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_vlstr.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_vlstr.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_eps.txt ) set (LIST_WIN_TEST_FILES @@ -498,8 +504,11 @@ set (ATTR_VERBOSE_LEVEL_FILE1 h5diff_attr_v_level1.h5) set (ATTR_VERBOSE_LEVEL_FILE2 h5diff_attr_v_level2.h5) # strings - set (STRINGS1 diff_strings1.h5) - set (STRINGS2 diff_strings2.h5) + set (STRINGS1 h5diff_strings1.h5) + set (STRINGS2 h5diff_strings2.h5) + # epsilon + set (EPS1 h5diff_eps1.h5) + set (EPS2 h5diff_eps2.h5) if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run @@ -871,6 +880,8 @@ h5diff_90.out.err h5diff_vlstr.out h5diff_vlstr.out.err + h5diff_eps.out + h5diff_eps.out.err ) set_tests_properties (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (last_test) @@ -961,6 +972,15 @@ ADD_H5_TEST (h5diff_27 1 -v ${FILE3} ${FILE3} t1 t2) ADD_H5_TEST (h5diff_28 1 -v ${FILE3} ${FILE3} l1 l2) # ############################################################################## +# # Enum value tests (may become more comprehensive in the future) +# ############################################################################## + +# 3.0 +# test enum types which may have invalid values +ADD_H5_TEST (h5diff_30 1 -v h5diff_enum_invalid_values.h5 h5diff_enum_invalid_values.h5 dset1 dset2) + + +# ############################################################################## # # Dataset datatypes # ############################################################################## @@ -989,7 +1009,7 @@ ADD_H5_TEST (h5diff_56 1 -v ${FILE4} ${FILE4} dset6a dset6b) ADD_H5_TEST (h5diff_57 0 -v ${FILE4} ${FILE4} dset7a dset7b) # 5.8 (region reference) -ADD_H5_TEST (h5diff_58 1 -v ${FILE7} ${FILE8} refreg) +ADD_H5_TEST (h5diff_58 1 -v2 ${FILE7} ${FILE8} refreg) # test for both dset and attr with same type but with different size # ( HDDFV-7942 ) @@ -1040,6 +1060,9 @@ ADD_H5_TEST (h5diff_609 0 -d 200 ${FILE1} ${FILE2} g1/dset3 g1/dset4) # 6.10: number smaller than smallest difference ADD_H5_TEST (h5diff_610 1 -d 1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) +# eps: number smaller than epsilon +ADD_H5_TEST (h5diff_eps 0 -v3 -d 1e-16 ${EPS1} ${EPS2}) + # ############################################################################## # # -p # ############################################################################## @@ -1425,9 +1448,9 @@ ADD_H5_TEST (h5diff_484 0 -v --exclude-path "/dset3" ${EXCLUDE_FILE1_1} ${EXCLUD # Only one file contains unique objs. Common objs are same. # (HDFFV-7837) # -ADD_H5_TEST (h5diff_485 0 -v --exclude-path "/group1" h5diff_exclude3-1.h5 h5diff_exclude3-2.h5) -ADD_H5_TEST (h5diff_486 0 -v --exclude-path "/group1" h5diff_exclude3-2.h5 h5diff_exclude3-1.h5) -ADD_H5_TEST (h5diff_487 1 -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 h5diff_exclude3-2.h5) +ADD_H5_TEST (h5diff_485 0 -v --exclude-path "/group1" ${EXCLUDE_FILE3_1} ${EXCLUDE_FILE3_2}) +ADD_H5_TEST (h5diff_486 0 -v --exclude-path "/group1" ${EXCLUDE_FILE3_2} ${EXCLUDE_FILE3_1}) +ADD_H5_TEST (h5diff_487 1 -v --exclude-path "/group1/dset" ${EXCLUDE_FILE3_1} ${EXCLUDE_FILE3_2}) # ############################################################################## # # diff various multiple vlen and fixed strings in a compound type dataset @@ -1461,8 +1484,6 @@ ADD_H5_TEST (h5diff_646 1 -v --use-system-epsilon -p 0.05 ${FILE1} ${FILE2} /g1/ # ############################################################################## # # Test array variances # ############################################################################## -# -# Test with -d , -p and --use-system-epsilon. ADD_H5_TEST (h5diff_800 1 -v ${FILE7} ${FILE8} /g1/array /g1/array) ADD_H5_TEST (h5diff_801 1 -v ${FILE7} ${FILE8A} /g1/array /g1/array) diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index e3475bf..61fdb12 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -430,19 +430,18 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ # Include src and tools/lib directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/tools/lib -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -473,6 +472,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -500,8 +500,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -680,15 +678,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -754,7 +752,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1304,8 +1302,9 @@ uninstall-am: uninstall-binPROGRAMS # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c index 09ff30d..a34ebe9 100644 --- a/tools/h5diff/h5diff_common.c +++ b/tools/h5diff/h5diff_common.c @@ -25,7 +25,7 @@ static int check_d_input(const char *); * Command-line options: The user can specify short or long-named * parameters. */ -static const char * s_opts = "hVrv:qn:d:p:NcelxE:S"; +static const char * s_opts = "hVrv*qn:d:p:NcelxE:A:S"; static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"version", no_arg, 'V'}, {"report", no_arg, 'r'}, @@ -40,6 +40,7 @@ static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"follow-symlinks", no_arg, 'l'}, {"no-dangling-links", no_arg, 'x'}, {"exclude-path", require_arg, 'E'}, + {"exclude-attribute", require_arg, 'A'}, {"enable-error-stack", no_arg, 'S'}, {NULL, 0, '\0'}}; @@ -47,7 +48,6 @@ static struct long_options l_opts[] = {{"help", no_arg, 'h'}, * Function: check_options * * Purpose: parse command line input - * *------------------------------------------------------------------------- */ static void @@ -60,7 +60,7 @@ check_options(diff_opt_t *opts) /* check between -d , -p, --use-system-epsilon. * These options are mutually exclusive. */ - if ((opts->d + opts->p + opts->use_system_epsilon) > 1) { + if ((opts->delta_bool + opts->percent_bool + opts->use_system_epsilon) > 1) { HDprintf("%s error: -d, -p and --use-system-epsilon options are mutually-exclusive;\n", PROGRAMNAME); HDprintf("use no more than one.\n"); HDprintf("Try '-h' or '--help' option for more information or see the %s entry in the 'HDF5 " @@ -70,11 +70,128 @@ check_options(diff_opt_t *opts) } } +#if TRILABS_227 +/*------------------------------------------------------------------------- + * Function: parse_hsize_list + * + * Purpose: Parse a list of comma or space separated integers and return + * them in a list. The string being passed into this function + * should be at the start of the list you want to parse. You are + * responsible for freeing the array returned from here. + * + * Lists in the so-called "terse" syntax are separated by + * semicolons (;). The lists themselves can be separated by + * either commas (,) or white spaces. + * + * Return: + *------------------------------------------------------------------------- + */ +static void +parse_hsize_list(const char *h_list, subset_d *d) +{ + hsize_t * p_list; + const char * ptr; + unsigned int size_count = 0; + unsigned int i = 0; + unsigned int last_digit = 0; + + if (!h_list || !*h_list || *h_list == ';') + return; + + H5TOOLS_START_DEBUG(" - h_list:%s", h_list); + /* count how many integers do we have */ + for (ptr = h_list; ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++) + if (HDisdigit(*ptr)) { + if (!last_digit) + /* the last read character wasn't a digit */ + size_count++; + + last_digit = 1; + } + else + last_digit = 0; + + if (size_count == 0) { + /* there aren't any integers to read */ + H5TOOLS_ENDDEBUG("No integers to read"); + return; + } + H5TOOLS_DEBUG("Number integers to read=%ld", size_count); + + /* allocate an array for the integers in the list */ + if ((p_list = (hsize_t *)HDcalloc(size_count, sizeof(hsize_t))) == NULL) + H5TOOLS_INFO("Unable to allocate space for subset data"); + + for (ptr = h_list; i < size_count && ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++) + if (HDisdigit(*ptr)) { + /* we should have an integer now */ + p_list[i++] = (hsize_t)HDstrtoull(ptr, NULL, 0); + + while (HDisdigit(*ptr)) + /* scroll to end of integer */ + ptr++; + } + d->data = p_list; + d->len = size_count; + H5TOOLS_ENDDEBUG(""); +} + +/*------------------------------------------------------------------------- + * Function: parse_subset_params + * + * Purpose: Parse the so-called "terse" syntax for specifying subsetting parameters. + * + * Return: Success: struct subset_t object + * Failure: NULL + *------------------------------------------------------------------------- + */ +static struct subset_t * +parse_subset_params(const char *dset) +{ + struct subset_t *s = NULL; + char * brace; + + H5TOOLS_START_DEBUG(" - dset:%s", dset); + if ((brace = HDstrrchr(dset, '[')) != NULL) { + *brace++ = '\0'; + + s = (struct subset_t *)HDcalloc(1, sizeof(struct subset_t)); + parse_hsize_list(brace, &s->start); + + while (*brace && *brace != ';') + brace++; + + if (*brace) + brace++; + + parse_hsize_list(brace, &s->stride); + + while (*brace && *brace != ';') + brace++; + + if (*brace) + brace++; + + parse_hsize_list(brace, &s->count); + + while (*brace && *brace != ';') + brace++; + + if (*brace) + brace++; + + parse_hsize_list(brace, &s->block); + } + H5TOOLS_ENDDEBUG(""); + + return s; +} +#endif + /*------------------------------------------------------------------------- * Function: parse_command_line * * Purpose: parse command line input - * *------------------------------------------------------------------------- */ @@ -85,9 +202,11 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char int i; int opt; struct exclude_path_list *exclude_head, *exclude_prev, *exclude_node; + struct exclude_path_list *exclude_attr_head, *exclude_attr_prev, *exclude_attr_node; + H5TOOLS_START_DEBUG(""); /* process the command-line */ - memset(opts, 0, sizeof(diff_opt_t)); + HDmemset(opts, 0, sizeof(diff_opt_t)); /* assume equal contents initially */ opts->contents = 1; @@ -96,7 +215,7 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char opts->do_nans = 1; /* not Listing objects that are not comparable */ - opts->m_list_not_cmp = 0; + opts->mode_list_not_cmp = 0; /* initially no not-comparable. */ /**this is bad in mixing option with results**/ @@ -105,6 +224,9 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char /* init for exclude-path option */ exclude_head = NULL; + /* init for exclude-attribute option */ + exclude_attr_head = NULL; + /* parse command line options */ while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { @@ -124,45 +246,39 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char break; case 'v': - opts->m_verbose = 1; - /* This for loop is for handling style like - * -v, -v1, --verbose, --verbose=1. - */ + opts->mode_verbose = 1; for (i = 1; i < argc; i++) { /* - * short opt + * special check for short opt */ - if (!strcmp(argv[i], "-v")) { /* no arg */ - opt_ind--; - opts->m_verbose_level = 0; + if (!strcmp(argv[i], "-v")) { + if (opt_arg != NULL) + opt_ind--; + opts->mode_verbose_level = 0; break; } else if (!strncmp(argv[i], "-v", (size_t)2)) { - opts->m_verbose_level = atoi(&argv[i][2]); + if (opt_arg != NULL) + opt_ind--; + opts->mode_verbose_level = atoi(&argv[i][2]); break; } - - /* - * long opt - */ - if (!strcmp(argv[i], "--verbose")) { /* no arg */ - opts->m_verbose_level = 0; - break; - } - else if (!strncmp(argv[i], "--verbose", (size_t)9) && argv[i][9] == '=') { - opts->m_verbose_level = atoi(&argv[i][10]); - break; + else { + if (opt_arg != NULL) + opts->mode_verbose_level = HDatoi(opt_arg); + else + opts->mode_verbose_level = 0; } } break; case 'q': /* use quiet mode; supress the message "0 differences found" */ - opts->m_quiet = 1; + opts->mode_quiet = 1; break; case 'r': - opts->m_report = 1; + opts->mode_report = 1; break; case 'l': @@ -188,7 +304,7 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char } /* init */ - exclude_node->obj_path = (char *)opt_arg; + exclude_node->obj_path = opt_arg; exclude_node->obj_type = H5TRAV_TYPE_UNKNOWN; exclude_prev = exclude_head; @@ -205,37 +321,62 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char } break; + case 'A': + opts->exclude_attr_path = 1; + + /* create linked list of excluding objects */ + if ((exclude_attr_node = + (struct exclude_path_list *)HDmalloc(sizeof(struct exclude_path_list))) == NULL) { + HDprintf("Error: lack of memory!\n"); + h5diff_exit(EXIT_FAILURE); + } + + /* init */ + exclude_attr_node->obj_path = opt_arg; + exclude_attr_node->obj_type = H5TRAV_TYPE_UNKNOWN; + exclude_attr_prev = exclude_attr_head; + + if (NULL == exclude_attr_head) { + exclude_attr_head = exclude_attr_node; + exclude_attr_head->next = NULL; + } + else { + while (NULL != exclude_attr_prev->next) + exclude_attr_prev = exclude_attr_prev->next; + + exclude_attr_node->next = NULL; + exclude_attr_prev->next = exclude_attr_node; + } + break; + case 'd': - opts->d = 1; + opts->delta_bool = 1; if (check_d_input(opt_arg) == -1) { HDprintf("<-d %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); } - opts->delta = atof(opt_arg); - - /* -d 0 is the same as default */ - if (H5_DBL_ABS_EQUAL(opts->delta, (double)0.0F)) - opts->d = 0; + opts->delta = HDatof(opt_arg); + /* do not check against default, the DBL_EPSILON is being replaced by user */ break; case 'p': - opts->p = 1; + opts->percent_bool = 1; if (check_p_input(opt_arg) == -1) { HDprintf("<-p %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); } - opts->percent = atof(opt_arg); + opts->percent = HDatof(opt_arg); /* -p 0 is the same as default */ if (H5_DBL_ABS_EQUAL(opts->percent, (double)0.0F)) - opts->p = 0; + opts->percent_bool = 0; break; case 'n': - opts->n = 1; + opts->count_bool = 1; if (check_n_input(opt_arg) == -1) { HDprintf("<-n %s> is not a valid option\n", opt_arg); usage(); @@ -249,7 +390,7 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char break; case 'c': - opts->m_list_not_cmp = 1; + opts->mode_list_not_cmp = 1; break; case 'e': @@ -265,6 +406,10 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char if (opts->exclude_path) opts->exclude = exclude_head; + /* if exclude-attribute option is used, keep the exclude attr list */ + if (opts->exclude_attr_path) + opts->exclude_attr = exclude_attr_head; + /* check for file names to be processed */ if (argc <= opt_ind || argv[opt_ind + 1] == NULL) { error_msg("missing file names\n"); @@ -275,11 +420,15 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char *fname1 = argv[opt_ind]; *fname2 = argv[opt_ind + 1]; *objname1 = argv[opt_ind + 2]; + H5TOOLS_DEBUG("file1 = %s", *fname1); + H5TOOLS_DEBUG("file2 = %s", *fname2); if (*objname1 == NULL) { *objname2 = NULL; + H5TOOLS_ENDDEBUG("No obj names"); return; } + H5TOOLS_DEBUG("objname1 = %s", *objname1); if (argv[opt_ind + 3] != NULL) { *objname2 = argv[opt_ind + 3]; @@ -287,33 +436,45 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char else { *objname2 = *objname1; } + H5TOOLS_DEBUG("objname2 = %s", *objname2); + + /* + * TRILABS_227 is complete except for an issue with printing indices + * the following calls will enable subsetting + */ +#if TRILABS_227 + opts->sset[0] = parse_subset_params(*objname1); + + opts->sset[1] = parse_subset_params(*objname2); +#endif + + H5TOOLS_ENDDEBUG(""); } /*------------------------------------------------------------------------- * Function: print_info * * Purpose: print several information messages after h5diff call - * *------------------------------------------------------------------------- */ void print_info(diff_opt_t *opts) { - if (opts->m_quiet || opts->err_stat) + if (opts->mode_quiet || opts->err_stat) return; if (opts->cmn_objs == 0) { HDprintf("No common objects found. Files are not comparable.\n"); - if (!opts->m_verbose) + if (!opts->mode_verbose) HDprintf("Use -v for a list of objects.\n"); } if (opts->not_cmp == 1) { - if (opts->m_list_not_cmp == 0) { + if (opts->mode_list_not_cmp == 0) { HDprintf("--------------------------------\n"); HDprintf("Some objects are not comparable\n"); HDprintf("--------------------------------\n"); - if (opts->m_verbose) + if (opts->mode_verbose) HDprintf("Use -c for a list of objects without details of differences.\n"); else HDprintf("Use -c for a list of objects.\n"); @@ -327,15 +488,6 @@ print_info(diff_opt_t *opts) * Purpose: check for valid input * * Return: 1 for ok, -1 for fail - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: May 9, 2003 - * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -362,13 +514,6 @@ check_n_input(const char *str) * Purpose: check for a valid p option input * * Return: 1 for ok, -1 for fail - * - * Date: May 9, 2003 - * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -377,13 +522,13 @@ check_p_input(const char *str) double x; /* - the atof return value on a hexadecimal input is different - on some systems; we do a character check for this - */ + * the atof return value on a hexadecimal input is different + * on some systems; we do a character check for this + */ if (HDstrlen(str) > 2 && str[0] == '0' && str[1] == 'x') return -1; - x = atof(str); + x = HDatof(str); if (x < 0) return -1; @@ -396,13 +541,6 @@ check_p_input(const char *str) * Purpose: check for a valid d option input * * Return: 1 for ok, -1 for fail - * - * Date: November 11, 2007 - * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -411,13 +549,13 @@ check_d_input(const char *str) double x; /* - the atof return value on a hexadecimal input is different - on some systems; we do a character check for this - */ + * the atof return value on a hexadecimal input is different + * on some systems; we do a character check for this + */ if (HDstrlen(str) > 2 && str[0] == '0' && str[1] == 'x') return -1; - x = atof(str); + x = HDatof(str); if (x < 0) return -1; @@ -430,7 +568,6 @@ check_d_input(const char *str) * Purpose: print a usage message * * Return: void - * *------------------------------------------------------------------------- */ @@ -458,10 +595,11 @@ usage(void) " Verbose mode with level. Print differences and list of objects.\n"); PRINTVALSTREAM(rawoutstream, " Level of detail depends on value of N:\n"); PRINTVALSTREAM(rawoutstream, " 0 : Identical to '-v' or '--verbose'.\n"); - PRINTVALSTREAM(rawoutstream, " 1 : All level 0 information plus one-line attribute\n"); - PRINTVALSTREAM(rawoutstream, " status summary.\n"); - PRINTVALSTREAM(rawoutstream, " 2 : All level 1 information plus extended attribute\n"); - PRINTVALSTREAM(rawoutstream, " status report.\n"); + PRINTVALSTREAM(rawoutstream, + " 1 : All level 0 information plus one-line attribute status summary.\n"); + PRINTVALSTREAM(rawoutstream, + " 2 : All level 1 information plus extended attribute status report.\n"); + PRINTVALSTREAM(rawoutstream, " 3 : All level 2 information plus file names.\n"); PRINTVALSTREAM(rawoutstream, " -q, --quiet\n"); PRINTVALSTREAM(rawoutstream, " Quiet mode. Do not produce output.\n"); PRINTVALSTREAM(rawoutstream, " --enable-error-stack\n"); @@ -574,7 +712,18 @@ usage(void) PRINTVALSTREAM(rawoutstream, " excluded.\n"); PRINTVALSTREAM(rawoutstream, " This option can be used repeatedly to exclude multiple paths.\n"); PRINTVALSTREAM(rawoutstream, "\n"); - + PRINTVALSTREAM(rawoutstream, " --exclude-attribute \"path/to/object/with/attribute\"\n"); + PRINTVALSTREAM( + rawoutstream, + " Exclude attributes on the specified path to an object when comparing files or groups.\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, + " If there are multiple paths to an object, only the specified path(s)\n"); + PRINTVALSTREAM(rawoutstream, + " will be excluded; the comparison will include any path not explicitly\n"); + PRINTVALSTREAM(rawoutstream, " excluded.\n"); + PRINTVALSTREAM(rawoutstream, " This option can be used repeatedly to exclude multiple paths.\n"); + PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " Modes of output:\n"); PRINTVALSTREAM(rawoutstream, " Default mode: print the number of differences found and where they occured\n"); @@ -614,7 +763,22 @@ usage(void) PRINTVALSTREAM(rawoutstream, " (The option --follow-symlinks overrides the default behavior when\n"); PRINTVALSTREAM(rawoutstream, " symbolic links are compared.).\n"); PRINTVALSTREAM(rawoutstream, "\n"); - + /* + * TRILABS_227 is complete except for an issue with printing indices + * the following will be needed for subsetting + PRINTVALSTREAM(rawoutstream, " Subsetting options:\n"); + PRINTVALSTREAM(rawoutstream, " Subsetting is available by using the fcompact form of subsetting, as + follows:\n"); PRINTVALSTREAM(rawoutstream, " obj1 /foo/mydataset[START;STRIDE;COUNT;BLOCK]\n"); + PRINTVALSTREAM(rawoutstream, " It is not required to use all parameters, but until the last parameter + value used,\n"); PRINTVALSTREAM(rawoutstream, " all of the semicolons (;) are required, even when a + parameter value is not specified. Example:\n"); PRINTVALSTREAM(rawoutstream, " obj1 + /foo/mydataset[START;;COUNT;BLOCK]\n"); PRINTVALSTREAM(rawoutstream, " obj1 /foo/mydataset[START]\n"); + PRINTVALSTREAM(rawoutstream, " The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 + in\n"); PRINTVALSTREAM(rawoutstream, " each dimension. START is optional and will default to 0 in each + dimension.\n"); PRINTVALSTREAM(rawoutstream, " Each of START, STRIDE, COUNT, and BLOCK must be a + comma-separated list of integers with\n"); PRINTVALSTREAM(rawoutstream, " one integer for each dimension + of the dataset.\n"); PRINTVALSTREAM(rawoutstream, "\n"); + */ PRINTVALSTREAM(rawoutstream, " Exit code:\n"); PRINTVALSTREAM(rawoutstream, " 0 if no differences, 1 if differences found, 2 if error\n"); PRINTVALSTREAM(rawoutstream, "\n"); diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index 64f9fcf..a835953 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -25,7 +25,7 @@ * Return: An exit status of 0 means no differences were found, 1 means some * differences were found. * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: May 9, 2003 * @@ -68,10 +68,7 @@ int main(int argc, const char *argv[]) { int ret; - H5E_auto2_t func; - H5E_auto2_t tools_func; - void * edata; - void * tools_edata; + int i; const char *fname1 = NULL; const char *fname2 = NULL; const char *objname1 = NULL; @@ -82,27 +79,17 @@ main(int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ h5tools_init(); - /* Disable tools error reporting */ - H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); - H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); - /*------------------------------------------------------------------------- * process the command-line *------------------------------------------------------------------------- */ parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts); - if (enable_error_stack > 0) { - H5Eset_auto2(H5E_DEFAULT, func, edata); - H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); - } + /* enable error reporting if command line option */ + h5tools_error_report(); /*------------------------------------------------------------------------- * do the diff @@ -129,6 +116,23 @@ main(int argc, const char *argv[]) if (opts.err_stat) ret = 2; + /* free any buffers */ + for (i = 0; i < 2; i++) { + if (opts.sset[i]) { + if (opts.sset[i]->start.data) + HDfree(opts.sset[i]->start.data); + if (opts.sset[i]->stride.data) + HDfree(opts.sset[i]->stride.data); + if (opts.sset[i]->count.data) + HDfree(opts.sset[i]->count.data); + if (opts.sset[i]->block.data) + HDfree(opts.sset[i]->block.data); + + HDfree(opts.sset[i]); + opts.sset[i] = NULL; + } + } + h5diff_exit(ret); } diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index f3b5304..eb967e1 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -31,7 +31,7 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); * * Purpose: generate files for h5diff testing * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: November 12, 2003 * @@ -92,8 +92,11 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); #define NON_COMPARBLES1 "non_comparables1.h5" #define NON_COMPARBLES2 "non_comparables2.h5" /* string dataset and attribute */ -#define DIFF_STRINGS1 "diff_strings1.h5" -#define DIFF_STRINGS2 "diff_strings2.h5" +#define DIFF_STRINGS1 "h5diff_strings1.h5" +#define DIFF_STRINGS2 "h5diff_strings2.h5" +/* double dataset and epsilon */ +#define DIFF_EPS1 "h5diff_eps1.h5" +#define DIFF_EPS2 "h5diff_eps2.h5" #define UIMAX 4294967295u /*Maximum value for a variable of type unsigned int */ #define STR_SIZE 3 @@ -109,10 +112,10 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); /* Error macros */ #define AT() HDprintf("ERROR at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); #define PROGRAM_ERROR \ - { \ + do { \ AT(); \ goto error; \ - } + } while (0) /* A UD link traversal function. Shouldn't actually be called. */ static hid_t @@ -171,6 +174,7 @@ static void test_comps_vlen_arry(const char *fname, const char *dset, const char static void test_data_nocomparables(const char *fname, int diff); static void test_objs_nocomparables(const char *fname1, const char *fname2); static void test_objs_strings(const char *fname, const char *fname2); +static void test_double_epsilon(const char *fname1, const char *fname2); /* called by test_attributes() and test_datasets() */ static void write_attr_strings(hid_t loc_id, const char *dset_name, hid_t fid, int make_diffs); @@ -278,6 +282,9 @@ main(void) /* string dataset and attribute. HDFFV-10028 */ test_objs_strings(DIFF_STRINGS1, DIFF_STRINGS2); + /* double dataset and epsilion. HDFFV-10897 */ + test_double_epsilon(DIFF_EPS1, DIFF_EPS2); + return EXIT_SUCCESS; } @@ -293,8 +300,8 @@ main(void) static int test_basic(const char *fname1, const char *fname2, const char *fname3) { - hid_t fid1 = -1, fid2 = H5I_INVALID_HID; - hid_t gid1 = -1, gid2 = -1, gid3 = H5I_INVALID_HID; + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; + hid_t gid1 = H5I_INVALID_HID, gid2 = H5I_INVALID_HID, gid3 = H5I_INVALID_HID; hsize_t dims1[1] = {6}; hsize_t dims2[2] = {3, 2}; @@ -409,12 +416,12 @@ test_basic(const char *fname1, const char *fname2, const char *fname3) /* epsilon = 0.0000000000000001 = 1e-16 * system epsilon for double : DBL_EPSILON = 2.22045E-16 */ - double data13[3][2] = {{H5_DOUBLE(0.0000000000000000), H5_DOUBLE(0.0000000000000001)}, - {H5_DOUBLE(0.0000000000000001), H5_DOUBLE(0.0000000000000000)}, - {H5_DOUBLE(0.00000000000000033), H5_DOUBLE(0.0000000000000001)}}; - double data14[3][2] = {{H5_DOUBLE(0.0000000000000000), H5_DOUBLE(0.0000000000000004)}, - {H5_DOUBLE(0.0000000000000002), H5_DOUBLE(0.0000000000000001)}, - {H5_DOUBLE(0.0000000000000001), H5_DOUBLE(0.00000000000000000)}}; + double data13[3][2] = {{0.0000000000000000, 0.0000000000000001}, + {0.0000000000000001, 0.0000000000000000}, + {0.00000000000000033, 0.0000000000000001}}; + double data14[3][2] = {{0.0000000000000000, 0.0000000000000004}, + {0.0000000000000002, 0.0000000000000001}, + {0.0000000000000001, 0.00000000000000000}}; write_dset(gid1, 2, dims2, "fp1", H5T_NATIVE_FLOAT, data11); write_dset(gid1, 2, dims2, "fp2", H5T_NATIVE_FLOAT, data12); @@ -1010,14 +1017,14 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2) { herr_t status = SUCCEED; - hid_t fid1 = -1, fid2 = H5I_INVALID_HID; - hid_t f1_gid = -1, f2_gid = H5I_INVALID_HID; - hid_t f1_gid2 = -1, f2_gid2 = H5I_INVALID_HID; - hid_t f1_gid3 = -1, f2_gid3 = H5I_INVALID_HID; - hid_t f1_gid4 = -1, f2_gid4 = H5I_INVALID_HID; - hid_t f1_did = -1, f2_did = H5I_INVALID_HID; - hid_t f1_sid = -1, f2_sid = H5I_INVALID_HID; - hid_t f1_tid = -1, f2_tid = H5I_INVALID_HID; + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; + hid_t f1_gid = H5I_INVALID_HID, f2_gid = H5I_INVALID_HID; + hid_t f1_gid2 = H5I_INVALID_HID, f2_gid2 = H5I_INVALID_HID; + hid_t f1_gid3 = H5I_INVALID_HID, f2_gid3 = H5I_INVALID_HID; + hid_t f1_gid4 = H5I_INVALID_HID, f2_gid4 = H5I_INVALID_HID; + hid_t f1_did = H5I_INVALID_HID, f2_did = H5I_INVALID_HID; + hid_t f1_sid = H5I_INVALID_HID, f2_sid = H5I_INVALID_HID; + hid_t f1_tid = H5I_INVALID_HID, f2_tid = H5I_INVALID_HID; /* dset */ hsize_t dset_dims[1] = {3}; int dset_data[3] = {0, 1, 2}; @@ -4816,73 +4823,73 @@ test_objs_nocomparables(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ /* file1 */ if ((fid1 = H5Fopen(fname1, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /* file2 */ if ((fid2 = H5Fopen(fname2, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /*----------------------------------------------------------------------- * in file1 : add member objects *------------------------------------------------------------------------*/ /* parent group */ if ((topgid1 = H5Gcreate2(fid1, "diffobjtypes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /* dataset */ if (write_dset(topgid1, 1, dims, "obj1", H5T_NATIVE_INT, data1) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /* group */ if ((gid1 = H5Gcreate2(topgid1, "obj2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /* committed type */ if ((tid1 = H5Tcopy(H5T_NATIVE_INT)) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; if (H5Tcommit2(topgid1, "obj3", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /*----------------------------------------------------------------------- * in file2 : add member objects *------------------------------------------------------------------------*/ /* parent group */ if ((topgid2 = H5Gcreate2(fid2, "diffobjtypes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /* group */ if ((gid2 = H5Gcreate2(topgid2, "obj1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /* committed type */ if ((tid2 = H5Tcopy(H5T_NATIVE_INT)) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; if (H5Tcommit2(topgid2, "obj2", tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /* dataset */ if (write_dset(topgid2, 1, dims, "obj3", H5T_NATIVE_INT, data2) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /*----------------------------------------------------------------------- * Close IDs *-----------------------------------------------------------------------*/ if (H5Fclose(fid1) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; if (H5Fclose(fid2) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; if (H5Gclose(topgid1) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; if (H5Gclose(topgid2) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; if (H5Gclose(gid1) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; if (H5Gclose(gid2) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; if (H5Tclose(tid1) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; if (H5Tclose(tid2) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; return; @@ -7897,6 +7904,61 @@ out: return -1; } +/* + * Function: test_double_epsilion + * + * Purpose: Create test files to compare data with epsilion + */ +static void +test_double_epsilon(const char *fname1, const char *fname2) +{ + hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; + hsize_t dims1[2] = {4, 7}; + double wdata[4][7]; + int i, j; + + /*------------------------------------------------------------------------- + * create two files + *------------------------------------------------------------------------- + */ + if ((fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + PROGRAM_ERROR; + if ((fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + PROGRAM_ERROR; + + /* + * Initialize data. + */ + for (i = 0; i < 4; i++) + for (j = 0; j < 7; j++) + wdata[i][j] = 0.0; + + /* dataset */ + if (write_dset(fid1, 2, dims1, "dataset", H5T_IEEE_F64LE, wdata) < 0) + PROGRAM_ERROR; + + /* + * Initialize data. + */ + for (i = 0; i < 4; i++) + for (j = 0; j < 7; j++) + wdata[i][j] = (double)1.e-19; + + /* dataset */ + if (write_dset(fid2, 2, dims1, "dataset", H5T_IEEE_F64LE, wdata) < 0) + PROGRAM_ERROR; + +error: + H5E_BEGIN_TRY + { + H5Fclose(fid1); + H5Fclose(fid2); + } + H5E_END_TRY; + + return; +} + /*------------------------------------------------------------------------- * Function: write_attr * @@ -7952,22 +8014,22 @@ write_dset(hid_t loc_id, int rank, hsize_t *dims, const char *name, hid_t tid, v /* create a space */ if ((sid = H5Screate_simple(rank, dims, NULL)) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /* create the dataset */ if ((did = H5Dcreate2(loc_id, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /* write */ if (buf) if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; /* close */ if (H5Dclose(did) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; if (H5Sclose(sid) < 0) - PROGRAM_ERROR + PROGRAM_ERROR; return SUCCEED; diff --git a/tools/h5diff/ph5diff_main.c b/tools/h5diff/ph5diff_main.c index 60e6dab..ec78e49 100644 --- a/tools/h5diff/ph5diff_main.c +++ b/tools/h5diff/ph5diff_main.c @@ -31,7 +31,7 @@ static void ph5diff_worker(int); * Return: An exit status of 0 means no differences were found, 1 means some * differences were found. * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: May 9, 2003 * diff --git a/tools/h5diff/testfiles/diff_strings1.h5 b/tools/h5diff/testfiles/diff_strings1.h5 deleted file mode 100644 index 8839f5a..0000000 Binary files a/tools/h5diff/testfiles/diff_strings1.h5 and /dev/null differ diff --git a/tools/h5diff/testfiles/diff_strings2.h5 b/tools/h5diff/testfiles/diff_strings2.h5 deleted file mode 100644 index 810278c..0000000 Binary files a/tools/h5diff/testfiles/diff_strings2.h5 and /dev/null differ diff --git a/tools/h5diff/testfiles/h5diff_10.txt b/tools/h5diff/testfiles/h5diff_10.txt index 11ad800..0618705 100644 --- a/tools/h5diff/testfiles/h5diff_10.txt +++ b/tools/h5diff/testfiles/h5diff_10.txt @@ -17,10 +17,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Verbose mode with level. Print differences and list of objects. Level of detail depends on value of N: 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. + 1 : All level 0 information plus one-line attribute status summary. + 2 : All level 1 information plus extended attribute status report. + 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. --enable-error-stack @@ -97,6 +96,14 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] excluded. This option can be used repeatedly to exclude multiple paths. + --exclude-attribute "path/to/object/with/attribute" + Exclude attributes on the specified path to an object when comparing files or groups. + + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. + Modes of output: Default mode: print the number of differences found and where they occured -r Report mode: print the above plus the differences diff --git a/tools/h5diff/testfiles/h5diff_58.txt b/tools/h5diff/testfiles/h5diff_58.txt index d27a0c9..da147bc 100644 --- a/tools/h5diff/testfiles/h5diff_58.txt +++ b/tools/h5diff/testfiles/h5diff_58.txt @@ -1,3 +1,4 @@ + dataset: and Referenced dataset 10784 10784 ------------------------------------------------------------ @@ -8,4 +9,7 @@ point #1 (2,2) (3,3) point #3 (1,6) (2,5) point #4 (2,8) (1,7) 4 differences found + obj1 obj2 + -------------------------------------- +Attributes status: 0 common, 0 only in obj1, 0 only in obj2 EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_600.txt b/tools/h5diff/testfiles/h5diff_600.txt index 13d627c..98c80be 100644 --- a/tools/h5diff/testfiles/h5diff_600.txt +++ b/tools/h5diff/testfiles/h5diff_600.txt @@ -17,10 +17,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Verbose mode with level. Print differences and list of objects. Level of detail depends on value of N: 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. + 1 : All level 0 information plus one-line attribute status summary. + 2 : All level 1 information plus extended attribute status report. + 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. --enable-error-stack @@ -97,6 +96,14 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] excluded. This option can be used repeatedly to exclude multiple paths. + --exclude-attribute "path/to/object/with/attribute" + Exclude attributes on the specified path to an object when comparing files or groups. + + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. + Modes of output: Default mode: print the number of differences found and where they occured -r Report mode: print the above plus the differences diff --git a/tools/h5diff/testfiles/h5diff_603.txt b/tools/h5diff/testfiles/h5diff_603.txt index 0d6b474..a5bb805 100644 --- a/tools/h5diff/testfiles/h5diff_603.txt +++ b/tools/h5diff/testfiles/h5diff_603.txt @@ -18,10 +18,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Verbose mode with level. Print differences and list of objects. Level of detail depends on value of N: 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. + 1 : All level 0 information plus one-line attribute status summary. + 2 : All level 1 information plus extended attribute status report. + 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. --enable-error-stack @@ -98,6 +97,14 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] excluded. This option can be used repeatedly to exclude multiple paths. + --exclude-attribute "path/to/object/with/attribute" + Exclude attributes on the specified path to an object when comparing files or groups. + + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. + Modes of output: Default mode: print the number of differences found and where they occured -r Report mode: print the above plus the differences diff --git a/tools/h5diff/testfiles/h5diff_606.txt b/tools/h5diff/testfiles/h5diff_606.txt index 94f44e8..4782e17 100644 --- a/tools/h5diff/testfiles/h5diff_606.txt +++ b/tools/h5diff/testfiles/h5diff_606.txt @@ -18,10 +18,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Verbose mode with level. Print differences and list of objects. Level of detail depends on value of N: 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. + 1 : All level 0 information plus one-line attribute status summary. + 2 : All level 1 information plus extended attribute status report. + 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. --enable-error-stack @@ -98,6 +97,14 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] excluded. This option can be used repeatedly to exclude multiple paths. + --exclude-attribute "path/to/object/with/attribute" + Exclude attributes on the specified path to an object when comparing files or groups. + + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. + Modes of output: Default mode: print the number of differences found and where they occured -r Report mode: print the above plus the differences diff --git a/tools/h5diff/testfiles/h5diff_612.txt b/tools/h5diff/testfiles/h5diff_612.txt index 7f83c64..ee40713 100644 --- a/tools/h5diff/testfiles/h5diff_612.txt +++ b/tools/h5diff/testfiles/h5diff_612.txt @@ -18,10 +18,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Verbose mode with level. Print differences and list of objects. Level of detail depends on value of N: 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. + 1 : All level 0 information plus one-line attribute status summary. + 2 : All level 1 information plus extended attribute status report. + 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. --enable-error-stack @@ -98,6 +97,14 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] excluded. This option can be used repeatedly to exclude multiple paths. + --exclude-attribute "path/to/object/with/attribute" + Exclude attributes on the specified path to an object when comparing files or groups. + + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. + Modes of output: Default mode: print the number of differences found and where they occured -r Report mode: print the above plus the differences diff --git a/tools/h5diff/testfiles/h5diff_615.txt b/tools/h5diff/testfiles/h5diff_615.txt index 3cfe6b9..5504812 100644 --- a/tools/h5diff/testfiles/h5diff_615.txt +++ b/tools/h5diff/testfiles/h5diff_615.txt @@ -18,10 +18,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Verbose mode with level. Print differences and list of objects. Level of detail depends on value of N: 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. + 1 : All level 0 information plus one-line attribute status summary. + 2 : All level 1 information plus extended attribute status report. + 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. --enable-error-stack @@ -98,6 +97,14 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] excluded. This option can be used repeatedly to exclude multiple paths. + --exclude-attribute "path/to/object/with/attribute" + Exclude attributes on the specified path to an object when comparing files or groups. + + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. + Modes of output: Default mode: print the number of differences found and where they occured -r Report mode: print the above plus the differences diff --git a/tools/h5diff/testfiles/h5diff_621.txt b/tools/h5diff/testfiles/h5diff_621.txt index 9c34945..e4dba56 100644 --- a/tools/h5diff/testfiles/h5diff_621.txt +++ b/tools/h5diff/testfiles/h5diff_621.txt @@ -18,10 +18,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Verbose mode with level. Print differences and list of objects. Level of detail depends on value of N: 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. + 1 : All level 0 information plus one-line attribute status summary. + 2 : All level 1 information plus extended attribute status report. + 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. --enable-error-stack @@ -98,6 +97,14 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] excluded. This option can be used repeatedly to exclude multiple paths. + --exclude-attribute "path/to/object/with/attribute" + Exclude attributes on the specified path to an object when comparing files or groups. + + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. + Modes of output: Default mode: print the number of differences found and where they occured -r Report mode: print the above plus the differences diff --git a/tools/h5diff/testfiles/h5diff_622.txt b/tools/h5diff/testfiles/h5diff_622.txt index 2b2df2f..0e7ffa3 100644 --- a/tools/h5diff/testfiles/h5diff_622.txt +++ b/tools/h5diff/testfiles/h5diff_622.txt @@ -18,10 +18,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Verbose mode with level. Print differences and list of objects. Level of detail depends on value of N: 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. + 1 : All level 0 information plus one-line attribute status summary. + 2 : All level 1 information plus extended attribute status report. + 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. --enable-error-stack @@ -98,6 +97,14 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] excluded. This option can be used repeatedly to exclude multiple paths. + --exclude-attribute "path/to/object/with/attribute" + Exclude attributes on the specified path to an object when comparing files or groups. + + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. + Modes of output: Default mode: print the number of differences found and where they occured -r Report mode: print the above plus the differences diff --git a/tools/h5diff/testfiles/h5diff_623.txt b/tools/h5diff/testfiles/h5diff_623.txt index 3e80438..bb70458 100644 --- a/tools/h5diff/testfiles/h5diff_623.txt +++ b/tools/h5diff/testfiles/h5diff_623.txt @@ -18,10 +18,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Verbose mode with level. Print differences and list of objects. Level of detail depends on value of N: 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. + 1 : All level 0 information plus one-line attribute status summary. + 2 : All level 1 information plus extended attribute status report. + 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. --enable-error-stack @@ -98,6 +97,14 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] excluded. This option can be used repeatedly to exclude multiple paths. + --exclude-attribute "path/to/object/with/attribute" + Exclude attributes on the specified path to an object when comparing files or groups. + + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. + Modes of output: Default mode: print the number of differences found and where they occured -r Report mode: print the above plus the differences diff --git a/tools/h5diff/testfiles/h5diff_624.txt b/tools/h5diff/testfiles/h5diff_624.txt index 7a2f585..cb30023 100644 --- a/tools/h5diff/testfiles/h5diff_624.txt +++ b/tools/h5diff/testfiles/h5diff_624.txt @@ -18,10 +18,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] Verbose mode with level. Print differences and list of objects. Level of detail depends on value of N: 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. + 1 : All level 0 information plus one-line attribute status summary. + 2 : All level 1 information plus extended attribute status report. + 3 : All level 2 information plus file names. -q, --quiet Quiet mode. Do not produce output. --enable-error-stack @@ -98,6 +97,14 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] excluded. This option can be used repeatedly to exclude multiple paths. + --exclude-attribute "path/to/object/with/attribute" + Exclude attributes on the specified path to an object when comparing files or groups. + + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. + Modes of output: Default mode: print the number of differences found and where they occured -r Report mode: print the above plus the differences diff --git a/tools/h5diff/testfiles/h5diff_70.txt b/tools/h5diff/testfiles/h5diff_70.txt index efa34ea..b0b8bf6 100644 --- a/tools/h5diff/testfiles/h5diff_70.txt +++ b/tools/h5diff/testfiles/h5diff_70.txt @@ -1183,10 +1183,42 @@ position opaque3D of opaque3D of difference [ 3 2 1 ] 24 0 24 24 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > size: [2] [2] diff --git a/tools/h5diff/testfiles/h5diff_700.txt b/tools/h5diff/testfiles/h5diff_700.txt index 851a407..6cf9893 100644 --- a/tools/h5diff/testfiles/h5diff_700.txt +++ b/tools/h5diff/testfiles/h5diff_700.txt @@ -1187,10 +1187,42 @@ position opaque3D of opaque3D of difference [ 3 2 1 ] 24 0 24 24 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > size: [2] [2] diff --git a/tools/h5diff/testfiles/h5diff_701.txt b/tools/h5diff/testfiles/h5diff_701.txt index 33f1a0f..4187754 100644 --- a/tools/h5diff/testfiles/h5diff_701.txt +++ b/tools/h5diff/testfiles/h5diff_701.txt @@ -1254,10 +1254,42 @@ position opaque3D of opaque3D of difference [ 3 2 1 ] 24 0 24 24 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > size: [2] [2] diff --git a/tools/h5diff/testfiles/h5diff_702.txt b/tools/h5diff/testfiles/h5diff_702.txt index 851a407..6cf9893 100644 --- a/tools/h5diff/testfiles/h5diff_702.txt +++ b/tools/h5diff/testfiles/h5diff_702.txt @@ -1187,10 +1187,42 @@ position opaque3D of opaque3D of difference [ 3 2 1 ] 24 0 24 24 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > size: [2] [2] diff --git a/tools/h5diff/testfiles/h5diff_703.txt b/tools/h5diff/testfiles/h5diff_703.txt index 33f1a0f..4187754 100644 --- a/tools/h5diff/testfiles/h5diff_703.txt +++ b/tools/h5diff/testfiles/h5diff_703.txt @@ -1254,10 +1254,42 @@ position opaque3D of opaque3D of difference [ 3 2 1 ] 24 0 24 24 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset +Not comparable: > or > is an empty dataset 0 differences found attribute: > and > size: [2] [2] diff --git a/tools/h5diff/testfiles/h5diff_80.txt b/tools/h5diff/testfiles/h5diff_80.txt index b223eed..11dccd8 100644 --- a/tools/h5diff/testfiles/h5diff_80.txt +++ b/tools/h5diff/testfiles/h5diff_80.txt @@ -528,166 +528,166 @@ position opaque3D opaque3D difference 24 differences found dataset: and size: [2] [2] -position difference +position reference reference difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference reference difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 4 differences found dataset: and size: [2] [2] -position difference +position reference2D reference2D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference2D reference2D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference2D reference2D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference2D reference2D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference2D reference2D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference2D reference2D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 12 differences found dataset: and size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 size: [2] [2] -position difference +position reference3D reference3D difference ------------------------------------------------------------ [ 0 ] 1 0 1 [ 1 ] 2 0 2 diff --git a/tools/h5diff/testfiles/h5diff_eps.txt b/tools/h5diff/testfiles/h5diff_eps.txt new file mode 100644 index 0000000..3a71366 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_eps.txt @@ -0,0 +1,17 @@ +file1: h5diff_eps1.h5 +file2: h5diff_eps2.h5 + +file1 file2 +--------------------------------------- + x x / + x x /DS1 + + +group : and +0 differences found +Attributes status: 0 common, 0 only in obj1, 0 only in obj2 + +dataset: and +0 differences found +Attributes status: 0 common, 0 only in obj1, 0 only in obj2 +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_eps1.h5 b/tools/h5diff/testfiles/h5diff_eps1.h5 new file mode 100644 index 0000000..2803a1d Binary files /dev/null and b/tools/h5diff/testfiles/h5diff_eps1.h5 differ diff --git a/tools/h5diff/testfiles/h5diff_eps2.h5 b/tools/h5diff/testfiles/h5diff_eps2.h5 new file mode 100644 index 0000000..4acf27a Binary files /dev/null and b/tools/h5diff/testfiles/h5diff_eps2.h5 differ diff --git a/tools/h5diff/testfiles/h5diff_strings1.h5 b/tools/h5diff/testfiles/h5diff_strings1.h5 new file mode 100644 index 0000000..0f8b380 Binary files /dev/null and b/tools/h5diff/testfiles/h5diff_strings1.h5 differ diff --git a/tools/h5diff/testfiles/h5diff_strings2.h5 b/tools/h5diff/testfiles/h5diff_strings2.h5 new file mode 100644 index 0000000..e8520ae Binary files /dev/null and b/tools/h5diff/testfiles/h5diff_strings2.h5 differ diff --git a/tools/h5diff/testh5diff.sh.in b/tools/h5diff/testh5diff.sh.in index 7687281..179e7dc 100644 --- a/tools/h5diff/testh5diff.sh.in +++ b/tools/h5diff/testh5diff.sh.in @@ -119,8 +119,10 @@ $SRC_H5DIFF_TESTFILES/h5diff_attr_v_level2.h5 $SRC_H5DIFF_TESTFILES/h5diff_enum_invalid_values.h5 $SRC_H5DIFF_TESTFILES/non_comparables1.h5 $SRC_H5DIFF_TESTFILES/non_comparables2.h5 -$SRC_H5DIFF_TESTFILES/diff_strings1.h5 -$SRC_H5DIFF_TESTFILES/diff_strings2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_strings1.h5 +$SRC_H5DIFF_TESTFILES/h5diff_strings2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_eps1.h5 +$SRC_H5DIFF_TESTFILES/h5diff_eps2.h5 $SRC_TOOLS_TESTFILES/tvlstr.h5 " @@ -313,6 +315,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_90.txt $SRC_H5DIFF_TESTFILES/h5diff_8625.txt $SRC_H5DIFF_TESTFILES/h5diff_8639.txt $SRC_H5DIFF_TESTFILES/h5diff_vlstr.txt +$SRC_H5DIFF_TESTFILES/h5diff_eps.txt " # @@ -435,18 +438,20 @@ TOOLTEST() { # Run test. TESTING $H5DIFF $@ ( - #echo "#############################" - #echo "Expected output for '$H5DIFF $@'" - #echo "#############################" - cd $TESTDIR - eval $RUNCMD $H5DIFF_BIN "$@" + #echo "#############################" + #echo "Expected output for '$H5DIFF $@'" + #echo "#############################" + cd $TESTDIR + eval $RUNCMD $H5DIFF_BIN "$@" ) >$actual 2>$actual_err EXIT_CODE=$? + # save actual and actual_err in case they are needed later. cp $actual $actual_sav STDOUT_FILTER $actual cp $actual_err $actual_err_sav STDERR_FILTER $actual_err + # don't add exit code check in pmode, as it causes failure. (exit code # is from mpirun not tool) # if any problem occurs relate to an exit code, it will be caught in @@ -480,23 +485,24 @@ TOOLTEST() { # is done by serial mode. grep -v "EXIT CODE:" $expect_sorted > $expect_sorted.noexit mv $expect_sorted.noexit $expect_sorted - if $CMP $expect_sorted $actual_sorted; then - echo " PASSED" - else - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if test yes = "$verbose"; then - echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" - $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' - echo "====The actual output ($actual_sav)" - sed 's/^/ /' < $actual_sav - echo "====The actual stderr ($actual_err_sav)" - sed 's/^/ /' < $actual_err_sav - echo "====End of actual stderr ($actual_err_sav)" - echo "" + + if $CMP $expect_sorted $actual_sorted; then + echo " PASSED" + else + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if test yes = "$verbose"; then + echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)" + $DIFF $expect_sorted $actual_sorted |sed 's/^/ /' + echo "====The actual output ($actual_sav)" + sed 's/^/ /' < $actual_sav + echo "====The actual stderr ($actual_err_sav)" + sed 's/^/ /' < $actual_err_sav + echo "====End of actual stderr ($actual_err_sav)" + echo "" + fi fi fi - fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then @@ -647,7 +653,7 @@ TOOLTEST h5diff_56.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset6a dset6b TOOLTEST h5diff_57.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset7a dset7b # 5.8 (region reference) -TOOLTEST h5diff_58.txt -v h5diff_dset1.h5 h5diff_dset2.h5 refreg +TOOLTEST h5diff_58.txt -v2 h5diff_dset1.h5 h5diff_dset2.h5 refreg # test for both dset and attr with same type but with different size # ( HDDFV-7942 ) @@ -655,10 +661,10 @@ TOOLTEST h5diff_59.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset11a dset11b # Strings # ( HDFFV-10128 ) -TOOLTEST h5diff_60.txt -v diff_strings1.h5 diff_strings2.h5 string1 string1 -TOOLTEST h5diff_61.txt -v diff_strings1.h5 diff_strings2.h5 string2 string2 -TOOLTEST h5diff_62.txt -v diff_strings1.h5 diff_strings2.h5 string3 string3 -TOOLTEST h5diff_63.txt -v diff_strings1.h5 diff_strings2.h5 string4 string4 +TOOLTEST h5diff_60.txt -v h5diff_strings1.h5 h5diff_strings2.h5 string1 string1 +TOOLTEST h5diff_61.txt -v h5diff_strings1.h5 h5diff_strings2.h5 string2 string2 +TOOLTEST h5diff_62.txt -v h5diff_strings1.h5 h5diff_strings2.h5 string3 string3 +TOOLTEST h5diff_63.txt -v h5diff_strings1.h5 h5diff_strings2.h5 string4 string4 # ############################################################################## # # Error messages @@ -701,6 +707,9 @@ TOOLTEST h5diff_609.txt -d 200 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dse # 6.10: number smaller than smallest difference TOOLTEST h5diff_610.txt -d 1 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 +# eps: number smaller than epsilon +TOOLTEST h5diff_eps.txt -v3 -d 1e-16 h5diff_eps1.h5 h5diff_eps2.h5 + # ############################################################################## # # -p diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index bedf172..5194f22 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -101,7 +101,7 @@ if (BUILD_TESTING) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) add_executable (h5dumpgentest ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) - target_include_directories (h5dumpgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_include_directories (h5dumpgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_TEST_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5dumpgentest STATIC) target_link_libraries (h5dumpgentest PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools) diff --git a/tools/h5dump/Makefile.am b/tools/h5dump/Makefile.am index 4c77476..52ff59b 100644 --- a/tools/h5dump/Makefile.am +++ b/tools/h5dump/Makefile.am @@ -19,7 +19,7 @@ include $(top_srcdir)/config/commence.am # Include files in /src directory and /tools/lib directory -AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib +AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/test -I$(top_srcdir)/tools/lib # Test programs and scripts if BUILD_TESTS_CONDITIONAL @@ -56,15 +56,16 @@ if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. noinst_LTLIBRARIES=libdynlibdump.la libdynlibdump_la_SOURCES=dynlib_dump.c - libdynlibdump_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere + libdynlibdump_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere libdynlibdump.la: $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_DEPENDENCIES) $(EXTRA_libdynlibdump_la_DEPENDENCIES) $(AM_V_CCLD)$(libdynlibdump_la_LINK) $(am_libdynlibdump_la_rpath) $(libdynlibdump_la_OBJECTS) $(libdynlibdump_la_LIBADD) endif endif + # Temporary files. *.h5 are generated by h5dumpgentest. They should # copied to the testfiles/ directory if update is required. CHECK_CLEANFILES+=*.h5 *.bin -DISTCLEANFILES=testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh +DISTCLEANFILES=testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh h5dump_plugin.sh include $(top_srcdir)/config/conclude.am diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index 3627e41..13a3c8f 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -433,19 +433,18 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ # Include files in /src directory and /tools/lib directory AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ - -I$(top_srcdir)/tools/lib -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ + -I$(top_srcdir)/test -I$(top_srcdir)/tools/lib +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -476,6 +475,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -503,8 +503,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -683,15 +681,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -710,6 +708,7 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. # *.clog and *.clog2 are from the MPE option. + # Temporary files. *.h5 are generated by h5dumpgentest. They should # copied to the testfiles/ directory if update is required. CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 *.bin @@ -734,8 +733,8 @@ LDADD = $(LIBH5TOOLS) $(LIBHDF5) h5dump_SOURCES = h5dump.c h5dump_ddl.c h5dump_xml.c @HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@noinst_LTLIBRARIES = libdynlibdump.la @HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@libdynlibdump_la_SOURCES = dynlib_dump.c -@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@libdynlibdump_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath /nowhere -DISTCLEANFILES = testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh +@HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@libdynlibdump_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere +DISTCLEANFILES = testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh h5dump_plugin.sh # Automake needs to be taught how to build lib, progs and tests targets. # These will be filled in automatically for the most part (e.g., @@ -748,7 +747,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1301,8 +1300,9 @@ uninstall-am: uninstall-binPROGRAMS # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index fd65a95..6382c9b 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -18,30 +18,32 @@ /* Name of tool */ #define PROGRAMNAME "h5dump" -static const char *driver = NULL; /* The driver to open the file with. */ -const char * outfname = NULL; -static int doxml = 0; -static int useschema = 1; -static const char *xml_dtd_uri = NULL; +static const char *driver_name_g = NULL; /* The driver to open the file with. */ +const char * outfname_g = NULL; +static hbool_t doxml_g = FALSE; +static hbool_t useschema_g = TRUE; +static const char *xml_dtd_uri_g = NULL; #ifdef H5_HAVE_ROS3_VFD -static H5FD_ros3_fapl_t ros3_fa = { - 1, /* version */ - FALSE, /* authenticate */ - "", /* aws region */ - "", /* access key id */ - "", /* secret access key */ +/* Default "anonymous" S3 configuration */ +static H5FD_ros3_fapl_t ros3_fa_g = { + 1, /* Structure Version */ + FALSE, /* Authenticate? */ + "", /* AWS Region */ + "", /* Access Key ID */ + "", /* Secret Access Key */ }; #endif /* H5_HAVE_ROS3_VFD */ #ifdef H5_HAVE_LIBHDFS -static H5FD_hdfs_fapl_t hdfs_fa = { - 1, /* fapl version */ - "localhost", /* namenode name */ - 0, /* namenode port */ - "", /* kerberos ticket cache */ - "", /* user name */ - 2048, /* stream buffer size */ +/* "Default" HDFS configuration */ +static H5FD_hdfs_fapl_t hdfs_fa_g = { + 1, /* Structure Version */ + "localhost", /* Namenode Name */ + 0, /* Namenode Port */ + "", /* Kerberos ticket cache */ + "", /* User name */ + 2048, /* Stream buffer size */ }; #endif /* H5_HAVE_LIBHDFS */ @@ -75,39 +77,8 @@ struct handler_t { */ /* The following initialization makes use of C language concatenating */ /* "xxx" "yyy" into "xxxyyy". */ -static const char * s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:A*q:z:m:RE*CM:O*N:"; -static struct long_options l_opts[] = {{"help", no_arg, 'h'}, - {"hel", no_arg, 'h'}, - {"contents", optional_arg, 'n'}, - {"properties", no_arg, 'p'}, - {"superblock", no_arg, 'B'}, - {"boot-block", no_arg, 'B'}, - {"boot-bloc", no_arg, 'B'}, - {"boot-blo", no_arg, 'B'}, - {"boot-bl", no_arg, 'B'}, - {"boot-b", no_arg, 'B'}, - {"boot", no_arg, 'B'}, - {"boo", no_arg, 'B'}, - {"bo", no_arg, 'B'}, - {"header", no_arg, 'H'}, - {"heade", no_arg, 'H'}, - {"head", no_arg, 'H'}, - {"hea", no_arg, 'H'}, - {"object-ids", no_arg, 'i'}, - {"object-id", no_arg, 'i'}, - {"object-i", no_arg, 'i'}, - {"object", no_arg, 'i'}, - {"objec", no_arg, 'i'}, - {"obje", no_arg, 'i'}, - {"obj", no_arg, 'i'}, - {"ob", no_arg, 'i'}, - {"version", no_arg, 'V'}, - {"versio", no_arg, 'V'}, - {"versi", no_arg, 'V'}, - {"vers", no_arg, 'V'}, - {"ver", no_arg, 'V'}, - {"ve", no_arg, 'V'}, - {"attribute", require_arg, 'a'}, +static const char * s_opts = "a:b*c:d:ef:g:hik:l:m:n*o*pq:rs:t:uvw:xyz:A*BCD:E*F:G:HM:N:O*RS:VX:"; +static struct long_options l_opts[] = {{"attribute", require_arg, 'a'}, {"attribut", require_arg, 'a'}, {"attribu", require_arg, 'a'}, {"attrib", require_arg, 'a'}, @@ -115,10 +86,7 @@ static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"attr", require_arg, 'a'}, {"att", require_arg, 'a'}, {"at", require_arg, 'a'}, - {"block", require_arg, 'k'}, - {"bloc", require_arg, 'k'}, - {"blo", require_arg, 'k'}, - {"bl", require_arg, 'k'}, + {"binary", optional_arg, 'b'}, {"count", require_arg, 'c'}, {"coun", require_arg, 'c'}, {"cou", require_arg, 'c'}, @@ -126,10 +94,7 @@ static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"dataset", require_arg, 'd'}, {"datase", require_arg, 'd'}, {"datas", require_arg, 'd'}, - {"datatype", require_arg, 't'}, - {"datatyp", require_arg, 't'}, - {"dataty", require_arg, 't'}, - {"datat", require_arg, 't'}, + {"escape", no_arg, 'e'}, {"filedriver", require_arg, 'f'}, {"filedrive", require_arg, 'f'}, {"filedriv", require_arg, 'f'}, @@ -143,24 +108,44 @@ static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"grou", require_arg, 'g'}, {"gro", require_arg, 'g'}, {"gr", require_arg, 'g'}, - {"output", optional_arg, 'o'}, - {"outpu", optional_arg, 'o'}, - {"outp", optional_arg, 'o'}, - {"out", optional_arg, 'o'}, - {"ou", optional_arg, 'o'}, + {"help", no_arg, 'h'}, + {"hel", no_arg, 'h'}, + {"object-ids", no_arg, 'i'}, + {"object-id", no_arg, 'i'}, + {"object-i", no_arg, 'i'}, + {"object", no_arg, 'i'}, + {"objec", no_arg, 'i'}, + {"obje", no_arg, 'i'}, + {"obj", no_arg, 'i'}, + {"ob", no_arg, 'i'}, + {"block", require_arg, 'k'}, + {"bloc", require_arg, 'k'}, + {"blo", require_arg, 'k'}, + {"bl", require_arg, 'k'}, {"soft-link", require_arg, 'l'}, {"soft-lin", require_arg, 'l'}, {"soft-li", require_arg, 'l'}, {"soft-l", require_arg, 'l'}, {"soft", require_arg, 'l'}, {"sof", require_arg, 'l'}, + {"format", require_arg, 'm'}, + {"contents", optional_arg, 'n'}, + {"output", optional_arg, 'o'}, + {"outpu", optional_arg, 'o'}, + {"outp", optional_arg, 'o'}, + {"out", optional_arg, 'o'}, + {"ou", optional_arg, 'o'}, + {"properties", no_arg, 'p'}, + {"sort_by", require_arg, 'q'}, + {"string", no_arg, 'r'}, + {"strin", no_arg, 'r'}, {"start", require_arg, 's'}, {"star", require_arg, 's'}, {"sta", require_arg, 's'}, - {"stride", require_arg, 'S'}, - {"strid", require_arg, 'S'}, - {"string", no_arg, 'r'}, - {"strin", no_arg, 'r'}, + {"datatype", require_arg, 't'}, + {"datatyp", require_arg, 't'}, + {"dataty", require_arg, 't'}, + {"datat", require_arg, 't'}, {"use-dtd", no_arg, 'u'}, {"use-dt", no_arg, 'u'}, {"use-d", no_arg, 'u'}, @@ -172,27 +157,44 @@ static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"widt", require_arg, 'w'}, {"wid", require_arg, 'w'}, {"wi", require_arg, 'w'}, - {"xml-dtd", require_arg, 'D'}, - {"xml-dt", require_arg, 'D'}, - {"xml-d", require_arg, 'D'}, - {"xml-ns", require_arg, 'X'}, - {"xml-n", require_arg, 'X'}, {"xml", no_arg, 'x'}, {"xm", no_arg, 'x'}, - {"onlyattr", optional_arg, 'A'}, - {"escape", no_arg, 'e'}, {"noindex", no_arg, 'y'}, - {"binary", optional_arg, 'b'}, - {"form", require_arg, 'F'}, - {"sort_by", require_arg, 'q'}, {"sort_order", require_arg, 'z'}, - {"format", require_arg, 'm'}, - {"region", no_arg, 'R'}, + {"onlyattr", optional_arg, 'A'}, + {"superblock", no_arg, 'B'}, + {"boot-block", no_arg, 'B'}, + {"boot-bloc", no_arg, 'B'}, + {"boot-blo", no_arg, 'B'}, + {"boot-bl", no_arg, 'B'}, + {"boot-b", no_arg, 'B'}, + {"boot", no_arg, 'B'}, + {"boo", no_arg, 'B'}, + {"bo", no_arg, 'B'}, + {"no-compact-subset", no_arg, 'C'}, + {"xml-dtd", require_arg, 'D'}, + {"xml-dt", require_arg, 'D'}, + {"xml-d", require_arg, 'D'}, {"enable-error-stack", optional_arg, 'E'}, + {"form", require_arg, 'F'}, + {"header", no_arg, 'H'}, + {"heade", no_arg, 'H'}, + {"head", no_arg, 'H'}, + {"hea", no_arg, 'H'}, {"packed-bits", require_arg, 'M'}, - {"no-compact-subset", no_arg, 'C'}, - {"ddl", optional_arg, 'O'}, {"any_path", require_arg, 'N'}, + {"ddl", optional_arg, 'O'}, + {"region", no_arg, 'R'}, + {"stride", require_arg, 'S'}, + {"strid", require_arg, 'S'}, + {"version", no_arg, 'V'}, + {"versio", no_arg, 'V'}, + {"versi", no_arg, 'V'}, + {"vers", no_arg, 'V'}, + {"ver", no_arg, 'V'}, + {"ve", no_arg, 'V'}, + {"xml-ns", require_arg, 'X'}, + {"xml-n", require_arg, 'X'}, {"s3-cred", require_arg, '$'}, {"hdfs-attrs", require_arg, '#'}, {NULL, 0, '\0'}}; @@ -664,12 +666,12 @@ parse_hsize_list(const char *h_list, subset_d *d) *------------------------------------------------------------------------- */ static struct subset_t * -parse_subset_params(char *dset) +parse_subset_params(const char *dset) { struct subset_t *s = NULL; char * brace; - if (!disable_compact_subset && ((brace = HDstrrchr(dset, '[')) != NULL)) { + if (!dump_opts.disable_compact_subset && ((brace = HDstrrchr(dset, '[')) != NULL)) { *brace++ = '\0'; s = (struct subset_t *)HDcalloc(1, sizeof(struct subset_t)); @@ -898,50 +900,50 @@ parse_command_line(int argc, const char *argv[]) parse_start: switch ((char)opt) { case 'R': - display_region = TRUE; - region_output = TRUE; + dump_opts.display_region = TRUE; + region_output = TRUE; break; case 'B': - display_bb = TRUE; - last_was_dset = FALSE; + dump_opts.display_bb = TRUE; + last_was_dset = FALSE; break; case 'n': - display_fi = TRUE; - last_was_dset = FALSE; + dump_opts.display_fi = TRUE; + last_was_dset = FALSE; if (opt_arg != NULL) h5trav_set_verbose(HDatoi(opt_arg)); break; case 'p': - display_dcpl = TRUE; + dump_opts.display_dcpl = TRUE; break; case 'y': - display_ai = FALSE; + dump_opts.display_ai = FALSE; break; case 'e': - display_escape = TRUE; + dump_opts.display_escape = TRUE; break; case 'H': - display_data = FALSE; - display_attr_data = FALSE; - last_was_dset = FALSE; + dump_opts.display_data = FALSE; + dump_opts.display_attr_data = FALSE; + last_was_dset = FALSE; break; case 'A': if (opt_arg != NULL) { if (0 == HDatoi(opt_arg)) - include_attrs = FALSE; + dump_opts.include_attrs = FALSE; } else { - display_data = FALSE; - display_attr_data = TRUE; - last_was_dset = FALSE; + dump_opts.display_data = FALSE; + dump_opts.display_attr_data = TRUE; + last_was_dset = FALSE; } break; case 'i': - display_oid = TRUE; - last_was_dset = FALSE; + dump_opts.display_oid = TRUE; + last_was_dset = FALSE; break; case 'r': - display_char = TRUE; + dump_opts.display_char = TRUE; break; case 'V': print_version(h5tools_getprogname()); @@ -960,7 +962,7 @@ parse_start: last_was_dset = FALSE; } break; case 'N': - display_all = 0; + dump_opts.display_all = 0; for (i = 0; i < argc; i++) if (!hand[i].func) { @@ -972,7 +974,7 @@ parse_start: last_was_dset = FALSE; break; case 'a': - display_all = 0; + dump_opts.display_all = 0; for (i = 0; i < argc; i++) if (!hand[i].func) { @@ -984,7 +986,7 @@ parse_start: last_was_dset = FALSE; break; case 'd': - display_all = 0; + dump_opts.display_all = 0; for (i = 0; i < argc; i++) if (!hand[i].func) { @@ -998,10 +1000,10 @@ parse_start: last_was_dset = TRUE; break; case 'f': - driver = opt_arg; + driver_name_g = opt_arg; break; case 'g': - display_all = 0; + dump_opts.display_all = 0; for (i = 0; i < argc; i++) if (!hand[i].func) { @@ -1013,7 +1015,7 @@ parse_start: last_was_dset = FALSE; break; case 'l': - display_all = 0; + dump_opts.display_all = 0; for (i = 0; i < argc; i++) if (!hand[i].func) { @@ -1025,7 +1027,7 @@ parse_start: last_was_dset = FALSE; break; case 't': - display_all = 0; + dump_opts.display_all = 0; for (i = 0; i < argc; i++) if (!hand[i].func) { @@ -1052,13 +1054,13 @@ parse_start: } } else { - if (display_attr_data && !display_data) { + if (dump_opts.display_attr_data && !dump_opts.display_data) { if (h5tools_set_attr_output_file(opt_arg, 0) < 0) { usage(h5tools_getprogname()); goto error; } } - if (display_data || display_all) { + if (dump_opts.display_data || dump_opts.display_all) { if (h5tools_set_data_output_file(opt_arg, 0) < 0) { usage(h5tools_getprogname()); goto error; @@ -1066,9 +1068,9 @@ parse_start: } } - usingdasho = TRUE; - last_was_dset = FALSE; - outfname = opt_arg; + dump_opts.usingdasho = TRUE; + last_was_dset = FALSE; + outfname_g = opt_arg; break; case 'b': @@ -1080,8 +1082,8 @@ parse_start: } } bin_output = TRUE; - if (outfname != NULL) { - if (h5tools_set_data_output_file(outfname, 1) < 0) { + if (outfname_g != NULL) { + if (h5tools_set_data_output_file(outfname_g, 1) < 0) { /* failed to set output file */ usage(h5tools_getprogname()); goto error; @@ -1116,21 +1118,21 @@ parse_start: usage(h5tools_getprogname()); goto error; } - display_packed_bits = TRUE; + dump_opts.display_packed_bits = TRUE; break; /** begin XML parameters **/ case 'x': /* select XML output */ - doxml = TRUE; - useschema = TRUE; + doxml_g = TRUE; + useschema_g = TRUE; h5tools_dump_header_format = NULL; dump_function_table = &xml_function_table; h5tools_nCols = 0; break; case 'u': - doxml = TRUE; - useschema = FALSE; + doxml_g = TRUE; + useschema_g = FALSE; xmlnsprefix = ""; h5tools_dump_header_format = NULL; dump_function_table = &xml_function_table; @@ -1139,7 +1141,7 @@ parse_start: case 'D': /* specify alternative XML DTD or schema */ /* To Do: check format of this value? */ - xml_dtd_uri = opt_arg; + xml_dtd_uri_g = opt_arg; h5tools_nCols = 0; break; @@ -1152,7 +1154,7 @@ parse_start: case 'X': /* specify XML namespace (default="hdf5:"), or none */ /* To Do: check format of this value? */ - if (!useschema) { + if (!useschema_g) { usage(h5tools_getprogname()); goto error; } @@ -1250,7 +1252,7 @@ end_collect: enable_error_stack = 1; break; case 'C': - disable_compact_subset = TRUE; + dump_opts.disable_compact_subset = TRUE; break; case 'h': usage(h5tools_getprogname()); @@ -1260,106 +1262,37 @@ end_collect: goto done; case '$': -#ifndef H5_HAVE_ROS3_VFD +#ifdef H5_HAVE_ROS3_VFD + if (h5tools_parse_ros3_fapl_tuple(opt_arg, ',', &ros3_fa_g) < 0) { + error_msg("failed to parse S3 VFD credential info\n"); + usage(h5tools_getprogname()); + free_handler(hand, argc); + hand = NULL; + h5tools_setstatus(EXIT_FAILURE); + goto done; + } +#else error_msg("Read-Only S3 VFD not enabled.\n"); h5tools_setstatus(EXIT_FAILURE); goto done; -#else - /* s3 credential */ - { - char ** s3_cred = NULL; - char * s3_cred_string = NULL; - const char *ccred[3]; - unsigned nelems = 0; - if (FAIL == parse_tuple(opt_arg, ',', &s3_cred_string, &nelems, &s3_cred)) { - error_msg("unable to parse malformed s3 credentials\n"); - usage(h5tools_getprogname()); - free_handler(hand, argc); - hand = NULL; - h5tools_setstatus(EXIT_FAILURE); - goto done; - } - if (nelems != 3) { - error_msg("s3 credentials expects 3 elements\n"); - usage(h5tools_getprogname()); - free_handler(hand, argc); - hand = NULL; - h5tools_setstatus(EXIT_FAILURE); - goto done; - } - ccred[0] = (const char *)s3_cred[0]; - ccred[1] = (const char *)s3_cred[1]; - ccred[2] = (const char *)s3_cred[2]; - if (0 == h5tools_populate_ros3_fapl(&ros3_fa, ccred)) { - error_msg("Invalid S3 credentials\n"); - usage(h5tools_getprogname()); - free_handler(hand, argc); - hand = NULL; - h5tools_setstatus(EXIT_FAILURE); - goto done; - } - HDfree(s3_cred); - HDfree(s3_cred_string); - } /* s3 credential block */ +#endif break; -#endif /* H5_HAVE_ROS3_VFD */ case '#': -#ifndef H5_HAVE_LIBHDFS - error_msg("HDFS VFD is not enabled.\n"); - goto error; -#else - { - /* read hdfs properties tuple and store values in `hdfs_fa` */ - unsigned nelems = 0; - char *props_src = NULL; - char **props = NULL; - unsigned long k = 0; - if (FAIL == parse_tuple((const char *)opt_arg, ',', &props_src, &nelems, &props)) { - error_msg("unable to parse hdfs properties tuple\n"); - goto error; - } - /* sanity-check tuple count - */ - if (nelems != 5) { +#ifdef H5_HAVE_LIBHDFS + if (h5tools_parse_hdfs_fapl_tuple(opt_arg, ',', &hdfs_fa_g) < 0) { + error_msg("failed to parse HDFS VFD configuration info\n"); + usage(h5tools_getprogname()); + free_handler(hand, argc); + hand = NULL; h5tools_setstatus(EXIT_FAILURE); - goto error; - } - /* Populate fapl configuration structure with given - * properties. - * WARNING: No error-checking is done on length of input - * strings... Silent overflow is possible, albeit - * unlikely. - */ - if (strncmp(props[0], "", 1)) - HDstrncpy(hdfs_fa.namenode_name, (const char *)props[0], HDstrlen(props[0])); - - if (strncmp(props[1], "", 1)) { - k = strtoul((const char *)props[1], NULL, 0); - if (errno == ERANGE) { - h5tools_setstatus(EXIT_FAILURE); - goto error; - } - hdfs_fa.namenode_port = (int32_t)k; - } - if (strncmp(props[2], "", 1)) - HDstrncpy(hdfs_fa.kerberos_ticket_cache, (const char *)props[2], HDstrlen(props[2])); - - if (strncmp(props[3], "", 1)) - HDstrncpy(hdfs_fa.user_name, (const char *)props[3], HDstrlen(props[3])); - - if (strncmp(props[4], "", 1)) { - k = strtoul((const char *)props[4], NULL, 0); - if (errno == ERANGE) { - h5tools_setstatus(EXIT_FAILURE); - goto error; - } - hdfs_fa.stream_buffer_size = (int32_t)k; + goto done; } - HDfree(props); - HDfree(props_src); - } -#endif /* H5_HAVE_LIBHDFS */ +#else + error_msg("HDFS VFD not enabled.\n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; +#endif break; case '?': @@ -1404,14 +1337,10 @@ main(int argc, const char *argv[]) hid_t fid = H5I_INVALID_HID; hid_t gid = H5I_INVALID_HID; hid_t fapl_id = H5P_DEFAULT; - H5E_auto2_t func; - H5E_auto2_t tools_func; H5O_info_t oi; struct handler_t *hand = NULL; int i; unsigned u; - void * edata; - void * tools_edata; char * fname = NULL; h5tools_setprogname(PROGRAMNAME); @@ -1420,63 +1349,50 @@ main(int argc, const char *argv[]) dump_function_table = &ddl_function_table; dump_indent = 0; - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ h5tools_init(); - /* Disable tools error reporting */ - H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); - H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); - if ((hand = parse_command_line(argc, argv)) == NULL) { goto done; } - if (bin_output && outfname == NULL) { + if (bin_output && outfname_g == NULL) { error_msg("binary output requires a file name, use -o \n"); h5tools_setstatus(EXIT_FAILURE); goto done; } - if (enable_error_stack > 0) { - H5Eset_auto2(H5E_DEFAULT, func, edata); - H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); - } - /* Check for conflicting options */ - if (doxml) { - if (!display_all) { + if (doxml_g) { + if (!dump_opts.display_all) { error_msg("option \"%s\" not available for XML\n", "to display selected objects"); h5tools_setstatus(EXIT_FAILURE); goto done; } - else if (display_bb) { + else if (dump_opts.display_bb) { error_msg("option \"%s\" not available for XML\n", "--boot-block"); h5tools_setstatus(EXIT_FAILURE); goto done; } - else if (display_oid == 1) { + else if (dump_opts.display_oid == 1) { error_msg("option \"%s\" not available for XML\n", "--object-ids"); h5tools_setstatus(EXIT_FAILURE); goto done; } - else if (display_char == TRUE) { + else if (dump_opts.display_char == TRUE) { error_msg("option \"%s\" not available for XML\n", "--string"); h5tools_setstatus(EXIT_FAILURE); goto done; } - else if (usingdasho) { + else if (dump_opts.usingdasho) { error_msg("option \"%s\" not available for XML\n", "--output"); h5tools_setstatus(EXIT_FAILURE); goto done; } } else { - if (xml_dtd_uri) { - warn_msg("option \"%s\" only applies with XML: %s\n", "--xml-dtd", xml_dtd_uri); + if (xml_dtd_uri_g) { + warn_msg("option \"%s\" only applies with XML: %s\n", "--xml-dtd", xml_dtd_uri_g); } } @@ -1486,57 +1402,49 @@ main(int argc, const char *argv[]) h5tools_setstatus(EXIT_FAILURE); goto done; } + + /* enable error reporting if command line option */ + h5tools_error_report(); + /* Initialize indexing options */ h5trav_set_index(sort_by, sort_order); - if (driver != NULL) { - void *conf_fa = NULL; + if (driver_name_g != NULL) { + h5tools_vfd_info_t vfd_info; + + vfd_info.info = NULL; + vfd_info.name = driver_name_g; - if (!strcmp(driver, "ros3")) { -#ifndef H5_HAVE_ROS3_VFD + if (!HDstrcmp(driver_name_g, drivernames[ROS3_VFD_IDX])) { +#ifdef H5_HAVE_ROS3_VFD + vfd_info.info = (void *)&ros3_fa_g; +#else error_msg("Read-Only S3 VFD not enabled.\n"); h5tools_setstatus(EXIT_FAILURE); goto done; -#else - conf_fa = (void *)&ros3_fa; -#endif /* H5_HAVE_ROS3_VFD */ +#endif } - else if (!HDstrcmp(driver, "hdfs")) { -#ifndef H5_HAVE_LIBHDFS - error_msg("HDFS VFD is not enabled.\n"); + else if (!HDstrcmp(driver_name_g, drivernames[HDFS_VFD_IDX])) { +#ifdef H5_HAVE_LIBHDFS + vfd_info.info = (void *)&hdfs_fa_g; +#else + error_msg("The HDFS VFD is not enabled.\n"); h5tools_setstatus(EXIT_FAILURE); goto done; -#else - conf_fa = (void *)&hdfs_fa; -#endif /* H5_HAVE_LIBHDFS */ +#endif } - if (conf_fa != NULL) { - fapl_id = H5Pcreate(H5P_FILE_ACCESS); - if (fapl_id < 0) { - error_msg("unable to create fapl entry\n"); - h5tools_setstatus(EXIT_FAILURE); - goto done; - } - /* driver guaranteed "ros3" or "hdfs" */ - /* conf_fa appropriate to driver */ - if (0 == h5tools_set_configured_fapl(fapl_id, driver, conf_fa)) { - error_msg("unable to set fapl\n"); - h5tools_setstatus(EXIT_FAILURE); - goto done; - } + if ((fapl_id = h5tools_get_fapl(H5P_DEFAULT, &vfd_info)) < 0) { + error_msg("unable to create FAPL for file access\n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; } - } /* driver defined */ + } /* driver name defined */ while (opt_ind < argc) { fname = HDstrdup(argv[opt_ind++]); - if (fapl_id != H5P_DEFAULT) { - fid = H5Fopen(fname, H5F_ACC_RDONLY, fapl_id); - } - else { - fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, driver, NULL, 0); - } + fid = h5tools_fopen(fname, H5F_ACC_RDONLY, fapl_id, (fapl_id == H5P_DEFAULT) ? FALSE : TRUE, NULL, 0); if (fid < 0) { error_msg("unable to open file \"%s\"\n", fname); @@ -1550,23 +1458,23 @@ main(int argc, const char *argv[]) /* Prepare to find objects that might be targets of a reference */ fill_ref_path_table(fid); - if (doxml) { + if (doxml_g) { /* initialize XML */ /* reset prefix! */ HDstrcpy(prefix, ""); /* make sure the URI is initialized to something */ - if (xml_dtd_uri == NULL) { - if (useschema) { - xml_dtd_uri = DEFAULT_XSD; + if (xml_dtd_uri_g == NULL) { + if (useschema_g) { + xml_dtd_uri_g = DEFAULT_XSD; } else { - xml_dtd_uri = DEFAULT_DTD; - xmlnsprefix = ""; + xml_dtd_uri_g = DEFAULT_DTD; + xmlnsprefix = ""; } } else { - if (useschema && HDstrcmp(xmlnsprefix, "")) { + if (useschema_g && HDstrcmp(xmlnsprefix, "")) { error_msg( "Cannot set Schema URL for a qualified namespace--use -X or -U option with -D \n"); h5tools_setstatus(EXIT_FAILURE); @@ -1600,7 +1508,7 @@ main(int argc, const char *argv[]) } /* end if */ /* start to dump - display file header information */ - if (!doxml) { + if (!doxml_g) { begin_obj(h5tools_dump_header_format->filebegin, fname, h5tools_dump_header_format->fileblockbegin); } @@ -1608,12 +1516,12 @@ main(int argc, const char *argv[]) PRINTVALSTREAM(rawoutstream, "\n"); /* alternative first element, depending on schema or DTD. */ - if (useschema) { + if (useschema_g) { if (HDstrcmp(xmlnsprefix, "") == 0) { PRINTSTREAM(rawoutstream, "\n", - xml_dtd_uri); + xml_dtd_uri_g); } else { /* TO DO: make -url option work in this case (may need new option) */ @@ -1636,13 +1544,13 @@ main(int argc, const char *argv[]) } else { PRINTSTREAM(rawoutstream, "\n", - xml_dtd_uri); + xml_dtd_uri_g); PRINTVALSTREAM(rawoutstream, "\n"); } } - if (!doxml) { - if (display_fi) { + if (!doxml_g) { + if (dump_opts.display_fi) { PRINTVALSTREAM(rawoutstream, "\n"); dump_fcontents(fid); end_obj(h5tools_dump_header_format->fileend, h5tools_dump_header_format->fileblockend); @@ -1650,20 +1558,20 @@ main(int argc, const char *argv[]) goto done; } - if (display_bb) + if (dump_opts.display_bb) dump_fcpl(fid); } - if (display_all) { + if (dump_opts.display_all) { if ((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) { error_msg("unable to open root group\n"); h5tools_setstatus(EXIT_FAILURE); } else { - if (!doxml) + if (!doxml_g) dump_indent += COL; dump_function_table->dump_group_function(gid, "/"); - if (!doxml) + if (!doxml_g) dump_indent -= COL; PRINTVALSTREAM(rawoutstream, "\n"); } @@ -1675,7 +1583,7 @@ main(int argc, const char *argv[]) } else { /* Note: this option is not supported for XML */ - if (doxml) { + if (doxml_g) { error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); h5tools_setstatus(EXIT_FAILURE); goto done; @@ -1689,7 +1597,7 @@ main(int argc, const char *argv[]) PRINTVALSTREAM(rawoutstream, "\n"); } - if (!doxml) { + if (!doxml_g) { end_obj(h5tools_dump_header_format->fileend, h5tools_dump_header_format->fileblockend); PRINTVALSTREAM(rawoutstream, "\n"); } @@ -1718,8 +1626,6 @@ main(int argc, const char *argv[]) /* To Do: clean up XML table */ - H5Eset_auto2(H5E_DEFAULT, func, edata); - leave(h5tools_getstatus()); done: @@ -1749,8 +1655,6 @@ done: /* To Do: clean up XML table */ - H5Eset_auto2(H5E_DEFAULT, func, edata); - leave(h5tools_getstatus()); } /* main */ diff --git a/tools/h5dump/h5dump.h b/tools/h5dump/h5dump.h index 5cad93d..92fc7d5 100644 --- a/tools/h5dump/h5dump.h +++ b/tools/h5dump/h5dump.h @@ -43,6 +43,7 @@ typedef struct h5dump_table_items_t { table_t * dset_table; /* Table of datasets */ table_t * type_table; /* Table of datatypes */ } h5dump_table_items_t; + typedef struct h5dump_table_list_t { size_t nalloc; size_t nused; @@ -51,30 +52,34 @@ typedef struct h5dump_table_list_t { h5dump_table_list_t table_list = {0, 0, NULL}; table_t * group_table = NULL, *dset_table = NULL, *type_table = NULL; -unsigned dump_indent = 0; /*how far in to indent the line */ -int unamedtype = 0; /* shared datatype with no name */ -hbool_t hit_elink = FALSE; /* whether we have traversed an external link */ -size_t prefix_len = 1024; -char * prefix = NULL; -const char *fp_format = NULL; +unsigned dump_indent = 0; /* how far in to indent the line */ +int unamedtype = 0; /* shared datatype with no name */ +hbool_t hit_elink = FALSE; /* whether we have traversed an external link */ +size_t prefix_len = 1024; +char * prefix = NULL; +const char *fp_format = NULL; /* things to display or which are set via command line parameters */ -int display_all = TRUE; -int display_oid = FALSE; -int display_data = TRUE; -int display_attr_data = TRUE; -int display_char = FALSE; /*print 1-byte numbers as ASCII */ -int usingdasho = FALSE; -int display_bb = FALSE; /*superblock */ -int display_dcpl = FALSE; /*dcpl */ -int display_fi = FALSE; /*file index */ -int display_ai = TRUE; /*array index */ -int display_escape = FALSE; /*escape non printable characters */ -int display_region = FALSE; /*print region reference data */ -int disable_compact_subset = FALSE; /* disable compact form of subset notation */ -int display_packed_bits = FALSE; /*print 1-8 byte numbers as packed bits*/ -int include_attrs = TRUE; /* Display attributes */ +typedef struct { + int display_all; + int display_oid; + int display_data; + int display_attr_data; + int display_char; /* print 1-byte numbers as ASCII */ + int usingdasho; + int display_bb; /* superblock */ + int display_dcpl; /* dcpl */ + int display_fi; /* file index */ + int display_ai; /* array index */ + int display_escape; /* escape non printable characters */ + int display_region; /* print region reference data */ + int disable_compact_subset; /* disable compact form of subset notation */ + int display_packed_bits; /* print 1-8 byte numbers as packed bits */ + int include_attrs; /* Display attributes */ +} dump_opt_t; +dump_opt_t dump_opts = {TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, + FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE}; #define PACKED_BITS_MAX 8 /* Maximum number of packed-bits to display */ #define PACKED_BITS_SIZE_MAX (8 * sizeof(long long)) /* Maximum bits size of integer types of packed-bits */ diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c index c913a02..241f5f9 100644 --- a/tools/h5dump/h5dump_ddl.c +++ b/tools/h5dump/h5dump_ddl.c @@ -103,13 +103,13 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED * HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - ctx.display_index = display_ai; - ctx.display_char = display_char; + ctx.display_index = dump_opts.display_ai; + ctx.display_char = dump_opts.display_char; attr_id = H5Aopen(oid, attr_name, H5P_DEFAULT); - oid_output = display_oid; - data_output = display_data; - attr_data_output = display_attr_data; + oid_output = dump_opts.display_oid; + data_output = dump_opts.display_data; + attr_data_output = dump_opts.display_attr_data; string_dataformat = *outputformat; @@ -125,7 +125,7 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED * else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; h5dump_type_table = type_table; @@ -184,7 +184,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; /* Build the object's path name */ @@ -564,7 +564,7 @@ attr_iteration(hid_t gid, unsigned attr_crt_order_flags) { /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set in the group for attributes, then, sort by creation order, otherwise by name */ - if (include_attrs) { + if (dump_opts.include_attrs) { if ((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { if (H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { error_msg("error getting attribute information\n"); @@ -641,7 +641,7 @@ dump_named_datatype(hid_t tid, const char *name) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; if ((tcpl_id = H5Tget_create_plist(tid)) < 0) { @@ -797,7 +797,7 @@ dump_group(hid_t gid, const char *name) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; ctx.need_prefix = TRUE; @@ -827,7 +827,7 @@ dump_group(hid_t gid, const char *name) } } /* end if */ - if (display_oid) + if (dump_opts.display_oid) h5tools_dump_oid(rawoutstream, outputformat, &ctx, gid); h5tools_dump_comment(rawoutstream, outputformat, &ctx, gid); @@ -924,7 +924,7 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; if ((dcpl_id = H5Dget_create_plist(did)) < 0) { @@ -965,11 +965,11 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) h5tools_dump_dataspace(rawoutstream, outputformat, &ctx, space); H5Sclose(space); - if (display_oid) { + if (dump_opts.display_oid) { h5tools_dump_oid(rawoutstream, outputformat, &ctx, did); } - if (display_dcpl) { + if (dump_opts.display_dcpl) { h5dump_type_table = type_table; h5tools_dump_dcpl(rawoutstream, outputformat, &ctx, dcpl_id, type, did); h5dump_type_table = NULL; @@ -977,16 +977,16 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) H5Pclose(dcpl_id); ctx.sset = sset; - ctx.display_index = display_ai; - ctx.display_char = display_char; - if (display_data) { + ctx.display_index = dump_opts.display_ai; + ctx.display_char = dump_opts.display_char; + if (dump_opts.display_data) { unsigned data_loop = 1; unsigned u; - if (display_packed_bits) + if (dump_opts.display_packed_bits) data_loop = packed_bits_num; for (u = 0; u < data_loop; u++) { - if (display_packed_bits) { + if (dump_opts.display_packed_bits) { ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ @@ -1090,7 +1090,7 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int display_index) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; HDmemset(&ctx, 0, sizeof(ctx)); @@ -1098,7 +1098,7 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int display_index) ctx.cur_column = dump_indent; ctx.sset = sset; ctx.display_index = display_index; - ctx.display_char = display_char; + ctx.display_char = dump_opts.display_char; if (obj_data == DATASET_DATA) print_dataset = TRUE; @@ -1486,8 +1486,8 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5 HDmemset(&ctx, 0, sizeof(ctx)); ctx.indent_level = dump_indent / COL; ctx.cur_column = dump_indent; - ctx.display_index = display_ai; - ctx.display_char = display_char; + ctx.display_index = dump_opts.display_ai; + ctx.display_char = dump_opts.display_char; string_dataformat = *outputformat; @@ -1503,7 +1503,7 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5 else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; attr_name = h5tools_str_replace(attr + j + 1, "\\/", "/"); @@ -1543,9 +1543,9 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5 } /* end if */ attr_id = H5Aopen(oid, attr_name, H5P_DEFAULT); - oid_output = display_oid; - data_output = display_data; - attr_data_output = display_attr_data; + oid_output = dump_opts.display_oid; + data_output = dump_opts.display_data; + attr_data_output = dump_opts.display_attr_data; h5dump_type_table = type_table; h5tools_dump_attribute(rawoutstream, outputformat, &ctx, attr_name, attr_id); diff --git a/tools/h5dump/h5dump_extern.h b/tools/h5dump/h5dump_extern.h index f6d5367..3ffac43 100644 --- a/tools/h5dump/h5dump_extern.h +++ b/tools/h5dump/h5dump_extern.h @@ -50,30 +50,33 @@ typedef struct h5dump_table_list_t { extern h5dump_table_list_t table_list; extern table_t * group_table, *dset_table, *type_table; -extern unsigned dump_indent; /*how far in to indent the line */ -extern int unamedtype; /* shared datatype with no name */ -extern hbool_t hit_elink; /* whether we have traversed an external link */ +extern unsigned dump_indent; /* how far in to indent the line */ +extern int unamedtype; /* shared datatype with no name */ +extern hbool_t hit_elink; /* whether we have traversed an external link */ extern size_t prefix_len; extern char * prefix; extern const char *fp_format; /* things to display or which are set via command line parameters */ -extern int display_all; -extern int display_oid; -extern int display_data; -extern int display_attr_data; -extern int display_char; /*print 1-byte numbers as ASCII */ -extern int usingdasho; -extern int display_bb; /*superblock */ -extern int display_dcpl; /*dcpl */ -extern int display_fi; /*file index */ -extern int display_ai; /*array index */ -extern int display_escape; /*escape non printable characters */ -extern int display_region; /*print region reference data */ -extern int disable_compact_subset; /* disable compact form of subset notation */ -extern int display_packed_bits; /*print 1-8 byte numbers as packed bits*/ -extern int include_attrs; /* Display attributes */ +typedef struct { + int display_all; + int display_oid; + int display_data; + int display_attr_data; + int display_char; /* print 1-byte numbers as ASCII */ + int usingdasho; + int display_bb; /* superblock */ + int display_dcpl; /* dcpl */ + int display_fi; /* file index */ + int display_ai; /* array index */ + int display_escape; /* escape non printable characters */ + int display_region; /* print region reference data */ + int disable_compact_subset; /* disable compact form of subset notation */ + int display_packed_bits; /* print 1-8 byte numbers as packed bits */ + int include_attrs; /* Display attributes */ +} dump_opt_t; +extern dump_opt_t dump_opts; #define PACKED_BITS_MAX 8 /* Maximum number of packed-bits to display */ #define PACKED_BITS_SIZE_MAX 8 * sizeof(long long) /* Maximum bits size of integer types of packed-bits */ diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index ca3c501..dd27bb4 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -161,7 +161,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; /* Build the object's path name */ @@ -616,7 +616,7 @@ xml_name_to_XID(const char *str, char *outstr, int outlen, int gen) HDsprintf(outstr, "xid_" H5_PRINTF_HADDR_FMT, objno); - return (0); + return 0; } static const char *quote = """; @@ -732,9 +732,9 @@ xml_escape_the_string(const char *str, int slen) size_t extra; size_t len; size_t i; - const char *cp; - char * ncp; - char * rcp; + const char *cp = NULL; + char * ncp = NULL; + char * rcp = NULL; size_t ncp_len; if (!str) @@ -776,30 +776,32 @@ xml_escape_the_string(const char *str, int slen) size_t esc_len; if (*cp == '\\') { - *ncp++ = '\\'; + *ncp++ = '\\'; + ncp_len--; *ncp = *cp; esc_len = 1; } else if (*cp == '\"') { - *ncp++ = '\\'; + *ncp++ = '\\'; + ncp_len--; *ncp = *cp; esc_len = 1; } else if (*cp == '\'') { + HDstrncpy(ncp, apos, ncp_len); esc_len = HDstrlen(apos); - HDstrncpy(ncp, apos, esc_len); } else if (*cp == '<') { + HDstrncpy(ncp, lt, ncp_len); esc_len = HDstrlen(lt); - HDstrncpy(ncp, lt, esc_len); } else if (*cp == '>') { + HDstrncpy(ncp, gt, ncp_len); esc_len = HDstrlen(gt); - HDstrncpy(ncp, gt, esc_len); } else if (*cp == '&') { + HDstrncpy(ncp, amp, ncp_len); esc_len = HDstrlen(amp); - HDstrncpy(ncp, amp, esc_len); } else { *ncp = *cp; @@ -880,7 +882,7 @@ xml_print_datatype(hid_t type, unsigned in_group) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; if (!in_group && H5Tcommitted(type) > 0) { @@ -1578,7 +1580,7 @@ xml_dump_datatype(hid_t type) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; ctx.indent_level++; @@ -1713,7 +1715,7 @@ xml_dump_dataspace(hid_t space) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; ctx.indent_level++; @@ -2057,7 +2059,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; ctx.need_prefix = TRUE; @@ -2080,7 +2082,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED ctx.indent_level++; dump_indent += COL; - if (display_attr_data && space_type != H5S_NULL) { + if (dump_opts.display_attr_data && space_type != H5S_NULL) { switch (H5Tget_class(type)) { case H5T_INTEGER: case H5T_FLOAT: @@ -2382,7 +2384,7 @@ xml_dump_named_datatype(hid_t type, const char *name) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; dtxid = (char *)HDmalloc((size_t)100); @@ -2602,7 +2604,7 @@ xml_dump_group(hid_t gid, const char *name) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; if (HDstrcmp(name, "/") == 0) { @@ -2993,7 +2995,7 @@ xml_print_refs(hid_t did, int source) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; for (i = 0; i < (hsize_t)ssiz; i++) { @@ -3145,7 +3147,7 @@ xml_print_strs(hid_t did, int source) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; for (i = 0; i < (hsize_t)ssiz; i++) { @@ -3261,7 +3263,7 @@ check_filters(hid_t dcpl) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; nfilt = H5Pget_nfilters(dcpl); @@ -3402,7 +3404,7 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; ctx.indent_level++; @@ -3770,7 +3772,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED *ss else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; xml_name_to_XID(tmp, rstr, 100, 1); @@ -4082,7 +4084,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED *ss dump_indent -= COL; tempi = H5Dget_storage_size(did); - if (display_data && (tempi > 0)) { + if (dump_opts.display_data && (tempi > 0)) { switch (H5Tget_class(type)) { case H5T_INTEGER: case H5T_FLOAT: @@ -4358,7 +4360,7 @@ xml_print_enum(hid_t type) else string_dataformat.line_ncols = h5tools_nCols; - string_dataformat.do_escape = display_escape; + string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; nmembs = (unsigned)H5Tget_nmembers(type); diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 495570e..fb7a083 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -22,7 +22,7 @@ */ #include "hdf5.h" -#include "H5private.h" +#include "h5test.h" #include "h5tools.h" #define FILE1 "tgroup.h5" @@ -259,6 +259,7 @@ typedef struct s1_t { #define F51_MAX_NAME_LEN ((64 * 1024) + 1024) /* "File 64" macros */ +#define F64_FILE "tarray8.h5" #define F64_DATASET "DS1" #define F64_DIM0 1 #define F64_ARRAY_BUF_LEN (4 * 1024) @@ -355,16 +356,13 @@ typedef struct s1_t { /* "File 82" macros */ /* Name of dataset to create in datafile */ -#define F82_DATASETNAME "CompoundComplex1D" -#define F82_DATASETNAME2 "CompoundComplex2D" -#define F82_DATASETNAME3 "CompoundComplex3D" -#define F82_DATASETNAME4 "CompoundComplex4D" +#define F82_DATASETNAME "CompoundComplex1D" /* Dataset dimensions */ #define F82_DIM32 32 #define F82_RANK 1 -#define F82_RANK2 2 -#define F82_RANK3 3 -#define F82_RANK4 4 +/* #define F82_RANK2 2 */ +/* #define F82_RANK3 3 */ +/* #define F82_RANK4 4 */ /* "File 83" macros */ /* Name of dataset to create in datafile */ @@ -424,11 +422,24 @@ gent_group(void) static void gent_dataset(void) { - hid_t fid, dataset, space; - hsize_t dims[2]; - int dset1[10][20]; - double dset2[30][20]; - int i, j; + hid_t fid, dataset, space; + hsize_t dims[2]; + int ** dset1 = NULL; + int * dset1_data = NULL; + double **dset2 = NULL; + double * dset2_data = NULL; + int i, j; + + /* Set up data arrays */ + dset1_data = (int *)HDcalloc(10 * 20, sizeof(int)); + dset1 = (int **)HDcalloc(10, sizeof(dset1_data)); + for (i = 0; i < 10; i++) + dset1[i] = dset1_data + (i * 20); + + dset2_data = (double *)HDcalloc(30 * 20, sizeof(double)); + dset2 = (double **)HDcalloc(30, sizeof(dset2_data)); + for (i = 0; i < 30; i++) + dset2[i] = dset2_data + (i * 20); fid = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -442,7 +453,7 @@ gent_dataset(void) for (j = 0; j < 20; j++) dset1[i][j] = j + i; - H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1); + H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1_data); H5Sclose(space); H5Dclose(dataset); @@ -456,11 +467,16 @@ gent_dataset(void) for (j = 0; j < 20; j++) dset2[i][j] = 0.0001F * (float)j + (float)i; - H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); + H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_data); H5Sclose(space); H5Dclose(dataset); H5Fclose(fid); + + HDfree(dset1); + HDfree(dset1_data); + HDfree(dset2); + HDfree(dset2_data); } static void @@ -1747,8 +1763,16 @@ gent_str(void) int a[8][10]; char s[12][33]; } compound_t; - compound_t comp1[3][6]; - hsize_t mdims[2]; + + compound_t **comp1 = NULL; + compound_t * comp1_data = NULL; + hsize_t mdims[2]; + + /* Set up data array */ + comp1_data = (compound_t *)HDcalloc(3 * 6, sizeof(compound_t)); + comp1 = (compound_t **)HDcalloc(3, sizeof(comp1_data)); + for (i = 0; i < 3; i++) + comp1[i] = comp1_data + (i * 6); fid = H5Fcreate(FILE13, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1837,7 +1861,7 @@ gent_str(void) } dataset = H5Dcreate2(fid, "/comp1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(dataset, f_type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, comp1); + H5Dwrite(dataset, f_type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, comp1_data); H5Tclose(f_type); H5Tclose(f_type2); @@ -1845,6 +1869,9 @@ gent_str(void) H5Dclose(dataset); H5Fclose(fid); + + HDfree(comp1); + HDfree(comp1_data); } /* diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in index 02cd832..a4fecc0 100644 --- a/tools/h5import/Makefile.in +++ b/tools/h5import/Makefile.in @@ -402,19 +402,18 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ # Include src and tools/lib directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/tools/lib -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -445,6 +444,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -472,8 +472,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -652,15 +650,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -702,7 +700,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1211,8 +1209,9 @@ uninstall-am: uninstall-binPROGRAMS # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index 9276768..e3f4384 100644 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -73,12 +73,12 @@ uint64_t swap_uint64(uint64_t val); int main(int argc, char *argv[]) { - struct Options opt; - int outfile_named = FALSE; - int token; - int i; - int state = 0; - struct Input * in = NULL; + struct Options *opt; + int outfile_named = FALSE; + int token; + int i; + int state = 0; + struct Input * in = NULL; const char *err1 = "Invalid number of arguments: %d.\n"; const char *err2 = "Error in state table.\n"; @@ -100,8 +100,8 @@ main(int argc, char *argv[]) (void)HDsetvbuf(stderr, (char *)NULL, _IOLBF, 0); (void)HDsetvbuf(stdout, (char *)NULL, _IOLBF, 0); - /* Initialize the file structure to 0 */ - HDmemset(&opt, 0, sizeof(struct Options)); + if ((opt = (struct Options *)HDcalloc(1, sizeof(struct Options))) == NULL) + goto err; if (argv[1] && (HDstrcmp("-V", argv[1]) == 0)) { print_version(PROGRAMNAME); @@ -131,12 +131,12 @@ main(int argc, char *argv[]) switch (state) { case 1: /* counting input files */ - if (opt.fcount < 29) { - (void)HDstrcpy(opt.infiles[opt.fcount].datafile, argv[i]); - in = &(opt.infiles[opt.fcount].in); - opt.infiles[opt.fcount].config = 0; - setDefaultValues(in, opt.fcount); - opt.fcount++; + if (opt->fcount < 29) { + (void)HDstrcpy(opt->infiles[opt->fcount].datafile, argv[i]); + in = &(opt->infiles[opt->fcount].in); + opt->infiles[opt->fcount].config = 0; + setDefaultValues(in, opt->fcount); + opt->fcount++; } else { (void)HDfprintf(stderr, err9, argv[i]); @@ -149,8 +149,8 @@ main(int argc, char *argv[]) break; case 3: /* get configfile name */ - (void)HDstrcpy(opt.infiles[opt.fcount - 1].configfile, argv[i]); - opt.infiles[opt.fcount - 1].config = 1; + (void)HDstrcpy(opt->infiles[opt->fcount - 1].configfile, argv[i]); + opt->infiles[opt->fcount - 1].config = 1; break; case 4: /* -o found; look for outfile */ @@ -161,7 +161,7 @@ main(int argc, char *argv[]) (void)HDfprintf(stderr, err10, argv[i]); goto err; } - (void)HDstrcpy(opt.outfile, argv[i]); + (void)HDstrcpy(opt->outfile, argv[i]); outfile_named = TRUE; break; @@ -233,11 +233,11 @@ main(int argc, char *argv[]) goto err; } - if (process(&opt) == -1) + if (process(opt) == -1) goto err; - for (i = 0; i < opt.fcount; i++) { - in = &(opt.infiles[i].in); + for (i = 0; i < opt->fcount; i++) { + in = &(opt->infiles[i].in); if (in->sizeOfDimension) HDfree(in->sizeOfDimension); if (in->sizeOfChunk) @@ -249,12 +249,13 @@ main(int argc, char *argv[]) if (in->data) HDfree(in->data); } + HDfree(opt); - return (EXIT_SUCCESS); + return EXIT_SUCCESS; err: (void)HDfprintf(stderr, "%s", err4); - for (i = 0; i < opt.fcount; i++) { - in = &(opt.infiles[i].in); + for (i = 0; i < opt->fcount; i++) { + in = &(opt->infiles[i].in); if (in->sizeOfDimension) HDfree(in->sizeOfDimension); if (in->sizeOfChunk) @@ -266,7 +267,9 @@ err: if (in->data) HDfree(in->data); } - return (EXIT_FAILURE); + HDfree(opt); + + return EXIT_FAILURE; } static int @@ -943,7 +946,7 @@ readFloatData(FILE *strm, struct Input *in) * * Return: 0, ok, -1 no * - * Programmer: Pedro Vicente, pvn@hdfgroup.org + * Programmer: Pedro Vicente * * Date: July, 26, 2007 * @@ -3776,8 +3779,8 @@ getExternalFilename(struct Input *in, FILE *strm) return (-1); } - in->externFilename = (char *)HDmalloc((size_t)(HDstrlen(temp)) * sizeof(char)); - (void)HDstrcpy(in->externFilename, temp); + in->externFilename = (char *)HDmalloc((size_t)(HDstrlen(temp) + 1) * sizeof(char)); + (void)HDstrncpy(in->externFilename, temp, HDstrlen(temp) + 1); return (0); } diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in index 7a60ca3..fdcead9 100644 --- a/tools/h5jam/Makefile.in +++ b/tools/h5jam/Makefile.in @@ -420,19 +420,18 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ # Include src and tools/lib directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/tools/lib -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -463,6 +462,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -490,8 +490,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -670,15 +668,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -724,7 +722,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1254,8 +1252,9 @@ uninstall-am: uninstall-binPROGRAMS # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c index a74d79d..1a85f24 100644 --- a/tools/h5jam/h5jam.c +++ b/tools/h5jam/h5jam.c @@ -92,13 +92,6 @@ usage(const char *prog) static void leave(int ret) { - if (ub_file) - HDfree(ub_file); - if (input_file) - HDfree(input_file); - if (output_file) - HDfree(output_file); - h5tools_close(); HDexit(ret); @@ -162,42 +155,40 @@ parse_command_line(int argc, const char *argv[]) int main(int argc, const char *argv[]) { - int ufid = -1; - int h5fid = -1; - int ofid = -1; - void * edata; - H5E_auto2_t func; - hid_t ifile = H5I_INVALID_HID; - hid_t plist = H5I_INVALID_HID; - herr_t status; - htri_t testval; - hsize_t usize; - hsize_t h5fsize; - hsize_t startub; - hsize_t where; - hsize_t newubsize; - off_t fsize; - h5_stat_t sbuf; - h5_stat_t sbuf2; - int res; + int ufid = -1; + int h5fid = -1; + int ofid = -1; + hid_t ifile = H5I_INVALID_HID; + hid_t plist = H5I_INVALID_HID; + herr_t status; + htri_t testval; + hsize_t usize; + hsize_t h5fsize; + hsize_t startub; + hsize_t where; + hsize_t newubsize; + off_t fsize; + h5_stat_t sbuf; + h5_stat_t sbuf2; + int res; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ h5tools_init(); parse_command_line(argc, argv); + /* enable error reporting if command line option */ + h5tools_error_report(); + if (ub_file == NULL) { /* no user block */ error_msg("missing argument for -u .\n"); help_ref_msg(stderr); - leave(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } testval = H5Fis_hdf5(ub_file); @@ -205,13 +196,15 @@ main(int argc, const char *argv[]) if (testval > 0) { error_msg("-u cannot be HDF5 file, but it appears to be an HDF5 file.\n"); help_ref_msg(stderr); - leave(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } if (input_file == NULL) { error_msg("missing argument for -i .\n"); help_ref_msg(stderr); - leave(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } testval = H5Fis_hdf5(input_file); @@ -219,74 +212,76 @@ main(int argc, const char *argv[]) if (testval <= 0) { error_msg("Input HDF5 file \"%s\" is not HDF5 format.\n", input_file); help_ref_msg(stderr); - leave(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } ifile = H5Fopen(input_file, H5F_ACC_RDONLY, H5P_DEFAULT); if (ifile < 0) { error_msg("Can't open input HDF5 file \"%s\"\n", input_file); - leave(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } plist = H5Fget_create_plist(ifile); if (plist < 0) { error_msg("Can't get file creation plist for file \"%s\"\n", input_file); - H5Fclose(ifile); - leave(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } status = H5Pget_userblock(plist, &usize); if (status < 0) { error_msg("Can't get user block for file \"%s\"\n", input_file); - H5Pclose(plist); - H5Fclose(ifile); - leave(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } H5Pclose(plist); + plist = H5I_INVALID_HID; H5Fclose(ifile); + ifile = H5I_INVALID_HID; - ufid = HDopen(ub_file, O_RDONLY, 0); + ufid = HDopen(ub_file, O_RDONLY); if (ufid < 0) { error_msg("unable to open user block file \"%s\"\n", ub_file); - leave(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } res = HDfstat(ufid, &sbuf); if (res < 0) { error_msg("Can't stat file \"%s\"\n", ub_file); - HDclose(ufid); - leave(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } fsize = (off_t)sbuf.st_size; - h5fid = HDopen(input_file, O_RDONLY, 0); + h5fid = HDopen(input_file, O_RDONLY); if (h5fid < 0) { error_msg("unable to open HDF5 file for read \"%s\"\n", input_file); - HDclose(ufid); - leave(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } res = HDfstat(h5fid, &sbuf2); if (res < 0) { error_msg("Can't stat file \"%s\"\n", input_file); - HDclose(h5fid); - HDclose(ufid); - leave(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } h5fsize = (hsize_t)sbuf2.st_size; if (output_file == NULL) { - ofid = HDopen(input_file, O_WRONLY, 0); + ofid = HDopen(input_file, O_WRONLY); if (ofid < 0) { error_msg("unable to open output file \"%s\"\n", output_file); - HDclose(h5fid); - HDclose(ufid); - leave(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } } else { @@ -294,9 +289,8 @@ main(int argc, const char *argv[]) if (ofid < 0) { error_msg("unable to create output file \"%s\"\n", output_file); - HDclose(h5fid); - HDclose(ufid); - leave(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } } @@ -335,12 +329,11 @@ main(int argc, const char *argv[]) /* pad the ub */ if (write_pad(ofid, where, &where) < 0) { error_msg("Can't pad file \"%s\"\n", output_file); - HDclose(h5fid); - HDclose(ufid); - HDclose(ofid); - leave(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } /* end if */ +done: if (ub_file) HDfree(ub_file); if (input_file) @@ -348,6 +341,11 @@ main(int argc, const char *argv[]) if (output_file) HDfree(output_file); + if (plist >= 0) + H5Pclose(plist); + if (ifile >= 0) + H5Fclose(ifile); + if (ufid >= 0) HDclose(ufid); if (h5fid >= 0) @@ -355,7 +353,7 @@ main(int argc, const char *argv[]) if (ofid >= 0) HDclose(ofid); - return h5tools_getstatus(); + leave(h5tools_getstatus()); } /*------------------------------------------------------------------------- diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c index fff4520..04fd27a 100644 --- a/tools/h5jam/h5unjam.c +++ b/tools/h5jam/h5unjam.c @@ -159,6 +159,13 @@ done: return EXIT_FAILURE; } +static void +leave(int ret) +{ + h5tools_close(); + HDexit(ret); +} + /*------------------------------------------------------------------------- * Function: main * @@ -171,30 +178,27 @@ done: int main(int argc, const char *argv[]) { - void * edata; - H5E_auto2_t func; - hid_t ifile = H5I_INVALID_HID; - hid_t plist = H5I_INVALID_HID; - off_t fsize; - hsize_t usize; - htri_t testval; - herr_t status; - int res; - h5_stat_t sbuf; + hid_t ifile = H5I_INVALID_HID; + hid_t plist = H5I_INVALID_HID; + off_t fsize; + hsize_t usize; + htri_t testval; + herr_t status; + int res; + h5_stat_t sbuf; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ h5tools_init(); if (EXIT_FAILURE == parse_command_line(argc, argv)) goto done; + /* enable error reporting if command line option */ + h5tools_error_report(); + if (input_file == NULL) { /* no user block */ error_msg("missing argument for HDF5 file input.\n"); @@ -293,9 +297,7 @@ done: HDfree(ub_file); } - h5tools_close(); - - return h5tools_getstatus(); + leave(h5tools_getstatus()); } /*------------------------------------------------------------------------- diff --git a/tools/h5jam/tellub.c b/tools/h5jam/tellub.c index ecb67b5..54f545a 100644 --- a/tools/h5jam/tellub.c +++ b/tools/h5jam/tellub.c @@ -65,11 +65,12 @@ parse_command_line(int argc, const char *argv[]) switch ((char)opt) { case 'h': usage(h5tools_getprogname()); - HDexit(EXIT_SUCCESS); + h5tools_setstatus(EXIT_SUCCESS); + break; case '?': default: usage(h5tools_getprogname()); - HDexit(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); } } @@ -77,10 +78,17 @@ parse_command_line(int argc, const char *argv[]) if (argc <= opt_ind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); - HDexit(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); } } /* end parse_command_line() */ +static void +leave(int ret) +{ + h5tools_close(); + HDexit(ret); +} + /*------------------------------------------------------------------------- * Function: main * @@ -92,14 +100,12 @@ parse_command_line(int argc, const char *argv[]) int main(int argc, const char *argv[]) { - char * ifname; - void * edata; - H5E_auto2_t func; - hid_t ifile; - hsize_t usize; - htri_t testval; - herr_t status; - hid_t plist = H5I_INVALID_HID; + char * ifname; + hid_t ifile = H5I_INVALID_HID; + hsize_t usize; + htri_t testval; + herr_t status; + hid_t plist = H5I_INVALID_HID; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); @@ -107,16 +113,16 @@ main(int argc, const char *argv[]) /* Initialize h5tools lib */ h5tools_init(); - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - parse_command_line(argc, argv); + /* enable error reporting if command line option */ + h5tools_error_report(); + if (argc <= (opt_ind)) { error_msg("missing file name\n"); usage(h5tools_getprogname()); - return EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); + goto done; } ifname = HDstrdup(argv[opt_ind]); @@ -125,32 +131,38 @@ main(int argc, const char *argv[]) if (testval <= 0) { error_msg("Input HDF5 file is not HDF \"%s\"\n", ifname); - return EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); + goto done; } ifile = H5Fopen(ifname, H5F_ACC_RDONLY, H5P_DEFAULT); if (ifile < 0) { error_msg("Can't open input HDF5 file \"%s\"\n", ifname); - return EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); + goto done; } plist = H5Fget_create_plist(ifile); if (plist < 0) { error_msg("Can't get file creation plist for file \"%s\"\n", ifname); - return EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); + goto done; } status = H5Pget_userblock(plist, &usize); if (status < 0) { error_msg("Can't get user block for file \"%s\"\n", ifname); - return EXIT_FAILURE; + h5tools_setstatus(EXIT_FAILURE); + goto done; } HDprintf("%ld\n", (long)usize); +done: H5Pclose(plist); - H5Fclose(ifile); + if (ifile >= 0) + H5Fclose(ifile); - return EXIT_SUCCESS; + leave(h5tools_getstatus()); } /* end main() */ diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in index 23a9ce8..b558174 100644 --- a/tools/h5ls/Makefile.in +++ b/tools/h5ls/Makefile.in @@ -415,19 +415,18 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ # Include src and tools/lib directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/tools/lib -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -458,6 +457,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -485,8 +485,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -665,15 +663,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -722,7 +720,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1243,8 +1241,9 @@ uninstall-am: uninstall-binPROGRAMS # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 74b6967..c5b0c01 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, March 23, 1998 */ @@ -1282,93 +1282,6 @@ print_type(h5tools_str_t *buffer, hid_t type, int ind) (unsigned)data_class); } -/* - * - */ -static void -dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t container, - hid_t f_type, void *ref_buf, int ndims) -{ - hid_t region_id = H5I_INVALID_HID; - hid_t region_space = H5I_INVALID_HID; - size_t nsize; - hsize_t elmt_counter = 0; /*counts the # elements printed. */ - size_t ncols = 80; /* available output width */ - int i; - hsize_t curr_pos = 0; /* total data element position */ - h5tools_str_t buffer; /* string into which to render */ - h5tools_context_t datactx; /* print context */ - unsigned char * mem = (unsigned char *)ref_buf; - - H5TOOLS_START_DEBUG(""); - - nsize = H5Tget_size(f_type); - datactx = *ctx; /* print context */ - /* Assume entire data space to be printed */ - if (datactx.ndims > 0) - for (i = 0; (unsigned)i < datactx.ndims; i++) - datactx.p_min_idx[i] = 0; - datactx.need_prefix = TRUE; - - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); - for (i = 0; i < ndims; i++, datactx.cur_elmt++, elmt_counter++) { - void *memref = mem + i * nsize; - - H5TOOLS_DEBUG("reference loop:%d with curr_pos=%ld", i, curr_pos); - - datactx.need_prefix = TRUE; - h5tools_str_reset(&buffer); - H5TOOLS_DEBUG("reference loop - h5tools_str_sprint"); - h5tools_str_sprint(&buffer, info, container, f_type, memref, &datactx); - h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)i, - (hsize_t)ndims); - - /* region data */ - if (!h5tools_is_zero(memref, H5Tget_size(f_type))) { - if ((region_id = H5Rdereference(container, H5R_DATASET_REGION, memref)) >= 0) { - if ((region_space = H5Rget_region(container, H5R_DATASET_REGION, memref)) >= 0) { - H5S_sel_type region_type; - - region_type = H5Sget_select_type(region_space); - if (region_type == H5S_SEL_POINTS) { - /* Print point information */ - H5TOOLS_DEBUG("H5S_SEL_POINTS H5R_DATASET_REGION"); - h5tools_dump_region_data_points(region_space, region_id, stream, info, &datactx, - &buffer, &curr_pos, ncols, (hsize_t)i, elmt_counter); - } - else if (region_type == H5S_SEL_HYPERSLABS) { - /* Print block information */ - H5TOOLS_DEBUG("H5S_SEL_HYPERSLABS H5R_DATASET_REGION"); - h5tools_dump_region_data_blocks(region_space, region_id, stream, info, &datactx, - &buffer, &curr_pos, ncols, (hsize_t)i, elmt_counter); - } - else - H5TOOLS_INFO("invalid region type"); - if (H5Sclose(region_space) < 0) - H5TOOLS_INFO("H5Sclose H5R_DATASET_REGION failed"); - } /* end if (region_space >= 0) */ - else - H5TOOLS_INFO("H5Rget_region H5R_DATASET_REGION failed"); - if (H5Dclose(region_id) < 0) - H5TOOLS_INFO("H5Dclose H5R_DATASET_REGION failed"); - } /* if (region_id >= 0) */ - else { - /* if (region_id < 0) - could mean that no reference was written do not throw failure */ - H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, - H5E_tools_min_id_g, "H5Rdereference failed"); - } - } /* end if (h5tools_is_zero(... */ - - H5TOOLS_DEBUG("finished reference loop:%d", i); - } /* end for(i = 0; i < ndims; i++, ctx->cur_elmt++, elmt_counter++) */ - - h5tools_str_close(&buffer); - - PRINTVALSTREAM(stream, "\n"); - - H5TOOLS_ENDDEBUG(""); -} - /*------------------------------------------------------------------------- * Function: dump_dataset_values * @@ -1384,7 +1297,6 @@ dump_dataset_values(hid_t dset) hid_t space = H5I_INVALID_HID; hsize_t total_size[H5S_MAX_RANK]; int ndims; - size_t i; size_t nsize; char string_prefix[64]; static char fmt_double[16]; @@ -1409,6 +1321,7 @@ dump_dataset_values(hid_t dset) outputformat.line_1st = NULL; outputformat.idx_fmt = ""; if (simple_output_g) { + outputformat.idx_fmt = ""; outputformat.line_per_line = 1; outputformat.line_multi_new = 0; outputformat.line_pre = " "; @@ -1501,13 +1414,9 @@ dump_dataset_values(hid_t dset) H5TOOLS_DEBUG("ndims=%d - ctx.ndims=%d", ndims, ctx.ndims); /* Assume entire data space to be printed */ - if (ctx.ndims > 0) - for (i = 0; i < (size_t)ctx.ndims; i++) - ctx.p_min_idx[i] = 0; - H5Sget_simple_extent_dims(space, total_size, NULL); - if (ctx.ndims > 0) - init_acc_pos(&ctx, total_size); + init_acc_pos(ctx.ndims, total_size, ctx.acc, ctx.pos, ctx.p_min_idx); + ctx.need_prefix = TRUE; if (NULL != (region_buf = (void *)HDcalloc(nsize, (size_t)ndims))) { @@ -1517,7 +1426,9 @@ dump_dataset_values(hid_t dset) H5TOOLS_INFO("H5Dread reference failed"); H5TOOLS_GOTO_DONE_NO_RET(); } - dump_reference(rawoutstream, info, &ctx, dset, f_type, region_buf, ndims); + h5tools_dump_reference(rawoutstream, info, &ctx, dset, f_type, region_buf, ndims); + + PRINTVALSTREAM(rawoutstream, "\n"); HDfree(region_buf); } } @@ -1555,7 +1466,6 @@ dump_attribute_values(hid_t attr) hid_t space = H5I_INVALID_HID; hsize_t total_size[H5S_MAX_RANK]; int ndims; - size_t i; size_t nsize; char string_prefix[64]; static char fmt_double[16]; @@ -1580,6 +1490,7 @@ dump_attribute_values(hid_t attr) outputformat.line_1st = NULL; outputformat.idx_fmt = ""; if (simple_output_g) { + outputformat.idx_fmt = ""; outputformat.line_per_line = 1; outputformat.line_multi_new = 0; outputformat.line_pre = " "; @@ -1673,13 +1584,9 @@ dump_attribute_values(hid_t attr) H5TOOLS_DEBUG("ndims=%d - ctx.ndims=%d", ndims, ctx.ndims); /* Assume entire data space to be printed */ - if (ctx.ndims > 0) - for (i = 0; i < (size_t)ctx.ndims; i++) - ctx.p_min_idx[i] = 0; - H5Sget_simple_extent_dims(space, total_size, NULL); - if (ctx.ndims > 0) - init_acc_pos(&ctx, total_size); + init_acc_pos(ctx.ndims, total_size, ctx.acc, ctx.pos, ctx.p_min_idx); + ctx.need_prefix = TRUE; if (NULL != (region_buf = (void *)HDcalloc(nsize, (size_t)ndims))) { @@ -1690,7 +1597,9 @@ dump_attribute_values(hid_t attr) H5TOOLS_GOTO_DONE_NO_RET(); } ctx.indent_level++; - dump_reference(rawoutstream, info, &ctx, attr, f_type, region_buf, ndims); + h5tools_dump_reference(rawoutstream, info, &ctx, attr, f_type, region_buf, ndims); + + PRINTVALSTREAM(rawoutstream, "\n"); ctx.indent_level--; HDfree(region_buf); } @@ -2179,13 +2088,13 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void (hsize_t)0, (hsize_t)0); } /* end if */ else { - hid_t obj = H5I_INVALID_HID; /* ID of object opened */ + hid_t obj_id = H5I_INVALID_HID; /* ID of object opened */ /* Open the object. Not all objects can be opened. If this is the case * then return right away. */ H5TOOLS_DEBUG("Open object name=%s", name); - if (obj_type >= 0 && (obj = H5Oopen(iter->fid, name, H5P_DEFAULT)) < 0) { + if (obj_type >= 0 && (obj_id = H5Oopen(iter->fid, name, H5P_DEFAULT)) < 0) { h5tools_str_reset(&buffer); h5tools_str_append(&buffer, " *ERROR*\n"); h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, @@ -2196,7 +2105,7 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void /* List the first line of information for the object. */ H5TOOLS_DEBUG("Object type:%d", obj_type); if (obj_type >= 0 && dispatch_g[obj_type].list1) - (dispatch_g[obj_type].list1)(obj); + (dispatch_g[obj_type].list1)(obj_id); if (!iter->symlink_target || (verbose_g > 0)) { h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "\n"); @@ -2214,7 +2123,7 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void /* Display attributes */ H5TOOLS_DEBUG("Display attributes"); if (obj_type >= 0) - H5Aiterate2(obj, H5_INDEX_NAME, H5_ITER_INC, NULL, list_attr, NULL); + H5Aiterate2(obj_id, H5_INDEX_NAME, H5_ITER_INC, NULL, list_attr, NULL); /* Object location & reference count */ h5tools_str_reset(&buffer); @@ -2243,15 +2152,15 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void } /* end if */ /* Object comment */ - cmt_bufsize = H5Oget_comment(obj, comment, buf_size); + cmt_bufsize = H5Oget_comment(obj_id, comment, buf_size); /* if the actual length of the comment is longer than cmt_bufsize, then call * H5Oget_comment again with the correct value. - * If the call to H5Oget_comment returned an error, skip this block */ + */ if (cmt_bufsize > 0) { comment = (char *)HDmalloc((size_t)cmt_bufsize + 1); /* new_size including null terminator */ if (comment) { - cmt_bufsize = H5Oget_comment(obj, comment, (size_t)cmt_bufsize); + cmt_bufsize = H5Oget_comment(obj_id, comment, (size_t)cmt_bufsize); if (cmt_bufsize > 0) { comment[cmt_bufsize] = 0; h5tools_str_reset(&buffer); @@ -2268,11 +2177,11 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void /* Detailed list for object */ if (obj_type >= 0 && dispatch_g[obj_type].list2) - (dispatch_g[obj_type].list2)(obj, name); + (dispatch_g[obj_type].list2)(obj_id, name); /* Close the object. */ if (obj_type >= 0) - H5Oclose(obj); + H5Oclose(obj_id); } /* end else */ done: @@ -2695,48 +2604,36 @@ main(int argc, const char *argv[]) const char *preferred_driver = NULL; int err_exit = 0; hid_t fapl_id = H5P_DEFAULT; - H5E_auto2_t func; - H5E_auto2_t tools_func; - void * edata; - void * tools_edata; #ifdef H5_HAVE_ROS3_VFD - /* default "anonymous" s3 configuration */ + /* Default "anonymous" S3 configuration */ H5FD_ros3_fapl_t ros3_fa = { - 1, /* fapl version */ - FALSE, /* authenticate */ - "", /* aws region */ - "", /* access key id */ - "", /* secret access key */ + 1, /* Structure Version */ + FALSE, /* Authenticate? */ + "", /* AWS Region */ + "", /* Access Key ID */ + "", /* Secret Access Key */ }; -#endif /* H5_HVAE_ROS3_VFD */ +#endif /* H5_HAVE_ROS3_VFD */ #ifdef H5_HAVE_LIBHDFS - /* "default" HDFS configuration */ + /* "Default" HDFS configuration */ H5FD_hdfs_fapl_t hdfs_fa = { - 1, /* fapl version */ - "localhost", /* namenode name */ - 0, /* namenode port */ - "", /* kerberos ticket cache */ - "", /* user name */ - 2048, /* stream buffer size */ + 1, /* Structure Version */ + "localhost", /* Namenode Name */ + 0, /* Namenode Port */ + "", /* Kerberos ticket cache */ + "", /* User name */ + 2048, /* Stream buffer size */ }; #endif /* H5_HAVE_LIBHDFS */ h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ h5tools_init(); - /* Disable tools error reporting */ - H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); - H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); - /* Build object display table */ DISPATCH(H5O_TYPE_GROUP, "Group", NULL, NULL); DISPATCH(H5O_TYPE_DATASET, "Dataset", dataset_list1, dataset_list2); @@ -2856,18 +2753,9 @@ main(int argc, const char *argv[]) } } else if (!HDstrncmp(argv[argno], "--s3-cred=", (size_t)10)) { -#ifndef H5_HAVE_ROS3_VFD - HDfprintf(rawerrorstream, "Error: Read-Only S3 VFD is not enabled\n\n"); - usage(); - leave(EXIT_FAILURE); -#else - unsigned nelems = 0; - char * start = NULL; - char * s3cred_src = NULL; - char ** s3cred = NULL; - char const *ccred[3]; - /* try to parse s3 credentials tuple - */ +#ifdef H5_HAVE_ROS3_VFD + char const *start = NULL; + start = strchr(argv[argno], '='); if (start == NULL) { HDfprintf(rawerrorstream, @@ -2877,123 +2765,38 @@ main(int argc, const char *argv[]) leave(EXIT_FAILURE); } start++; - if (FAIL == parse_tuple((const char *)start, ',', &s3cred_src, &nelems, &s3cred)) { - HDfprintf(rawerrorstream, "Error: Unable to parse S3 credentials\n\n"); - usage(); - leave(EXIT_FAILURE); - } - /* sanity-check tuple count - */ - if (nelems != 3) { - HDfprintf(rawerrorstream, "Error: Invalid S3 credentials\n\n"); - usage(); - leave(EXIT_FAILURE); - } - ccred[0] = (const char *)s3cred[0]; - ccred[1] = (const char *)s3cred[1]; - ccred[2] = (const char *)s3cred[2]; - if (0 == h5tools_populate_ros3_fapl(&ros3_fa, ccred)) { - HDfprintf(rawerrorstream, "Error: Invalid S3 credentials\n\n"); + + if (h5tools_parse_ros3_fapl_tuple(start, ',', &ros3_fa) < 0) { + HDfprintf(rawerrorstream, "Error: failed to parse S3 VFD credential info\n\n"); usage(); leave(EXIT_FAILURE); } - HDfree(s3cred); - HDfree(s3cred_src); -#endif /* H5_HAVE_ROS3_VFD */ +#else + HDfprintf(rawerrorstream, "Error: Read-Only S3 VFD is not enabled\n\n"); + usage(); + leave(EXIT_FAILURE); +#endif } else if (!HDstrncmp(argv[argno], "--hdfs-attrs=", (size_t)13)) { -#ifndef H5_HAVE_LIBHDFS - PRINTVALSTREAM(rawoutstream, "The HDFS VFD is not enabled.\n"); - leave(EXIT_FAILURE); -#else - /* Parse received configuration data and set fapl config struct */ - - hbool_t _debug = FALSE; - unsigned nelems = 0; - char const * start = NULL; - char * props_src = NULL; - char ** props = NULL; - unsigned long k = 0; +#ifdef H5_HAVE_LIBHDFS + char const *start = NULL; - /* try to parse tuple - */ - if (_debug) { - HDfprintf(stderr, "configuring hdfs...\n"); - } start = argv[argno] + 13; /* should never segfault: worst case of */ if (*start != '(') { /* null-termintor after '='. */ - - if (_debug) { - HDfprintf(stderr, " no tuple.\n"); - } - usage(); - leave(EXIT_FAILURE); - } - if (FAIL == parse_tuple((const char *)start, ',', &props_src, &nelems, &props)) { - HDfprintf(stderr, " unable to parse tuple.\n"); usage(); leave(EXIT_FAILURE); } - /* sanity-check tuple count - */ - if (nelems != 5) { - HDfprintf(stderr, " expected 5-ple, got `%d`\n", nelems); + if (h5tools_parse_hdfs_fapl_tuple(start, ',', &hdfs_fa) < 0) { + HDfprintf(rawerrorstream, "Error: failed to parse HDFS VFD configuration info\n\n"); usage(); leave(EXIT_FAILURE); } - if (_debug) { - HDfprintf(stderr, " got hdfs-attrs tuple: `(%s,%s,%s,%s,%s)`\n", props[0], props[1], - props[2], props[3], props[4]); - } - - /* Populate fapl configuration structure with given properties. - * WARNING: No error-checking is done on length of input strings... - * Silent overflow is possible, albeit unlikely. - */ - if (HDstrncmp(props[0], "", 1)) { - if (_debug) { - HDfprintf(stderr, " setting namenode name: %s\n", props[0]); - } - HDstrncpy(hdfs_fa.namenode_name, (const char *)props[0], HDstrlen(props[0])); - } - if (HDstrncmp(props[1], "", 1)) { - k = strtoul((const char *)props[1], NULL, 0); - if (errno == ERANGE) { - HDfprintf(stderr, " supposed port number wasn't.\n"); - leave(EXIT_FAILURE); - } - if (_debug) { - HDfprintf(stderr, " setting namenode port: %lu\n", k); - } - hdfs_fa.namenode_port = (int32_t)k; - } - if (HDstrncmp(props[2], "", 1)) { - if (_debug) { - HDfprintf(stderr, " setting kerb cache path: %s\n", props[2]); - } - HDstrncpy(hdfs_fa.kerberos_ticket_cache, (const char *)props[2], HDstrlen(props[2])); - } - if (HDstrncmp(props[3], "", 1)) { - if (_debug) { - HDfprintf(stderr, " setting username: %s\n", props[3]); - } - HDstrncpy(hdfs_fa.user_name, (const char *)props[3], HDstrlen(props[3])); - } - if (HDstrncmp(props[4], "", 1)) { - k = HDstrtoul((const char *)props[4], NULL, 0); - if (errno == ERANGE) { - HDfprintf(stderr, " supposed buffersize number wasn't.\n"); - leave(EXIT_FAILURE); - } - if (_debug) { - HDfprintf(stderr, " setting stream buffer size: %lu\n", k); - } - hdfs_fa.stream_buffer_size = (int32_t)k; - } - HDfree(props); - HDfree(props_src); -#endif /* H5_HAVE_LIBHDFS */ +#else + HDfprintf(rawerrorstream, "Error: The HDFS VFD is not enabled\n\n"); + usage(); + leave(EXIT_FAILURE); +#endif } else if ('-' != argv[argno][1]) { /* Single-letter switches */ @@ -3073,6 +2876,9 @@ main(int argc, const char *argv[]) } } /* end for */ + /* enable error reporting if command line option */ + h5tools_error_report(); + /* If no arguments remain then print a usage message (instead of doing * absolutely nothing ;-) */ if (argno >= argc) { @@ -3087,44 +2893,32 @@ main(int argc, const char *argv[]) } if (preferred_driver) { - void *conf_fa = NULL; + h5tools_vfd_info_t vfd_info; - if (!HDstrcmp(preferred_driver, "ros3")) { -#ifndef H5_HAVE_ROS3_VFD - HDfprintf(rawerrorstream, "Error: Read-Only S3 VFD not enabled.\n\n"); - usage(); - leave(EXIT_FAILURE); + vfd_info.info = NULL; + vfd_info.name = preferred_driver; + + if (!HDstrcmp(preferred_driver, drivernames[ROS3_VFD_IDX])) { +#ifdef H5_HAVE_ROS3_VFD + vfd_info.info = (void *)&ros3_fa; #else - conf_fa = (void *)&ros3_fa; -#endif /* H5_HAVE_ROS3_VFD */ - } - else if (!HDstrcmp(preferred_driver, "hdfs")) { -#ifndef H5_HAVE_LIBHDFS - PRINTVALSTREAM(rawoutstream, "The HDFS VFD is not enabled.\n"); + HDfprintf(rawerrorstream, "Error: Read-Only S3 VFD is not enabled\n\n"); leave(EXIT_FAILURE); +#endif + } + else if (!HDstrcmp(preferred_driver, drivernames[HDFS_VFD_IDX])) { +#ifdef H5_HAVE_LIBHDFS + vfd_info.info = (void *)&hdfs_fa; #else - conf_fa = (void *)&hdfs_fa; -#endif /* H5_HAVE_LIBHDFS */ + HDfprintf(rawerrorstream, "Error: The HDFS VFD is not enabled\n\n"); + leave(EXIT_FAILURE); +#endif } - if (conf_fa != NULL) { - HDassert(fapl_id == H5P_DEFAULT); - fapl_id = H5Pcreate(H5P_FILE_ACCESS); - if (fapl_id < 0) { - HDfprintf(rawerrorstream, "Error: Unable to create fapl entry\n\n"); - leave(EXIT_FAILURE); - } - if (0 == h5tools_set_configured_fapl(fapl_id, preferred_driver, conf_fa)) { - HDfprintf(rawerrorstream, "Error: Unable to set fapl\n\n"); - usage(); - leave(EXIT_FAILURE); - } + if ((fapl_id = h5tools_get_fapl(H5P_DEFAULT, &vfd_info)) < 0) { + HDfprintf(rawerrorstream, "Error: Unable to create FAPL for file access\n\n"); + leave(EXIT_FAILURE); } - } /* preferred_driver defined */ - - if (enable_error_stack > 0) { - H5Eset_auto2(H5E_DEFAULT, func, edata); - H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); } /* Each remaining argument is an hdf5 file followed by an optional slash @@ -3151,13 +2945,8 @@ main(int argc, const char *argv[]) file_id = H5I_INVALID_HID; while (fname && *fname) { - if (fapl_id != H5P_DEFAULT) { - file_id = H5Fopen(fname, H5F_ACC_RDONLY, fapl_id); - } - else { - file_id = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, preferred_driver, drivername, - sizeof drivername); - } + file_id = h5tools_fopen(fname, H5F_ACC_RDONLY, fapl_id, (fapl_id == H5P_DEFAULT) ? FALSE : TRUE, + drivername, sizeof drivername); if (file_id >= 0) { if (verbose_g) @@ -3190,7 +2979,6 @@ main(int argc, const char *argv[]) x = oname; if (NULL == (oname = HDstrdup(oname))) { HDfprintf(rawerrorstream, "memory allocation failed\n"); - H5Eset_auto2(H5E_DEFAULT, func, edata); leave(EXIT_FAILURE); } *x = '\0'; @@ -3236,7 +3024,6 @@ main(int argc, const char *argv[]) print_obj_name(&buffer, &iter, oname, "**NOT FOUND**"); h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0); - H5Eset_auto2(H5E_DEFAULT, func, edata); leave(EXIT_FAILURE); } /* end if */ } /* end if */ @@ -3246,7 +3033,6 @@ main(int argc, const char *argv[]) /* Open the object and display it's information */ if (li.type == H5L_TYPE_HARD) { if (visit_obj(file_id, oname, &iter) < 0) { - H5Eset_auto2(H5E_DEFAULT, func, edata); leave(EXIT_FAILURE); } } /* end if(li.type == H5L_TYPE_HARD) */ @@ -3277,12 +3063,10 @@ main(int argc, const char *argv[]) if (fapl_id != H5P_DEFAULT) { if (0 < H5Pclose(fapl_id)) { HDfprintf(rawerrorstream, "Error: Unable to set close fapl entry\n\n"); - H5Eset_auto2(H5E_DEFAULT, func, edata); leave(EXIT_FAILURE); } } - H5Eset_auto2(H5E_DEFAULT, func, edata); if (err_exit) leave(EXIT_FAILURE); else diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 0895d55..878f095 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -474,20 +474,19 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ # Include src, test, and tools/lib directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/test -I$(top_srcdir)/tools/lib \ -I$(top_srcdir)/tools/h5repack -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -518,6 +517,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -545,8 +545,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -725,15 +723,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -803,7 +801,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1393,8 +1391,9 @@ uninstall-am: uninstall-binPROGRAMS # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index 80c658e..6ea0178 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -73,10 +73,12 @@ h5repack_init(pack_opt_t *options, int verbose, hbool_t latest) int k, n; HDmemset(options, 0, sizeof(pack_opt_t)); - options->min_comp = 0; - options->verbose = verbose; - options->latest = latest; - options->layout_g = H5D_LAYOUT_ERROR; + options->min_comp = 0; + options->verbose = verbose; + options->latest = latest; + options->layout_g = H5D_LAYOUT_ERROR; + options->fin_fapl = H5P_DEFAULT; + options->fout_fapl = H5P_DEFAULT; for (n = 0; n < H5_REPACK_MAX_NFILTERS; n++) { options->filter_g[n].filtn = -1; @@ -521,6 +523,8 @@ done: */ if (TRUE == h5tools_detect_vlen(wtype_id)) H5Dvlen_reclaim(wtype_id, space_id, H5P_DEFAULT, buf); + + /* Free buf */ HDfree(buf); } @@ -699,7 +703,7 @@ check_options(pack_opt_t *options) } if (options->ublock_filename == NULL && options->ublock_size != 0) - H5TOOLS_GOTO_ERROR((-1), "file name missing for user block", options->ublock_filename); + H5TOOLS_GOTO_ERROR((-1), "file name missing for user block"); /*------------------------------------------------------------------------ * Verify alignment options; threshold is zero default but alignment not @@ -741,7 +745,8 @@ check_objects(const char *fname, pack_opt_t *options) * open the file *------------------------------------------------------------------------- */ - if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, 0)) < 0) + if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, options->fin_fapl, + (options->fin_fapl == H5P_DEFAULT) ? FALSE : TRUE, NULL, 0)) < 0) H5TOOLS_GOTO_ERROR((-1), "h5tools_fopen failed <%s>: %s", fname, H5FOPENERROR); /*------------------------------------------------------------------------- diff --git a/tools/h5repack/h5repack.h b/tools/h5repack/h5repack.h index 254d839..58967c0 100644 --- a/tools/h5repack/h5repack.h +++ b/tools/h5repack/h5repack.h @@ -92,17 +92,21 @@ typedef struct { /* all the above, ready to go to the hrepack call */ typedef struct { - pack_opttbl_t *op_tbl; /*table with all -c and -f options */ - int all_layout; /*apply the layout to all objects */ - int all_filter; /*apply the filter to all objects */ + pack_opttbl_t *op_tbl; /* table with all -c and -f options */ + int all_layout; /* apply the layout to all objects */ + int all_filter; /* apply the filter to all objects */ filter_info_t filter_g[H5_REPACK_MAX_NFILTERS]; /*global filter array for the ALL case */ - int n_filter_g; /*number of global filters */ - chunk_info_t chunk_g; /*global chunk INFO for the ALL case */ - H5D_layout_t layout_g; /*global layout information for the ALL case */ - int verbose; /*verbose mode */ - hsize_t min_comp; /*minimum size to compress, in bytes */ - int use_native; /*use a native type in write */ - int latest; /*pack file with the latest file format */ + int n_filter_g; /* number of global filters */ + chunk_info_t chunk_g; /* global chunk INFO for the ALL case */ + H5D_layout_t layout_g; /* global layout information for the ALL case */ + int verbose; /* verbose mode */ + hbool_t merge; /* Merge external file. */ + hbool_t prune; /* Don't follow external file. */ + hsize_t min_comp; /* minimum size to compress, in bytes */ + int use_native; /* use a native type in write */ + int latest; /* pack file with the latest file format */ + hid_t fin_fapl; /* FAPL to use for opening the input file */ + hid_t fout_fapl; /* FAPL to use for opening/creating the output file */ int grp_compact; /* Set the maximum number of links to store as header messages in the group */ int grp_indexed; /* Set the minimum number of links to store in the indexed format */ int msg_size[8]; /* Minimum size of shared messages: dataspace, @@ -135,7 +139,7 @@ int h5repack_addlayout(const char *str, pack_opt_t *options); int h5repack_init(pack_opt_t *options, int verbose, hbool_t latest); int h5repack_end(pack_opt_t *options); int h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options); -int h5repack_cmp_pl(const char *fname1, const char *fname2); +int h5repack_cmp_pl(const char *fname1, hid_t fname1_fapl, const char *fname2, hid_t fname2_fapl); /* Note: The below copy_named_datatype(), named_datatype_free(), copy_attr() * and struct named_dt_t were located in h5repack_copy.c as static prior to diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 7ee6399..2df22fa 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -33,23 +33,6 @@ /* size of buffer/# of bytes to xfer at a time when copying userblock */ #define USERBLOCK_XFER_SIZE 512 -/* check H5Dread()/H5Dwrite() error, e.g. memory allocation error inside the library. */ -#define CHECK_H5DRW_ERROR(_fun, _fail, _did, _mtid, _msid, _fsid, _pid, _buf) \ - { \ - H5E_BEGIN_TRY \ - { \ - if (_fun(_did, _mtid, _msid, _fsid, _pid, _buf) < 0) { \ - hid_t _err_num = 0; \ - char _msg[80]; \ - H5Ewalk2(H5E_DEFAULT, H5E_WALK_DOWNWARD, walk_error_callback, &_err_num); \ - H5Eget_msg(_err_num, NULL, _msg, (size_t)80); \ - error_msg("%s %s -- %s\n", #_fun, "failed", _msg); \ - HGOTO_DONE(_fail) \ - } \ - } \ - H5E_END_TRY; \ - } - /*------------------------------------------------------------------------- * local functions *------------------------------------------------------------------------- @@ -62,17 +45,6 @@ static int copy_user_block(const char *infile, const char *outfile, hsize_t siz #if defined(H5REPACK_DEBUG_USER_BLOCK) static void print_user_block(const char *filename, hid_t fid); #endif -static herr_t walk_error_callback(unsigned n, const H5E_error2_t *err_desc, void *udata); - -/* get the major number from the error stack. */ -static herr_t -walk_error_callback(H5_ATTR_UNUSED unsigned n, const H5E_error2_t *err_desc, void *udata) -{ - if (err_desc) - *((hid_t *)udata) = err_desc->maj_num; - - return 0; -} /*------------------------------------------------------------------------- * Function: copy_objects @@ -92,7 +64,6 @@ copy_objects(const char *fnamein, const char *fnameout, pack_opt_t *options) hid_t grp_in = H5I_INVALID_HID; /* group ID */ hid_t gcpl_in = H5I_INVALID_HID; /* group creation property list */ hid_t fcpl = H5P_DEFAULT; /* file creation property list ID */ - hid_t fapl = H5P_DEFAULT; /* file access property list ID */ trav_table_t *travt = NULL; hsize_t ub_size = 0; /* size of user block */ unsigned crt_order_flags; /* group creation order flag */ @@ -102,7 +73,8 @@ copy_objects(const char *fnamein, const char *fnameout, pack_opt_t *options) * open input file *------------------------------------------------------------------------- */ - if ((fidin = h5tools_fopen(fnamein, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) + if ((fidin = h5tools_fopen(fnamein, H5F_ACC_RDONLY, options->fin_fapl, + (options->fin_fapl == H5P_DEFAULT) ? FALSE : TRUE, NULL, (size_t)0)) < 0) H5TOOLS_GOTO_ERROR((-1), "h5tools_fopen failed <%s>: %s", fnamein, H5FOPENERROR); /* get user block size and file space strategy/threshold */ @@ -130,11 +102,12 @@ copy_objects(const char *fnamein, const char *fnameout, pack_opt_t *options) } /* Create file access property list */ - if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - H5TOOLS_GOTO_ERROR((-1), "H5Pcreate failed to create file access property list"); + if (options->fout_fapl == H5P_DEFAULT) + if ((options->fout_fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Pcreate failed to create file access property list"); if (options->latest) - if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + if (H5Pset_libver_bounds(options->fout_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Pset_libver_bounds failed to set format version bounds"); /* Check if we need to create a non-default file creation property list */ @@ -230,12 +203,12 @@ copy_objects(const char *fnamein, const char *fnameout, pack_opt_t *options) */ if (options->alignment > 0) { /* either use the FAPL already created or create a new one */ - if (fapl == H5P_DEFAULT) + if (options->fout_fapl == H5P_DEFAULT) /* create a file access property list */ - if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + if ((options->fout_fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Pcreate failed to create file access property list"); - if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0) + if (H5Pset_alignment(options->fout_fapl, options->threshold, options->alignment) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Pset_alignment failed to set alignment"); } @@ -245,12 +218,12 @@ copy_objects(const char *fnamein, const char *fnameout, pack_opt_t *options) */ if (options->meta_block_size > 0) { /* either use the FAPL already created or create a new one */ - if (fapl == H5P_DEFAULT) + if (options->fout_fapl == H5P_DEFAULT) /* create a file access property list */ - if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + if ((options->fout_fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Pcreate failed to create file access property list"); - if (H5Pset_meta_block_size(fapl, options->meta_block_size) < 0) + if (H5Pset_meta_block_size(options->fout_fapl, options->meta_block_size) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Pset_meta_block_size failed to set metadata block size"); } @@ -275,7 +248,7 @@ copy_objects(const char *fnamein, const char *fnameout, pack_opt_t *options) if (options->verbose) HDprintf("Making new file ...\n"); - if ((fidout = H5Fcreate(fnameout, H5F_ACC_TRUNC, fcpl, fapl)) < 0) + if ((fidout = H5Fcreate(fnameout, H5F_ACC_TRUNC, fcpl, options->fout_fapl)) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Fcreate could not create file <%s>:", fnameout); /*------------------------------------------------------------------------- @@ -331,15 +304,14 @@ copy_objects(const char *fnamein, const char *fnameout, pack_opt_t *options) done: H5E_BEGIN_TRY { - H5Pclose(fcpl_in); - H5Pclose(gcpl_in); - H5Pclose(fapl); H5Pclose(fcpl); + H5Pclose(options->fout_fapl); + options->fout_fapl = H5P_DEFAULT; + H5Pclose(gcpl_in); H5Gclose(grp_in); - H5Fclose(fidin); + H5Pclose(fcpl_in); H5Fclose(fidout); H5Fclose(fidin); - H5Fclose(fidout); } H5E_END_TRY; if (travt) @@ -574,6 +546,8 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti hid_t f_space_id = H5I_INVALID_HID; /* file space ID */ hid_t ftype_id = H5I_INVALID_HID; /* file type ID */ hid_t wtype_id = H5I_INVALID_HID; /* read/write type ID */ + hid_t ocpl_id = H5I_INVALID_HID; /* property to pass copy options */ + hid_t lcpl_id = H5I_INVALID_HID; /* link creation property list */ named_dt_t * named_dt_head = NULL; /* Pointer to the stack of named datatypes copied */ size_t msize; /* size of type */ hsize_t nelmts; /* number of elements in dataset */ @@ -590,6 +564,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti int req_filter; /* there was a request for a filter */ int req_obj_layout = 0; /* request layout to current object */ unsigned crt_order_flags; /* group creation order flag */ + h5tool_link_info_t linkinfo; unsigned i; unsigned u; int ifil; @@ -599,6 +574,9 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti hsize_t size_dset; int ret_value = 0; + /* init linkinfo struct */ + HDmemset(&linkinfo, 0, sizeof(h5tool_link_info_t)); + /*------------------------------------------------------------------------- * copy the supplied object list *------------------------------------------------------------------------- @@ -1105,26 +1083,25 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti *------------------------------------------------------------------------- */ else { - hid_t pid = H5I_INVALID_HID; - /* create property to pass copy options */ - if ((pid = H5Pcreate(H5P_OBJECT_COPY)) < 0) + if ((ocpl_id = H5Pcreate(H5P_OBJECT_COPY)) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Pcreate failed"); /* set options for object copy */ - if (H5Pset_copy_object(pid, H5O_COPY_WITHOUT_ATTR_FLAG) < 0) + if (H5Pset_copy_object(ocpl_id, H5O_COPY_WITHOUT_ATTR_FLAG) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Pset_copy_object failed"); if (H5Ocopy(fidin, /* Source file or group identifier */ travt->objs[i].name, /* Name of the source object to be copied */ fidout, /* Destination file or group identifier */ travt->objs[i].name, /* Name of the destination object */ - pid, /* Properties which apply to the copy */ + ocpl_id, /* Properties which apply to the copy */ H5P_DEFAULT) < 0) /* Properties which apply to the new hard link */ H5TOOLS_GOTO_ERROR((-1), "H5Ocopy failed"); - if (H5Pclose(pid) < 0) + if (H5Pclose(ocpl_id) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Pclose failed"); + ocpl_id = H5I_INVALID_HID; /*------------------------------------------------------------------------- * Copy attrs manually @@ -1197,12 +1174,64 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti if (options->verbose) HDprintf(FORMAT_OBJ, "link", travt->objs[i].name); - if (H5Lcopy(fidin, travt->objs[i].name, fidout, travt->objs[i].name, H5P_DEFAULT, - H5P_DEFAULT) < 0) - H5TOOLS_GOTO_ERROR((-1), "H5Lcopy failed"); + /* Check -X option. */ + if (options->merge) { + if (H5tools_get_symlink_info(fidin, travt->objs[i].name, &linkinfo, 1) == 0) { + /* dangling link */ + if (options->prune) { + HDprintf("Pruned %s.\n", travt->objs[i].name); + } + else { + if (H5Lcopy(fidin, travt->objs[i].name, fidout, travt->objs[i].name, + H5P_DEFAULT, H5P_DEFAULT) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Lcopy failed"); + } + } + else { + /* valid link */ + /* create property to pass copy options */ + if ((ocpl_id = H5Pcreate(H5P_OBJECT_COPY)) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Pcreate create property failed"); + + /* set options for object copy */ + if (H5Pset_copy_object(ocpl_id, H5O_COPY_EXPAND_EXT_LINK_FLAG) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Pset_copy_object failed"); + + /* Create link creation property list */ + if ((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0) { + H5TOOLS_GOTO_ERROR((-1), "H5Pcreate link creation property failed"); + } + + /* Set flag for intermediate group creation */ + if (H5Pset_create_intermediate_group(lcpl_id, TRUE) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Pset_create_intermediate_group failed"); + + if (H5Ocopy(fidin, travt->objs[i].name, fidout, travt->objs[i].name, ocpl_id, + lcpl_id) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Ocopy failed"); + + if (H5Pclose(lcpl_id) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Pclose failed"); + + if (H5Pclose(ocpl_id) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Pclose failed"); + } - if (options->verbose) - HDprintf(FORMAT_OBJ, "link", travt->objs[i].name); + /* free link info path */ + if (linkinfo.trg_path) + HDfree(linkinfo.trg_path); + linkinfo.trg_path = NULL; + } /* options->merge */ + else { + if (options->prune) { + HDprintf("Pruned %s.\n", travt->objs[i].name); + } + else { + if (H5Lcopy(fidin, travt->objs[i].name, fidout, travt->objs[i].name, H5P_DEFAULT, + H5P_DEFAULT) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Lcopy failed"); + } + } break; default: @@ -1219,14 +1248,21 @@ done: if (named_datatype_free(&named_dt_head, 0) < 0) H5TOOLS_ERROR((-1), "named_datatype_free failed"); } - else + else { H5E_BEGIN_TRY { named_datatype_free(&named_dt_head, 1); } - H5E_END_TRY; + H5E_END_TRY; + } + + /* free link info path */ + if (linkinfo.trg_path) + HDfree(linkinfo.trg_path); H5E_BEGIN_TRY { H5Gclose(grp_in); H5Gclose(grp_out); + H5Pclose(lcpl_id); + H5Pclose(ocpl_id); H5Pclose(dcpl_in); H5Pclose(gcpl_in); H5Pclose(gcpl_out); diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index 25d01d1..80d496f 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -31,29 +31,31 @@ const char *outfile = NULL; * Command-line options: The user can specify short or long-named * parameters. */ -static const char * s_opts = "hVvf:l:m:e:nLc:d:s:u:b:M:t:a:i:o:q:z:E"; -static struct long_options l_opts[] = {{"help", no_arg, 'h'}, - {"version", no_arg, 'V'}, - {"verbose", no_arg, 'v'}, +static const char * s_opts = "a:b:c:d:e:f:hi:l:m:no:q:s:t:u:vz:ELM:VXW"; +static struct long_options l_opts[] = {{"alignment", require_arg, 'a'}, + {"block", require_arg, 'b'}, + {"compact", require_arg, 'c'}, + {"indexed", require_arg, 'd'}, + {"file", require_arg, 'e'}, {"filter", require_arg, 'f'}, + {"help", no_arg, 'h'}, + {"infile", require_arg, 'i'}, /* for backward compability */ {"layout", require_arg, 'l'}, {"minimum", require_arg, 'm'}, - {"file", require_arg, 'e'}, {"native", no_arg, 'n'}, - {"latest", no_arg, 'L'}, - {"compact", require_arg, 'c'}, - {"indexed", require_arg, 'd'}, - {"ssize", require_arg, 's'}, - {"ublock", require_arg, 'u'}, - {"block", require_arg, 'b'}, - {"metadata_block_size", require_arg, 'M'}, - {"threshold", require_arg, 't'}, - {"alignment", require_arg, 'a'}, - {"infile", require_arg, 'i'}, /* for backward compability */ {"outfile", require_arg, 'o'}, /* for backward compability */ {"sort_by", require_arg, 'q'}, + {"ssize", require_arg, 's'}, + {"threshold", require_arg, 't'}, + {"ublock", require_arg, 'u'}, + {"verbose", no_arg, 'v'}, {"sort_order", require_arg, 'z'}, {"enable-error-stack", no_arg, 'E'}, + {"latest", no_arg, 'L'}, + {"metadata_block_size", require_arg, 'M'}, + {"version", no_arg, 'V'}, + {"merge", no_arg, 'X'}, + {"prune", no_arg, 'W'}, {NULL, 0, '\0'}}; /*------------------------------------------------------------------------- @@ -81,6 +83,12 @@ usage(const char *prog) " --enable-error-stack Prints messages from the HDF5 error stack as they\n"); PRINTVALSTREAM(rawoutstream, " occur\n"); PRINTVALSTREAM(rawoutstream, " -L, --latest Use latest version of file format\n"); + PRINTVALSTREAM(rawoutstream, + " --merge Follow external soft link recursively and merge data\n"); + PRINTVALSTREAM(rawoutstream, + " --prune Do not follow external soft links and remove link\n"); + PRINTVALSTREAM(rawoutstream, + " --merge --prune Follow external link, merge data and remove dangling link\n"); PRINTVALSTREAM(rawoutstream, " -c L1, --compact=L1 Maximum number of links in header messages\n"); PRINTVALSTREAM(rawoutstream, " -d L2, --indexed=L2 Minimum number of links in the indexed format\n"); @@ -153,6 +161,7 @@ usage(const char *prog) PRINTVALSTREAM(rawoutstream, " Required values: filter_number, filter_flag, cd_value_count, value1\n"); PRINTVALSTREAM(rawoutstream, " Optional values: value2 to valueN\n"); + PRINTVALSTREAM(rawoutstream, " filter_flag: 1 is OPTIONAL or 0 is MANDATORY\n"); PRINTVALSTREAM(rawoutstream, " NONE (no parameter)\n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " LAYT - is a string with the format:\n"); @@ -451,6 +460,14 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) options->latest = TRUE; break; + case 'X': + options->merge = TRUE; + break; + + case 'W': + options->prune = TRUE; + break; + case 'c': options->grp_compact = HDatoi(opt_arg); if (options->grp_compact > 0) @@ -520,7 +537,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) case 'q': if (H5_INDEX_UNKNOWN == (sort_by = set_sort_by(opt_arg))) { - error_msg(" failed to set sort by form <%s>\n", opt_arg); + error_msg("failed to set sort by form <%s>\n", opt_arg); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; goto done; @@ -529,7 +546,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) case 'z': if (H5_ITER_UNKNOWN == (sort_order = set_sort_order(opt_arg))) { - error_msg(" failed to set sort order form <%s>\n", opt_arg); + error_msg("failed to set sort order form <%s>\n", opt_arg); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; goto done; @@ -589,28 +606,16 @@ done: int main(int argc, const char **argv) { - pack_opt_t options; /*the global options */ - H5E_auto2_t func; - H5E_auto2_t tools_func; - void * edata; - void * tools_edata; - int parse_ret; + pack_opt_t options; /*the global options */ + int parse_ret; HDmemset(&options, 0, sizeof(pack_opt_t)); - h5tools_setprogname(PROGRAMNAME); - h5tools_setstatus(EXIT_SUCCESS); - - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ h5tools_init(); - /* Disable tools error reporting */ - H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); - H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); /* update hyperslab buffer size from H5TOOLS_BUFSIZE env if exist */ if (h5tools_getenv_update_hyperslab_bufsize() < 0) { @@ -641,10 +646,8 @@ main(int argc, const char **argv) goto done; } - if (enable_error_stack > 0) { - H5Eset_auto2(H5E_DEFAULT, func, edata); - H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); - } + /* enable error reporting if command line option */ + h5tools_error_report(); /* pack it */ if (h5repack(infile, outfile, &options) < 0) { @@ -656,6 +659,11 @@ main(int argc, const char **argv) h5tools_setstatus(EXIT_SUCCESS); done: + if (options.fin_fapl >= 0 && options.fin_fapl != H5P_DEFAULT) + H5Pclose(options.fin_fapl); + if (options.fout_fapl >= 0 && options.fout_fapl != H5P_DEFAULT) + H5Pclose(options.fout_fapl); + /* free tables */ h5repack_end(&options); diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c index 1bfed8b..1c06cae 100644 --- a/tools/h5repack/h5repack_parse.c +++ b/tools/h5repack/h5repack_parse.c @@ -478,7 +478,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t * Example: * "AA,B,CDE:CHUNK=10X10" * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: December 30, 2003 * diff --git a/tools/h5repack/h5repack_verify.c b/tools/h5repack/h5repack_verify.c index 3c4d03d..ed29bd2 100644 --- a/tools/h5repack/h5repack_verify.c +++ b/tools/h5repack/h5repack_verify.c @@ -257,7 +257,7 @@ verify_layout(hid_t pid, pack_info_t *obj) */ int -h5repack_cmp_pl(const char *fname1, const char *fname2) +h5repack_cmp_pl(const char *fname1, hid_t fname1_fapl, const char *fname2, hid_t fname2_fapl) { hid_t fid1 = H5I_INVALID_HID; /* file ID */ hid_t fid2 = H5I_INVALID_HID; /* file ID */ @@ -278,9 +278,11 @@ h5repack_cmp_pl(const char *fname1, const char *fname2) *------------------------------------------------------------------------- */ /* Open the files */ - if ((fid1 = H5Fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) + if ((fid1 = h5tools_fopen(fname1, H5F_ACC_RDONLY, fname1_fapl, + (fname1_fapl == H5P_DEFAULT) ? FALSE : TRUE, NULL, 0)) < 0) H5TOOLS_GOTO_ERROR((-1), "h5tools_fopen failed <%s>: %s", fname1, H5FOPENERROR); - if ((fid2 = H5Fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) + if ((fid2 = h5tools_fopen(fname2, H5F_ACC_RDONLY, fname2_fapl, + (fname2_fapl == H5P_DEFAULT) ? FALSE : TRUE, NULL, 0)) < 0) H5TOOLS_GOTO_ERROR((-1), "h5tools_fopen failed <%s>: %s", fname2, H5FOPENERROR); /*------------------------------------------------------------------------- diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index d57cd60..db6ce8b 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -199,7 +199,6 @@ main(void) * file with fill values *------------------------------------------------------------------------- */ - TESTING(" copy of datasets (fill values)"); if (h5repack_init(&pack_options, 0, FALSE) < 0) @@ -210,7 +209,7 @@ main(void) GOERROR; if (h5repack_verify(FNAME0, FNAME0OUT, &pack_options) <= 0) GOERROR; - if (h5repack_cmp_pl(FNAME0, FNAME0OUT) <= 0) + if (h5repack_cmp_pl(FNAME0, pack_options.fin_fapl, FNAME0OUT, pack_options.fout_fapl) <= 0) GOERROR; if (h5repack_end(&pack_options) < 0) GOERROR; @@ -229,7 +228,7 @@ main(void) GOERROR; if (h5repack_verify(FNAME1, FNAME1OUT, &pack_options) <= 0) GOERROR; - if (h5repack_cmp_pl(FNAME1, FNAME1OUT) <= 0) + if (h5repack_cmp_pl(FNAME1, pack_options.fin_fapl, FNAME1OUT, pack_options.fout_fapl) <= 0) GOERROR; if (h5repack_end(&pack_options) < 0) GOERROR; @@ -248,7 +247,7 @@ main(void) GOERROR; if (h5repack_verify(FNAME2, FNAME2OUT, &pack_options) <= 0) GOERROR; - if (h5repack_cmp_pl(FNAME2, FNAME2OUT) <= 0) + if (h5repack_cmp_pl(FNAME2, pack_options.fin_fapl, FNAME2OUT, pack_options.fout_fapl) <= 0) GOERROR; if (h5repack_end(&pack_options) < 0) GOERROR; @@ -267,7 +266,7 @@ main(void) GOERROR; if (h5repack_verify(FNAME3, FNAME3OUT, &pack_options) <= 0) GOERROR; - if (h5repack_cmp_pl(FNAME3, FNAME3OUT) <= 0) + if (h5repack_cmp_pl(FNAME3, pack_options.fin_fapl, FNAME3OUT, pack_options.fout_fapl) <= 0) GOERROR; if (h5repack_end(&pack_options) < 0) GOERROR; @@ -902,7 +901,7 @@ main(void) GOERROR; if (h5repack_verify(FNAME7, FNAME7OUT, &pack_options) <= 0) GOERROR; - if (h5repack_cmp_pl(FNAME7, FNAME7OUT) <= 0) + if (h5repack_cmp_pl(FNAME7, pack_options.fin_fapl, FNAME7OUT, pack_options.fout_fapl) <= 0) GOERROR; if (h5repack_end(&pack_options) < 0) GOERROR; @@ -2046,24 +2045,24 @@ make_szip(hid_t loc_id) unsigned szip_pixels_per_block = 8; hsize_t dims[RANK] = {DIM1, DIM2}; hsize_t chunk_dims[RANK] = {CDIM1, CDIM2}; - int buf[DIM1][DIM2]; - int i, j, n; - int szip_can_encode = 0; + int ** buf = NULL; + int szip_can_encode = 0; + + /* Create and fill array */ + H5TEST_ALLOCATE_2D_ARRAY(buf, int, DIM1, DIM2); + if (NULL == buf) + goto error; + H5TEST_FILL_2D_ARRAY(buf, int, DIM1, DIM2); - for (i = n = 0; i < DIM1; i++) { - for (j = 0; j < DIM2; j++) { - buf[i][j] = n++; - } - } /* create a space */ if ((sid = H5Screate_simple(RANK, dims, NULL)) < 0) - return -1; + goto error; /* create a dcpl */ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto out; + goto error; /* set up chunk */ if (H5Pset_chunk(dcpl, RANK, chunk_dims) < 0) - goto out; + goto error; /*------------------------------------------------------------------------- * SZIP @@ -2076,27 +2075,32 @@ make_szip(hid_t loc_id) if (szip_can_encode) { /* set szip data */ if (H5Pset_szip(dcpl, szip_options_mask, szip_pixels_per_block) < 0) - goto out; - if (make_dset(loc_id, "dset_szip", sid, dcpl, buf) < 0) - goto out; + goto error; + if (make_dset(loc_id, "dset_szip", sid, dcpl, buf[0]) < 0) + goto error; } else /* WARNING? SZIP is decoder only, can't generate test files */ if (H5Sclose(sid) < 0) - goto out; + goto error; if (H5Pclose(dcpl) < 0) - goto out; + goto error; + + HDfree(buf); return 0; -out: +error: H5E_BEGIN_TRY { H5Pclose(dcpl); H5Sclose(sid); } H5E_END_TRY; + + HDfree(buf); + return -1; } #endif /* H5_HAVE_FILTER_SZIP */ @@ -2115,26 +2119,25 @@ make_deflate(hid_t loc_id) hid_t sid = H5I_INVALID_HID; /* dataspace ID */ hsize_t dims[RANK] = {DIM1, DIM2}; hsize_t chunk_dims[RANK] = {CDIM1, CDIM2}; - int buf[DIM1][DIM2]; + int ** buf = NULL; hobj_ref_t bufref[1]; /* reference */ hsize_t dims1r[1] = {1}; - int i, j, n; - for (i = n = 0; i < DIM1; i++) { - for (j = 0; j < DIM2; j++) { - buf[i][j] = n++; - } - } + /* Create and fill array */ + H5TEST_ALLOCATE_2D_ARRAY(buf, int, DIM1, DIM2); + if (NULL == buf) + goto error; + H5TEST_FILL_2D_ARRAY(buf, int, DIM1, DIM2); /* create a space */ if ((sid = H5Screate_simple(RANK, dims, NULL)) < 0) - return -1; + goto error; /* create a dcpl */ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto out; + goto error; /* set up chunk */ if (H5Pset_chunk(dcpl, RANK, chunk_dims) < 0) - goto out; + goto error; /*------------------------------------------------------------------------- * GZIP @@ -2143,16 +2146,16 @@ make_deflate(hid_t loc_id) #if defined(H5_HAVE_FILTER_DEFLATE) /* set deflate data */ if (H5Pset_deflate(dcpl, 9) < 0) - goto out; - if (make_dset(loc_id, "dset_deflate", sid, dcpl, buf) < 0) - goto out; + goto error; + if (make_dset(loc_id, "dset_deflate", sid, dcpl, buf[0]) < 0) + goto error; /* create a reference to the dataset, test second seeep of file for references */ if (H5Rcreate(&bufref[0], loc_id, "dset_deflate", H5R_OBJECT, (hid_t)-1) < 0) - goto out; + goto error; if (write_dset(loc_id, 1, dims1r, "ref", H5T_STD_REF_OBJ, bufref) < 0) - goto out; + goto error; #endif /*------------------------------------------------------------------------- @@ -2160,19 +2163,24 @@ make_deflate(hid_t loc_id) *------------------------------------------------------------------------- */ if (H5Sclose(sid) < 0) - goto out; + goto error; if (H5Pclose(dcpl) < 0) - goto out; + goto error; + + HDfree(buf); return 0; -out: +error: H5E_BEGIN_TRY { H5Pclose(dcpl); H5Sclose(sid); } H5E_END_TRY; + + HDfree(buf); + return -1; } @@ -2186,27 +2194,27 @@ out: static int make_shuffle(hid_t loc_id) { - hid_t dcpl; /* dataset creation property list */ - hid_t sid; /* dataspace ID */ + hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list */ + hid_t sid = H5I_INVALID_HID; /* dataspace ID */ hsize_t dims[RANK] = {DIM1, DIM2}; hsize_t chunk_dims[RANK] = {CDIM1, CDIM2}; - int buf[DIM1][DIM2]; - int i, j, n; + int ** buf = NULL; + + /* Create and fill array */ + H5TEST_ALLOCATE_2D_ARRAY(buf, int, DIM1, DIM2); + if (NULL == buf) + goto error; + H5TEST_FILL_2D_ARRAY(buf, int, DIM1, DIM2); - for (i = n = 0; i < DIM1; i++) { - for (j = 0; j < DIM2; j++) { - buf[i][j] = n++; - } - } /* create a space */ if ((sid = H5Screate_simple(RANK, dims, NULL)) < 0) - return -1; + goto error; /* create a dcpl */ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto out; + goto error; /* set up chunk */ if (H5Pset_chunk(dcpl, RANK, chunk_dims) < 0) - goto out; + goto error; /*------------------------------------------------------------------------- * shuffle @@ -2215,28 +2223,33 @@ make_shuffle(hid_t loc_id) /* set the shuffle filter */ if (H5Pset_shuffle(dcpl) < 0) - goto out; - if (make_dset(loc_id, "dset_shuffle", sid, dcpl, buf) < 0) - goto out; + goto error; + if (make_dset(loc_id, "dset_shuffle", sid, dcpl, buf[0]) < 0) + goto error; /*------------------------------------------------------------------------- * close space and dcpl *------------------------------------------------------------------------- */ if (H5Sclose(sid) < 0) - goto out; + goto error; if (H5Pclose(dcpl) < 0) - goto out; + goto error; + + HDfree(buf); return 0; -out: +error: H5E_BEGIN_TRY { H5Pclose(dcpl); H5Sclose(sid); } H5E_END_TRY; + + HDfree(buf); + return -1; } @@ -2254,23 +2267,23 @@ make_fletcher32(hid_t loc_id) hid_t sid = H5I_INVALID_HID; /* dataspace ID */ hsize_t dims[RANK] = {DIM1, DIM2}; hsize_t chunk_dims[RANK] = {CDIM1, CDIM2}; - int buf[DIM1][DIM2]; - int i, j, n; + int ** buf = NULL; + + /* Create and fill array */ + H5TEST_ALLOCATE_2D_ARRAY(buf, int, DIM1, DIM2); + if (NULL == buf) + goto error; + H5TEST_FILL_2D_ARRAY(buf, int, DIM1, DIM2); - for (i = n = 0; i < DIM1; i++) { - for (j = 0; j < DIM2; j++) { - buf[i][j] = n++; - } - } /* create a space */ if ((sid = H5Screate_simple(RANK, dims, NULL)) < 0) - return -1; + goto error; /* create a dataset creation property list; the same DCPL is used for all dsets */ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto out; + goto error; /* set up chunk */ if (H5Pset_chunk(dcpl, RANK, chunk_dims) < 0) - goto out; + goto error; /*------------------------------------------------------------------------- * fletcher32 @@ -2279,31 +2292,36 @@ make_fletcher32(hid_t loc_id) /* remove the filters from the dcpl */ if (H5Premove_filter(dcpl, H5Z_FILTER_ALL) < 0) - goto out; + goto error; /* set the checksum filter */ if (H5Pset_fletcher32(dcpl) < 0) - goto out; - if (make_dset(loc_id, "dset_fletcher32", sid, dcpl, buf) < 0) - goto out; + goto error; + if (make_dset(loc_id, "dset_fletcher32", sid, dcpl, buf[0]) < 0) + goto error; /*------------------------------------------------------------------------- * close space and dcpl *------------------------------------------------------------------------- */ if (H5Sclose(sid) < 0) - goto out; + goto error; if (H5Pclose(dcpl) < 0) - goto out; + goto error; + + HDfree(buf); return 0; -out: +error: H5E_BEGIN_TRY { H5Pclose(dcpl); H5Sclose(sid); } H5E_END_TRY; + + HDfree(buf); + return -1; } @@ -2323,45 +2341,45 @@ make_nbit(hid_t loc_id) hid_t dsid = H5I_INVALID_HID; hsize_t dims[RANK] = {DIM1, DIM2}; hsize_t chunk_dims[RANK] = {CDIM1, CDIM2}; - int buf[DIM1][DIM2]; - int i, j, n; + int ** buf = NULL; + + /* Create and fill array */ + H5TEST_ALLOCATE_2D_ARRAY(buf, int, DIM1, DIM2); + if (NULL == buf) + goto error; + H5TEST_FILL_2D_ARRAY(buf, int, DIM1, DIM2); - for (i = n = 0; i < DIM1; i++) { - for (j = 0; j < DIM2; j++) { - buf[i][j] = n++; - } - } /* create a space */ if ((sid = H5Screate_simple(RANK, dims, NULL)) < 0) - return -1; + goto error; /* create a dataset creation property list; the same DCPL is used for all dsets */ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto out; + goto error; /* set up chunk */ if (H5Pset_chunk(dcpl, RANK, chunk_dims) < 0) - goto out; + goto error; dtid = H5Tcopy(H5T_NATIVE_INT); if (H5Tset_precision(dtid, (H5Tget_precision(dtid) - 1)) < 0) - goto out; + goto error; /* remove the filters from the dcpl */ if (H5Premove_filter(dcpl, H5Z_FILTER_ALL) < 0) - goto out; + goto error; if (H5Pset_nbit(dcpl) < 0) - goto out; + goto error; if ((dsid = H5Dcreate2(loc_id, "dset_nbit", dtid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto out; - if (H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto out; + goto error; + if (H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + goto error; H5Dclose(dsid); if (H5Premove_filter(dcpl, H5Z_FILTER_ALL) < 0) - goto out; + goto error; if ((dsid = H5Dcreate2(loc_id, "dset_int31", dtid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto out; - if (H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto out; + goto error; + if (H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + goto error; H5Dclose(dsid); /*------------------------------------------------------------------------- @@ -2369,15 +2387,17 @@ make_nbit(hid_t loc_id) *------------------------------------------------------------------------- */ if (H5Sclose(sid) < 0) - goto out; + goto error; if (H5Pclose(dcpl) < 0) - goto out; + goto error; if (H5Tclose(dtid) < 0) - goto out; + goto error; + + HDfree(buf); return 0; -out: +error: H5E_BEGIN_TRY { H5Tclose(dtid); @@ -2386,6 +2406,9 @@ out: H5Dclose(dsid); } H5E_END_TRY; + + HDfree(buf); + return -1; } @@ -2405,40 +2428,40 @@ make_scaleoffset(hid_t loc_id) hid_t dsid = H5I_INVALID_HID; hsize_t dims[RANK] = {DIM1, DIM2}; hsize_t chunk_dims[RANK] = {CDIM1, CDIM2}; - int buf[DIM1][DIM2]; - int i, j, n; + int ** buf = NULL; + + /* Create and fill array */ + H5TEST_ALLOCATE_2D_ARRAY(buf, int, DIM1, DIM2); + if (NULL == buf) + goto error; + H5TEST_FILL_2D_ARRAY(buf, int, DIM1, DIM2); - for (i = n = 0; i < DIM1; i++) { - for (j = 0; j < DIM2; j++) { - buf[i][j] = n++; - } - } /* create a space */ if ((sid = H5Screate_simple(RANK, dims, NULL)) < 0) - return -1; + goto error; /* create a dataset creation property list; the same DCPL is used for all dsets */ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto out; + goto error; /* set up chunk */ if (H5Pset_chunk(dcpl, RANK, chunk_dims) < 0) - goto out; + goto error; dtid = H5Tcopy(H5T_NATIVE_INT); /* remove the filters from the dcpl */ if (H5Premove_filter(dcpl, H5Z_FILTER_ALL) < 0) - goto out; + goto error; if (H5Pset_scaleoffset(dcpl, H5Z_SO_INT, 31) < 0) - goto out; + goto error; if ((dsid = H5Dcreate2(loc_id, "dset_scaleoffset", dtid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto out; - if (H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto out; + goto error; + if (H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + goto error; H5Dclose(dsid); if ((dsid = H5Dcreate2(loc_id, "dset_none", dtid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto out; - if (H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto out; + goto error; + if (H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + goto error; H5Tclose(dtid); H5Dclose(dsid); @@ -2447,13 +2470,15 @@ make_scaleoffset(hid_t loc_id) *------------------------------------------------------------------------- */ if (H5Sclose(sid) < 0) - goto out; + goto error; if (H5Pclose(dcpl) < 0) - goto out; + goto error; + + HDfree(buf); return 0; -out: +error: H5E_BEGIN_TRY { H5Dclose(dsid); @@ -2462,6 +2487,9 @@ out: H5Sclose(sid); } H5E_END_TRY; + + HDfree(buf); + return -1; } @@ -2485,34 +2513,34 @@ make_all_filters(hid_t loc_id) #endif /* H5_HAVE_FILTER_SZIP */ hsize_t dims[RANK] = {DIM1, DIM2}; hsize_t chunk_dims[RANK] = {CDIM1, CDIM2}; - int buf[DIM1][DIM2]; - int i, j, n; + int ** buf = NULL; #if defined(H5_HAVE_FILTER_SZIP) int szip_can_encode = 0; #endif - for (i = n = 0; i < DIM1; i++) { - for (j = 0; j < DIM2; j++) { - buf[i][j] = n++; - } - } + /* Create and fill array */ + H5TEST_ALLOCATE_2D_ARRAY(buf, int, DIM1, DIM2); + if (NULL == buf) + goto error; + H5TEST_FILL_2D_ARRAY(buf, int, DIM1, DIM2); + /* create a space */ if ((sid = H5Screate_simple(RANK, dims, NULL)) < 0) - return -1; + goto error; /* create a dataset creation property list; the same DCPL is used for all dsets */ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto out; + goto error; /* set up chunk */ if (H5Pset_chunk(dcpl, RANK, chunk_dims) < 0) - goto out; + goto error; /* set the shuffle filter */ if (H5Pset_shuffle(dcpl) < 0) - goto out; + goto error; /* set the checksum filter */ if (H5Pset_fletcher32(dcpl) < 0) - goto out; + goto error; #if defined(H5_HAVE_FILTER_SZIP) if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { @@ -2521,7 +2549,7 @@ make_all_filters(hid_t loc_id) if (szip_can_encode) { /* set szip data */ if (H5Pset_szip(dcpl, szip_options_mask, szip_pixels_per_block) < 0) - goto out; + goto error; } else { /* WARNING? SZIP is decoder only, can't generate test data using szip */ @@ -2531,32 +2559,32 @@ make_all_filters(hid_t loc_id) #if defined(H5_HAVE_FILTER_DEFLATE) /* set deflate data */ if (H5Pset_deflate(dcpl, 9) < 0) - goto out; + goto error; #endif - if (make_dset(loc_id, "dset_all", sid, dcpl, buf) < 0) - goto out; + if (make_dset(loc_id, "dset_all", sid, dcpl, buf[0]) < 0) + goto error; /* remove the filters from the dcpl */ if (H5Premove_filter(dcpl, H5Z_FILTER_ALL) < 0) - goto out; + goto error; /* set the checksum filter */ if (H5Pset_fletcher32(dcpl) < 0) - goto out; - if (make_dset(loc_id, "dset_fletcher32", sid, dcpl, buf) < 0) - goto out; + goto error; + if (make_dset(loc_id, "dset_fletcher32", sid, dcpl, buf[0]) < 0) + goto error; /* Make sure encoding is enabled */ #if defined(H5_HAVE_FILTER_SZIP) if (szip_can_encode) { /* remove the filters from the dcpl */ if (H5Premove_filter(dcpl, H5Z_FILTER_ALL) < 0) - goto out; + goto error; /* set szip data */ if (H5Pset_szip(dcpl, szip_options_mask, szip_pixels_per_block) < 0) - goto out; - if (make_dset(loc_id, "dset_szip", sid, dcpl, buf) < 0) - goto out; + goto error; + if (make_dset(loc_id, "dset_szip", sid, dcpl, buf[0]) < 0) + goto error; } else { /* WARNING? SZIP is decoder only, can't generate test dataset */ @@ -2565,53 +2593,55 @@ make_all_filters(hid_t loc_id) /* remove the filters from the dcpl */ if (H5Premove_filter(dcpl, H5Z_FILTER_ALL) < 0) - goto out; + goto error; /* set the shuffle filter */ if (H5Pset_shuffle(dcpl) < 0) - goto out; - if (make_dset(loc_id, "dset_shuffle", sid, dcpl, buf) < 0) - goto out; + goto error; + if (make_dset(loc_id, "dset_shuffle", sid, dcpl, buf[0]) < 0) + goto error; #if defined(H5_HAVE_FILTER_DEFLATE) /* remove the filters from the dcpl */ if (H5Premove_filter(dcpl, H5Z_FILTER_ALL) < 0) - goto out; + goto error; /* set deflate data */ if (H5Pset_deflate(dcpl, 1) < 0) - goto out; - if (make_dset(loc_id, "dset_deflate", sid, dcpl, buf) < 0) - goto out; + goto error; + if (make_dset(loc_id, "dset_deflate", sid, dcpl, buf[0]) < 0) + goto error; #endif /* remove the filters from the dcpl */ if (H5Premove_filter(dcpl, H5Z_FILTER_ALL) < 0) - goto out; + goto error; /* set the shuffle filter */ if (H5Pset_nbit(dcpl) < 0) - goto out; + goto error; if ((dtid = H5Tcopy(H5T_NATIVE_INT)) < 0) - goto out; + goto error; if (H5Tset_precision(dtid, (H5Tget_precision(dtid) - 1)) < 0) - goto out; + goto error; if ((dsid = H5Dcreate2(loc_id, "dset_nbit", dtid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto out; - if (H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto out; + goto error; + if (H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0) + goto error; /* close */ if (H5Tclose(dtid) < 0) - goto out; + goto error; if (H5Dclose(dsid) < 0) - goto out; + goto error; if (H5Sclose(sid) < 0) - goto out; + goto error; if (H5Pclose(dcpl) < 0) - goto out; + goto error; + + HDfree(buf); return 0; -out: +error: H5E_BEGIN_TRY { H5Tclose(dtid); @@ -2620,6 +2650,9 @@ out: H5Sclose(sid); } H5E_END_TRY; + + HDfree(buf); + return -1; } @@ -2732,15 +2765,15 @@ make_layout(hid_t loc_id) hid_t sid = H5I_INVALID_HID; /* dataspace ID */ hsize_t dims[RANK] = {DIM1, DIM2}; hsize_t chunk_dims[RANK] = {CDIM1, CDIM2}; - int buf[DIM1][DIM2]; - int i, j, n; + int ** buf = NULL; + int i; char name[16]; - for (i = n = 0; i < DIM1; i++) { - for (j = 0; j < DIM2; j++) { - buf[i][j] = n++; - } - } + /* Create and fill array */ + H5TEST_ALLOCATE_2D_ARRAY(buf, int, DIM1, DIM2); + if (NULL == buf) + goto error; + H5TEST_FILL_2D_ARRAY(buf, int, DIM1, DIM2); /*------------------------------------------------------------------------- * make several dataset with no filters @@ -2748,8 +2781,8 @@ make_layout(hid_t loc_id) */ for (i = 0; i < 4; i++) { HDsprintf(name, "dset%d", i + 1); - if (write_dset(loc_id, RANK, dims, name, H5T_NATIVE_INT, buf) < 0) - return -1; + if (write_dset(loc_id, RANK, dims, name, H5T_NATIVE_INT, buf[0]) < 0) + goto error; } /*------------------------------------------------------------------------- @@ -2758,60 +2791,61 @@ make_layout(hid_t loc_id) */ /* create a space */ if ((sid = H5Screate_simple(RANK, dims, NULL)) < 0) - return -1; + goto error; /* create a dataset creation property list; the same DCPL is used for all dsets */ - if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) { - goto out; - } + if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; /*------------------------------------------------------------------------- * H5D_COMPACT *------------------------------------------------------------------------- */ if (H5Pset_layout(dcpl, H5D_COMPACT) < 0) - goto out; - if (make_dset(loc_id, "dset_compact", sid, dcpl, buf) < 0) { - goto out; - } + goto error; + if (make_dset(loc_id, "dset_compact", sid, dcpl, buf[0]) < 0) + goto error; /*------------------------------------------------------------------------- * H5D_CONTIGUOUS *------------------------------------------------------------------------- */ if (H5Pset_layout(dcpl, H5D_CONTIGUOUS) < 0) - goto out; - if (make_dset(loc_id, "dset_contiguous", sid, dcpl, buf) < 0) { - goto out; - } + goto error; + if (make_dset(loc_id, "dset_contiguous", sid, dcpl, buf[0]) < 0) + goto error; /*------------------------------------------------------------------------- * H5D_CHUNKED *------------------------------------------------------------------------- */ if (H5Pset_chunk(dcpl, RANK, chunk_dims) < 0) - goto out; - if (make_dset(loc_id, "dset_chunk", sid, dcpl, buf) < 0) { - goto out; - } + goto error; + if (make_dset(loc_id, "dset_chunk", sid, dcpl, buf[0]) < 0) + goto error; /*------------------------------------------------------------------------- * close space and dcpl *------------------------------------------------------------------------- */ if (H5Sclose(sid) < 0) - goto out; + goto error; if (H5Pclose(dcpl) < 0) - goto out; + goto error; + + HDfree(buf); return 0; -out: +error: H5E_BEGIN_TRY { H5Pclose(dcpl); H5Sclose(sid); } H5E_END_TRY; + + HDfree(buf); + return -1; } @@ -2837,44 +2871,43 @@ make_layout2(hid_t loc_id) hid_t contig_dcpl = H5I_INVALID_HID; /* dataset creation property list */ hid_t chunked_dcpl = H5I_INVALID_HID; /* dataset creation property list */ - int i, j, n; /* Local index variables */ int ret_value = -1; /* Return value */ hid_t s_sid = H5I_INVALID_HID; /* dataspace ID */ hsize_t s_dims[RANK] = {S_DIM1, S_DIM2}; /* Dataspace (< 1 k) */ hsize_t chunk_dims[RANK] = {S_DIM1 / 2, S_DIM2 / 2}; /* Dimension sizes for chunks */ - int s_buf[S_DIM1][S_DIM2]; /* Temporary buffer */ + int **s_buf = NULL; /* Temporary buffer */ - for (i = n = 0; i < S_DIM1; i++) { - for (j = 0; j < S_DIM2; j++) { - s_buf[i][j] = n++; - } - } + /* Create and fill array */ + H5TEST_ALLOCATE_2D_ARRAY(s_buf, int, S_DIM1, S_DIM2); + if (NULL == s_buf) + goto error; + H5TEST_FILL_2D_ARRAY(s_buf, int, S_DIM1, S_DIM2); /* Create dataspaces */ if ((s_sid = H5Screate_simple(RANK, s_dims, NULL)) < 0) - goto out; + goto error; /* Create contiguous datasets */ if ((contig_dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto out; + goto error; if (H5Pset_layout(contig_dcpl, H5D_CONTIGUOUS) < 0) - goto out; - if (make_dset(loc_id, CONTIG_S, s_sid, contig_dcpl, s_buf) < 0) - goto out; + goto error; + if (make_dset(loc_id, CONTIG_S, s_sid, contig_dcpl, s_buf[0]) < 0) + goto error; /* Create chunked datasets */ if ((chunked_dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto out; + goto error; if (H5Pset_chunk(chunked_dcpl, RANK, chunk_dims) < 0) - goto out; - if (make_dset(loc_id, CHUNKED_S_FIX, s_sid, chunked_dcpl, s_buf) < 0) - goto out; + goto error; + if (make_dset(loc_id, CHUNKED_S_FIX, s_sid, chunked_dcpl, s_buf[0]) < 0) + goto error; ret_value = 0; -out: +error: H5E_BEGIN_TRY { H5Pclose(contig_dcpl); @@ -2884,6 +2917,8 @@ out: } H5E_END_TRY; + HDfree(s_buf); + return (ret_value); } /* make_layout2() */ @@ -2921,23 +2956,19 @@ make_layout3(hid_t loc_id) hsize_t chunk_dims1[RANK] = {DIM1_L3 * 2, 5}; hsize_t chunk_dims2[RANK] = {SDIM1_L3 + 2, SDIM2_L3 / 2}; hsize_t chunk_dims3[RANK] = {SDIM1_L3 - 2, SDIM2_L3 / 2}; - int buf1[DIM1_L3][DIM2_L3]; - int buf2[SDIM1_L3][SDIM2_L3]; - int i, j, n; - - /* init buf1 */ - for (i = n = 0; i < DIM1_L3; i++) { - for (j = 0; j < DIM2_L3; j++) { - buf1[i][j] = n++; - } - } + int ** buf1 = NULL; + int ** buf2 = NULL; - /* init buf2 */ - for (i = n = 0; i < SDIM1_L3; i++) { - for (j = 0; j < SDIM2_L3; j++) { - buf2[i][j] = n++; - } - } + /* Create and fill arrays */ + H5TEST_ALLOCATE_2D_ARRAY(buf1, int, DIM1_L3, DIM2_L3); + if (NULL == buf1) + goto error; + H5TEST_FILL_2D_ARRAY(buf1, int, DIM1_L3, DIM2_L3); + + H5TEST_ALLOCATE_2D_ARRAY(buf2, int, SDIM1_L3, SDIM2_L3); + if (NULL == buf2) + goto error; + H5TEST_FILL_2D_ARRAY(buf2, int, SDIM1_L3, SDIM2_L3); /*------------------------------------------------------------------------- * make chunked dataset with @@ -2948,17 +2979,15 @@ make_layout3(hid_t loc_id) */ /* create a space */ if ((sid1 = H5Screate_simple(RANK, dims1, maxdims)) < 0) - return -1; + goto error; /* create a dataset creation property list; the same DCPL is used for all dsets */ - if ((dcpl1 = H5Pcreate(H5P_DATASET_CREATE)) < 0) { - goto out; - } + if ((dcpl1 = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; if (H5Pset_chunk(dcpl1, RANK, chunk_dims1) < 0) - goto out; - if (make_dset(loc_id, "chunk_unlimit1", sid1, dcpl1, buf1) < 0) { - goto out; - } + goto error; + if (make_dset(loc_id, "chunk_unlimit1", sid1, dcpl1, buf1[0]) < 0) + goto error; /*------------------------------------------------------------------------- * make chunked dataset with @@ -2970,16 +2999,16 @@ make_layout3(hid_t loc_id) /* create a space */ if ((sid2 = H5Screate_simple(RANK, dims2, maxdims)) < 0) - return -1; + goto error; /* create a dataset creation property list; the same DCPL is used for all dsets */ if ((dcpl2 = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto out; + goto error; if (H5Pset_chunk(dcpl2, RANK, chunk_dims2) < 0) - goto out; + goto error; - if (make_dset(loc_id, "chunk_unlimit2", sid2, dcpl2, buf2) < 0) - goto out; + if (make_dset(loc_id, "chunk_unlimit2", sid2, dcpl2, buf2[0]) < 0) + goto error; /*------------------------------------------------------------------------- * make chunked dataset with @@ -2990,32 +3019,35 @@ make_layout3(hid_t loc_id) */ /* create a dataset creation property list; the same DCPL is used for all dsets */ if ((dcpl3 = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto out; + goto error; if (H5Pset_chunk(dcpl3, RANK, chunk_dims3) < 0) - goto out; + goto error; - if (make_dset(loc_id, "chunk_unlimit3", sid2, dcpl3, buf2) < 0) - goto out; + if (make_dset(loc_id, "chunk_unlimit3", sid2, dcpl3, buf2[0]) < 0) + goto error; /*------------------------------------------------------------------------- * close space and dcpl *------------------------------------------------------------------------- */ if (H5Sclose(sid1) < 0) - goto out; + goto error; if (H5Sclose(sid2) < 0) - goto out; + goto error; if (H5Pclose(dcpl1) < 0) - goto out; + goto error; if (H5Pclose(dcpl2) < 0) - goto out; + goto error; if (H5Pclose(dcpl3) < 0) - goto out; + goto error; + + HDfree(buf1); + HDfree(buf2); return 0; -out: +error: H5E_BEGIN_TRY { H5Sclose(sid1); @@ -3025,6 +3057,10 @@ out: H5Pclose(dcpl3); } H5E_END_TRY; + + HDfree(buf1); + HDfree(buf2); + return -1; } @@ -3395,7 +3431,7 @@ out: * * Purpose: write datasets in LOC_ID * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: November 12, 2003 * @@ -4232,7 +4268,7 @@ out: * * Purpose: write attributes in LOC_ID (dataset, group, named datatype) * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: November 12, 2003 * @@ -5370,7 +5406,7 @@ out: * * Purpose: utility function to create and write a dataset in LOC_ID * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: November 12, 2003 * @@ -5400,7 +5436,7 @@ out: * * Purpose: utility function to create and write a dataset in LOC_ID * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: November 12, 2003 * @@ -5442,7 +5478,7 @@ out: * * Purpose: utility function to write an attribute in LOC_ID * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Pedro Vicente * * Date: November 12, 2003 * diff --git a/tools/h5repack/testfiles/h5repack-help.txt b/tools/h5repack/testfiles/h5repack-help.txt index 05b8b21..4927fe4 100644 --- a/tools/h5repack/testfiles/h5repack-help.txt +++ b/tools/h5repack/testfiles/h5repack-help.txt @@ -9,6 +9,9 @@ usage: h5repack [OPTIONS] file1 file2 --enable-error-stack Prints messages from the HDF5 error stack as they occur -L, --latest Use latest version of file format + --merge Follow external soft link recursively and merge data + --prune Do not follow external soft links and remove link + --merge --prune Follow external link, merge data and remove dangling link -c L1, --compact=L1 Maximum number of links in header messages -d L2, --indexed=L2 Minimum number of links in the indexed format -s S[:F], --ssize=S[:F] Shared object header message minimum size @@ -67,6 +70,7 @@ usage: h5repack [OPTIONS] file1 file2 UD= Required values: filter_number, filter_flag, cd_value_count, value1 Optional values: value2 to valueN + filter_flag: 1 is OPTIONAL or 0 is MANDATORY NONE (no parameter) LAYT - is a string with the format: diff --git a/tools/h5stat/Makefile.in b/tools/h5stat/Makefile.in index d04061d..00f205a 100644 --- a/tools/h5stat/Makefile.in +++ b/tools/h5stat/Makefile.in @@ -403,19 +403,18 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ # Include src directory AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/tools/lib -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -446,6 +445,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -473,8 +473,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -653,15 +651,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -713,7 +711,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1260,8 +1258,9 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index b6ea201..eef8efa5 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -96,30 +96,28 @@ typedef struct iter_t { int local; /* Flag to indicate iteration over the object*/ } iter_t; -static const char *drivername = ""; +static const char *drivername = NULL; #ifdef H5_HAVE_ROS3_VFD -/* default "anonymous" s3 configuration - */ +/* Default "anonymous" S3 configuration */ static H5FD_ros3_fapl_t ros3_fa = { - 1, /* fapl version */ - FALSE, /* authenticate */ - "", /* aws region */ - "", /* access key id */ - "", /* secret access key */ + 1, /* Structure Version */ + FALSE, /* Authenticate? */ + "", /* AWS Region */ + "", /* Access Key ID */ + "", /* Secret Access Key */ }; #endif /* H5_HAVE_ROS3_VFD */ #ifdef H5_HAVE_LIBHDFS -/* default HDFS access configuration - */ +/* "Default" HDFS configuration */ static H5FD_hdfs_fapl_t hdfs_fa = { - 1, /* fapl version */ - "localhost", /* namenode name */ - 0, /* namenode port */ - "", /* kerberos ticket cache */ - "", /* user name */ - 2048, /* stream buffer size */ + 1, /* Structure Version */ + "localhost", /* Namenode Name */ + 0, /* Namenode Port */ + "", /* Kerberos ticket cache */ + "", /* User name */ + 2048, /* Stream buffer size */ }; #endif /* H5_HAVE_LIBHDFS */ @@ -954,101 +952,32 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) break; case 'w': -#ifndef H5_HAVE_ROS3_VFD - error_msg("Read-Only S3 VFD not enabled.\n"); - goto error; -#else - { - char * cred_str = NULL; - unsigned nelems = 0; - char ** cred = NULL; - char const *ccred[3]; - - if (FAIL == parse_tuple((const char *)opt_arg, ',', &cred_str, &nelems, &cred)) { - error_msg("Unable to parse s3 credential\n"); - goto error; - } - if (nelems != 3) { - error_msg("s3 credential must have three elements\n"); - goto error; - } - ccred[0] = (const char *)cred[0]; - ccred[1] = (const char *)cred[1]; - ccred[2] = (const char *)cred[2]; - if (0 == h5tools_populate_ros3_fapl(&ros3_fa, ccred)) { - error_msg("Unable to set ros3 fapl config\n"); +#ifdef H5_HAVE_ROS3_VFD + if (h5tools_parse_ros3_fapl_tuple(opt_arg, ',', &ros3_fa) < 0) { + error_msg("failed to parse S3 VFD credential info\n"); goto error; } - HDfree(cred); - HDfree(cred_str); - } /* parse s3-cred block */ - drivername = "ros3"; + + drivername = drivernames[ROS3_VFD_IDX]; +#else + error_msg("Read-Only S3 VFD not enabled.\n"); + goto error; +#endif break; -#endif /* H5_HAVE_ROS3_VFD */ case 'H': -#ifndef H5_HAVE_LIBHDFS - error_msg("HDFS VFD is not enabled.\n"); - goto error; -#else - { - unsigned nelems = 0; - char * props_src = NULL; - char ** props = NULL; - unsigned long k = 0; - if (FAIL == parse_tuple((const char *)opt_arg, ',', &props_src, &nelems, &props)) { - error_msg("unable to parse hdfs properties tuple\n"); - goto error; - } - /* sanity-check tuple count - */ - if (nelems != 5) { - char str[64] = ""; - HDsprintf(str, - "expected 5 elements in hdfs properties tuple " - "but found %u\n", - nelems); - HDfree(props); - HDfree(props_src); - error_msg(str); +#ifdef H5_HAVE_LIBHDFS + if (h5tools_parse_hdfs_fapl_tuple(opt_arg, ',', &hdfs_fa) < 0) { + error_msg("failed to parse HDFS VFD configuration info\n"); goto error; } - /* Populate fapl configuration structure with given - * properties. - * TODO/WARNING: No error-checking is done on length of - * input strings... Silent overflow is possible, - * albeit unlikely. - */ - if (HDstrncmp(props[0], "", 1)) { - HDstrncpy(hdfs_fa.namenode_name, (const char *)props[0], HDstrlen(props[0])); - } - if (HDstrncmp(props[1], "", 1)) { - k = strtoul((const char *)props[1], NULL, 0); - if (errno == ERANGE) { - error_msg("supposed port number wasn't.\n"); - goto error; - } - hdfs_fa.namenode_port = (int32_t)k; - } - if (HDstrncmp(props[2], "", 1)) { - HDstrncpy(hdfs_fa.kerberos_ticket_cache, (const char *)props[2], HDstrlen(props[2])); - } - if (HDstrncmp(props[3], "", 1)) { - HDstrncpy(hdfs_fa.user_name, (const char *)props[3], HDstrlen(props[3])); - } - if (strncmp(props[4], "", 1)) { - k = HDstrtoul((const char *)props[4], NULL, 0); - if (errno == ERANGE) { - error_msg("supposed buffersize number wasn't.\n"); - goto error; - } - hdfs_fa.stream_buffer_size = (int32_t)k; - } - HDfree(props); - HDfree(props_src); - drivername = "hdfs"; - } break; -#endif /* H5_HAVE_LIBHDFS */ + + drivername = drivernames[HDFS_VFD_IDX]; +#else + error_msg("HDFS VFD not enabled.\n"); + goto error; +#endif + break; default: usage(h5tools_getprogname()); @@ -1662,76 +1591,56 @@ int main(int argc, const char *argv[]) { iter_t iter; - const char * fname = NULL; - hid_t fid = H5I_INVALID_HID; - H5E_auto2_t func; - H5E_auto2_t tools_func; - void * edata; - void * tools_edata; + const char * fname = NULL; + hid_t fid = H5I_INVALID_HID; struct handler_t *hand = NULL; hid_t fapl_id = H5P_DEFAULT; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ h5tools_init(); - /* Disable tools error reporting */ - H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); - H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); - HDmemset(&iter, 0, sizeof(iter)); if (parse_command_line(argc, argv, &hand) < 0) goto done; - /* if drivername is not null, probably need to set the fapl */ - if (HDstrcmp(drivername, "")) { - void *conf_fa = NULL; + /* enable error reporting if command line option */ + h5tools_error_report(); - if (!HDstrcmp(drivername, "ros3")) { -#ifndef H5_HAVE_ROS3_VFD - error_msg("Read-Only S3 VFD not enabled.\n\n"); - goto done; + if (drivername) { + h5tools_vfd_info_t vfd_info; + + vfd_info.info = NULL; + vfd_info.name = drivername; + + if (!HDstrcmp(drivername, drivernames[ROS3_VFD_IDX])) { +#ifdef H5_HAVE_ROS3_VFD + vfd_info.info = (void *)&ros3_fa; #else - conf_fa = (void *)&ros3_fa; -#endif /* H5_HAVE_ROS3_VFD */ - } - else if (!HDstrcmp(drivername, "hdfs")) { -#ifndef H5_HAVE_LIBHDFS - error_msg("HDFS VFD not enabled.\n\n"); + error_msg("Read-Only S3 VFD not enabled.\n"); goto done; +#endif + } + else if (!HDstrcmp(drivername, drivernames[HDFS_VFD_IDX])) { +#ifdef H5_HAVE_LIBHDFS + vfd_info.info = (void *)&hdfs_fa; #else - conf_fa = (void *)&hdfs_fa; -#endif /* H5_HAVE_LIBHDFS */ + error_msg("HDFS VFD not enabled.\n"); + goto done; +#endif } - if (conf_fa != NULL) { - HDassert(fapl_id == H5P_DEFAULT); - fapl_id = H5Pcreate(H5P_FILE_ACCESS); - if (fapl_id < 0) { - error_msg("Unable to create fapl entry\n"); - goto done; - } - if (1 > h5tools_set_configured_fapl(fapl_id, drivername, conf_fa)) { - error_msg("Unable to set fapl\n"); - goto done; - } + if ((fapl_id = h5tools_get_fapl(H5P_DEFAULT, &vfd_info)) < 0) { + error_msg("Unable to create FAPL for file access\n"); + goto done; } - } /* drivername set */ + } fname = argv[opt_ind]; - if (enable_error_stack > 0) { - H5Eset_auto2(H5E_DEFAULT, func, edata); - H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); - } - /* Check for filename given */ if (fname) { hid_t fcpl; @@ -1739,7 +1648,8 @@ main(int argc, const char *argv[]) HDprintf("Filename: %s\n", fname); - fid = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT); + fid = h5tools_fopen(fname, H5F_ACC_RDONLY, fapl_id, (fapl_id == H5P_DEFAULT) ? FALSE : TRUE, NULL, 0); + if (fid < 0) { error_msg("unable to open file \"%s\"\n", fname); h5tools_setstatus(EXIT_FAILURE); @@ -1821,7 +1731,5 @@ done: h5tools_setstatus(EXIT_FAILURE); } /* end if */ - H5Eset_auto2(H5E_DEFAULT, func, edata); - leave(h5tools_getstatus()); } /* end main() */ diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in index d240b54..9baf1b8 100644 --- a/tools/lib/Makefile.in +++ b/tools/lib/Makefile.in @@ -399,18 +399,17 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ # Include files in /src directory AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -441,6 +440,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -468,8 +468,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -648,15 +646,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -702,7 +700,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1179,8 +1177,9 @@ uninstall-am: # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 42154bc..1b11672 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -28,7 +28,7 @@ int print_objname(diff_opt_t *opts, hsize_t nfound) { - return ((opts->m_verbose || nfound) && !opts->m_quiet) ? 1 : 0; + return ((opts->mode_verbose || nfound) && !opts->mode_quiet) ? 1 : 0; } /*------------------------------------------------------------------------- @@ -44,7 +44,7 @@ do_print_objname(const char *OBJ, const char *path1, const char *path2, diff_opt * displaying any object or symbolic links. This improves * readability of the output. */ - if (opts->m_verbose_level >= 1) + if (opts->mode_verbose_level >= 1) parallel_print("\n"); parallel_print("%-7s: <%s> and <%s>\n", OBJ, path1, path2); } @@ -73,7 +73,7 @@ do_print_attrname(const char *attr, const char *path1, const char *path2) static int print_warn(diff_opt_t *opts) { - return ((opts->m_verbose)) ? 1 : 0; + return ((opts->mode_verbose)) ? 1 : 0; } #ifdef H5_HAVE_PARALLEL @@ -139,7 +139,7 @@ is_valid_options(diff_opt_t *opts) /*----------------------------------------------- * no -q(quiet) with -v (verbose) or -r (report) */ - if (opts->m_quiet && (opts->m_verbose || opts->m_report)) { + if (opts->mode_quiet && (opts->mode_verbose || opts->mode_report)) { parallel_print("Error: -q (quiet mode) cannot be added to verbose or report modes\n"); opts->err_stat = H5DIFF_ERR; H5TOOLS_GOTO_DONE(0); @@ -207,7 +207,7 @@ is_exclude_path(char *path, h5trav_type_t type, diff_opt_t *opts) if (ret_cmp == 0) { /* found matching object */ /* excluded non-group object */ ret_value = 1; - /* remember the type of this maching object. + /* remember the type of this matching object. * if it's group, it can be used for excluding its member * objects in this while() loop */ exclude_path_ptr->obj_type = type; @@ -222,6 +222,70 @@ done: } /*------------------------------------------------------------------------- + * Function: is_exclude_attr + * + * Purpose: check if 'paths' are part of exclude path list + * + * Return: + * 1 - excluded path + * 0 - not excluded path + *------------------------------------------------------------------------*/ +static int +is_exclude_attr(const char *path, h5trav_type_t type, diff_opt_t *opts) +{ + struct exclude_path_list *exclude_ptr; + int ret_cmp; + int ret_value = 0; + + /* check if exclude attr option is given */ + if (!opts->exclude_attr_path) + H5TOOLS_GOTO_DONE(0); + + /* assign to local exclude list pointer */ + exclude_ptr = opts->exclude_attr; + + /* search objects in exclude list */ + while (NULL != exclude_ptr) { + /* if exclude path is is group, exclude its members as well */ + if (exclude_ptr->obj_type == H5TRAV_TYPE_GROUP) { + ret_cmp = HDstrncmp(exclude_ptr->obj_path, path, HDstrlen(exclude_ptr->obj_path)); + if (ret_cmp == 0) { /* found matching members */ + size_t len_grp; + + /* check if given path belong to an excluding group, if so + * exclude it as well. + * This verifies if “/grp1/dset1” is only under “/grp1”, but + * not under “/grp1xxx/” group. + */ + len_grp = HDstrlen(exclude_ptr->obj_path); + if (path[len_grp] == '/') { + /* belong to excluded group! */ + ret_value = 1; + break; /* while */ + } + } + } + /* exclude target is not group, just exclude the object */ + else { + ret_cmp = HDstrcmp(exclude_ptr->obj_path, path); + if (ret_cmp == 0) { /* found matching object */ + /* excluded non-group object */ + ret_value = 1; + /* remember the type of this matching object. + * if it's group, it can be used for excluding its member + * objects in this while() loop */ + exclude_ptr->obj_type = type; + break; /* while */ + } + } + exclude_ptr = exclude_ptr->next; + } + +done: + return ret_value; +} + +/*------------------------------------------------------------------------- * Function: free_exclude_path_list * * Purpose: free exclude object list from diff options @@ -240,6 +304,24 @@ free_exclude_path_list(diff_opt_t *opts) } /*------------------------------------------------------------------------- + * Function: free_exclude_attr_list + * + * Purpose: free exclude object attribute list from diff options + *------------------------------------------------------------------------*/ +static void +free_exclude_attr_list(diff_opt_t *opts) +{ + struct exclude_path_list *curr = opts->exclude_attr; + struct exclude_path_list *next; + + while (NULL != curr) { + next = curr->next; + HDfree(curr); + curr = next; + } +} + +/*------------------------------------------------------------------------- * Function: build_match_list * * Purpose: get list of matching path_name from info1 and info2 @@ -284,6 +366,7 @@ build_match_list(const char *objname1, trav_info_t *info1, const char *objname2, * All the objects belong to given groups are the candidates. * So prepare to compare paths without the group names. */ + H5TOOLS_DEBUG("objname1 = %s objname2 = %s ", objname1, objname2); /* if obj1 is not root */ if (HDstrcmp(objname1, "/") != 0) @@ -551,17 +634,17 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char *------------------------------------------------------------------------- */ /* open file 1 */ - if ((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { + if ((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, FALSE, NULL, (size_t)0)) < 0) { parallel_print("h5diff: <%s>: unable to open file\n", fname1); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "<%s>: unable to open file\n", fname1); - } /* end if */ + } H5TOOLS_DEBUG("file1_id = %s", fname1); /* open file 2 */ - if ((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { + if ((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, FALSE, NULL, (size_t)0)) < 0) { parallel_print("h5diff: <%s>: unable to open file\n", fname2); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "<%s>: unable to open file\n", fname2); - } /* end if */ + } H5TOOLS_DEBUG("file2_id = %s", fname2); /*------------------------------------------------------------------------- @@ -591,6 +674,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char } else obj1fullname = HDstrdup(objname1); + H5TOOLS_DEBUG("obj1fullname = %s", obj1fullname); /* make the given object2 fullpath, start with "/" */ if (HDstrncmp(objname2, "/", 1)) { @@ -608,6 +692,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char } else obj2fullname = HDstrdup(objname2); + H5TOOLS_DEBUG("obj2fullname = %s", obj2fullname); /*---------------------------------------------------------- * check if obj1 is root, group, single object or symlink @@ -741,12 +826,12 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char H5TOOLS_DEBUG("h5diff ... dangling link"); if (opts->no_dangle_links) { /* treat dangling link as error */ - if (opts->m_verbose) + if (opts->mode_verbose) parallel_print("Warning: <%s> is a dangling link.\n", obj1fullname); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "treat dangling link as error"); } else { - if (opts->m_verbose) + if (opts->mode_verbose) parallel_print("obj1 <%s> is a dangling link.\n", obj1fullname); if (l_ret1 != 0 || l_ret2 != 0) { nfound++; @@ -782,12 +867,12 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char H5TOOLS_DEBUG("h5diff ... dangling link"); if (opts->no_dangle_links) { /* treat dangling link as error */ - if (opts->m_verbose) + if (opts->mode_verbose) parallel_print("Warning: <%s> is a dangling link.\n", obj2fullname); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "treat dangling link as error"); } else { - if (opts->m_verbose) + if (opts->mode_verbose) parallel_print("obj2 <%s> is a dangling link.\n", obj2fullname); if (l_ret1 != 0 || l_ret2 != 0) { nfound++; @@ -821,8 +906,8 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char * comparing details of same objects. */ - if (!(opts->m_verbose || opts->m_report)) { - H5TOOLS_DEBUG("h5diff NOT (opts->m_verbose || opts->m_report)"); + if (!(opts->mode_verbose || opts->mode_report)) { + H5TOOLS_DEBUG("h5diff NOT (opts->mode_verbose || opts->mode_report)"); /* if no danglink links */ if (l_ret1 > 0 && l_ret2 > 0) if (h5tools_is_obj_same(file1_id, obj1fullname, file2_id, obj2fullname) != 0) @@ -889,9 +974,14 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char /*------------------------------------------------------ * print the list */ - if (opts->m_verbose) { + if (opts->mode_verbose) { unsigned u; + if (opts->mode_verbose_level > 2) { + parallel_print("file1: %s\n", fname1); + parallel_print("file2: %s\n", fname2); + } + parallel_print("\n"); /* if given objects is group under root */ if (HDstrcmp(obj1fullname, "/") || HDstrcmp(obj2fullname, "/")) @@ -910,6 +1000,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char } H5TOOLS_DEBUG("diff_match next - errstat:%d", opts->err_stat); nfound = diff_match(file1_id, obj1fullname, info1_lp, file2_id, obj2fullname, info2_lp, match_list, opts); + H5TOOLS_DEBUG("diff_match nfound: %d - errstat:%d", nfound, opts->err_stat); done: opts->err_stat = opts->err_stat | ret_value; @@ -1004,12 +1095,14 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, *------------------------------------------------------------------------- */ + H5TOOLS_DEBUG("exclude_path opts->contents:%d", opts->contents); /* not valid compare used when --exclude-path option is used */ if (!opts->exclude_path) { /* number of different objects */ if (info1->nused != info2->nused) { opts->contents = 0; } + H5TOOLS_DEBUG("opts->exclude_path opts->contents:%d", opts->contents); } /* objects in one file and not the other */ @@ -1018,6 +1111,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, opts->contents = 0; break; } + H5TOOLS_DEBUG("table->nobjs[%d] opts->contents:%d", i, opts->contents); } /*------------------------------------------------------------------------- @@ -1361,6 +1455,8 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, opts->err_stat = opts->err_stat | ret_value; + free_exclude_attr_list(opts); + /* free table */ if (table) trav_table_free(table); @@ -1432,7 +1528,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ if (status == 0) { if (opts->no_dangle_links) { /* dangling link is error */ - if (opts->m_verbose) + if (opts->mode_verbose) parallel_print("Warning: <%s> is a dangling link.\n", path1); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "dangling link is error"); } @@ -1447,7 +1543,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ if (status == 0) { if (opts->no_dangle_links) { /* dangling link is error */ - if (opts->m_verbose) + if (opts->mode_verbose) parallel_print("Warning: <%s> is a dangling link.\n", path2); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "dangling link is error"); } @@ -1472,10 +1568,11 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ /* if objects are not the same type */ if (argdata->type[0] != argdata->type[1]) { H5TOOLS_DEBUG("diff objects are not the same"); - if (opts->m_verbose || opts->m_list_not_cmp) { + if (opts->mode_verbose || opts->mode_list_not_cmp) { parallel_print("Not comparable: <%s> is of type %s and <%s> is of type %s\n", path1, get_type(argdata->type[0]), path2, get_type(argdata->type[1])); } + opts->not_cmp = 1; /* TODO: will need to update non-comparable is different * opts->contents = 0; @@ -1499,7 +1596,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ object_type == H5TRAV_TYPE_GROUP); if (opts->follow_links || is_hard_link) { /* print information is only verbose option is used */ - if (opts->m_verbose || opts->m_report) { + if (opts->mode_verbose || opts->mode_report) { switch (object_type) { case H5TRAV_TYPE_DATASET: do_print_objname("dataset", path1, path2, opts); @@ -1529,7 +1626,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ } /* switch(type)*/ print_found(nfound); - } /* if(opts->m_verbose || opts->m_report) */ + } /* if(opts->mode_verbose || opts->mode_report) */ /* exact same, so comparison is done */ H5TOOLS_GOTO_DONE(H5DIFF_NO_ERR); @@ -1547,15 +1644,16 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Dopen2 failed"); if ((dset2_id = H5Dopen2(file2_id, path2, H5P_DEFAULT)) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Dopen2 failed"); + H5TOOLS_DEBUG("paths: %s - %s", path1, path2); /* verbose (-v) and report (-r) mode */ - if (opts->m_verbose || opts->m_report) { + if (opts->mode_verbose || opts->mode_report) { do_print_objname("dataset", path1, path2, opts); H5TOOLS_DEBUG("call diff_dataset 1:%s 2:%s ", path1, path2); nfound = diff_dataset(file1_id, file2_id, path1, path2, opts); print_found(nfound); } /* quiet mode (-q), just count differences */ - else if (opts->m_quiet) { + else if (opts->mode_quiet) { nfound = diff_dataset(file1_id, file2_id, path1, path2, opts); } /* the rest (-c, none, ...) */ @@ -1575,7 +1673,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ * referenced object *--------------------------------------------------------- */ - if (path1) { + if (path1 && !is_exclude_attr(path1, object_type, opts)) { H5TOOLS_DEBUG("call diff_attr 1:%s 2:%s ", path1, path2); nfound += diff_attr(dset1_id, dset2_id, path1, path2, opts); } @@ -1607,7 +1705,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ do_print_objname("datatype", path1, path2, opts); /* always print the number of differences found in verbose mode */ - if (opts->m_verbose) + if (opts->mode_verbose) print_found(nfound); /*----------------------------------------------------------------- @@ -1616,7 +1714,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ * referenced object *----------------------------------------------------------------- */ - if (path1) { + if (path1 && !is_exclude_attr(path1, object_type, opts)) { H5TOOLS_DEBUG("call diff_attr 1:%s 2:%s ", path1, path2); nfound += diff_attr(type1_id, type2_id, path1, path2, opts); } @@ -1637,7 +1735,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ do_print_objname("group", path1, path2, opts); /* always print the number of differences found in verbose mode */ - if (opts->m_verbose) + if (opts->mode_verbose) print_found(nfound); if ((grp1_id = H5Gopen2(file1_id, path1, H5P_DEFAULT)) < 0) @@ -1651,7 +1749,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ * referenced object *----------------------------------------------------------------- */ - if (path1) { + if (path1 && !is_exclude_attr(path1, object_type, opts)) { H5TOOLS_DEBUG("call diff_attr 1:%s 2:%s ", path1, path2); nfound += diff_attr(grp1_id, grp2_id, path1, path2, opts); } @@ -1677,7 +1775,7 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ do_print_objname("link", path1, path2, opts); /* always print the number of differences found in verbose mode */ - if (opts->m_verbose) + if (opts->mode_verbose) print_found(nfound); } break; @@ -1725,13 +1823,13 @@ diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_ } /* end else */ /* always print the number of differences found in verbose mode */ - if (opts->m_verbose) + if (opts->mode_verbose) print_found(nfound); } break; case H5TRAV_TYPE_UNKNOWN: default: - if (opts->m_verbose) + if (opts->mode_verbose) parallel_print("Comparison not supported: <%s> and <%s> are of type %s\n", path1, path2, get_type(object_type)); opts->not_cmp = 1; @@ -1753,7 +1851,7 @@ done: } /* path1 is dangling link */ else if (is_dangle_link1) { - if (opts->m_verbose) + if (opts->mode_verbose) parallel_print("obj1 <%s> is a dangling link.\n", path1); nfound++; if (print_objname(opts, nfound)) @@ -1761,7 +1859,7 @@ done: } /* path2 is dangling link */ else if (is_dangle_link2) { - if (opts->m_verbose) + if (opts->mode_verbose) parallel_print("obj2 <%s> is a dangling link.\n", path2); nfound++; if (print_objname(opts, nfound)) diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 1445d5a..d518675 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -15,25 +15,9 @@ #define H5DIFF_H__ #include "hdf5.h" +#include "h5tools.h" #include "h5trav.h" -/* - * Debug printf macros. The prefix allows output filtering by test scripts. - */ -#ifdef H5DIFF_DEBUG -#define h5difftrace(x) HDfprintf(stderr, "h5diff debug: " x) -#define h5diffdebug2(x1, x2) HDfprintf(stderr, "h5diff debug: " x1, x2) -#define h5diffdebug3(x1, x2, x3) HDfprintf(stderr, "h5diff debug: " x1, x2, x3) -#define h5diffdebug4(x1, x2, x3, x4) HDfprintf(stderr, "h5diff debug: " x1, x2, x3, x4) -#define h5diffdebug5(x1, x2, x3, x4, x5) HDfprintf(stderr, "h5diff debug: " x1, x2, x3, x4, x5) -#else -#define h5difftrace(x) -#define h5diffdebug2(x1, x2) -#define h5diffdebug3(x1, x2, x3) -#define h5diffdebug4(x1, x2, x3, x4) -#define h5diffdebug5(x1, x2, x3, x4, x5) -#endif - #define MAX_FILENAME 1024 /*------------------------------------------------------------------------- @@ -52,7 +36,7 @@ typedef struct { */ /* linked list to keep exclude path list */ struct exclude_path_list { - char * obj_path; + const char * obj_path; h5trav_type_t obj_type; struct exclude_path_list *next; }; @@ -65,27 +49,46 @@ typedef enum { } diff_err_t; typedef struct { - int m_quiet; /* quiet mode: no output at all */ - int m_report; /* report mode: print the data */ - int m_verbose; /* verbose mode: print the data, list of objcets, warnings */ - int m_verbose_level; /* control verbose details */ - int d; /* delta, absolute value to compare */ - double delta; /* delta value */ - int p; /* relative error to compare*/ + int mode_quiet; /* quiet mode: no output at all */ + int mode_report; /* report mode: print the data */ + int mode_verbose; /* verbose mode: print the data, list of objcets, warnings */ + int mode_verbose_level; /* control verbose details */ + int mode_list_not_cmp; /* list not comparable messages */ + int print_header; /* print header */ + int print_percentage; /* print percentage */ + int print_dims; /* print dimension index */ + int delta_bool; /* delta, absolute value to compare */ + double delta; /* delta value */ int use_system_epsilon; /* flag to use system epsilon (1 or 0) */ + int percent_bool; /* relative error to compare*/ double percent; /* relative error value */ - int n; /* count, compare up to count */ - hsize_t count; /* count value */ hbool_t follow_links; /* follow symbolic links */ int no_dangle_links; /* return error when find dangling link */ - diff_err_t err_stat; /* an error ocurred (2, error, 1, differences, 0, no error) */ - int cmn_objs; /* do we have common objects */ - int not_cmp; /* are the objects comparable */ - int contents; /* equal contents */ - int do_nans; /* consider Nans while diffing floats */ - int m_list_not_cmp; /* list not comparable messages */ - int exclude_path; /* exclude path to an object */ - struct exclude_path_list *exclude; /* keep exclude path list */ + int cmn_objs; /* do we have common objects */ + int not_cmp; /* are the objects comparable */ + int contents; /* equal contents */ + int do_nans; /* consider Nans while diffing floats */ + int exclude_path; /* exclude path to an object */ + int exclude_attr_path; /* exclude path to an object */ + struct exclude_path_list *exclude; /* keep exclude path list */ + struct exclude_path_list *exclude_attr; /* keep exclude attribute list */ + int count_bool; /* count, compare up to count */ + hsize_t count; /* count value */ + diff_err_t err_stat; /* an error ocurred (2, error, 1, differences, 0, no error) */ + hsize_t nelmts; /* total number of elements */ + hsize_t hs_nelmts; /* number of elements to read at a time*/ + int rank; /* dimensionality */ + size_t m_size; /* m_size for diff */ + hid_t m_tid; /* m_tid for diff */ + hsize_t dims[H5S_MAX_RANK]; /* dimensions of object */ + hsize_t p_min_idx[H5S_MAX_RANK]; /* min selected index */ + hsize_t p_max_idx[H5S_MAX_RANK]; /* max selected index */ + hsize_t acc[H5S_MAX_RANK]; /* accumulator position */ + hsize_t pos[H5S_MAX_RANK]; /* matrix position */ + hsize_t sm_pos[H5S_MAX_RANK]; /* stripmine position */ + char * obj_name[2]; /* name for object */ + struct subset_t * sset[2]; /* subsetting parameters */ + hbool_t custom_vol[2]; /* Using a custom input, output VOL? */ } diff_opt_t; /*------------------------------------------------------------------------- @@ -126,16 +129,12 @@ hsize_t diff_datasetid(hid_t dset1_id, hid_t dset2_id, const char *obj1_name, co hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, const char *grp2, trav_info_t *info2, trav_table_t *table, diff_opt_t *opts); -hsize_t diff_array(void *_mem1, void *_mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - diff_opt_t *opts, const char *name1, const char *name2, hid_t m_type, hid_t container1_id, - hid_t container2_id); /* dataset where the reference came from*/ +hsize_t diff_array(void *_mem1, void *_mem2, diff_opt_t *opts, hid_t container1_id, hid_t container2_id); -int diff_can_type(hid_t f_type1, /* file data type */ - hid_t f_type2, /* file data type */ - int rank1, int rank2, hsize_t *dims1, hsize_t *dims2, hsize_t *maxdim1, hsize_t *maxdim2, - const char *obj1_name, const char *obj2_name, diff_opt_t *opts, int is_compound); +int diff_can_type(hid_t f_type1, hid_t f_type2, int rank1, int rank2, hsize_t *dims1, hsize_t *dims2, + hsize_t *maxdim1, hsize_t *maxdim2, diff_opt_t *opts, int is_compound); -hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *attr1_name, const char *attr2_name, +hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *name2, const char *path1, const char *path2, diff_opt_t *opts); hsize_t diff_attr(hid_t loc1_id, hid_t loc2_id, const char *path1, const char *path2, diff_opt_t *opts); diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index f0e8c71..97a731a 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -138,73 +138,53 @@ typedef struct mcomp_t { * local prototypes *------------------------------------------------------------------------- */ -static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, - diff_opt_t *opts); static hbool_t all_zero(const void *_mem, size_t size); static int ull2float(unsigned long long ull_value, float *f_value); -static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, - const char *obj2, int *ph); -static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, hsize_t i, int rank, - hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, - const char *obj1, const char *obj2, int *ph); +static hsize_t character_compare(char *mem1, char *mem2, hsize_t elemtno, size_t u, diff_opt_t *opts); +static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, hsize_t elemtno, + diff_opt_t *opts); static hbool_t equal_float(float value, float expected, diff_opt_t *opts); static hbool_t equal_double(double value, double expected, diff_opt_t *opts); #if H5_SIZEOF_LONG_DOUBLE != 0 static hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *opts); #endif + static int print_data(diff_opt_t *opts); -static void print_pos(int *ph, int pp, hsize_t curr_pos, hsize_t *acc, hsize_t *pos, int rank, hsize_t *dims, - const char *obj1, const char *obj2); -static void print_char_pos(int *ph, int pp, hsize_t curr_pos, size_t u, hsize_t *acc, hsize_t *pos, int rank, - hsize_t *dims, const char *obj1, const char *obj2); +static void print_pos(diff_opt_t *opts, hsize_t elemtno, size_t u); static void h5diff_print_char(char ch); -static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, - hid_t container1_id, hid_t container2_id, /*where the reference came from*/ - int * ph, /*print header */ - mcomp_t *members); /*compound members */ -static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, - int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, - const char *obj1, const char *obj2, int *ph); -static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, - int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, - const char *obj1, const char *obj2, int *ph); + +static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, + diff_opt_t *opts); +static hsize_t diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t container1_id, + hid_t container2_id, mcomp_t *members); +/* element diffs */ +static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, + diff_opt_t *opts); +static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, + diff_opt_t *opts); #if H5_SIZEOF_LONG_DOUBLE != 0 -static hsize_t diff_ldouble(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, - int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, - const char *obj1, const char *obj2, int *ph); +static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, + diff_opt_t *opts); #endif -static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, - int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, - const char *obj1, const char *obj2, int *ph); -static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, - int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, - const char *obj1, const char *obj2, int *ph); -static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, - int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, - const char *obj1, const char *obj2, int *ph); -static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, - int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, - const char *obj1, const char *obj2, int *ph); -static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, - int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, - const char *obj1, const char *obj2, int *ph); -static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, - int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, - const char *obj1, const char *obj2, int *ph); -static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, - int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, - const char *obj1, const char *obj2, int *ph); -static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, - int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, - const char *obj1, const char *obj2, int *ph); -static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, - int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, - const char *obj1, const char *obj2, int *ph); -static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, - int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, - const char *obj1, const char *obj2, int *ph); +static hsize_t diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, + diff_opt_t *opts); +static hsize_t diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, + diff_opt_t *opts); +static hsize_t diff_short_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, + diff_opt_t *opts); +static hsize_t diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, + diff_opt_t *opts); +static hsize_t diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts); +static hsize_t diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, + diff_opt_t *opts); +static hsize_t diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, + diff_opt_t *opts); +static hsize_t diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, + diff_opt_t *opts); +static hsize_t diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, + diff_opt_t *opts); +static hsize_t diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, + diff_opt_t *opts); /*------------------------------------------------------------------------- * NaN detection @@ -235,50 +215,40 @@ static void close_member_types(mcomp_t *members); */ hsize_t -diff_array(void *_mem1, void *_mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - diff_opt_t *opts, const char *name1, const char *name2, hid_t m_type, hid_t container1_id, - hid_t container2_id) +diff_array(void *_mem1, void *_mem2, diff_opt_t *opts, hid_t container1_id, hid_t container2_id) { hsize_t nfound = 0; /* number of differences found */ size_t size; /* size of datum */ unsigned char *mem1 = (unsigned char *)_mem1; unsigned char *mem2 = (unsigned char *)_mem2; - hsize_t acc[32]; /* accumulator position */ - hsize_t pos[32]; /* matrix position */ - int ph = 1; /* print header */ hsize_t i; - int j; mcomp_t members; H5T_class_t type_class; - H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat); + H5TOOLS_START_DEBUG(" - rank:%d hs_nelmts:%ld errstat:%d", opts->rank, opts->hs_nelmts, opts->err_stat); + opts->print_header = 1; /* enable print header */ + /* get the size. */ - size = H5Tget_size(m_type); - type_class = H5Tget_class(m_type); + size = H5Tget_size(opts->m_tid); + type_class = H5Tget_class(opts->m_tid); /* Fast comparison first for atomic type by memcmp(). * It is OK not to list non-atomic type here because it will not be caught * by the condition, but it gives more clarity for code planning */ if (type_class != H5T_REFERENCE && type_class != H5T_COMPOUND && type_class != H5T_STRING && - type_class != H5T_VLEN && HDmemcmp(mem1, mem2, size * nelmts) == 0) + type_class != H5T_VLEN && HDmemcmp(mem1, mem2, size * opts->hs_nelmts) == 0) { + H5TOOLS_ENDDEBUG(":Fast comparison - errstat:%d", opts->err_stat); return 0; - - if (rank > 0) { - acc[rank - 1] = 1; - for (j = (rank - 2); j >= 0; j--) { - acc[j] = acc[j + 1] * dims[j + 1]; - } - for (j = 0; j < rank; j++) - pos[j] = 0; } - H5TOOLS_DEBUG("diff_array type_class:%d", type_class); + H5TOOLS_DEBUG("type_class:%d", type_class); switch (type_class) { case H5T_NO_CLASS: case H5T_TIME: case H5T_NCLASSES: default: + H5TOOLS_DEBUG("type_class:INVALID"); HDassert(0); break; @@ -287,50 +257,142 @@ diff_array(void *_mem1, void *_mem2, hsize_t nelmts, hsize_t hyper_start, int ra *------------------------------------------------------------------------- */ case H5T_FLOAT: - if (H5Tequal(m_type, H5T_NATIVE_FLOAT)) - nfound = diff_float(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, - &ph); - else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE)) - nfound = diff_double(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, - name2, &ph); + H5TOOLS_DEBUG("type_class:H5T_FLOAT"); + if (H5Tequal(opts->m_tid, H5T_NATIVE_FLOAT)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_float_element(mem1, mem2, i, opts); + + mem1 += sizeof(float); + mem2 += sizeof(float); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } + else if (H5Tequal(opts->m_tid, H5T_NATIVE_DOUBLE)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_double_element(mem1, mem2, i, opts); + + mem1 += sizeof(double); + mem2 += sizeof(double); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } #if H5_SIZEOF_LONG_DOUBLE != 0 - else if (H5Tequal(m_type, H5T_NATIVE_LDOUBLE)) - nfound = diff_ldouble(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, - name2, &ph); + else if (H5Tequal(opts->m_tid, H5T_NATIVE_LDOUBLE)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_ldouble_element(mem1, mem2, i, opts); + + mem1 += sizeof(long double); + mem2 += sizeof(long double); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } #endif break; case H5T_INTEGER: - if (H5Tequal(m_type, H5T_NATIVE_SCHAR)) - nfound = diff_schar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, - &ph); - else if (H5Tequal(m_type, H5T_NATIVE_UCHAR)) - nfound = diff_uchar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, - &ph); - else if (H5Tequal(m_type, H5T_NATIVE_SHORT)) - nfound = diff_short(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, - &ph); - else if (H5Tequal(m_type, H5T_NATIVE_USHORT)) - nfound = diff_ushort(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, - name2, &ph); - else if (H5Tequal(m_type, H5T_NATIVE_INT)) - nfound = - diff_int(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); - else if (H5Tequal(m_type, H5T_NATIVE_UINT)) - nfound = - diff_uint(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); - else if (H5Tequal(m_type, H5T_NATIVE_LONG)) - nfound = - diff_long(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); - else if (H5Tequal(m_type, H5T_NATIVE_ULONG)) - nfound = diff_ulong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, - &ph); - else if (H5Tequal(m_type, H5T_NATIVE_LLONG)) - nfound = diff_llong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, - &ph); - else if (H5Tequal(m_type, H5T_NATIVE_ULLONG)) - nfound = diff_ullong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, - name2, &ph); + H5TOOLS_DEBUG("type_class:H5T_INTEGER"); + if (H5Tequal(opts->m_tid, H5T_NATIVE_SCHAR)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_schar_element(mem1, mem2, i, opts); + mem1 += sizeof(char); + mem2 += sizeof(char); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } + else if (H5Tequal(opts->m_tid, H5T_NATIVE_UCHAR)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_uchar_element(mem1, mem2, i, opts); + + mem1 += sizeof(unsigned char); + mem2 += sizeof(unsigned char); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } + else if (H5Tequal(opts->m_tid, H5T_NATIVE_SHORT)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_short_element(mem1, mem2, i, opts); + + mem1 += sizeof(short); + mem2 += sizeof(short); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } + else if (H5Tequal(opts->m_tid, H5T_NATIVE_USHORT)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_ushort_element(mem1, mem2, i, opts); + + mem1 += sizeof(unsigned short); + mem2 += sizeof(unsigned short); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } + else if (H5Tequal(opts->m_tid, H5T_NATIVE_INT)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_int_element(mem1, mem2, i, opts); + + mem1 += sizeof(int); + mem2 += sizeof(int); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } + else if (H5Tequal(opts->m_tid, H5T_NATIVE_UINT)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_int_element(mem1, mem2, i, opts); + + mem1 += sizeof(unsigned int); + mem2 += sizeof(unsigned int); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } + else if (H5Tequal(opts->m_tid, H5T_NATIVE_LONG)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_long_element(mem1, mem2, i, opts); + + mem1 += sizeof(long); + mem2 += sizeof(long); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } + else if (H5Tequal(opts->m_tid, H5T_NATIVE_ULONG)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_ulong_element(mem1, mem2, i, opts); + + mem1 += sizeof(unsigned long); + mem2 += sizeof(unsigned long); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } + else if (H5Tequal(opts->m_tid, H5T_NATIVE_LLONG)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_llong_element(mem1, mem2, i, opts); + + mem1 += sizeof(long long); + mem2 += sizeof(long long); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } + else if (H5Tequal(opts->m_tid, H5T_NATIVE_ULLONG)) { + for (i = 0; i < opts->hs_nelmts; i++) { + nfound += diff_ullong_element(mem1, mem2, i, opts); + + mem1 += sizeof(unsigned long long); + mem2 += sizeof(unsigned long long); + if (opts->count_bool && nfound >= opts->count) + return nfound; + } /* nelmts */ + } break; /*------------------------------------------------------------------------- @@ -345,13 +407,14 @@ diff_array(void *_mem1, void *_mem2, hsize_t nelmts, hsize_t hyper_start, int ra case H5T_ARRAY: case H5T_VLEN: case H5T_REFERENCE: + H5TOOLS_DEBUG("type_class:OTHER"); HDmemset(&members, 0, sizeof(mcomp_t)); - get_member_types(m_type, &members); - H5TOOLS_DEBUG("call diff_datum nelmts:%d - errstat:%d", nelmts, opts->err_stat); - for (i = 0; i < nelmts; i++) { - nfound += diff_datum(mem1 + i * size, mem2 + i * size, m_type, i, rank, dims, acc, pos, opts, - name1, name2, container1_id, container2_id, &ph, &members); - if (opts->n && nfound >= opts->count) + get_member_types(opts->m_tid, &members); + for (i = 0; i < opts->hs_nelmts; i++) { + H5TOOLS_DEBUG("opts->pos[%ld]:%ld - nelmts:%ld", i, opts->pos[i], opts->hs_nelmts); + nfound += diff_datum(mem1 + i * size, mem2 + i * size, i, opts, container1_id, container2_id, + &members); + if (opts->count_bool && nfound >= opts->count) break; } /* i */ close_member_types(&members); @@ -394,10 +457,8 @@ diff_array(void *_mem1, void *_mem2, hsize_t nelmts, hsize_t hyper_start, int ra *------------------------------------------------------------------------- */ static hsize_t -diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_t *dims, hsize_t *acc, - hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, hid_t container1_id, - hid_t container2_id, int *ph, /*print header */ - mcomp_t *members) /*compound members */ +diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t container1_id, + hid_t container2_id, mcomp_t *members) { unsigned char *mem1 = (unsigned char *)_mem1; unsigned char *mem2 = (unsigned char *)_mem2; @@ -408,7 +469,6 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ size_t offset; unsigned nmembs; unsigned j; - hsize_t nelmts; size_t size = 0; hbool_t iszero1; hbool_t iszero2; @@ -417,10 +477,10 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ hbool_t both_zero; diff_err_t ret_value = opts->err_stat; - H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat); + H5TOOLS_START_DEBUG("ph:%d elemtno:%d - errstat:%d", opts->print_header, elemtno, opts->err_stat); - type_size = H5Tget_size(m_type); - type_class = H5Tget_class(m_type); + type_size = H5Tget_size(opts->m_tid); + type_class = H5Tget_class(opts->m_tid); /* Fast comparison first for atomic type by memcmp(). * It is OK not to list non-atomic type here because it will not be caught @@ -430,7 +490,7 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ type_class != H5T_VLEN && HDmemcmp(mem1, mem2, type_size) == 0) H5TOOLS_GOTO_DONE(opts->err_stat); - switch (H5Tget_class(m_type)) { + switch (H5Tget_class(opts->m_tid)) { case H5T_NO_CLASS: case H5T_TIME: case H5T_NCLASSES: @@ -443,18 +503,23 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ *------------------------------------------------------------------------- */ case H5T_COMPOUND: - H5TOOLS_DEBUG("diff_datum H5T_COMPOUND"); + H5TOOLS_DEBUG("H5T_COMPOUND"); { - hid_t memb_type = H5I_INVALID_HID; - nmembs = members->n; + diff_opt_t cmpd_opts; + + cmpd_opts = *opts; + nmembs = members->n; for (j = 0; j < nmembs; j++) { - offset = members->offsets[j]; - memb_type = members->ids[j]; + offset = members->offsets[j]; + cmpd_opts.m_tid = members->ids[j]; - nfound += diff_datum(mem1 + offset, mem2 + offset, memb_type, idx, rank, dims, acc, pos, - opts, obj1, obj2, container1_id, container2_id, ph, members->m[j]); + nfound += diff_datum(mem1 + offset, mem2 + offset, elemtno, &cmpd_opts, container1_id, + container2_id, members->m[j]); } + opts->err_stat = opts->err_stat | cmpd_opts.err_stat; + opts->print_header = cmpd_opts.print_header; + opts->not_cmp = cmpd_opts.not_cmp; } break; @@ -463,7 +528,7 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ *------------------------------------------------------------------------- */ case H5T_STRING: - H5TOOLS_DEBUG("diff_datum H5T_STRING"); + H5TOOLS_DEBUG("H5T_STRING"); { char * s = NULL; char * sx = NULL; @@ -472,12 +537,12 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ size_t size1; size_t size2; size_t sizex; - size_t size_mtype = H5Tget_size(m_type); - H5T_str_t pad = H5Tget_strpad(m_type); + size_t size_mtype = H5Tget_size(opts->m_tid); + H5T_str_t pad = H5Tget_strpad(opts->m_tid); /* if variable length string */ - if (H5Tis_variable_str(m_type)) { - H5TOOLS_DEBUG("diff_datum H5T_STRING variable"); + if (H5Tis_variable_str(opts->m_tid)) { + H5TOOLS_DEBUG("H5T_STRING variable"); /* Get pointer to first string */ s1 = *(char **)((void *)mem1); if (s1) @@ -493,7 +558,7 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ size2 = 0; } else if (H5T_STR_NULLTERM == pad) { - H5TOOLS_DEBUG("diff_datum H5T_STRING null term"); + H5TOOLS_DEBUG("H5T_STRING null term"); /* Get pointer to first string */ s1 = (char *)mem1; if (s1) @@ -530,10 +595,10 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ * of length of strings. * For now mimic the previous way. */ - H5TOOLS_DEBUG("diff_datum string size:%d", size1); - H5TOOLS_DEBUG("diff_datum string size:%d", size2); + H5TOOLS_DEBUG("string size:%d", size1); + H5TOOLS_DEBUG("string size:%d", size2); if (size1 != size2) { - H5TOOLS_DEBUG("diff_datum string sizes difference"); + H5TOOLS_DEBUG("string sizes difference"); nfound++; } if (size1 < size2) { @@ -552,17 +617,13 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ /* check for NULL pointer for string */ if (s != NULL) { /* try fast compare first */ - if (HDmemcmp(s, sx, size) == 0) { - if (size1 != size2) - if (print_data(opts)) - for (u = size; u < sizex; u++) - character_compare(s + u, sx + u, idx, u, rank, dims, acc, pos, opts, obj1, - obj2, ph); + if ((HDmemcmp(s, sx, size) == 0) && (size1 != size2)) { + for (u = size; u < sizex; u++) + character_compare(s + u, sx + u, elemtno, u, opts); } else for (u = 0; u < size; u++) - nfound += character_compare(s + u, sx + u, idx, u, rank, dims, acc, pos, opts, - obj1, obj2, ph); + nfound += character_compare(s + u, sx + u, elemtno, u, opts); } /* end check for NULL pointer for string */ } break; @@ -572,11 +633,10 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ *------------------------------------------------------------------------- */ case H5T_BITFIELD: - H5TOOLS_DEBUG("diff_datum H5T_BITFIELD"); + H5TOOLS_DEBUG("H5T_BITFIELD"); /* byte-by-byte comparison */ for (u = 0; u < type_size; u++) - nfound += character_compare_opt(mem1 + u, mem2 + u, idx, rank, dims, acc, pos, opts, obj1, - obj2, ph); + nfound += character_compare_opt(mem1 + u, mem2 + u, elemtno, opts); break; /*------------------------------------------------------------------------- @@ -584,11 +644,10 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ *------------------------------------------------------------------------- */ case H5T_OPAQUE: - H5TOOLS_DEBUG("diff_datum H5T_OPAQUE"); + H5TOOLS_DEBUG("H5T_OPAQUE"); /* byte-by-byte comparison */ for (u = 0; u < type_size; u++) - nfound += character_compare_opt(mem1 + u, mem2 + u, idx, rank, dims, acc, pos, opts, obj1, - obj2, ph); + nfound += character_compare_opt(mem1 + u, mem2 + u, elemtno, opts); break; /*------------------------------------------------------------------------- @@ -601,7 +660,7 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ * compared, we convert both bit patterns to their corresponding * enumeration constant and do a string comparison */ - H5TOOLS_DEBUG("diff_datum H5T_ENUM"); + H5TOOLS_DEBUG("H5T_ENUM"); { char enum_name1[1024]; char enum_name2[1024]; @@ -614,11 +673,11 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ /* If the enum value cannot be converted to a string * it is set to an error string for later output. */ - err1 = H5Tenum_nameof(m_type, mem1, enum_name1, sizeof enum_name1); + err1 = H5Tenum_nameof(opts->m_tid, mem1, enum_name1, sizeof enum_name1); if (err1 < 0) HDsnprintf(enum_name1, sizeof(enum_name1), "**INVALID VALUE**"); - err2 = H5Tenum_nameof(m_type, mem2, enum_name2, sizeof enum_name2); + err2 = H5Tenum_nameof(opts->m_tid, mem2, enum_name2, sizeof enum_name2); if (err2 < 0) HDsnprintf(enum_name2, sizeof(enum_name2), "**INVALID VALUE**"); @@ -629,26 +688,25 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ * don't attempt to convert them - just report errors. */ nfound += 1; + opts->print_percentage = 0; + print_pos(opts, elemtno, 0); if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); parallel_print(S_FORMAT, enum_name1, enum_name2); } } else { /* Both enum values were valid */ if (HDstrcmp(enum_name1, enum_name2) != 0) { - nfound = 1; + nfound = 1; + opts->print_percentage = 0; + print_pos(opts, elemtno, 0); if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); parallel_print(S_FORMAT, enum_name1, enum_name2); } } else { for (u = 0; u < type_size; u++) - nfound += character_compare_opt(mem1 + u, mem2 + u, idx, rank, dims, acc, pos, - opts, obj1, obj2, ph); + nfound += character_compare_opt(mem1 + u, mem2 + u, elemtno, opts); } } /* enable error reporting */ @@ -662,26 +720,34 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ *------------------------------------------------------------------------- */ case H5T_ARRAY: { - hid_t memb_type = H5I_INVALID_HID; - hsize_t adims[H5S_MAX_RANK]; - int ndims; + hsize_t adims[H5S_MAX_RANK]; + int ndims; + diff_opt_t arr_opts; - H5TOOLS_DEBUG("diff_datum H5T_ARRAY"); + H5TOOLS_DEBUG("H5T_ARRAY ph=%d", opts->print_header); + + arr_opts = *opts; + H5TOOLS_DEBUG("Check opts: hs_nelmts:%ld to %ld rank:%d to %ld", opts->hs_nelmts, + arr_opts.hs_nelmts, opts->rank, arr_opts.rank); /* get the array's base datatype for each element */ - memb_type = H5Tget_super(m_type); - size = H5Tget_size(memb_type); - ndims = H5Tget_array_ndims(m_type); - H5Tget_array_dims2(m_type, adims); + arr_opts.m_tid = H5Tget_super(opts->m_tid); + size = H5Tget_size(arr_opts.m_tid); + ndims = H5Tget_array_ndims(opts->m_tid); + H5Tget_array_dims2(opts->m_tid, adims); HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK); + H5TOOLS_DEBUG("attr ph=%d", arr_opts.print_header); /* calculate the number of array elements */ - for (u = 0, nelmts = 1; u < (unsigned)ndims; u++) - nelmts *= adims[u]; - for (u = 0; u < nelmts; u++) { - nfound += diff_datum(mem1 + u * size, mem2 + u * size, memb_type, idx, rank, dims, acc, pos, - opts, obj1, obj2, container1_id, container2_id, ph, members); - } - H5Tclose(memb_type); + for (u = 0, arr_opts.hs_nelmts = 1; u < (unsigned)ndims; u++) + arr_opts.hs_nelmts *= adims[u]; + for (u = 0; u < arr_opts.hs_nelmts; u++) { + nfound += diff_datum(mem1 + u * size, mem2 + u * size, elemtno, &arr_opts, container1_id, + container2_id, members); + } + opts->err_stat = opts->err_stat | arr_opts.err_stat; + opts->print_header = arr_opts.print_header; + opts->not_cmp = arr_opts.not_cmp; + H5Tclose(arr_opts.m_tid); } break; /*------------------------------------------------------------------------- @@ -689,105 +755,129 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ *------------------------------------------------------------------------- */ case H5T_REFERENCE: - H5TOOLS_DEBUG("diff_datum H5T_REFERENCE"); - iszero1 = all_zero(_mem1, H5Tget_size(m_type)); - iszero2 = all_zero(_mem2, H5Tget_size(m_type)); + H5TOOLS_DEBUG("H5T_REFERENCE"); + iszero1 = all_zero(_mem1, H5Tget_size(opts->m_tid)); + iszero2 = all_zero(_mem2, H5Tget_size(opts->m_tid)); if (iszero1 != iszero2) { nfound++; H5TOOLS_GOTO_DONE(opts->err_stat); } else if (!iszero1 && !iszero2) { - hid_t obj1_id = H5I_INVALID_HID; - hid_t obj2_id = H5I_INVALID_HID; - - /*------------------------------------------------------------------------- - * H5T_STD_REF_DSETREG - * Dataset region reference - *------------------------------------------------------------------------- - */ - if (type_size == H5R_DSET_REG_REF_BUF_SIZE) { - hid_t region1_id = H5I_INVALID_HID; - hid_t region2_id = H5I_INVALID_HID; - - H5TOOLS_INFO("H5T_STD_REF_DSETREG reference type"); - - if ((obj1_id = H5Rdereference(container1_id, H5R_DATASET_REGION, _mem1)) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Rdereference object 1 failed"); - } - if ((obj2_id = H5Rdereference(container2_id, H5R_DATASET_REGION, _mem2)) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Rdereference object 2 failed"); - } - if ((region1_id = H5Rget_region(container1_id, H5R_DATASET_REGION, _mem1)) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Rget_region object 1 failed"); - } - if ((region2_id = H5Rget_region(container2_id, H5R_DATASET_REGION, _mem2)) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Rget_region object 2 failed"); - } - - nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, opts); - - H5Oclose(obj1_id); - H5Oclose(obj2_id); - H5Sclose(region1_id); - H5Sclose(region2_id); - } /*dataset reference*/ + hid_t obj1_id = H5I_INVALID_HID; + hid_t obj2_id = H5I_INVALID_HID; + diff_opt_t ref_opts; /*------------------------------------------------------------------------- * H5T_STD_REF_OBJ * Object references. get the type and OID of the referenced object *------------------------------------------------------------------------- */ - else if (type_size == H5R_OBJ_REF_BUF_SIZE) { + ref_opts = *opts; + ref_opts.obj_name[0] = NULL; + ref_opts.obj_name[1] = NULL; + if (type_size == H5R_OBJ_REF_BUF_SIZE) { H5O_type_t obj1_type; H5O_type_t obj2_type; - H5TOOLS_INFO("H5T_STD_REF_OBJ reference type"); - - if (H5Rget_obj_type2(container1_id, H5R_OBJECT, _mem1, &obj1_type) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Rget_obj_type2 object 1 failed"); + H5TOOLS_DEBUG("ref_type is H5T_STD_REF_OBJ"); + + if (H5Rget_obj_type2(container1_id, H5R_OBJECT, _mem1, &obj1_type) >= 0) { + if (H5Rget_obj_type2(container2_id, H5R_OBJECT, _mem2, &obj2_type) >= 0) { + /* check object type */ + if (obj1_type == obj2_type) { + if (obj1_type == H5O_TYPE_DATASET) { + if ((obj1_id = H5Rdereference(container1_id, H5R_OBJECT, _mem1)) >= 0) { + if ((obj2_id = H5Rdereference(container2_id, H5R_OBJECT, _mem2)) >= + 0) { + /* compare */ + nfound = diff_datasetid(obj1_id, obj2_id, opts->obj_name[0], + opts->obj_name[1], &ref_opts); + if (H5Oclose(obj2_id) < 0) { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Oclose H5T_STD_REF_OBJ 2 failed"); + } + } + else { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Rdereference object 2 failed"); + } + if (H5Oclose(obj1_id) < 0) { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Oclose H5T_STD_REF_OBJ 1 failed"); + } + } + else { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Rdereference object 1 failed"); + } + } + else { + if (ref_opts.mode_verbose) + parallel_print("Warning: Comparison not possible of object types " + "referenced: <%s> and <%s>\n", + obj1_type, obj2_type); + ref_opts.not_cmp = 1; + } + } + else { + parallel_print("Different object types referenced: <%s> and <%s>", + opts->obj_name[0], opts->obj_name[1]); + ref_opts.not_cmp = 1; + ref_opts.err_stat = H5DIFF_ERR; + } + } + else { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Rget_obj_type2 object 2 failed"); + } } - if (H5Rget_obj_type2(container2_id, H5R_OBJECT, _mem2, &obj2_type) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Rget_obj_type2 object 2 failed"); + else { + ref_opts.err_stat = H5DIFF_ERR; + H5TOOLS_INFO("H5Rget_obj_type2 object 1 failed"); } + } /*object reference*/ - /* check object type */ - if (obj1_type != obj2_type) { - parallel_print("Different object types referenced: <%s> and <%s>", obj1, obj2); - opts->not_cmp = 1; - H5TOOLS_GOTO_DONE(opts->err_stat); - } + /*------------------------------------------------------------------------- + * H5T_STD_REF_DSETREG + * Dataset region reference + *------------------------------------------------------------------------- + */ + else if (type_size == H5R_DSET_REG_REF_BUF_SIZE) { + hid_t region1_id = H5I_INVALID_HID; + hid_t region2_id = H5I_INVALID_HID; - if ((obj1_id = H5Rdereference(container1_id, H5R_OBJECT, _mem1)) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Rdereference object 1 failed"); - } - if ((obj2_id = H5Rdereference(container2_id, H5R_OBJECT, _mem2)) < 0) { - opts->err_stat = H5DIFF_ERR; - H5TOOLS_INFO("H5Rdereference object 2 failed"); + H5TOOLS_DEBUG("H5T_REFERENCE - H5T_STD_REF_DSETREG"); + + if ((obj1_id = H5Rdereference(container1_id, H5R_DATASET_REGION, _mem1)) >= 0) { + if ((obj2_id = H5Rdereference(container2_id, H5R_DATASET_REGION, _mem2)) >= 0) { + if ((region1_id = H5Rget_region(container1_id, H5R_DATASET_REGION, _mem1)) >= 0) { + if ((region2_id = H5Rget_region(container2_id, H5R_DATASET_REGION, _mem2)) >= + 0) { + nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, &ref_opts); + if (H5Sclose(region2_id) < 0) + H5TOOLS_INFO("H5Sclose H5T_STD_REF_DSETREG region 2 failed"); + } + if (H5Sclose(region1_id) < 0) + H5TOOLS_INFO("H5Sclose H5T_STD_REF_DSETREG region 1 failed"); + } + if (H5Oclose(obj2_id) < 0) + H5TOOLS_INFO("H5Oclose H5T_STD_REF_DSETREG region 2 failed"); + } + else { + H5TOOLS_INFO("H5Rdereference object 2 failed"); + } + if (H5Oclose(obj1_id) < 0) + H5TOOLS_INFO("H5Oclose H5T_STD_REF_DSETREG region 1 failed"); } - - /* compare */ - if (obj1_type == H5O_TYPE_DATASET) - nfound = diff_datasetid(obj1_id, obj2_id, NULL, NULL, opts); else { - if (opts->m_verbose) - parallel_print("Warning: Comparison not possible of object types referenced: " - "<%s> and <%s>\n", - obj1, obj2); - opts->not_cmp = 1; + H5TOOLS_INFO("H5Rdereference object 1 failed"); } - - H5Oclose(obj1_id); - H5Oclose(obj2_id); - } /*object reference*/ - } /*is zero*/ - H5TOOLS_DEBUG("diff_datum H5T_REFERENCE complete"); + } /*dataset reference*/ + opts->print_header = ref_opts.print_header; + opts->not_cmp = ref_opts.not_cmp; + opts->err_stat = ref_opts.err_stat | ret_value; + } /*is zero*/ + H5TOOLS_DEBUG("H5T_REFERENCE complete"); break; /*------------------------------------------------------------------------- @@ -795,25 +885,29 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ *------------------------------------------------------------------------- */ case H5T_VLEN: { - hid_t memb_type = H5I_INVALID_HID; + diff_opt_t vl_opts; + + H5TOOLS_DEBUG("H5T_VLEN"); - H5TOOLS_DEBUG("diff_datum H5T_VLEN"); + vl_opts = *opts; /* get the VL sequences's base datatype for each element */ - memb_type = H5Tget_super(m_type); - size = H5Tget_size(memb_type); + vl_opts.m_tid = H5Tget_super(opts->m_tid); + size = H5Tget_size(vl_opts.m_tid); /* get the number of sequence elements */ - nelmts = ((hvl_t *)((void *)mem1))->len; + vl_opts.hs_nelmts = ((hvl_t *)((void *)mem1))->len; - for (j = 0; j < nelmts; j++) + for (j = 0; j < vl_opts.hs_nelmts; j++) nfound += diff_datum(((char *)(((hvl_t *)((void *)mem1))->p)) + j * size, - ((char *)(((hvl_t *)((void *)mem2))->p)) + j * size, memb_type, - idx, /* Extra (void *) cast to quiet "cast to create alignment" warning - - 2019/07/05, QAK */ - rank, dims, acc, pos, opts, obj1, obj2, container1_id, container2_id, ph, - members); - - H5Tclose(memb_type); + ((char *)(((hvl_t *)((void *)mem2))->p)) + j * size, + elemtno, /* Extra (void *) cast to quiet "cast to create alignment" + warning - 2019/07/05, QAK */ + &vl_opts, container1_id, container2_id, members); + opts->print_header = vl_opts.print_header; + opts->not_cmp = vl_opts.not_cmp; + opts->err_stat = opts->err_stat | vl_opts.err_stat; + + H5Tclose(vl_opts.m_tid); } break; /*------------------------------------------------------------------------- @@ -821,85 +915,16 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ *------------------------------------------------------------------------- */ case H5T_INTEGER: - H5TOOLS_DEBUG("diff_datum H5T_INTEGER"); - type_sign = H5Tget_sign(m_type); + H5TOOLS_DEBUG("H5T_INTEGER"); + type_sign = H5Tget_sign(opts->m_tid); /*------------------------------------------------------------------------- * H5T_NATIVE_SCHAR *------------------------------------------------------------------------- */ if (type_size == 1 && type_sign != H5T_SGN_NONE) { - char temp1_char; - char temp2_char; - if (type_size != sizeof(char)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not char size"); - HDmemcpy(&temp1_char, mem1, sizeof(char)); - HDmemcpy(&temp2_char, mem2, sizeof(char)); - /* -d and !-p */ - if (opts->d && !opts->p) { - if (ABS(temp1_char - temp2_char) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); - } - nfound++; - } - } - /* !-d and -p */ - else if (!opts->d && opts->p) { - PER(temp1_char, temp2_char); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, - ABS(temp1_char - temp2_char)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), - per); - } - nfound++; - } - } - /* -d and -p */ - else if (opts->d && opts->p) { - PER(temp1_char, temp2_char); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, - ABS(temp1_char - temp2_char)); - } - nfound++; - } - else if (per > opts->percent && ABS(temp1_char - temp2_char) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), - per); - } - nfound++; - } - } - else if (temp1_char != temp2_char) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); - } - nfound++; - } + nfound += diff_schar_element(mem1, mem2, elemtno, opts); } /*H5T_NATIVE_SCHAR*/ /*------------------------------------------------------------------------- @@ -907,80 +932,9 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ *------------------------------------------------------------------------- */ else if (type_size == 1 && type_sign == H5T_SGN_NONE) { - unsigned char temp1_uchar; - unsigned char temp2_uchar; - if (type_size != sizeof(unsigned char)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not unsigned char size"); - - HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - /* -d and !-p */ - if (opts->d && !opts->p) { - if (PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, - PDIFF(temp1_uchar, temp2_uchar)); - } - nfound++; - } - } - /* !-d and -p */ - else if (!opts->d && opts->p) { - PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, - PDIFF(temp1_uchar, temp2_uchar)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, - PDIFF(temp1_uchar, temp2_uchar), per); - } - nfound++; - } - } - /* -d and -p */ - else if (opts->d && opts->p) { - PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, - PDIFF(temp1_uchar, temp2_uchar)); - } - nfound++; - } - else if (per > opts->percent && PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, - PDIFF(temp1_uchar, temp2_uchar), per); - } - nfound++; - } - } - else if (temp1_uchar != temp2_uchar) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); - } - nfound++; - } + nfound += diff_uchar_element(mem1, mem2, elemtno, opts); } /*H5T_NATIVE_UCHAR*/ /*------------------------------------------------------------------------- @@ -988,80 +942,9 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ *------------------------------------------------------------------------- */ else if (type_size == 2 && type_sign != H5T_SGN_NONE) { - short temp1_short; - short temp2_short; - if (type_size != sizeof(short)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not short size"); - - HDmemcpy(&temp1_short, mem1, sizeof(short)); - HDmemcpy(&temp2_short, mem2, sizeof(short)); - /* -d and !-p */ - if (opts->d && !opts->p) { - if (ABS(temp1_short - temp2_short) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_short, temp2_short, - ABS(temp1_short - temp2_short)); - } - nfound++; - } - } - /* !-d and -p */ - else if (!opts->d && opts->p) { - PER(temp1_short, temp2_short); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, - ABS(temp1_short - temp2_short)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_short, temp2_short, - ABS(temp1_short - temp2_short), per); - } - nfound++; - } - } - /* -d and -p */ - else if (opts->d && opts->p) { - PER(temp1_short, temp2_short); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, - ABS(temp1_short - temp2_short)); - } - nfound++; - } - else if (per > opts->percent && ABS(temp1_short - temp2_short) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_short, temp2_short, - ABS(temp1_short - temp2_short), per); - } - nfound++; - } - } - else if (temp1_short != temp2_short) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); - } - nfound++; - } + nfound += diff_short_element(mem1, mem2, elemtno, opts); } /*H5T_NATIVE_SHORT*/ /*------------------------------------------------------------------------- @@ -1069,81 +952,9 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ *------------------------------------------------------------------------- */ else if (type_size == 2 && type_sign == H5T_SGN_NONE) { - unsigned short temp1_ushort; - unsigned short temp2_ushort; - if (type_size != sizeof(unsigned short)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not unsigned short size"); - - HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - /* -d and !-p */ - if (opts->d && !opts->p) { - if (PDIFF(temp1_ushort, temp2_ushort) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, - PDIFF(temp1_ushort, temp2_ushort)); - } - nfound++; - } - } - /* !-d and -p */ - else if (!opts->d && opts->p) { - PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, - PDIFF(temp1_ushort, temp2_ushort)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, - PDIFF(temp1_ushort, temp2_ushort), per); - } - nfound++; - } - } - /* -d and -p */ - else if (opts->d && opts->p) { - PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, - PDIFF(temp1_ushort, temp2_ushort)); - } - nfound++; - } - else if (per > opts->percent && PDIFF(temp1_ushort, temp2_ushort) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, - PDIFF(temp1_ushort, temp2_ushort), per); - } - nfound++; - } - } - else if (temp1_ushort != temp2_ushort) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, - PDIFF(temp1_ushort, temp2_ushort)); - } - nfound++; - } + nfound += diff_ushort_element(mem1, mem2, elemtno, opts); } /*H5T_NATIVE_USHORT*/ /*------------------------------------------------------------------------- @@ -1151,77 +962,9 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ *------------------------------------------------------------------------- */ else if (type_size == 4 && type_sign != H5T_SGN_NONE) { - int temp1_int; - int temp2_int; - if (type_size != sizeof(int)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not int size"); - - HDmemcpy(&temp1_int, mem1, sizeof(int)); - HDmemcpy(&temp2_int, mem2, sizeof(int)); - /* -d and !-p */ - if (opts->d && !opts->p) { - if (ABS(temp1_int - temp2_int) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); - } - nfound++; - } - } - /* !-d and -p */ - else if (!opts->d && opts->p) { - PER(temp1_int, temp2_int); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, - ABS(temp1_int - temp2_int)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); - } - nfound++; - } - } - /* -d and -p */ - else if (opts->d && opts->p) { - PER(temp1_int, temp2_int); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, - ABS(temp1_int - temp2_int)); - } - nfound++; - } - else if (per > opts->percent && ABS(temp1_int - temp2_int) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); - } - nfound++; - } - } - else if (temp1_int != temp2_int) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); - } - nfound++; - } + nfound += diff_int_element(mem1, mem2, elemtno, opts); } /*H5T_NATIVE_INT*/ /*------------------------------------------------------------------------- @@ -1229,79 +972,9 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ *------------------------------------------------------------------------- */ else if (type_size == 4 && type_sign == H5T_SGN_NONE) { - unsigned int temp1_uint; - unsigned int temp2_uint; - if (type_size != sizeof(unsigned int)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not unsigned int size"); - - HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); - HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); - /* -d and !-p */ - if (opts->d && !opts->p) { - if (PDIFF(temp1_uint, temp2_uint) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); - } - nfound++; - } - } - /* !-d and -p */ - else if (!opts->d && opts->p) { - PER_UNSIGN(signed int, temp1_uint, temp2_uint); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, - PDIFF(temp1_uint, temp2_uint)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), - per); - } - nfound++; - } - } - /* -d and -p */ - else if (opts->d && opts->p) { - PER_UNSIGN(signed int, temp1_uint, temp2_uint); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, - PDIFF(temp1_uint, temp2_uint)); - } - nfound++; - } - else if (per > opts->percent && PDIFF(temp1_uint, temp2_uint) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), - per); - } - nfound++; - } - } - else if (temp1_uint != temp2_uint) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); - } - nfound++; - } + nfound += diff_uint_element(mem1, mem2, elemtno, opts); } /*H5T_NATIVE_UINT*/ /*------------------------------------------------------------------------- @@ -1309,79 +982,9 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ *------------------------------------------------------------------------- */ else if (type_size == 8 && type_sign != H5T_SGN_NONE) { - long temp1_long; - long temp2_long; - if (type_size != sizeof(long)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not long size"); - - HDmemcpy(&temp1_long, mem1, sizeof(long)); - HDmemcpy(&temp2_long, mem2, sizeof(long)); - /* -d and !-p */ - if (opts->d && !opts->p) { - if (ABS(temp1_long - temp2_long) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); - } - nfound++; - } - } - /* !-d and -p */ - else if (!opts->d && opts->p) { - PER(temp1_long, temp2_long); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, - ABS(temp1_long - temp2_long)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), - per); - } - nfound++; - } - } - /* -d and -p */ - else if (opts->d && opts->p) { - PER(temp1_long, temp2_long); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, - ABS(temp1_long - temp2_long)); - } - nfound++; - } - else if (per > opts->percent && ABS(temp1_long - temp2_long) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), - per); - } - nfound++; - } - } - else if (temp1_long != temp2_long) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); - } - nfound++; - } + nfound += diff_long_element(mem1, mem2, elemtno, opts); } /*H5T_NATIVE_LONG*/ /*------------------------------------------------------------------------- @@ -1389,81 +992,30 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ *------------------------------------------------------------------------- */ else if (type_size == 8 && type_sign == H5T_SGN_NONE) { - unsigned long temp1_ulong; - unsigned long temp2_ulong; - if (type_size != sizeof(unsigned long)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not unsigned long size"); + nfound += diff_ulong_element(mem1, mem2, elemtno, opts); + } /*H5T_NATIVE_ULONG*/ - HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - /* -d and !-p */ - if (opts->d && !opts->p) { - if (PDIFF(temp1_ulong, temp2_ulong) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, - PDIFF(temp1_ulong, temp2_ulong)); - } - nfound++; - } - } - /* !-d and -p */ - else if (!opts->d && opts->p) { - PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, - PDIFF(temp1_ulong, temp2_ulong)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, - PDIFF(temp1_ulong, temp2_ulong), per); - } - nfound++; - } - } - /* -d and -p */ - else if (opts->d && opts->p) { - PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); + /*------------------------------------------------------------------------- + * H5T_NATIVE_LLONG + *------------------------------------------------------------------------- + */ + else if (type_size == 16 && type_sign != H5T_SGN_NONE) { + if (type_size != sizeof(long long)) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not long long size"); + nfound += diff_llong_element(mem1, mem2, elemtno, opts); + } /*H5T_NATIVE_LLONG*/ - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, - PDIFF(temp1_ulong, temp2_ulong)); - } - nfound++; - } - else if (per > opts->percent && PDIFF(temp1_ulong, temp2_ulong) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, - PDIFF(temp1_ulong, temp2_ulong), per); - } - nfound++; - } - } - else if (temp1_ulong != temp2_ulong) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); - } - nfound++; - } - } /*H5T_NATIVE_ULONG*/ + /*------------------------------------------------------------------------- + * H5T_NATIVE_ULLONG + *------------------------------------------------------------------------- + */ + else if (type_size == 16 && type_sign == H5T_SGN_NONE) { + if (type_size != sizeof(unsigned long long)) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not unsigned long long size"); + nfound += diff_ullong_element(mem1, mem2, elemtno, opts); + } /*H5T_NATIVE_ULLONG*/ break; /* H5T_INTEGER class */ /*------------------------------------------------------------------------- @@ -1475,339 +1027,21 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ * H5T_NATIVE_FLOAT *------------------------------------------------------------------------- */ - H5TOOLS_DEBUG("diff_datum H5T_FLOAT"); + H5TOOLS_DEBUG("H5T_FLOAT"); if (type_size == 4) { - float temp1_float; - float temp2_float; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; - if (type_size != sizeof(float)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not float size"); - - HDmemcpy(&temp1_float, mem1, sizeof(float)); - HDmemcpy(&temp2_float, mem2, sizeof(float)); - - /* logic for detecting NaNs is different with opts -d, -p and no opts */ - - /*------------------------------------------------------------------------- - * -d and !-p - *------------------------------------------------------------------------- - */ - if (opts->d && !opts->p) { - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_float); - isnan2 = HDisnan(temp2_float); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - if (ABS(temp1_float - temp2_float) > (float)opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float)); - } - nfound++; - } - } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float)); - } - nfound++; - } - } - /*------------------------------------------------------------------------- - * !-d and -p - *------------------------------------------------------------------------- - */ - else if (!opts->d && opts->p) { - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_float); - isnan2 = HDisnan(temp2_float); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_float, temp2_float); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float)); - } - nfound++; - } - else if (per > opts->percent && - (double)ABS(temp1_float - temp2_float) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float), - (double)ABS(1 - temp2_float / temp1_float)); - } - nfound++; - } - } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float)); - } - nfound++; - } - } - /*------------------------------------------------------------------------- - * -d and -p - *------------------------------------------------------------------------- - */ - else if (opts->d && opts->p) { - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_float); - isnan2 = HDisnan(temp2_float); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_float, temp2_float); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float), - (double)ABS(1 - temp2_float / temp1_float)); - } - nfound++; - } - } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float)); - } - nfound++; - } - } - /*------------------------------------------------------------------------- - * no -d and -p - *------------------------------------------------------------------------- - */ - else if (equal_float(temp1_float, temp2_float, opts) == FALSE) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float)); - } - nfound++; - } - } /*H5T_NATIVE_FLOAT*/ - + nfound += diff_float_element(mem1, mem2, elemtno, opts); + } /*------------------------------------------------------------------------- * H5T_NATIVE_DOUBLE *------------------------------------------------------------------------- */ else if (type_size == 8) { - double temp1_double; - double temp2_double; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; - if (type_size != sizeof(double)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not double size"); - - HDmemcpy(&temp1_double, mem1, sizeof(double)); - HDmemcpy(&temp2_double, mem2, sizeof(double)); - - /* logic for detecting NaNs is different with opts -d, -p and no opts */ - /*------------------------------------------------------------------------- - * -d and !-p - *------------------------------------------------------------------------- - */ - if (opts->d && !opts->p) { - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - if (ABS(temp1_double - temp2_double) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, - ABS(temp1_double - temp2_double)); - } - nfound++; - } - } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, - ABS(temp1_double - temp2_double)); - } - nfound++; - } - } /* opts->d && !opts->p */ - /*------------------------------------------------------------------------- - * !-d and -p - *------------------------------------------------------------------------- - */ - else if (!opts->d && opts->p) { - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_double, temp2_double); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, - ABS(temp1_double - temp2_double)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, temp1_double, temp2_double, - ABS(temp1_double - temp2_double), - ABS(1 - temp2_double / temp1_double)); - } - nfound++; - } - } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, - ABS(temp1_double - temp2_double)); - } - nfound++; - } - } - /*------------------------------------------------------------------------- - * -d and -p - *------------------------------------------------------------------------- - */ - else if (opts->d && opts->p) { - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_double, temp2_double); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, - ABS(temp1_double - temp2_double)); - } - nfound++; - } - else if (per > opts->percent && ABS(temp1_double - temp2_double) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, temp1_double, temp2_double, - ABS(temp1_double - temp2_double), - ABS(1 - temp2_double / temp1_double)); - } - nfound++; - } - } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, - ABS(temp1_double - temp2_double)); - } - nfound++; - } - } - /*------------------------------------------------------------------------- - * no -d and -p - *------------------------------------------------------------------------- - */ - else if (equal_double(temp1_double, temp2_double, opts) == FALSE) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, - ABS(temp1_double - temp2_double)); - } - nfound++; - } - } /*H5T_NATIVE_DOUBLE*/ - + nfound += diff_double_element(mem1, mem2, elemtno, opts); + } #if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE /*------------------------------------------------------------------------- @@ -1815,168 +1049,10 @@ diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t idx, int rank, hsize_ *------------------------------------------------------------------------- */ else if (type_size == H5_SIZEOF_LONG_DOUBLE) { - long double temp1_double; - long double temp2_double; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; - if (type_size != sizeof(long double)) { H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Type size is not long double size"); } - - HDmemcpy(&temp1_double, mem1, sizeof(long double)); - HDmemcpy(&temp2_double, mem2, sizeof(long double)); - - /* logic for detecting NaNs is different with options -d, -p and no options */ - - /*------------------------------------------------------------------------- - * -d and !-p - *------------------------------------------------------------------------- - */ - if (opts->d && !opts->p) { - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - if (ABS(temp1_double - temp2_double) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LD_FORMAT, temp1_double, temp2_double, - ABS(temp1_double - temp2_double)); - } - nfound++; - } - } /* NaN */ - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, - ABS(temp1_double - temp2_double)); - } - nfound++; - } - } - /*------------------------------------------------------------------------- - * !-d and -p - *------------------------------------------------------------------------- - */ - else if (!opts->d && opts->p) { - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_double, temp2_double); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, - ABS(temp1_double - temp2_double)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LD_FORMAT_P, temp1_double, temp2_double, - ABS(temp1_double - temp2_double), - ABS(1 - temp2_double / temp1_double)); - } - nfound++; - } - } /* NaN */ - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, - ABS(temp1_double - temp2_double)); - } - nfound++; - } - } - /*------------------------------------------------------------------------- - * -d and -p - *------------------------------------------------------------------------- - */ - else if (opts->d && opts->p) { - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_double, temp2_double); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, - ABS(temp1_double - temp2_double)); - } - nfound++; - } - else if (per > opts->percent && ABS(temp1_double - temp2_double) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LD_FORMAT_P, temp1_double, temp2_double, - ABS(temp1_double - temp2_double), - ABS(1 - temp2_double / temp1_double)); - } - nfound++; - } - } /* NaN */ - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, - ABS(temp1_double - temp2_double)); - } - nfound++; - } - } - /*------------------------------------------------------------------------- - * no -d and -p - *------------------------------------------------------------------------- - */ - else if (equal_ldouble(temp1_double, temp2_double, opts) == FALSE) { - if (print_data(opts)) { - print_pos(ph, 0, idx, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LD_FORMAT, temp1_double, temp2_double, - ABS(temp1_double - temp2_double)); - } - nfound++; - } + nfound += diff_ldouble_element(mem1, mem2, elemtno, opts); } /*H5T_NATIVE_LDOUBLE*/ #endif /* H5_SIZEOF_LONG_DOUBLE */ @@ -2098,8 +1174,8 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di npoints2 = H5Sget_select_elem_npoints(region2_id); } H5E_END_TRY; - H5TOOLS_DEBUG("diff_region blocks: 1=%ld-2=%ld", nblocks1, nblocks2); - H5TOOLS_DEBUG("diff_region points: 1=%ld-2=%ld", npoints1, npoints2); + H5TOOLS_DEBUG("blocks: 1=%ld-2=%ld", nblocks1, nblocks2); + H5TOOLS_DEBUG("points: 1=%ld-2=%ld", npoints1, npoints2); if (nblocks1 != nblocks2 || npoints1 != npoints2 || ndims1 != ndims2) { opts->not_cmp = 1; @@ -2147,7 +1223,7 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di } /* print differences if found */ - if (nfound_b && opts->m_verbose) { + if (nfound_b && opts->mode_verbose) { H5O_info_t oi1, oi2; H5Oget_info(obj1_id, &oi1); @@ -2208,7 +1284,7 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di } } - if (nfound_p && opts->m_verbose) { + if (nfound_p && opts->mode_verbose) { parallel_print("Region points\n"); for (i = 0; i < npoints1; i++) { hsize_t pt1, pt2; @@ -2269,8 +1345,7 @@ done: */ static hsize_t -character_compare(char *mem1, char *mem2, hsize_t i, size_t u, int rank, hsize_t *dims, hsize_t *acc, - hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) +character_compare(char *mem1, char *mem2, hsize_t elemtno, size_t u, diff_opt_t *opts) { hsize_t nfound = 0; /* differences found */ char temp1_uchar; @@ -2282,8 +1357,10 @@ character_compare(char *mem1, char *mem2, hsize_t i, size_t u, int rank, hsize_t if (temp1_uchar != temp2_uchar) { if (print_data(opts)) { - print_char_pos(ph, 0, i, u, acc, pos, rank, dims, obj1, obj2); - parallel_print(" "); + opts->print_percentage = 0; + opts->print_dims = 1; + print_pos(opts, elemtno, u); + parallel_print(" "); h5diff_print_char(temp1_uchar); parallel_print(" "); h5diff_print_char(temp2_uchar); @@ -2305,499 +1382,424 @@ character_compare(char *mem1, char *mem2, hsize_t i, size_t u, int rank, hsize_t */ static hsize_t -character_compare_opt(unsigned char *mem1, unsigned char *mem2, hsize_t i, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, - int *ph) +character_compare_opt(unsigned char *mem1, unsigned char *mem2, hsize_t elemtno, diff_opt_t *opts) { hsize_t nfound = 0; /* differences found */ unsigned char temp1_uchar; unsigned char temp2_uchar; + hbool_t both_zero = FALSE; double per; - hbool_t both_zero; HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + H5TOOLS_START_DEBUG(" %d=%d", temp1_uchar, temp2_uchar); /* -d and !-p */ - if (opts->d && !opts->p) { + if (opts->delta_bool && !opts->percent_bool) { if (PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elemtno, 0); if (print_data(opts)) { - print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { + else if (!opts->delta_bool && opts->percent_bool) { PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elemtno, 0); if (print_data(opts)) { - print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { + else if (opts->delta_bool && opts->percent_bool) { PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); if (per > opts->percent && PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elemtno, 0); if (print_data(opts)) { - print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } nfound++; } } else if (temp1_uchar != temp2_uchar) { + opts->print_percentage = 0; + print_pos(opts, elemtno, 0); if (print_data(opts)) { - print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } + H5TOOLS_ENDDEBUG(": %d zero:%d", nfound, both_zero); return nfound; } /*------------------------------------------------------------------------- - * Function: diff_float + * Function: diff_float_element * - * Purpose: diff a H5T_NATIVE_FLOAT type + * Purpose: diff a single H5T_NATIVE_FLOAT type * * Return: number of differences found * *------------------------------------------------------------------------- */ static hsize_t -diff_float(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, - hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, - int *ph) - +diff_float_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ float temp1_float; float temp2_float; - hsize_t i; double per; - hbool_t both_zero; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; + hbool_t both_zero = FALSE; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; + + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); + + HDmemcpy(&temp1_float, mem1, sizeof(float)); + HDmemcpy(&temp2_float, mem2, sizeof(float)); + + /* logic for detecting NaNs is different with opts -d, -p and no opts */ /*------------------------------------------------------------------------- * -d and !-p *------------------------------------------------------------------------- */ + if (opts->delta_bool && !opts->percent_bool) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (opts->do_nans) { + isnan1 = HDisnan(temp1_float); + isnan2 = HDisnan(temp2_float); + } - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_float, mem1, sizeof(float)); - HDmemcpy(&temp2_float, mem2, sizeof(float)); - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_float); - isnan2 = HDisnan(temp2_float); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - if ((double)ABS(temp1_float - temp2_float) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float)); - } - nfound++; - } - } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + if ((double)ABS(temp1_float - temp2_float) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); } nfound++; } - mem1 += sizeof(float); - mem2 += sizeof(float); - if (opts->n && nfound >= opts->count) - return nfound; - } /* i */ + } + /* only one is NaN, assume difference */ + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float)); + } + nfound++; + } } /*------------------------------------------------------------------------- * !-d and -p *------------------------------------------------------------------------- */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_float, mem1, sizeof(float)); - HDmemcpy(&temp2_float, mem2, sizeof(float)); + else if (!opts->delta_bool && opts->percent_bool) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (opts->do_nans) { + isnan1 = HDisnan(temp1_float); + isnan2 = HDisnan(temp2_float); + } + /* both not NaN, do the comparison */ + if ((!isnan1 && !isnan2)) { + PER(temp1_float, temp2_float); - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_float); - isnan2 = HDisnan(temp2_float); - } - /* both not NaN, do the comparison */ - if ((!isnan1 && !isnan2)) { - PER(temp1_float, temp2_float); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float), - (double)ABS(1 - temp2_float / temp1_float)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float)); } + nfound++; } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float), + (double)ABS(1 - temp2_float / temp1_float)); } nfound++; } - mem1 += sizeof(float); - mem2 += sizeof(float); - if (opts->n && nfound >= opts->count) - return nfound; - } /* i */ + } + /* only one is NaN, assume difference */ + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float)); + } + nfound++; + } } /*------------------------------------------------------------------------- * -d and -p *------------------------------------------------------------------------- */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_float, mem1, sizeof(float)); - HDmemcpy(&temp2_float, mem2, sizeof(float)); - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_float); - isnan2 = HDisnan(temp2_float); - } + else if (opts->delta_bool && opts->percent_bool) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (opts->do_nans) { + isnan1 = HDisnan(temp1_float); + isnan2 = HDisnan(temp2_float); + } - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_float, temp2_float); + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + PER(temp1_float, temp2_float); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float)); - } - nfound++; - } - else if (per > opts->percent && (double)ABS(temp1_float - temp2_float) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float), - (double)ABS(1 - temp2_float / temp1_float)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float)); } + nfound++; } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + else if (per > opts->percent && (double)ABS(temp1_float - temp2_float) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float), + (double)ABS(1 - temp2_float / temp1_float)); } nfound++; } - mem1 += sizeof(float); - mem2 += sizeof(float); - if (opts->n && nfound >= opts->count) - return nfound; - } /* i */ + } + /* only one is NaN, assume difference */ + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float)); + } + nfound++; + } } - /*------------------------------------------------------------------------- * no -d and -p *------------------------------------------------------------------------- */ else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_float, mem1, sizeof(float)); - HDmemcpy(&temp2_float, mem2, sizeof(float)); - - if (equal_float(temp1_float, temp2_float, opts) == FALSE) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float)); - } - nfound++; + if (equal_float(temp1_float, temp2_float, opts) == FALSE) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, + (double)ABS(temp1_float - temp2_float)); } - - mem1 += sizeof(float); - mem2 += sizeof(float); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + nfound++; + } } + H5TOOLS_ENDDEBUG(": %d zero:%d", nfound, both_zero); return nfound; } /*------------------------------------------------------------------------- - * Function: diff_double + * Function: diff_double_element * - * Purpose: diff a H5T_NATIVE_DOUBLE type + * Purpose: diff a single H5T_NATIVE_DOUBLE type * * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t -diff_double(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, - hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, - int *ph) - +diff_double_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ double temp1_double; double temp2_double; - hsize_t i; double per; - hbool_t both_zero; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; + hbool_t both_zero = FALSE; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; + + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); + + HDmemcpy(&temp1_double, mem1, sizeof(double)); + HDmemcpy(&temp2_double, mem2, sizeof(double)); /*------------------------------------------------------------------------- * -d and !-p *------------------------------------------------------------------------- */ + if (opts->delta_bool && !opts->percent_bool) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (opts->do_nans) { + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); + } - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_double, mem1, sizeof(double)); - HDmemcpy(&temp2_double, mem2, sizeof(double)); - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - if (ABS(temp1_double - temp2_double) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, - ABS(temp1_double - temp2_double)); - } - nfound++; - } - } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + if (ABS(temp1_double - temp2_double) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - mem1 += sizeof(double); - mem2 += sizeof(double); - if (opts->n && nfound >= opts->count) - return nfound; - } /* i */ + } + /* only one is NaN, assume difference */ + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + } + nfound++; + } } /*------------------------------------------------------------------------- * !-d and -p *------------------------------------------------------------------------- */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_double, mem1, sizeof(double)); - HDmemcpy(&temp2_double, mem2, sizeof(double)); + else if (!opts->delta_bool && opts->percent_bool) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (opts->do_nans) { + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); + } + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + PER(temp1_double, temp2_double); - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_double, temp2_double); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, - ABS(temp1_double - temp2_double)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, temp1_double, temp2_double, - ABS(temp1_double - temp2_double), - ABS(1 - temp2_double / temp1_double)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, + ABS(temp1_double - temp2_double)); } + nfound++; } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), + ABS(1 - temp2_double / temp1_double)); } nfound++; } - mem1 += sizeof(double); - mem2 += sizeof(double); - if (opts->n && nfound >= opts->count) - return nfound; - } /* i */ + } + /* only one is NaN, assume difference */ + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + } + nfound++; + } } /*------------------------------------------------------------------------- * -d and -p *------------------------------------------------------------------------- */ - else if (opts->d && opts->p) { - - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_double, mem1, sizeof(double)); - HDmemcpy(&temp2_double, mem2, sizeof(double)); - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } + else if (opts->delta_bool && opts->percent_bool) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (opts->do_nans) { + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); + } - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_double, temp2_double); + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + PER(temp1_double, temp2_double); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, - ABS(temp1_double - temp2_double)); - } - nfound++; - } - else if (per > opts->percent && ABS(temp1_double - temp2_double) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, temp1_double, temp2_double, - ABS(temp1_double - temp2_double), - ABS(1 - temp2_double / temp1_double)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, + ABS(temp1_double - temp2_double)); } + nfound++; } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + else if (per > opts->percent && ABS(temp1_double - temp2_double) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), + ABS(1 - temp2_double / temp1_double)); } nfound++; } - mem1 += sizeof(double); - mem2 += sizeof(double); - if (opts->n && nfound >= opts->count) - return nfound; - } /* i */ + } + /* only one is NaN, assume difference */ + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + } + nfound++; + } } /*------------------------------------------------------------------------- * no -d and -p *------------------------------------------------------------------------- */ else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_double, mem1, sizeof(double)); - HDmemcpy(&temp2_double, mem2, sizeof(double)); - - if (equal_double(temp1_double, temp2_double, opts) == FALSE) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; + if (equal_double(temp1_double, temp2_double, opts) == FALSE) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } - - mem1 += sizeof(double); - mem2 += sizeof(double); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + nfound++; + } } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); return nfound; } /*------------------------------------------------------------------------- - * Function: diff_ldouble + * Function: diff_ldouble_element * - * Purpose: diff a H5T_NATIVE_LDOUBLE type + * Purpose: diff a single H5T_NATIVE_LDOUBLE type * * Return: number of differences found *------------------------------------------------------------------------- @@ -2805,463 +1807,349 @@ diff_double(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hy #if H5_SIZEOF_LONG_DOUBLE != 0 static hsize_t -diff_ldouble(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, - hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, - int *ph) - +diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ long double temp1_double; long double temp2_double; - hsize_t i; double per; - hbool_t both_zero; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; + hbool_t both_zero = FALSE; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; + + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); + + HDmemcpy(&temp1_double, mem1, sizeof(long double)); + HDmemcpy(&temp2_double, mem2, sizeof(long double)); + + /* logic for detecting NaNs is different with options -d, -p and no options */ /*------------------------------------------------------------------------- * -d and !-p *------------------------------------------------------------------------- */ + if (opts->delta_bool && !opts->percent_bool) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (opts->do_nans) { + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); + } - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_double, mem1, sizeof(long double)); - HDmemcpy(&temp2_double, mem2, sizeof(long double)); - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } - - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - if (ABS(temp1_double - temp2_double) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, - ABS(temp1_double - temp2_double)); - } - nfound++; - } - } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + if (ABS(temp1_double - temp2_double) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - mem1 += sizeof(long double); - mem2 += sizeof(long double); - if (opts->n && nfound >= opts->count) - return nfound; - } /* i */ + } /* NaN */ + /* only one is NaN, assume difference */ + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + } + nfound++; + } } - /*------------------------------------------------------------------------- * !-d and -p *------------------------------------------------------------------------- */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_double, mem1, sizeof(long double)); - HDmemcpy(&temp2_double, mem2, sizeof(long double)); + else if (!opts->delta_bool && opts->percent_bool) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (opts->do_nans) { + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); + } - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_double, temp2_double); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, - ABS(temp1_double - temp2_double)); - } - nfound++; - } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, temp1_double, temp2_double, - ABS(temp1_double - temp2_double), - ABS(1 - temp2_double / temp1_double)); - } - nfound++; + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + PER(temp1_double, temp2_double); + + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, + ABS(temp1_double - temp2_double)); } + nfound++; } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), + ABS(1 - temp2_double / temp1_double)); } nfound++; } - mem1 += sizeof(long double); - mem2 += sizeof(long double); - if (opts->n && nfound >= opts->count) - return nfound; - } /* i */ + } /* NaN */ + /* only one is NaN, assume difference */ + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + } + nfound++; + } } /*------------------------------------------------------------------------- * -d and -p *------------------------------------------------------------------------- */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_double, mem1, sizeof(long double)); - HDmemcpy(&temp2_double, mem2, sizeof(long double)); - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if (opts->do_nans) { - isnan1 = HDisnan(temp1_double); - isnan2 = HDisnan(temp2_double); - } + else if (opts->delta_bool && opts->percent_bool) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (opts->do_nans) { + isnan1 = HDisnan(temp1_double); + isnan2 = HDisnan(temp2_double); + } - /* both not NaN, do the comparison */ - if (!isnan1 && !isnan2) { - PER(temp1_double, temp2_double); + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + PER(temp1_double, temp2_double); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, - ABS(temp1_double - temp2_double)); - } - nfound++; - } - else if (per > opts->percent && ABS(temp1_double - temp2_double) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, temp1_double, temp2_double, - ABS(temp1_double - temp2_double), - ABS(1 - temp2_double / temp1_double)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, + ABS(temp1_double - temp2_double)); } + nfound++; } - /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + else if (per > opts->percent && ABS(temp1_double - temp2_double) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), + ABS(1 - temp2_double / temp1_double)); } nfound++; } - mem1 += sizeof(long double); - mem2 += sizeof(long double); - if (opts->n && nfound >= opts->count) - return nfound; - } /* i */ + } /* NaN */ + /* only one is NaN, assume difference */ + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + } + nfound++; + } } /*------------------------------------------------------------------------- * no -d and -p *------------------------------------------------------------------------- */ - else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_double, mem1, sizeof(long double)); - HDmemcpy(&temp2_double, mem2, sizeof(long double)); - - if (equal_ldouble(temp1_double, temp2_double, opts) == FALSE) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); - } - nfound++; - } - mem1 += sizeof(long double); - mem2 += sizeof(long double); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + else if (equal_ldouble(temp1_double, temp2_double, opts) == FALSE) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); + } + nfound++; } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); + return nfound; } #endif /* H5_SIZEOF_LONG_DOUBLE */ /*------------------------------------------------------------------------- - * Function: diff_schar + * Function: diff_schar_element * - * Purpose: diff a H5T_NATIVE_SCHAR type + * Purpose: diff a single H5T_NATIVE_SCHAR type * * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t -diff_schar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, - hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, - int *ph) - +diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ char temp1_char; char temp2_char; - hsize_t i; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; - /* -d and !-p */ - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_char, mem1, sizeof(char)); - HDmemcpy(&temp2_char, mem2, sizeof(char)); + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); + HDmemcpy(&temp1_char, mem1, sizeof(char)); + HDmemcpy(&temp2_char, mem2, sizeof(char)); - if (ABS(temp1_char - temp2_char) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); - } - nfound++; + /* -d and !-p */ + if (opts->delta_bool && !opts->percent_bool) { + if (ABS(temp1_char - temp2_char) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } - mem1 += sizeof(char); - mem2 += sizeof(char); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_char, mem1, sizeof(char)); - HDmemcpy(&temp2_char, mem2, sizeof(char)); + else if (!opts->delta_bool && opts->percent_bool) { + PER(temp1_char, temp2_char); - PER(temp1_char, temp2_char); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); } - mem1 += sizeof(char); - mem2 += sizeof(char); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_char, mem1, sizeof(char)); - HDmemcpy(&temp2_char, mem2, sizeof(char)); - - PER(temp1_char, temp2_char); + else if (opts->delta_bool && opts->percent_bool) { + PER(temp1_char, temp2_char); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } - else if (per > opts->percent && ABS(temp1_char - temp2_char) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent && ABS(temp1_char - temp2_char) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); } - mem1 += sizeof(char); - mem2 += sizeof(char); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } - else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_char, mem1, sizeof(char)); - HDmemcpy(&temp2_char, mem2, sizeof(char)); - - if (temp1_char != temp2_char) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); - } - nfound++; - } - - mem1 += sizeof(char); - mem2 += sizeof(char); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + else if (temp1_char != temp2_char) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); + } + nfound++; } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); + return nfound; } /*------------------------------------------------------------------------- - * Function: diff_uchar + * Function: diff_uchar_element * - * Purpose: diff a H5T_NATIVE_UCHAR type + * Purpose: diff a single H5T_NATIVE_UCHAR type * * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t -diff_uchar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, - hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, - int *ph) +diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ unsigned char temp1_uchar; unsigned char temp2_uchar; - hsize_t i; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; - /* -d and !-p */ - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - if (PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); - } - nfound++; + HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); + HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + /* -d and !-p */ + if (opts->delta_bool && !opts->percent_bool) { + if (PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } - mem1 += sizeof(unsigned char); - mem2 += sizeof(unsigned char); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - - PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); + else if (!opts->delta_bool && opts->percent_bool) { + PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, - PDIFF(temp1_uchar, temp2_uchar)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), - per); - } - nfound++; + nfound++; + } + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } - mem1 += sizeof(unsigned char); - mem2 += sizeof(unsigned char); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - - PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); + else if (opts->delta_bool && opts->percent_bool) { + PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, - PDIFF(temp1_uchar, temp2_uchar)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } - else if (per > opts->percent && PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), - per); - } - nfound++; + nfound++; + } + else if (per > opts->percent && PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } - mem1 += sizeof(unsigned char); - mem2 += sizeof(unsigned char); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } - else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - - if (temp1_uchar != temp2_uchar) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); - } - nfound++; - } - - mem1 += sizeof(unsigned char); - mem2 += sizeof(unsigned char); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + else if (temp1_uchar != temp2_uchar) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); + } + nfound++; } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); + return nfound; } /*------------------------------------------------------------------------- - * Function: diff_short + * Function: diff_short_element * * Purpose: diff a H5T_NATIVE_SHORT type * @@ -3269,1017 +2157,720 @@ diff_uchar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyp *------------------------------------------------------------------------- */ static hsize_t -diff_short(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, - hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, - int *ph) +diff_short_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ short temp1_short; short temp2_short; - hsize_t i; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; - /* -d and !-p */ - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_short, mem1, sizeof(short)); - HDmemcpy(&temp2_short, mem2, sizeof(short)); + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - if (ABS(temp1_short - temp2_short) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); - } - nfound++; + HDmemcpy(&temp1_short, mem1, sizeof(short)); + HDmemcpy(&temp2_short, mem2, sizeof(short)); + /* -d and !-p */ + if (opts->delta_bool && !opts->percent_bool) { + if (ABS(temp1_short - temp2_short) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } - mem1 += sizeof(short); - mem2 += sizeof(short); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_short, mem1, sizeof(short)); - HDmemcpy(&temp2_short, mem2, sizeof(short)); - - PER(temp1_short, temp2_short); + else if (!opts->delta_bool && opts->percent_bool) { + PER(temp1_short, temp2_short); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, - ABS(temp1_short - temp2_short)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); } - mem1 += sizeof(short); - mem2 += sizeof(short); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_short, mem1, sizeof(short)); - HDmemcpy(&temp2_short, mem2, sizeof(short)); - - PER(temp1_short, temp2_short); + else if (opts->delta_bool && opts->percent_bool) { + PER(temp1_short, temp2_short); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, - ABS(temp1_short - temp2_short)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } - else if (per > opts->percent && ABS(temp1_short - temp2_short) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent && ABS(temp1_short - temp2_short) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); } - mem1 += sizeof(short); - mem2 += sizeof(short); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } - else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_short, mem1, sizeof(short)); - HDmemcpy(&temp2_short, mem2, sizeof(short)); - - if (temp1_short != temp2_short) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); - } - nfound++; - } - - mem1 += sizeof(short); - mem2 += sizeof(short); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + else if (temp1_short != temp2_short) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); + } + nfound++; } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); + return nfound; } /*------------------------------------------------------------------------- - * Function: diff_ushort + * Function: diff_ushort_element * - * Purpose: diff a H5T_NATIVE_USHORT type + * Purpose: diff a single H5T_NATIVE_USHORT type * * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t -diff_ushort(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, - hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, - int *ph) - +diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ unsigned short temp1_ushort; unsigned short temp2_ushort; - hsize_t i; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; - /* -d and !-p */ - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - if (PDIFF(temp1_ushort, temp2_ushort) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); - } - nfound++; + HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); + HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); + /* -d and !-p */ + if (opts->delta_bool && !opts->percent_bool) { + if (PDIFF(temp1_ushort, temp2_ushort) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } - mem1 += sizeof(unsigned short); - mem2 += sizeof(unsigned short); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - - PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); + else if (!opts->delta_bool && opts->percent_bool) { + PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, - PDIFF(temp1_ushort, temp2_ushort)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, + PDIFF(temp1_ushort, temp2_ushort)); } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), - per); - } - nfound++; + nfound++; + } + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), + per); } - mem1 += sizeof(unsigned short); - mem2 += sizeof(unsigned short); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - - PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); + else if (opts->delta_bool && opts->percent_bool) { + PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, - PDIFF(temp1_ushort, temp2_ushort)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, + PDIFF(temp1_ushort, temp2_ushort)); } - else if (per > opts->percent && PDIFF(temp1_ushort, temp2_ushort) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), - per); - } - nfound++; + nfound++; + } + else if (per > opts->percent && PDIFF(temp1_ushort, temp2_ushort) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), + per); } - mem1 += sizeof(unsigned short); - mem2 += sizeof(unsigned short); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } - else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - - if (temp1_ushort != temp2_ushort) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); - } - nfound++; - } - - mem1 += sizeof(unsigned short); - mem2 += sizeof(unsigned short); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + else if (temp1_ushort != temp2_ushort) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); + } + nfound++; } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); + return nfound; } /*------------------------------------------------------------------------- - * Function: diff_int + * Function: diff_int_element * - * Purpose: diff a H5T_NATIVE_INT type + * Purpose: diff a single H5T_NATIVE_INT type * * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t -diff_int(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, - hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, - int *ph) +diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ int temp1_int; int temp2_int; - hsize_t i; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; - /* -d and !-p */ - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_int, mem1, sizeof(int)); - HDmemcpy(&temp2_int, mem2, sizeof(int)); + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - if (ABS(temp1_int - temp2_int) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); - } - nfound++; + HDmemcpy(&temp1_int, mem1, sizeof(int)); + HDmemcpy(&temp2_int, mem2, sizeof(int)); + /* -d and !-p */ + if (opts->delta_bool && !opts->percent_bool) { + if (ABS(temp1_int - temp2_int) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } - mem1 += sizeof(int); - mem2 += sizeof(int); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_int, mem1, sizeof(int)); - HDmemcpy(&temp2_int, mem2, sizeof(int)); - - PER(temp1_int, temp2_int); + else if (!opts->delta_bool && opts->percent_bool) { + PER(temp1_int, temp2_int); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); } - mem1 += sizeof(int); - mem2 += sizeof(int); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_int, mem1, sizeof(int)); - HDmemcpy(&temp2_int, mem2, sizeof(int)); + else if (opts->delta_bool && opts->percent_bool) { + PER(temp1_int, temp2_int); - PER(temp1_int, temp2_int); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } - else if (per > opts->percent && ABS(temp1_int - temp2_int) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent && ABS(temp1_int - temp2_int) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); } - mem1 += sizeof(int); - mem2 += sizeof(int); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } - else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_int, mem1, sizeof(int)); - HDmemcpy(&temp2_int, mem2, sizeof(int)); + else if (temp1_int != temp2_int) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); + } + nfound++; + } - if (temp1_int != temp2_int) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); - } - nfound++; - } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); - mem1 += sizeof(int); - mem2 += sizeof(int); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ - } return nfound; } /*------------------------------------------------------------------------- - * Function: diff_uint + * Function: diff_uint_element * - * Purpose: diff a H5T_NATIVE_UINT type + * Purpose: diff a single H5T_NATIVE_UINT type * * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t -diff_uint(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, - hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, - int *ph) +diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ unsigned int temp1_uint; unsigned int temp2_uint; - hsize_t i; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; - /* -d and !-p */ - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); - HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - if (PDIFF(temp1_uint, temp2_uint) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); - } - nfound++; + HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); + HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); + /* -d and !-p */ + if (opts->delta_bool && !opts->percent_bool) { + if (PDIFF(temp1_uint, temp2_uint) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } - mem1 += sizeof(unsigned int); - mem2 += sizeof(unsigned int); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); - HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); - - PER_UNSIGN(signed int, temp1_uint, temp2_uint); + else if (!opts->delta_bool && opts->percent_bool) { + PER_UNSIGN(signed int, temp1_uint, temp2_uint); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); } - mem1 += sizeof(unsigned int); - mem2 += sizeof(unsigned int); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); - HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); - - PER_UNSIGN(signed int, temp1_uint, temp2_uint); + else if (opts->delta_bool && opts->percent_bool) { + PER_UNSIGN(signed int, temp1_uint, temp2_uint); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } - else if (per > opts->percent && PDIFF(temp1_uint, temp2_uint) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent && PDIFF(temp1_uint, temp2_uint) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); } - mem1 += sizeof(unsigned int); - mem2 += sizeof(unsigned int); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } - else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); - HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); - - if (temp1_uint != temp2_uint) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); - } - nfound++; - } - - mem1 += sizeof(unsigned int); - mem2 += sizeof(unsigned int); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + else if (temp1_uint != temp2_uint) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); + } + nfound++; } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); + return nfound; } /*------------------------------------------------------------------------- - * Function: diff_long + * Function: diff_long_element * - * Purpose: diff a H5T_NATIVE_LONG type + * Purpose: diff a single H5T_NATIVE_LONG type * * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t -diff_long(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, - hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, - int *ph) +diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ long temp1_long; long temp2_long; - hsize_t i; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); + + HDmemcpy(&temp1_long, mem1, sizeof(long)); + HDmemcpy(&temp2_long, mem2, sizeof(long)); /* -d and !-p */ - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_long, mem1, sizeof(long)); - HDmemcpy(&temp2_long, mem2, sizeof(long)); - - if (ABS(temp1_long - temp2_long) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); - } - nfound++; - } - mem1 += sizeof(long); - mem2 += sizeof(long); - if (opts->n && nfound >= opts->count) - return nfound; + if (opts->delta_bool && !opts->percent_bool) { + if (ABS(temp1_long - temp2_long) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } + nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_long, mem1, sizeof(long)); - HDmemcpy(&temp2_long, mem2, sizeof(long)); + else if (!opts->delta_bool && opts->percent_bool) { + PER(temp1_long, temp2_long); - PER(temp1_long, temp2_long); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); } - mem1 += sizeof(long); - mem2 += sizeof(long); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_long, mem1, sizeof(long)); - HDmemcpy(&temp2_long, mem2, sizeof(long)); + else if (opts->delta_bool && opts->percent_bool) { + PER(temp1_long, temp2_long); - PER(temp1_long, temp2_long); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } - else if (per > opts->percent && ABS(temp1_long - temp2_long) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent && ABS(temp1_long - temp2_long) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); } - mem1 += sizeof(long); - mem2 += sizeof(long); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } - else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_long, mem1, sizeof(long)); - HDmemcpy(&temp2_long, mem2, sizeof(long)); - - if (temp1_long != temp2_long) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); - } - nfound++; - } - - mem1 += sizeof(long); - mem2 += sizeof(long); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + else if (temp1_long != temp2_long) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); + } + nfound++; } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); + return nfound; } /*------------------------------------------------------------------------- - * Function: diff_ulong + * Function: diff_ulong_element * - * Purpose: diff a H5T_NATIVE_ULONG type + * Purpose: diff a single H5T_NATIVE_ULONG type * * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t -diff_ulong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, - hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, - int *ph) +diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ unsigned long temp1_ulong; unsigned long temp2_ulong; - hsize_t i; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; + + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); + HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); + HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); /* -d and !-p */ - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - - if (PDIFF(temp1_ulong, temp2_ulong) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); - } - nfound++; - } - mem1 += sizeof(unsigned long); - mem2 += sizeof(unsigned long); - if (opts->n && nfound >= opts->count) - return nfound; + if (opts->delta_bool && !opts->percent_bool) { + if (PDIFF(temp1_ulong, temp2_ulong) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } + nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - - PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); + else if (!opts->delta_bool && opts->percent_bool) { + PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, - PDIFF(temp1_ulong, temp2_ulong)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, + PDIFF(temp1_ulong, temp2_ulong)); } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), - per); - } - nfound++; + nfound++; + } + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); } - mem1 += sizeof(unsigned long); - mem2 += sizeof(unsigned long); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - - PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); + else if (opts->delta_bool && opts->percent_bool) { + PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, - PDIFF(temp1_ulong, temp2_ulong)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, + PDIFF(temp1_ulong, temp2_ulong)); } - else if (per > opts->percent && PDIFF(temp1_ulong, temp2_ulong) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), - per); - } - nfound++; + nfound++; + } + else if (per > opts->percent && PDIFF(temp1_ulong, temp2_ulong) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); } - mem1 += sizeof(unsigned long); - mem2 += sizeof(unsigned long); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } - else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - - if (temp1_ulong != temp2_ulong) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); - } - nfound++; - } - - mem1 += sizeof(unsigned long); - mem2 += sizeof(unsigned long); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + else if (temp1_ulong != temp2_ulong) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); + } + nfound++; } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); + return nfound; } /*------------------------------------------------------------------------- - * Function: diff_llong + * Function: diff_llong_element * - * Purpose: diff a H5T_NATIVE_LLONG type + * Purpose: diff a single H5T_NATIVE_LLONG type * * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t -diff_llong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, - hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, - int *ph) +diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ long long temp1_llong; long long temp2_llong; - hsize_t i; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; - /* -d and !-p */ - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_llong, mem1, sizeof(long long)); - HDmemcpy(&temp2_llong, mem2, sizeof(long long)); + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - if (ABS(temp1_llong - temp2_llong) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); - } - nfound++; + HDmemcpy(&temp1_llong, mem1, sizeof(long long)); + HDmemcpy(&temp2_llong, mem2, sizeof(long long)); + + /* -d and !-p */ + if (opts->delta_bool && !opts->percent_bool) { + if (ABS(temp1_llong - temp2_llong) > opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } - mem1 += sizeof(long long); - mem2 += sizeof(long long); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_llong, mem1, sizeof(long long)); - HDmemcpy(&temp2_llong, mem2, sizeof(long long)); + else if (!opts->delta_bool && opts->percent_bool) { + PER(temp1_llong, temp2_llong); - PER(temp1_llong, temp2_llong); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, - ABS(temp1_llong - temp2_llong)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, + ABS(temp1_llong - temp2_llong)); } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong), - per); - } - nfound++; + nfound++; + } + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong), per); } - mem1 += sizeof(long long); - mem2 += sizeof(long long); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_llong, mem1, sizeof(long long)); - HDmemcpy(&temp2_llong, mem2, sizeof(long long)); + else if (opts->delta_bool && opts->percent_bool) { + PER(temp1_llong, temp2_llong); - PER(temp1_llong, temp2_llong); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, - ABS(temp1_llong - temp2_llong)); - } - nfound++; + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, + ABS(temp1_llong - temp2_llong)); } - else if (per > opts->percent && ABS(temp1_llong - temp2_llong) > opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong), - per); - } - nfound++; + nfound++; + } + else if (per > opts->percent && ABS(temp1_llong - temp2_llong) > opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong), per); } - mem1 += sizeof(long long); - mem2 += sizeof(long long); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_llong, mem1, sizeof(long long)); - HDmemcpy(&temp2_llong, mem2, sizeof(long long)); - - if (temp1_llong != temp2_llong) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); - } - nfound++; + if (temp1_llong != temp2_llong) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } - - mem1 += sizeof(long long); - mem2 += sizeof(long long); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + nfound++; + } } + H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat); + return nfound; } /*------------------------------------------------------------------------- - * Function: diff_ullong + * Function: diff_ullong_element * - * Purpose: diff a H5T_NATIVE_ULLONG type + * Purpose: diff a single H5T_NATIVE_ULLONG type * * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t -diff_ullong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, - hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, - int *ph) - +diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts) { hsize_t nfound = 0; /* number of differences found */ unsigned long long temp1_ullong; unsigned long long temp2_ullong; - hsize_t i; float f1, f2; double per; - hbool_t both_zero; + hbool_t both_zero = FALSE; - /* -d and !-p */ - if (opts->d && !opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); - HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); + H5TOOLS_START_DEBUG("delta_bool:%d - percent_bool:%d", opts->delta_bool, opts->percent_bool); - if (PDIFF(temp1_ullong, temp2_ullong) > (unsigned long long)opts->delta) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULLI_FORMAT, temp1_ullong, temp2_ullong, - PDIFF(temp1_ullong, temp2_ullong)); - } - nfound++; + HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); + HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); + + /* -d and !-p */ + if (opts->delta_bool && !opts->percent_bool) { + if (PDIFF(temp1_ullong, temp2_ullong) > (unsigned long long)opts->delta) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(ULLI_FORMAT, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong)); } - mem1 += sizeof(unsigned long long); - mem2 += sizeof(unsigned long long); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* !-d and -p */ - else if (!opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); - HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); - - ull2float(temp1_ullong, &f1); - ull2float(temp2_ullong, &f2); - PER(f1, f2); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULLI_FORMAT_P_NOTCOMP, temp1_ullong, temp2_ullong, - PDIFF(temp1_ullong, temp2_ullong)); - } - nfound++; + else if (!opts->delta_bool && opts->percent_bool) { + ull2float(temp1_ullong, &f1); + ull2float(temp2_ullong, &f2); + PER(f1, f2); + + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(ULLI_FORMAT_P_NOTCOMP, temp1_ullong, temp2_ullong, + PDIFF(temp1_ullong, temp2_ullong)); } - else if (per > opts->percent) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULLI_FORMAT_P, temp1_ullong, temp2_ullong, - PDIFF(temp1_ullong, temp2_ullong), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(ULLI_FORMAT_P, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong), + per); } - mem1 += sizeof(unsigned long long); - mem2 += sizeof(unsigned long long); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } /* -d and -p */ - else if (opts->d && opts->p) { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); - HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); - - ull2float(temp1_ullong, &f1); - ull2float(temp2_ullong, &f2); - PER(f1, f2); - - if (not_comparable && !both_zero) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULLI_FORMAT_P_NOTCOMP, temp1_ullong, temp2_ullong, - PDIFF(temp1_ullong, temp2_ullong)); - } - nfound++; + else if (opts->delta_bool && opts->percent_bool) { + ull2float(temp1_ullong, &f1); + ull2float(temp2_ullong, &f2); + PER(f1, f2); + + if (not_comparable && !both_zero) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(ULLI_FORMAT_P_NOTCOMP, temp1_ullong, temp2_ullong, + PDIFF(temp1_ullong, temp2_ullong)); } - else if (per > opts->percent && - PDIFF(temp1_ullong, temp2_ullong) > (unsigned long long)opts->delta) { - if (print_data(opts)) { - print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULLI_FORMAT_P, temp1_ullong, temp2_ullong, - PDIFF(temp1_ullong, temp2_ullong), per); - } - nfound++; + nfound++; + } + else if (per > opts->percent && PDIFF(temp1_ullong, temp2_ullong) > (unsigned long long)opts->delta) { + opts->print_percentage = 1; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(ULLI_FORMAT_P, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong), + per); } - mem1 += sizeof(unsigned long long); - mem2 += sizeof(unsigned long long); - if (opts->n && nfound >= opts->count) - return nfound; + nfound++; } } else { - for (i = 0; i < nelmts; i++) { - HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); - HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); - - if (temp1_ullong != temp2_ullong) { - if (print_data(opts)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); - parallel_print(SPACES); - parallel_print(ULLI_FORMAT, temp1_ullong, temp2_ullong, - PDIFF(temp1_ullong, temp2_ullong)); - } - nfound++; + if (temp1_ullong != temp2_ullong) { + opts->print_percentage = 0; + print_pos(opts, elem_idx, 0); + if (print_data(opts)) { + parallel_print(ULLI_FORMAT, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong)); } - - mem1 += sizeof(unsigned long long); - mem2 += sizeof(unsigned long long); - if (opts->n && nfound >= opts->count) - return nfound; - } /* nelmts */ + nfound++; + } } + H5TOOLS_ENDDEBUG(": %d zero:%d", nfound, both_zero); return nfound; } @@ -4484,7 +3075,7 @@ equal_float(float value, float expected, diff_opt_t *opts) static int print_data(diff_opt_t *opts) { - return ((opts->m_report || opts->m_verbose) && !opts->m_quiet) ? 1 : 0; + return ((opts->mode_report || opts->mode_verbose) && !opts->mode_quiet) ? 1 : 0; } /*------------------------------------------------------------------------- @@ -4494,24 +3085,23 @@ print_data(diff_opt_t *opts) *------------------------------------------------------------------------- */ static void -print_header(int pp, /* print percentage */ - int rank, hsize_t *dims, const char *obj1, const char *obj2) +print_header(diff_opt_t *opts) { /* print header */ parallel_print("%-16s", "size:"); - print_dimensions(rank, dims); + print_dimensions(opts->rank, opts->dims); parallel_print("%-11s", ""); - print_dimensions(rank, dims); + print_dimensions(opts->rank, opts->dims); parallel_print("\n"); - if (pp) { - parallel_print("%-15s %-15s %-15s %-15s %-15s\n", "position", (obj1 != NULL) ? obj1 : " ", - (obj2 != NULL) ? obj2 : " ", "difference", "relative"); + if (opts->print_percentage) { + parallel_print("%-15s %-15s %-15s %-15s %-15s\n", "position", opts->obj_name[0], opts->obj_name[1], + "difference", "relative"); parallel_print("------------------------------------------------------------------------\n"); } else { - parallel_print("%-15s %-15s %-15s %-20s\n", "position", (obj1 != NULL) ? obj1 : " ", - (obj2 != NULL) ? obj2 : " ", "difference"); + parallel_print("%-15s %-15s %-15s %-20s\n", "position", opts->obj_name[0], opts->obj_name[1], + "difference"); parallel_print("------------------------------------------------------------\n"); } } @@ -4523,76 +3113,100 @@ print_header(int pp, /* print percentage */ *------------------------------------------------------------------------- */ static void -print_pos(int * ph, /* print header */ - int pp, /* print percentage */ - hsize_t curr_pos, hsize_t *acc, hsize_t *pos, int rank, hsize_t *dims, const char *obj1, - const char *obj2) +print_pos(diff_opt_t *opts, hsize_t idx, size_t u) { - int i; - - /* print header */ - if (*ph == 1) { - *ph = 0; - - print_header(pp, rank, dims, obj1, obj2); - } /* end print header */ - - for (i = 0; i < rank; i++) { - pos[i] = curr_pos / acc[i]; - curr_pos -= acc[i] * pos[i]; - } - HDassert(curr_pos == 0); + int i, j; + + H5TOOLS_START_DEBUG(" -- idx:%ld", idx); + + if (print_data(opts)) { + /* print header */ + if (opts->print_header == 1) { + opts->print_header = 0; + + print_header(opts); + } /* end print header */ + + H5TOOLS_DEBUG("rank=%d", opts->rank); + if (opts->rank > 0) { + hsize_t curr_pos = idx; + + parallel_print("[ "); + H5TOOLS_DEBUG("do calc_acc_pos[%ld] nelmts:%d - errstat:%d", i, opts->hs_nelmts, opts->err_stat); + + if (opts->sset[0] != NULL) { + /* Subsetting is used - calculate total position */ + hsize_t elmnt_cnt = 1; + hsize_t dim_cnt = 0; /* previous dim size */ + hsize_t str_cnt = 0; /* previous dim stride */ + hsize_t curr_idx = idx; /* calculated running position */ + hsize_t str_idx = 0; + hsize_t blk_idx = 0; + hsize_t cnt_idx = 0; + hsize_t hs_idx = 0; + j = opts->rank - 1; + do { + cnt_idx = opts->sset[0]->count.data[j]; /* Count value for current dim */ + H5TOOLS_DEBUG("... sset loop:%d with curr_pos:%ld (curr_idx:%ld) - count:%ld", j, + curr_pos, curr_idx, cnt_idx); + blk_idx = opts->sset[0]->block.data[j]; /* Block value for current dim */ + H5TOOLS_DEBUG("... sset loop:%d with curr_pos:%ld (curr_idx:%ld) - block:%ld", j, + curr_pos, curr_idx, blk_idx); + hs_idx = cnt_idx * blk_idx; /* hyperslab area value for current dim */ + H5TOOLS_DEBUG("... sset loop:%d with curr_pos:%ld (curr_idx:%ld) - hs:%ld", j, curr_pos, + curr_idx, hs_idx); + str_idx = opts->sset[0]->stride.data[j]; /* Stride value for current dim */ + H5TOOLS_DEBUG("... sset loop:%d with curr_pos:%ld (curr_idx:%ld) - stride:%ld", j, + curr_pos, curr_idx, str_idx); + elmnt_cnt *= opts->dims[j]; /* Total number of elements in dimension */ + H5TOOLS_DEBUG("... sset loop:%d with elmnt_cnt:%ld", j, elmnt_cnt); + if (str_idx > blk_idx) + curr_idx += dim_cnt * (str_idx - blk_idx); /* */ + else if (curr_idx >= hs_idx) + curr_idx += dim_cnt * str_cnt; + H5TOOLS_DEBUG("... sset loop:%d with idx:%ld (curr_idx:%ld) - stride:%ld", j, idx, + curr_idx, str_idx); + dim_cnt = elmnt_cnt; /* */ + if (str_idx > blk_idx) + str_cnt = str_idx - blk_idx; /* */ + else + str_cnt = str_idx; /* */ + H5TOOLS_DEBUG("... sset loop:%d with dim_cnt:%ld - str_cnt:%ld", j, dim_cnt, str_cnt); + j--; + } while (curr_idx >= elmnt_cnt && j >= 0); + curr_pos = curr_idx; /* New current position */ + H5TOOLS_DEBUG("pos loop:%d,%d with elmnt_cnt:%ld - curr_pos:%ld", i, j, elmnt_cnt, curr_pos); + } /* if (opts->sset[0] != NULL) */ + /* + * Calculate the number of elements represented by a unit change in a + * certain index position. + */ + calc_acc_pos((unsigned)opts->rank, curr_pos, opts->acc, opts->pos); - if (rank > 0) { - parallel_print("[ "); - for (i = 0; i < rank; i++) { - parallel_print(HSIZE_T_FORMAT, (unsigned long long)pos[i]); - parallel_print(" "); + for (i = 0; i < opts->rank; i++) { + H5TOOLS_DEBUG("pos loop:%d with opts->pos=%ld opts->sm_pos=%ld", i, opts->pos[i], + opts->sm_pos[i]); + opts->pos[i] += (unsigned long)opts->sm_pos[i]; + H5TOOLS_DEBUG("pos loop:%d with opts->pos=%ld", i, opts->pos[i]); + parallel_print(HSIZE_T_FORMAT, (unsigned long long)opts->pos[i]); + parallel_print(" "); + } + parallel_print("]"); } - parallel_print("]"); - } - else - parallel_print(" "); -} - -/*------------------------------------------------------------------------- - * Function: print_char_pos - * - * Purpose: print character position in string - *------------------------------------------------------------------------- - */ -static void -print_char_pos(int * ph, /* print header */ - int pp, /* print percentage */ - hsize_t curr_pos, size_t u, hsize_t *acc, hsize_t *pos, int rank, hsize_t *dims, - const char *obj1, const char *obj2) -{ - int i; - - /* print header */ - if (*ph == 1) { - *ph = 0; - - print_header(pp, rank, dims, obj1, obj2); - } /* end print header */ - - for (i = 0; i < rank; i++) { - pos[i] = curr_pos / acc[i]; - curr_pos -= acc[i] * pos[i]; - } - HDassert(curr_pos == 0); - - parallel_print("[ "); - if (rank > 0) { - for (i = 0; i < rank; i++) { - parallel_print(HSIZE_T_FORMAT, (unsigned long long)pos[i]); - parallel_print(" "); + else { + if (opts->print_dims) { + parallel_print("[ "); + parallel_print("%zu", u); + parallel_print("]"); + opts->print_dims = 0; + } + else + parallel_print(" "); } + parallel_print(SPACES); } - else - parallel_print("%zu", u); - parallel_print("]"); + H5TOOLS_ENDDEBUG(""); } /*------------------------------------------------------------------------- diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 705815f..e8751da 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -157,10 +157,14 @@ build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t **table_out, H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat); - if (H5Oget_info(loc1_id, &oinfo1) < 0) + if (H5Oget_info(loc1_id, &oinfo1) < 0) { H5TOOLS_GOTO_ERROR(FAIL, "H5Oget_info first object failed"); - if (H5Oget_info(loc2_id, &oinfo2) < 0) + } + H5TOOLS_DEBUG("H5Oget_info loc1id=%d", oinfo1.num_attrs); + if (H5Oget_info(loc2_id, &oinfo2) < 0) { H5TOOLS_GOTO_ERROR(FAIL, "H5Oget_info second object failed"); + } + H5TOOLS_DEBUG("H5Oget_info loc2id=%d", oinfo2.num_attrs); table_attrs_init(&table_lp); if (table_lp == NULL) @@ -170,8 +174,8 @@ build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t **table_out, * build the list */ while (curr1 < oinfo1.num_attrs && curr2 < oinfo2.num_attrs) { - H5TOOLS_DEBUG("build_match_list_attrs 1: %ld - %ld", curr1, oinfo1.num_attrs); - H5TOOLS_DEBUG("build_match_list_attrs 2: %ld - %ld", curr2, oinfo2.num_attrs); + H5TOOLS_DEBUG("list_attrs 1: %ld - %ld", curr1, oinfo1.num_attrs); + H5TOOLS_DEBUG("list_attrs 2: %ld - %ld", curr2, oinfo2.num_attrs); /*------------------ * open attribute1 */ @@ -227,7 +231,7 @@ build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t **table_out, infile[0] = 1; infile[1] = 0; while (curr1 < oinfo1.num_attrs) { - H5TOOLS_DEBUG("build_match_list_attrs 1: %ld - %ld", curr1, oinfo1.num_attrs); + H5TOOLS_DEBUG("list_attrs 1: %ld - %ld", curr1, oinfo1.num_attrs); /*------------------ * open attribute1 */ @@ -237,7 +241,7 @@ build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t **table_out, /* get name */ if (H5Aget_name(attr1_id, (size_t)ATTR_NAME_MAX, name1) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Aget_name first attribute failed"); - H5TOOLS_DEBUG("build_match_list_attrs #1 name - %s", name1); + H5TOOLS_DEBUG("list_attrs 1 name - %s", name1); table_attr_mark_exist(infile, name1, table_lp); table_lp->nattrs_only1++; @@ -252,7 +256,7 @@ build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t **table_out, infile[0] = 0; infile[1] = 1; while (curr2 < oinfo2.num_attrs) { - H5TOOLS_DEBUG("build_match_list_attrs 2: %ld - %ld", curr2, oinfo2.num_attrs); + H5TOOLS_DEBUG("list_attrs 2: %ld - %ld", curr2, oinfo2.num_attrs); /*------------------ * open attribute2 */ if ((attr2_id = H5Aopen_by_idx(loc2_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)curr2, H5P_DEFAULT, @@ -261,7 +265,7 @@ build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t **table_out, /* get name */ if (H5Aget_name(attr2_id, (size_t)ATTR_NAME_MAX, name2) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Aget_name second attribute failed"); - H5TOOLS_DEBUG("build_match_list_attrs #2 name - %s", name2); + H5TOOLS_DEBUG("list_attrs 2 name - %s", name2); table_attr_mark_exist(infile, name2, table_lp); table_lp->nattrs_only2++; @@ -275,7 +279,7 @@ build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t **table_out, /*------------------------------------------------------ * print the list */ - if (opts->m_verbose_level == 2) { + if (opts->mode_verbose_level == 2) { /* if '-v2' is detected */ parallel_print(" obj1 obj2\n"); parallel_print(" --------------------------------------\n"); @@ -287,7 +291,7 @@ build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t **table_out, } /* end for */ } - if (opts->m_verbose_level >= 1) + if (opts->mode_verbose_level >= 1) parallel_print("Attributes status: %d common, %d only in obj1, %d only in obj2\n", table_lp->nattrs - table_lp->nattrs_only1 - table_lp->nattrs_only2, table_lp->nattrs_only1, table_lp->nattrs_only2); @@ -334,19 +338,15 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na void * buf2 = NULL; /* data buffer */ hbool_t buf1hasdata = FALSE; /* buffer has data */ hbool_t buf2hasdata = FALSE; /* buffer has data */ - hsize_t nelmts1; /* number of elements in dataset */ int rank1; /* rank of dataset */ int rank2; /* rank of dataset */ hsize_t dims1[H5S_MAX_RANK]; /* dimensions of dataset */ hsize_t dims2[H5S_MAX_RANK]; /* dimensions of dataset */ - char np1[512]; - char np2[512]; hsize_t nfound = 0; - int j; + size_t sz; diff_err_t ret_value = opts->err_stat; H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat); - /* get the datatypes */ if ((ftype1_id = H5Aget_type(attr1_id)) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Aget_type first attribute failed"); @@ -378,12 +378,33 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na * check for comparable TYPE and SPACE *---------------------------------------------------------------------- */ - H5TOOLS_DEBUG("diff_attr_data check for comparable TYPE and SPACE"); + H5TOOLS_DEBUG("Check for comparable TYPE and SPACE"); + + H5TOOLS_DEBUG("attr_names: %s - %s", name1, name2); + if (name1) { + sz = HDstrlen(name1); + H5TOOLS_DEBUG("attr1_name: %s - %d", name1, sz); + if (sz > 0) { + opts->obj_name[0] = (char *)HDmalloc(sz + 1); + HDstrncpy(opts->obj_name[0], name1, sz + 1); + } + } + if (name2) { + sz = HDstrlen(name2); + H5TOOLS_DEBUG("attr2_name: %s - %d", name2, sz); + if (sz > 0) { + opts->obj_name[1] = (char *)HDmalloc(sz + 1); + HDstrncpy(opts->obj_name[1], name2, sz + 1); + } + } + H5TOOLS_DEBUG("attr_names: %s - %s", opts->obj_name[0], opts->obj_name[1]); /* pass dims1 and dims2 for maxdims as well since attribute's maxdims * are always same */ - if (diff_can_type(ftype1_id, ftype2_id, rank1, rank2, dims1, dims2, dims1, dims2, name1, name2, opts, - 0) == 1) { + if (diff_can_type(ftype1_id, ftype2_id, rank1, rank2, dims1, dims2, dims1, dims2, opts, 0) == 1) { + + int j; + /*----------------------------------------------------------------- * "upgrade" the smaller memory size *------------------------------------------------------------------ @@ -391,17 +412,26 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na if (FAIL == match_up_memsize(ftype1_id, ftype2_id, &mtype1_id, &mtype2_id, &msize1, &msize2)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "match_up_memsize failed"); - H5TOOLS_DEBUG("diff_attr_data read"); + H5TOOLS_DEBUG("initialize read"); /*--------------------------------------------------------------------- - * read + * initialize diff_opt_t structure for dimensions *---------------------------------------------------------------------- */ - nelmts1 = 1; - for (j = 0; j < rank1; j++) - nelmts1 *= dims1[j]; + opts->nelmts = 1; + for (j = 0; j < rank1; j++) { + opts->dims[j] = dims1[j]; + opts->nelmts *= dims1[j]; + } + opts->rank = rank1; + init_acc_pos((unsigned)opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx); - buf1 = (void *)HDcalloc((size_t)(nelmts1), msize1); - buf2 = (void *)HDcalloc((size_t)(nelmts1), msize2); + /*--------------------------------------------------------------------- + * read + *---------------------------------------------------------------------- + */ + buf1 = (void *)HDcalloc((size_t)(opts->nelmts), msize1); + buf2 = (void *)HDcalloc((size_t)(opts->nelmts), msize2); + H5TOOLS_DEBUG("attr buffer size %ld * %ld", opts->nelmts, msize1); if (buf1 == NULL || buf2 == NULL) { parallel_print("cannot read into memory\n"); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "buffer allocation failed"); @@ -412,6 +442,7 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na } else buf1hasdata = TRUE; + H5TOOLS_DEBUG("attr H5Aread 1"); if (H5Aread(attr2_id, mtype2_id, buf2) < 0) { parallel_print("Failed reading attribute2 %s\n", name2); @@ -419,50 +450,81 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na } else buf2hasdata = TRUE; + H5TOOLS_DEBUG("attr H5Aread 2"); /* format output string */ - HDsnprintf(np1, sizeof(np1), "%s of <%s>", name1, path1); - HDsnprintf(np2, sizeof(np1), "%s of <%s>", name2, path2); + if (opts->obj_name[0] != NULL) + HDfree(opts->obj_name[0]); + opts->obj_name[0] = NULL; + if (opts->obj_name[1] != NULL) + HDfree(opts->obj_name[1]); + opts->obj_name[1] = NULL; + + H5TOOLS_DEBUG("attr_names: %s - %s : %s - %s", name1, name2, path1, path2); + if (name1) { + sz = HDstrlen(name1) + HDstrlen(path1) + 7; + H5TOOLS_DEBUG("attr1_name: %s - %d", name1, sz); + opts->obj_name[0] = (char *)HDcalloc(sz + 1, sizeof(char)); + HDsnprintf(opts->obj_name[0], sz, "%s of <%s>", name1, path1); + opts->obj_name[0][sz] = '\0'; + } + if (name2) { + sz = HDstrlen(name2) + HDstrlen(path2) + 7; + H5TOOLS_DEBUG("attr2_name: %s - %d", name2, sz); + opts->obj_name[1] = (char *)HDcalloc(sz + 1, sizeof(char)); + HDsnprintf(opts->obj_name[1], sz, "%s of <%s>", name2, path2); + opts->obj_name[1][sz] = '\0'; + } /*--------------------------------------------------------------------- * array compare *---------------------------------------------------------------------- */ - H5TOOLS_DEBUG("diff_attr_data array compare %s - %s", name1, name1); + H5TOOLS_DEBUG("array compare %s - %s", opts->obj_name[0], opts->obj_name[1]); + + opts->hs_nelmts = opts->nelmts; + opts->m_tid = mtype1_id; + + /* initialize the current stripmine position; this is necessary to print the array indices */ + for (j = 0; j < opts->rank; j++) + opts->sm_pos[j] = (hsize_t)0; /* always print name */ /* verbose (-v) and report (-r) mode */ - if (opts->m_verbose || opts->m_report) { - do_print_attrname("attribute", np1, np2); + if (opts->mode_verbose || opts->mode_report) { + do_print_attrname("attribute", opts->obj_name[0], opts->obj_name[1]); - nfound = diff_array(buf1, buf2, nelmts1, (hsize_t)0, rank1, dims1, opts, np1, np2, mtype1_id, - attr1_id, attr2_id); + nfound = diff_array(buf1, buf2, opts, attr1_id, attr2_id); print_found(nfound); } /* quiet mode (-q), just count differences */ - else if (opts->m_quiet) { - nfound = diff_array(buf1, buf2, nelmts1, (hsize_t)0, rank1, dims1, opts, np1, np2, mtype1_id, - attr1_id, attr2_id); + else if (opts->mode_quiet) { + nfound = diff_array(buf1, buf2, opts, attr1_id, attr2_id); } /* the rest (-c, none, ...) */ else { - nfound = diff_array(buf1, buf2, nelmts1, (hsize_t)0, rank1, dims1, opts, np1, np2, mtype1_id, - attr1_id, attr2_id); + nfound = diff_array(buf1, buf2, opts, attr1_id, attr2_id); /* print info if compatible and difference found */ if (nfound) { - do_print_attrname("attribute", np1, np2); + do_print_attrname("attribute", opts->obj_name[0], opts->obj_name[1]); print_found(nfound); } /* end if */ } /* end else */ } - H5TOOLS_DEBUG("diff_attr_data check for comparable TYPE and SPACE complete nfound:%d - errstat:%d", - nfound, opts->err_stat); + H5TOOLS_DEBUG("check for comparable TYPE and SPACE complete nfound:%d - errstat:%d", nfound, + opts->err_stat); /*---------------------------------------------------------------------- * close *---------------------------------------------------------------------- */ + if (opts->obj_name[0] != NULL) + HDfree(opts->obj_name[0]); + opts->obj_name[0] = NULL; + if (opts->obj_name[1] != NULL) + HDfree(opts->obj_name[1]); + opts->obj_name[1] = NULL; /* Free buf1 and buf2, check both VLEN-data VLEN-string to reclaim any * VLEN memory first */ @@ -543,28 +605,33 @@ diff_attr(hid_t loc1_id, hid_t loc2_id, const char *path1, const char *path2, di unsigned u; /* Local index variable */ hsize_t nfound = 0; hsize_t nfound_total = 0; - diff_err_t ret_value = opts->err_stat; + diff_opt_t attr_opts; + diff_err_t ret_value = opts->err_stat; H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat); + attr_opts = *opts; + attr_opts.obj_name[0] = NULL; + attr_opts.obj_name[1] = NULL; - if (build_match_list_attrs(loc1_id, loc2_id, &match_list_attrs, opts) < 0) { + if (build_match_list_attrs(loc1_id, loc2_id, &match_list_attrs, &attr_opts) < 0) { H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "build_match_list_attrs failed"); } - H5TOOLS_DEBUG("build_match_list_attrs - errstat:%d", opts->err_stat); + H5TOOLS_DEBUG("check match_list_attrs - opts->contents:%d - errstat:%d", attr_opts.contents, + attr_opts.err_stat); /* if detect any unique extra attr */ if (match_list_attrs->nattrs_only1 || match_list_attrs->nattrs_only2) { - H5TOOLS_DEBUG("diff_attr attributes only in one file"); + H5TOOLS_DEBUG("attributes only in one file"); /* exit will be 1 */ - opts->contents = 0; + attr_opts.contents = 0; } - H5TOOLS_DEBUG("match_list_attrs info - errstat:%d", opts->err_stat); + H5TOOLS_DEBUG("match_list_attrs info - opts->contents:%d", attr_opts.contents); for (u = 0; u < (unsigned)match_list_attrs->nattrs; u++) { - H5TOOLS_DEBUG("match_list_attrs loop[%d] - errstat:%d", u, opts->err_stat); + H5TOOLS_DEBUG("match_list_attrs loop[%d] - errstat:%d", u, attr_opts.err_stat); if ((match_list_attrs->attrs[u].exist[0]) && (match_list_attrs->attrs[u].exist[1])) { name1 = name2 = match_list_attrs->attrs[u].name; - H5TOOLS_DEBUG("diff_attr name - %s", name1); + H5TOOLS_DEBUG("name - %s", name1); /*-------------- * attribute 1 */ @@ -576,8 +643,8 @@ diff_attr(hid_t loc1_id, hid_t loc2_id, const char *path1, const char *path2, di if ((attr2_id = H5Aopen(loc2_id, name2, H5P_DEFAULT)) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Aopen second attribute failed"); - H5TOOLS_DEBUG("diff_attr got attributes"); - nfound = diff_attr_data(attr1_id, attr2_id, name1, name2, path1, path2, opts); + H5TOOLS_DEBUG("got attributes"); + nfound = diff_attr_data(attr1_id, attr2_id, name1, name2, path1, path2, &attr_opts); if (H5Aclose(attr1_id) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Aget_type first attribute failed"); if (H5Aclose(attr2_id) < 0) @@ -588,7 +655,10 @@ diff_attr(hid_t loc1_id, hid_t loc2_id, const char *path1, const char *path2, di } /* u */ done: - opts->err_stat = opts->err_stat | ret_value; + opts->print_header = attr_opts.print_header; + opts->contents = attr_opts.contents; + opts->not_cmp = attr_opts.not_cmp; + opts->err_stat = attr_opts.err_stat | ret_value; H5E_BEGIN_TRY { diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 582df75..495cbbc 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -29,15 +29,21 @@ hsize_t diff_dataset(hid_t file1_id, hid_t file2_id, const char *obj1_name, const char *obj2_name, diff_opt_t *opts) { - int status = -1; - hid_t did1 = H5I_INVALID_HID; - hid_t did2 = H5I_INVALID_HID; - hid_t dcpl1 = H5I_INVALID_HID; - hid_t dcpl2 = H5I_INVALID_HID; - hsize_t nfound = 0; + int status = -1; + hid_t did1 = H5I_INVALID_HID; + hid_t did2 = H5I_INVALID_HID; + hid_t dcpl1 = H5I_INVALID_HID; + hid_t dcpl2 = H5I_INVALID_HID; + hsize_t nfound = 0; + diff_opt_t diff_opts; diff_err_t ret_value = opts->err_stat; H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat); + diff_opts = *opts; + diff_opts.obj_name[0] = NULL; + diff_opts.obj_name[1] = NULL; + + H5TOOLS_DEBUG("obj_names: %s - %s", obj1_name, obj2_name); /*------------------------------------------------------------------------- * open the handles *------------------------------------------------------------------------- @@ -64,20 +70,22 @@ diff_dataset(hid_t file1_id, hid_t file2_id, const char *obj1_name, const char * * 2) the internal filters might be turned off *------------------------------------------------------------------------- */ - H5TOOLS_DEBUG("diff_dataset h5tools_canreadf then diff_datasetid"); - if ((status = h5tools_canreadf((opts->m_verbose ? obj1_name : NULL), dcpl1) == 1) && - (status = h5tools_canreadf((opts->m_verbose ? obj2_name : NULL), dcpl2) == 1)) - nfound = diff_datasetid(did1, did2, obj1_name, obj2_name, opts); + H5TOOLS_DEBUG("h5tools_canreadf then diff_datasetid"); + if ((status = h5tools_canreadf((opts->mode_verbose ? obj1_name : NULL), dcpl1) == 1) && + (status = h5tools_canreadf((opts->mode_verbose ? obj2_name : NULL), dcpl2) == 1)) + nfound = diff_datasetid(did1, did2, obj1_name, obj2_name, &diff_opts); else if (status < 0) { H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "h5tools_canreadf failed"); } else { - ret_value = 1; - opts->not_cmp = 1; + ret_value = 1; + diff_opts.not_cmp = 1; } done: - opts->err_stat = opts->err_stat | ret_value; + opts->print_header = diff_opts.print_header; + opts->not_cmp = diff_opts.not_cmp; + opts->err_stat = diff_opts.err_stat | ret_value; /* disable error reporting */ H5E_BEGIN_TRY @@ -148,34 +156,28 @@ done: hsize_t diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_name, diff_opt_t *opts) { - hid_t sid1 = H5I_INVALID_HID; - hid_t sid2 = H5I_INVALID_HID; - hid_t f_tid1 = H5I_INVALID_HID; - hid_t f_tid2 = H5I_INVALID_HID; - hid_t dam_tid = H5I_INVALID_HID; /* m_tid for diff_array function */ - hid_t m_tid1 = H5I_INVALID_HID; - hid_t m_tid2 = H5I_INVALID_HID; - hid_t dcpl1 = H5I_INVALID_HID; - hid_t dcpl2 = H5I_INVALID_HID; - H5D_layout_t stl1 = -1; - H5D_layout_t stl2 = -1; - size_t dam_size; /* m_size for diff_array function */ + hid_t sid1 = H5I_INVALID_HID; + hid_t sid2 = H5I_INVALID_HID; + hid_t f_tid1 = H5I_INVALID_HID; + hid_t f_tid2 = H5I_INVALID_HID; + hid_t m_tid1 = H5I_INVALID_HID; + hid_t m_tid2 = H5I_INVALID_HID; + hid_t dcpl1 = H5I_INVALID_HID; + hid_t dcpl2 = H5I_INVALID_HID; + H5D_layout_t stl1 = -1; + H5D_layout_t stl2 = -1; size_t m_size1; size_t m_size2; H5T_sign_t sign1; H5T_sign_t sign2; int rank1; int rank2; - hsize_t danelmts; /* nelmts for diff_array function */ hsize_t nelmts1; hsize_t nelmts2; - hsize_t * dadims; /* dims for diff_array function */ hsize_t dims1[H5S_MAX_RANK]; hsize_t dims2[H5S_MAX_RANK]; hsize_t maxdim1[H5S_MAX_RANK]; hsize_t maxdim2[H5S_MAX_RANK]; - const char * name1 = NULL; /* relative names */ - const char * name2 = NULL; hsize_t storage_size1; hsize_t storage_size2; hsize_t nfound = 0; /* number of differences found */ @@ -184,9 +186,10 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n void * buf2 = NULL; void * sm_buf1 = NULL; void * sm_buf2 = NULL; - hid_t sm_space = H5I_INVALID_HID; /*stripmine data space */ + hid_t sm_space1 = H5I_INVALID_HID; /*stripmine data space */ + hid_t sm_space2 = H5I_INVALID_HID; /*stripmine data space */ size_t need; /* bytes needed for malloc */ - int i; + int i, j; unsigned int vl_data1 = 0; /*contains VL datatypes */ unsigned int vl_data2 = 0; /*contains VL datatypes */ diff_err_t ret_value = opts->err_stat; @@ -236,13 +239,15 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n */ if ((dcpl1 = H5Dget_create_plist(did1)) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Dget_create_plist failed"); - if ((dcpl2 = H5Dget_create_plist(did2)) < 0) - H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Dget_create_plist failed"); - if ((stl1 = H5Pget_layout(dcpl1)) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Pget_layout failed"); + H5Pclose(dcpl1); + + if ((dcpl2 = H5Dget_create_plist(did2)) < 0) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Dget_create_plist failed"); if ((stl2 = H5Pget_layout(dcpl2)) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Pget_layout failed"); + H5Pclose(dcpl2); /*------------------------------------------------------------------------- * check for empty datasets @@ -255,20 +260,40 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n H5TOOLS_DEBUG("storage size: %ld - %ld", storage_size1, storage_size2); if (storage_size1 == 0 || storage_size2 == 0) { - if ((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) + if ((opts->mode_verbose || opts->mode_list_not_cmp) && obj1_name && obj2_name) parallel_print("Not comparable: <%s> or <%s> is an empty dataset\n", obj1_name, obj2_name); can_compare = 0; opts->not_cmp = 1; } + H5TOOLS_DEBUG("obj_names: %s - %s", obj1_name, obj2_name); + opts->obj_name[0] = NULL; + if (obj1_name) { + j = (int)HDstrlen(obj1_name); + H5TOOLS_DEBUG("obj1_name: %s - %d", obj1_name, j); + if (j > 0) { + opts->obj_name[0] = (char *)HDmalloc((size_t)j + 1); + HDstrncpy(opts->obj_name[0], obj1_name, (size_t)j + 1); + } + } + + opts->obj_name[1] = NULL; + if (obj2_name) { + j = (int)HDstrlen(obj2_name); + H5TOOLS_DEBUG("obj2_name: %s - %d", obj2_name, j); + if (j > 0) { + opts->obj_name[1] = (char *)HDmalloc((size_t)j + 1); + HDstrncpy(opts->obj_name[1], obj2_name, (size_t)j + 1); + } + } + /*------------------------------------------------------------------------- * check for comparable TYPE and SPACE *------------------------------------------------------------------------- */ - if (diff_can_type(f_tid1, f_tid2, rank1, rank2, dims1, dims2, maxdim1, maxdim2, obj1_name, obj2_name, - opts, 0) != 1) + if (diff_can_type(f_tid1, f_tid2, rank1, rank2, dims1, dims2, maxdim1, maxdim2, opts, 0) != 1) can_compare = 0; - H5TOOLS_DEBUG("diff_can_type - errstat:%d", opts->err_stat); + H5TOOLS_DEBUG("diff_can_type returned errstat:%d", opts->err_stat); /*------------------------------------------------------------------------- * memory type and sizes @@ -276,10 +301,10 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n */ H5TOOLS_DEBUG("check for memory type and sizes"); if ((m_tid1 = H5Tget_native_type(f_tid1, H5T_DIR_DEFAULT)) < 0) - H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Tget_native_type failed"); + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Tget_native_type first ftype failed"); if ((m_tid2 = H5Tget_native_type(f_tid2, H5T_DIR_DEFAULT)) < 0) - H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Tget_native_type failed"); + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Tget_native_type second ftype failed"); m_size1 = H5Tget_size(m_tid1); m_size2 = H5Tget_size(m_tid2); @@ -295,7 +320,7 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n sign2 = H5Tget_sign(m_tid2); if (sign1 != sign2) { H5TOOLS_DEBUG("sign1 != sign2"); - if ((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { + if ((opts->mode_verbose || opts->mode_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> has sign %s ", obj1_name, get_sign(sign1)); parallel_print("and <%s> has sign %s\n", obj2_name, get_sign(sign2)); } @@ -346,36 +371,53 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n if (FAIL == match_up_memsize(f_tid1, f_tid2, &m_tid1, &m_tid2, &m_size1, &m_size2)) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "match_up_memsize failed"); H5TOOLS_DEBUG("m_size: %ld - %ld", m_size1, m_size2); - dadims = dims1; - dam_size = m_size1; - dam_tid = m_tid1; - danelmts = nelmts1; - need = (size_t)(nelmts1 * m_size1); /* bytes needed */ + opts->rank = rank1; + for (i = 0; i < rank1; i++) + opts->dims[i] = dims1[i]; + opts->m_size = m_size1; + opts->m_tid = m_tid1; + opts->nelmts = nelmts1; + need = (size_t)(nelmts1 * m_size1); /* bytes needed */ } else { H5TOOLS_DEBUG("Array dims: %d - %d", dims1[0], dims2[0]); /* Compare the smallest array, but create the largest buffer */ if (m_size1 <= m_size2) { - dadims = dims1; - dam_size = m_size1; - dam_tid = m_tid1; - danelmts = nelmts1; - need = (size_t)(nelmts2 * m_size2); /* bytes needed */ + opts->rank = rank1; + for (i = 0; i < rank1; i++) + opts->dims[i] = dims1[i]; + opts->m_size = m_size1; + opts->m_tid = m_tid1; + opts->nelmts = nelmts1; + need = (size_t)(nelmts2 * m_size2); /* bytes needed */ } else { - dadims = dims2; - dam_size = m_size2; - dam_tid = m_tid2; - danelmts = nelmts2; - need = (size_t)(nelmts1 * m_size1); /* bytes needed */ + opts->rank = rank2; + for (i = 0; i < rank2; i++) + opts->dims[i] = dims2[i]; + opts->m_size = m_size2; + opts->m_tid = m_tid2; + opts->nelmts = nelmts2; + need = (size_t)(nelmts1 * m_size1); /* bytes needed */ } } + opts->hs_nelmts = opts->nelmts; + H5TOOLS_DEBUG("need: %ld", need); /* print names */ + H5TOOLS_DEBUG("obj_names: %s - %s", obj1_name, obj2_name); + + if (opts->obj_name[0] != NULL) + HDfree(opts->obj_name[0]); + opts->obj_name[0] = NULL; + if (opts->obj_name[1] != NULL) + HDfree(opts->obj_name[1]); + opts->obj_name[1] = NULL; + if (obj1_name) - name1 = diff_basename(obj1_name); + opts->obj_name[0] = HDstrdup(diff_basename(obj1_name)); if (obj2_name) - name2 = diff_basename(obj2_name); - H5TOOLS_DEBUG("obj_names: %s - %s", name1, name2); + opts->obj_name[1] = HDstrdup(diff_basename(obj2_name)); + H5TOOLS_DEBUG("obj_names: %s - %s", opts->obj_name[0], opts->obj_name[1]); H5TOOLS_DEBUG("read/compare"); /*---------------------------------------------------------------- @@ -387,7 +429,14 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n buf2 = HDmalloc(need); } /* end if */ - if (buf1 != NULL && buf2 != NULL) { + /* Assume entire data space to be printed */ + init_acc_pos((unsigned)opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx); + + for (i = 0; i < opts->rank; i++) { + opts->p_max_idx[i] = opts->dims[i]; + } + + if (buf1 != NULL && buf2 != NULL && opts->sset[0] == NULL && opts->sset[1] == NULL) { H5TOOLS_DEBUG("buf1 != NULL && buf2 != NULL"); H5TOOLS_DEBUG("H5Dread did1"); if (H5Dread(did1, m_tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf1) < 0) @@ -396,10 +445,13 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n if (H5Dread(did2, m_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Dread failed"); + /* initialize the current stripmine position; this is necessary to print the array indices */ + for (j = 0; j < opts->rank; j++) + opts->sm_pos[j] = (hsize_t)0; + /* array diff */ - nfound = diff_array(buf1, buf2, danelmts, (hsize_t)0, rank1, dadims, opts, name1, name2, dam_tid, - did1, did2); - H5TOOLS_DEBUG("diff_array nfound:%d - errstat:%d", nfound, opts->err_stat); + nfound = diff_array(buf1, buf2, opts, did1, did2); + H5TOOLS_DEBUG("diff_array ret nfound:%d - errstat:%d", nfound, opts->err_stat); /* reclaim any VL memory, if necessary */ H5TOOLS_DEBUG("check vl_data1:%d", vl_data1); @@ -416,125 +468,406 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n HDfree(buf2); buf2 = NULL; } - } /* end if */ - else { /* possibly not enough memory, read/compare by hyperslabs */ - size_t p_type_nbytes = dam_size; /*size of memory type */ - hsize_t p_nelmts = danelmts; /*total selected elmts */ - hsize_t elmtno; /*counter */ - int carry; /*counter carry value */ + } /* end if */ + else { /* possibly not enough memory, read/compare by hyperslabs */ + hsize_t elmtno; /* counter */ + int carry; /* counter carry value */ /* stripmine info */ - hsize_t sm_size[H5S_MAX_RANK]; /*stripmine size */ - hsize_t sm_nbytes; /*bytes per stripmine */ - hsize_t sm_nelmts; /*elements per stripmine*/ + hsize_t sm_size[H5S_MAX_RANK]; /* stripmine size */ + hsize_t sm_block[H5S_MAX_RANK]; /* stripmine block size */ + hsize_t sm_nbytes; /* bytes per stripmine */ + hsize_t sm_nelmts1; /* elements per stripmine */ + hsize_t sm_nelmts2; /* elements per stripmine */ + hssize_t ssm_nelmts; /* elements temp */ /* hyperslab info */ - hsize_t hs_offset[H5S_MAX_RANK]; /*starting offset */ - hsize_t hs_size[H5S_MAX_RANK]; /*size this pass */ - hsize_t hs_nelmts; /*elements in request */ - hsize_t zero[8]; /*vector of zeros */ + hsize_t hs_offset1[H5S_MAX_RANK]; /* starting offset */ + hsize_t hs_count1[H5S_MAX_RANK]; /* number of blocks */ + hsize_t hs_block1[H5S_MAX_RANK]; /* size of blocks */ + hsize_t hs_stride1[H5S_MAX_RANK]; /* stride */ + hsize_t hs_size1[H5S_MAX_RANK]; /* size this pass */ + hsize_t hs_offset2[H5S_MAX_RANK]; /* starting offset */ + hsize_t hs_count2[H5S_MAX_RANK]; /* number of blocks */ + hsize_t hs_block2[H5S_MAX_RANK]; /* size of blocks */ + hsize_t hs_stride2[H5S_MAX_RANK]; /* stride */ + hsize_t hs_size2[H5S_MAX_RANK]; /* size this pass */ + hsize_t hs_nelmts1 = 0; /* elements in request */ + hsize_t hs_nelmts2 = 0; /* elements in request */ + hsize_t zero[8]; /* vector of zeros */ + hsize_t low[H5S_MAX_RANK]; /* low bound of hyperslab */ + hsize_t high[H5S_MAX_RANK]; /* higher bound of hyperslab */ + + H5TOOLS_DEBUG("reclaim any VL memory and free unused buffers"); + if (buf1 != NULL) { + /* reclaim any VL memory, if necessary */ + if (vl_data1) + H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1); + HDfree(buf1); + buf1 = NULL; + } + if (buf2 != NULL) { + /* reclaim any VL memory, if necessary */ + if (vl_data2) + H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2); + HDfree(buf2); + buf2 = NULL; + } + + /* the stripmine loop */ + HDmemset(hs_offset1, 0, sizeof hs_offset1); + HDmemset(hs_stride1, 0, sizeof hs_stride1); + HDmemset(hs_count1, 0, sizeof hs_count1); + HDmemset(hs_block1, 0, sizeof hs_block1); + HDmemset(hs_size1, 0, sizeof hs_size1); + HDmemset(hs_offset2, 0, sizeof hs_offset2); + HDmemset(hs_stride2, 0, sizeof hs_stride2); + HDmemset(hs_count2, 0, sizeof hs_count2); + HDmemset(hs_block2, 0, sizeof hs_block2); + HDmemset(hs_size2, 0, sizeof hs_size2); + HDmemset(zero, 0, sizeof zero); + + /* if subsetting was requested - initialize the subsetting variables */ + H5TOOLS_DEBUG("compare by hyperslabs: opts->nelmts=%ld - opts->m_size=%ld", opts->nelmts, + opts->m_size); + if (opts->sset[0] != NULL) { + H5TOOLS_DEBUG("opts->sset[0] != NULL"); + + /* Check for valid settings - default if not specified */ + if (!opts->sset[0]->start.data || !opts->sset[0]->stride.data || !opts->sset[0]->count.data || + !opts->sset[0]->block.data) { + /* they didn't specify a ``stride'' or ``block''. default to 1 in all + * dimensions */ + if (!opts->sset[0]->start.data) { + /* default to (0, 0, ...) for the start coord */ + opts->sset[0]->start.data = (hsize_t *)HDcalloc((size_t)rank1, sizeof(hsize_t)); + opts->sset[0]->start.len = (unsigned)rank1; + } + + if (!opts->sset[0]->stride.data) { + opts->sset[0]->stride.data = (hsize_t *)HDcalloc((size_t)rank1, sizeof(hsize_t)); + opts->sset[0]->stride.len = (unsigned)rank1; + for (i = 0; i < rank1; i++) + opts->sset[0]->stride.data[i] = 1; + } + + if (!opts->sset[0]->count.data) { + opts->sset[0]->count.data = (hsize_t *)HDcalloc((size_t)rank1, sizeof(hsize_t)); + opts->sset[0]->count.len = (unsigned)rank1; + for (i = 0; i < rank1; i++) + opts->sset[0]->count.data[i] = 1; + } + + if (!opts->sset[0]->block.data) { + opts->sset[0]->block.data = (hsize_t *)HDcalloc((size_t)rank1, sizeof(hsize_t)); + opts->sset[0]->block.len = (unsigned)rank1; + for (i = 0; i < rank1; i++) + opts->sset[0]->block.data[i] = 1; + } + + /*------------------------------------------------------------------------- + * check for block overlap + *------------------------------------------------------------------------- + */ + for (i = 0; i < rank1; i++) { + if (opts->sset[0]->count.data[i] > 1) { + if (opts->sset[0]->stride.data[i] < opts->sset[0]->block.data[i]) { + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "wrong subset selection[0]; blocks overlap"); + } /* end if */ + } /* end if */ + } /* end for */ + } + + /* Reset the total number of elements to the subset from the command */ + opts->nelmts = 1; + for (i = 0; i < rank1; i++) { + hs_offset1[i] = opts->sset[0]->start.data[i]; + hs_stride1[i] = opts->sset[0]->stride.data[i]; + hs_count1[i] = opts->sset[0]->count.data[i]; + hs_block1[i] = opts->sset[0]->block.data[i]; + opts->nelmts *= hs_count1[i] * hs_block1[i]; + hs_size1[i] = 0; + H5TOOLS_DEBUG("[%d]hs_offset1:%ld, hs_stride1:%ld, hs_count1:%ld, hs_block1:%ld", i, + hs_offset1[i], hs_stride1[i], hs_count1[i], hs_block1[i]); + } + } + if (opts->sset[1] != NULL) { + H5TOOLS_DEBUG("opts->sset[1] != NULL"); + + /* Check for valid settings - default if not specified */ + if (!opts->sset[1]->start.data || !opts->sset[1]->stride.data || !opts->sset[1]->count.data || + !opts->sset[1]->block.data) { + /* they didn't specify a ``stride'' or ``block''. default to 1 in all + * dimensions */ + if (!opts->sset[1]->start.data) { + /* default to (0, 0, ...) for the start coord */ + opts->sset[1]->start.data = (hsize_t *)HDcalloc((size_t)rank2, sizeof(hsize_t)); + opts->sset[1]->start.len = (unsigned)rank2; + } + + if (!opts->sset[1]->stride.data) { + opts->sset[1]->stride.data = (hsize_t *)HDcalloc((size_t)rank2, sizeof(hsize_t)); + opts->sset[1]->stride.len = (unsigned)rank2; + for (i = 0; i < rank2; i++) + opts->sset[1]->stride.data[i] = 1; + } + + if (!opts->sset[1]->count.data) { + opts->sset[1]->count.data = (hsize_t *)HDcalloc((size_t)rank2, sizeof(hsize_t)); + opts->sset[1]->count.len = (unsigned)rank2; + for (i = 0; i < rank2; i++) + opts->sset[1]->count.data[i] = 1; + } + + if (!opts->sset[1]->block.data) { + opts->sset[1]->block.data = (hsize_t *)HDcalloc((size_t)rank2, sizeof(hsize_t)); + opts->sset[1]->block.len = (unsigned)rank2; + for (i = 0; i < rank2; i++) + opts->sset[1]->block.data[i] = 1; + } + + /*------------------------------------------------------------------------- + * check for block overlap + *------------------------------------------------------------------------- + */ + for (i = 0; i < rank2; i++) { + if (opts->sset[1]->count.data[i] > 1) { + if (opts->sset[1]->stride.data[i] < opts->sset[1]->block.data[i]) { + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "wrong subset selection[1]; blocks overlap"); + } /* end if */ + } /* end if */ + } /* end for */ + } + + for (i = 0; i < rank2; i++) { + hs_offset2[i] = opts->sset[1]->start.data[i]; + hs_stride2[i] = opts->sset[1]->stride.data[i]; + hs_count2[i] = opts->sset[1]->count.data[i]; + hs_block2[i] = opts->sset[1]->block.data[i]; + hs_size2[i] = 0; + H5TOOLS_DEBUG("[%d]hs_offset2:%ld, hs_stride2:%ld, hs_count2:%ld, hs_block2:%ld", i, + hs_offset2[i], hs_stride2[i], hs_count2[i], hs_block2[i]); + } + } /* * determine the strip mine size and allocate a buffer. The strip mine is * a hyperslab whose size is manageable. */ - sm_nbytes = p_type_nbytes; - - for (i = rank1; i > 0; --i) { - hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes; - - if (size == 0) /* datum size > H5TOOLS_BUFSIZE */ - size = 1; - sm_size[i - 1] = MIN(dadims[i - 1], size); - sm_nbytes *= sm_size[i - 1]; - H5TOOLS_DEBUG("sm_nbytes: %ld", sm_nbytes); - } /* end for */ - - /* malloc return code should be verified. - * If fail, need to handle the error. - * This else branch should be recoded as a separate function. - * Note that there are many "goto error" within this branch - * that fails to address freeing other objects created here. - * E.g., sm_space. - */ - if ((sm_buf1 = HDmalloc((size_t)sm_nbytes)) == NULL) - H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "HDmalloc failed"); - if ((sm_buf2 = HDmalloc((size_t)sm_nbytes)) == NULL) - H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "HDmalloc failed"); + sm_nbytes = opts->m_size; + if (opts->rank > 0) { + for (i = opts->rank; i > 0; --i) { + hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes; + if (size == 0) /* datum size > H5TOOLS_BUFSIZE */ + size = 1; + H5TOOLS_DEBUG("opts->dims[%d]: %ld - size: %ld", i - 1, opts->dims[i - 1], size); + if (opts->sset[1] != NULL) { + sm_size[i - 1] = MIN(hs_block1[i - 1] * hs_count1[i - 1], size); + sm_block[i - 1] = MIN(hs_block1[i - 1], sm_size[i - 1]); + } + else { + sm_size[i - 1] = MIN(opts->dims[i - 1], size); + sm_block[i - 1] = sm_size[i - 1]; + } + H5TOOLS_DEBUG("sm_size[%d]: %ld - sm_block:%ld", i - 1, sm_size[i - 1], sm_block[i - 1]); + sm_nbytes *= sm_size[i - 1]; + H5TOOLS_DEBUG("sm_nbytes: %ld", sm_nbytes); + } + } - sm_nelmts = sm_nbytes / p_type_nbytes; - sm_space = H5Screate_simple(1, &sm_nelmts, NULL); + H5TOOLS_DEBUG("opts->nelmts: %ld", opts->nelmts); + for (elmtno = 0; elmtno < opts->nelmts; elmtno += opts->hs_nelmts) { + H5TOOLS_DEBUG("elmtno: %ld - hs_nelmts1: %ld", elmtno, hs_nelmts1); - /* the stripmine loop */ - HDmemset(hs_offset, 0, sizeof hs_offset); - HDmemset(zero, 0, sizeof zero); + if (NULL == (sm_buf1 = (unsigned char *)HDmalloc((size_t)sm_nbytes))) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Could not allocate buffer for strip-mine"); + if (NULL == (sm_buf2 = (unsigned char *)HDmalloc((size_t)sm_nbytes))) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Could not allocate buffer for strip-mine"); - for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts) { /* calculate the hyperslab size */ - if (rank1 > 0) { - for (i = 0, hs_nelmts = 1; i < rank1; i++) { - hs_size[i] = MIN(dadims[i] - hs_offset[i], sm_size[i]); - hs_nelmts *= hs_size[i]; - } /* end for */ - if (H5Sselect_hyperslab(sid1, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) + /* initialize subset */ + if (opts->rank > 0) { + if (opts->sset[0] != NULL) { + H5TOOLS_DEBUG("sset1 has data"); + /* calculate the potential number of elements */ + for (i = 0; i < rank1; i++) { + H5TOOLS_DEBUG("[%d]opts->dims: %ld - hs_offset1: %ld - sm_block: %ld", i, + opts->dims[i], hs_offset1[i], sm_block[i]); + hs_size1[i] = MIN(opts->dims[i] - hs_offset1[i], sm_block[i]); + H5TOOLS_DEBUG("hs_size1[%d]: %ld", i, hs_size1[i]); + } + if (H5Sselect_hyperslab(sid1, H5S_SELECT_SET, hs_offset1, hs_stride1, hs_count1, + hs_size1) < 0) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Sselect_hyperslab sid1 failed"); + } + else { + for (i = 0, hs_nelmts1 = 1; i < rank1; i++) { + H5TOOLS_DEBUG("[%d]opts->dims: %ld - hs_offset1: %ld - sm_block: %ld", i, + opts->dims[i], hs_offset1[i], sm_block[i]); + hs_size1[i] = MIN(opts->dims[i] - hs_offset1[i], sm_block[i]); + H5TOOLS_DEBUG("hs_size1[%d]: %ld", i, hs_size1[i]); + hs_nelmts1 *= hs_size1[i]; + H5TOOLS_DEBUG("hs_nelmts1:%ld *= hs_size1[%d]: %ld", hs_nelmts1, i, hs_size1[i]); + } + if (H5Sselect_hyperslab(sid1, H5S_SELECT_SET, hs_offset1, NULL, hs_size1, NULL) < 0) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Sselect_hyperslab sid1 failed"); + } + + if ((ssm_nelmts = H5Sget_select_npoints(sid1)) < 0) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Sget_select_npoints failed"); + sm_nelmts1 = (hsize_t)ssm_nelmts; + H5TOOLS_DEBUG("sm_nelmts1: %ld", sm_nelmts1); + hs_nelmts1 = sm_nelmts1; + + if ((sm_space1 = H5Screate_simple(1, &sm_nelmts1, NULL)) < 0) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Screate_simple failed"); + + if (H5Sselect_hyperslab(sm_space1, H5S_SELECT_SET, zero, NULL, &sm_nelmts1, NULL) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Sselect_hyperslab failed"); - if (H5Sselect_hyperslab(sid2, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) - H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Sselect_hyperslab failed"); - if (H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0) + + if (opts->sset[1] != NULL) { + H5TOOLS_DEBUG("sset2 has data"); + for (i = 0; i < rank2; i++) { + H5TOOLS_DEBUG("[%d]opts->dims: %ld - hs_offset2: %ld - sm_block: %ld", i, + opts->dims[i], hs_offset2[i], sm_block[i]); + hs_size2[i] = MIN(opts->dims[i] - hs_offset2[i], sm_block[i]); + H5TOOLS_DEBUG("hs_size2[%d]: %ld", i, hs_size2[i]); + } + if (H5Sselect_hyperslab(sid2, H5S_SELECT_SET, hs_offset2, hs_stride2, hs_count2, + hs_size2) < 0) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Sselect_hyperslab sid2 failed"); + } + else { + for (i = 0, hs_nelmts2 = 1; i < rank2; i++) { + H5TOOLS_DEBUG("[%d]opts->dims: %ld - hs_offset2: %ld - sm_block: %ld", i, + opts->dims[i], hs_offset2[i], sm_block[i]); + hs_size2[i] = MIN(opts->dims[i] - hs_offset2[i], sm_block[i]); + H5TOOLS_DEBUG("hs_size2[%d]: %ld", i, hs_size2[i]); + hs_nelmts2 *= hs_size2[i]; + H5TOOLS_DEBUG("hs_nelmts2:%ld *= hs_size2[%d]: %ld", hs_nelmts2, i, hs_size2[i]); + } + if (H5Sselect_hyperslab(sid2, H5S_SELECT_SET, hs_offset2, NULL, hs_size2, NULL) < 0) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Sselect_hyperslab sid2 failed"); + } + + if ((ssm_nelmts = H5Sget_select_npoints(sid2)) < 0) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Sget_select_npoints failed"); + sm_nelmts2 = (hsize_t)ssm_nelmts; + H5TOOLS_DEBUG("sm_nelmts2: %ld", sm_nelmts2); + hs_nelmts2 = sm_nelmts2; + + if ((sm_space2 = H5Screate_simple(1, &sm_nelmts2, NULL)) < 0) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Screate_simple failed"); + + if (H5Sselect_hyperslab(sm_space2, H5S_SELECT_SET, zero, NULL, &sm_nelmts2, NULL) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Sselect_hyperslab failed"); - } /* end if */ + } else - hs_nelmts = 1; + hs_nelmts1 = 1; + opts->hs_nelmts = hs_nelmts1; + H5TOOLS_DEBUG("hs_nelmts: %ld", opts->hs_nelmts); - if (H5Dread(did1, m_tid1, sm_space, sid1, H5P_DEFAULT, sm_buf1) < 0) + /* read the data */ + if (H5Dread(did1, m_tid1, sm_space1, sid1, H5P_DEFAULT, sm_buf1) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Dread failed"); - if (H5Dread(did2, m_tid2, sm_space, sid2, H5P_DEFAULT, sm_buf2) < 0) + if (H5Dread(did2, m_tid2, sm_space2, sid2, H5P_DEFAULT, sm_buf2) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Dread failed"); + /* print array indices. get the lower bound of the hyperslab and calculate + the element position at the start of hyperslab */ + if (H5Sget_select_bounds(sid1, low, high) < 0) + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Sget_select_bounds failed"); + /* initialize the current stripmine position; this is necessary to print the array indices */ + for (j = 0; j < opts->rank; j++) + opts->sm_pos[j] = low[j]; + + /* Assume entire data space to be printed */ + init_acc_pos((unsigned)opts->rank, opts->dims, opts->acc, opts->pos, opts->p_min_idx); + /* get array differences. in the case of hyperslab read, increment the number of differences found in each hyperslab and pass the position at the beginning for printing */ - nfound += diff_array(sm_buf1, sm_buf2, hs_nelmts, elmtno, rank1, dadims, opts, name1, name2, - dam_tid, did1, did2); - - /* reclaim any VL memory, if necessary */ - if (vl_data1) - H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf1); - if (vl_data2) - H5Dvlen_reclaim(m_tid2, sm_space, H5P_DEFAULT, sm_buf2); + nfound += diff_array(sm_buf1, sm_buf2, opts, did1, did2); + + if (sm_buf1 != NULL) { + /* reclaim any VL memory, if necessary */ + if (vl_data1) + H5Dvlen_reclaim(m_tid1, sm_space1, H5P_DEFAULT, sm_buf1); + HDfree(sm_buf1); + sm_buf1 = NULL; + } + if (sm_buf2 != NULL) { + /* reclaim any VL memory, if necessary */ + if (vl_data2) + H5Dvlen_reclaim(m_tid2, sm_space2, H5P_DEFAULT, sm_buf2); + HDfree(sm_buf2); + sm_buf2 = NULL; + } + + H5Sclose(sm_space1); + H5Sclose(sm_space2); /* calculate the next hyperslab offset */ - for (i = rank1, carry = 1; i > 0 && carry; --i) { - hs_offset[i - 1] += hs_size[i - 1]; - if (hs_offset[i - 1] == dadims[i - 1]) - hs_offset[i - 1] = 0; + for (i = opts->rank, carry = 1; i > 0 && carry; --i) { + if (opts->sset[0] != NULL) { + H5TOOLS_DEBUG("[%d]hs_size1:%ld - hs_block1:%ld - hs_stride1:%ld", i - 1, + hs_size1[i - 1], hs_block1[i - 1], hs_stride1[i - 1]); + if (hs_size1[i - 1] >= hs_block1[i - 1]) { + hs_offset1[i - 1] += hs_size1[i - 1]; + } + else { + hs_offset1[i - 1] += hs_stride1[i - 1]; + } + } + else + hs_offset1[i - 1] += hs_size1[i - 1]; + H5TOOLS_DEBUG("[%d]hs_offset1:%ld - opts->dims:%ld", i - 1, hs_offset1[i - 1], + opts->dims[i - 1]); + if (hs_offset1[i - 1] >= opts->dims[i - 1]) + hs_offset1[i - 1] = 0; else carry = 0; - } /* i */ - } /* elmtno */ - if (sm_buf1 != NULL) { - HDfree(sm_buf1); - sm_buf1 = NULL; - } - if (sm_buf2 != NULL) { - HDfree(sm_buf2); - sm_buf2 = NULL; - } - - H5Sclose(sm_space); - } /* hyperslab read */ - H5TOOLS_DEBUG("can_compare complete"); + H5TOOLS_DEBUG("[%d]hs_offset1:%ld", i - 1, hs_offset1[i - 1]); + if (opts->sset[1] != NULL) { + H5TOOLS_DEBUG("[%d]hs_size2:%ld - hs_block2:%ld - hs_stride2:%ld", i - 1, + hs_size2[i - 1], hs_block2[i - 1], hs_stride2[i - 1]); + if (hs_size2[i - 1] >= hs_block2[i - 1]) { + hs_offset2[i - 1] += hs_size2[i - 1]; + } + else { + hs_offset2[i - 1] += hs_stride2[i - 1]; + } + } + else + hs_offset2[i - 1] += hs_size2[i - 1]; + H5TOOLS_DEBUG("[%d]hs_offset2:%ld - opts->dims:%ld", i - 1, hs_offset2[i - 1], + opts->dims[i - 1]); + if (hs_offset2[i - 1] >= opts->dims[i - 1]) + hs_offset2[i - 1] = 0; + H5TOOLS_DEBUG("[%d]hs_offset2:%ld", i - 1, hs_offset2[i - 1]); + } + } /* elmtno for loop */ + } /* hyperslab read */ + H5TOOLS_DEBUG("can compare complete"); } /*can_compare*/ /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ - H5TOOLS_DEBUG("reclaim any VL memory - errstat:%d", opts->err_stat); done: opts->err_stat = opts->err_stat | ret_value; + H5TOOLS_DEBUG("free names - errstat:%d", opts->err_stat); /* free */ + if (opts->obj_name[0] != NULL) + HDfree(opts->obj_name[0]); + opts->obj_name[0] = NULL; + if (opts->obj_name[1] != NULL) + HDfree(opts->obj_name[1]); + opts->obj_name[1] = NULL; + + H5TOOLS_DEBUG("reclaim any VL memory"); if (buf1 != NULL) { /* reclaim any VL memory, if necessary */ if (vl_data1) @@ -549,27 +882,32 @@ done: HDfree(buf2); buf2 = NULL; } + H5TOOLS_DEBUG("reclaim any stripmine VL memory"); if (sm_buf1 != NULL) { /* reclaim any VL memory, if necessary */ if (vl_data1) - H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf1); + H5Dvlen_reclaim(m_tid1, sm_space1, H5P_DEFAULT, sm_buf1); HDfree(sm_buf1); sm_buf1 = NULL; } if (sm_buf2 != NULL) { /* reclaim any VL memory, if necessary */ if (vl_data2) - H5Dvlen_reclaim(m_tid2, sm_space, H5P_DEFAULT, sm_buf2); + H5Dvlen_reclaim(m_tid2, sm_space2, H5P_DEFAULT, sm_buf2); HDfree(sm_buf2); sm_buf2 = NULL; } + H5TOOLS_DEBUG("close ids"); /* disable error reporting */ H5E_BEGIN_TRY { H5Sclose(sid1); H5Sclose(sid2); - H5Sclose(sm_space); + H5Sclose(sm_space1); + H5Sclose(sm_space2); + H5Pclose(dcpl1); + H5Pclose(dcpl2); H5Tclose(f_tid1); H5Tclose(f_tid2); H5Tclose(m_tid1); @@ -596,8 +934,7 @@ done: int diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, hsize_t *dims1, hsize_t *dims2, - hsize_t *maxdim1, hsize_t *maxdim2, const char *obj1_name, const char *obj2_name, - diff_opt_t *opts, int is_compound) + hsize_t *maxdim1, hsize_t *maxdim2, diff_opt_t *opts, int is_compound) { H5T_class_t tclass1; H5T_class_t tclass2; @@ -616,17 +953,19 @@ diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, hsize_t *dims1, if ((tclass2 = H5Tget_class(f_tid2)) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Tget_class second object failed"); + H5TOOLS_DEBUG("obj_names: %s - %s", opts->obj_name[0], opts->obj_name[1]); if (tclass1 != tclass2) { - if ((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { + if ((opts->mode_verbose || opts->mode_list_not_cmp) && opts->obj_name[0] && opts->obj_name[1]) { if (is_compound) { - parallel_print("Not comparable: <%s> has a class %s and <%s> has a class %s\n", obj1_name, - get_class(tclass1), obj2_name, get_class(tclass2)); + parallel_print("Not comparable: <%s> has a class %s and <%s> has a class %s\n", + opts->obj_name[0], get_class(tclass1), opts->obj_name[1], get_class(tclass2)); } else { - parallel_print("Not comparable: <%s> is of class %s and <%s> is of class %s\n", obj1_name, - get_class(tclass1), obj2_name, get_class(tclass2)); + parallel_print("Not comparable: <%s> is of class %s and <%s> is of class %s\n", + opts->obj_name[0], get_class(tclass1), opts->obj_name[1], get_class(tclass2)); } } + opts->not_cmp = 1; H5TOOLS_GOTO_DONE(0); } @@ -637,10 +976,11 @@ diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, hsize_t *dims1, */ switch (tclass1) { case H5T_TIME: - if ((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { - parallel_print("Not comparable: <%s> and <%s> are of class %s\n", obj1_name, obj2_name, - get_class(tclass2)); + if ((opts->mode_verbose || opts->mode_list_not_cmp) && opts->obj_name[0] && opts->obj_name[1]) { + parallel_print("Not comparable: <%s> and <%s> are of class %s\n", opts->obj_name[0], + opts->obj_name[1], get_class(tclass2)); } /* end if */ + opts->not_cmp = 1; H5TOOLS_GOTO_DONE(0); break; @@ -658,7 +998,7 @@ diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, hsize_t *dims1, case H5T_NO_CLASS: case H5T_NCLASSES: default: - H5TOOLS_DEBUG("diff_can_type class - %s", get_class(tclass1)); + H5TOOLS_DEBUG("class - %s", get_class(tclass1)); break; } /* end switch */ @@ -666,15 +1006,15 @@ diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, hsize_t *dims1, * check for equal file datatype; warning only *------------------------------------------------------------------------- */ - if ((H5Tequal(f_tid1, f_tid2) == 0) && (opts->m_verbose) && obj1_name && obj2_name) { + if ((H5Tequal(f_tid1, f_tid2) == 0) && (opts->mode_verbose) && opts->obj_name[0] && opts->obj_name[1]) { H5T_class_t cl = H5Tget_class(f_tid1); parallel_print("Warning: different storage datatype\n"); if (cl == H5T_INTEGER || cl == H5T_FLOAT) { - parallel_print("<%s> has file datatype ", obj1_name); + parallel_print("<%s> has file datatype ", opts->obj_name[0]); print_type(f_tid1); parallel_print("\n"); - parallel_print("<%s> has file datatype ", obj2_name); + parallel_print("<%s> has file datatype ", opts->obj_name[1]); print_type(f_tid2); parallel_print("\n"); } @@ -685,18 +1025,19 @@ diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, hsize_t *dims1, *------------------------------------------------------------------------- */ if (rank1 != rank2) { - if ((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { - parallel_print("Not comparable: <%s> has rank %d, dimensions ", obj1_name, rank1); + if ((opts->mode_verbose || opts->mode_list_not_cmp) && opts->obj_name[0] && opts->obj_name[1]) { + parallel_print("Not comparable: <%s> has rank %d, dimensions ", opts->obj_name[0], rank1); print_dimensions(rank1, dims1); parallel_print(", max dimensions "); print_dimensions(rank1, maxdim1); parallel_print("\n"); - parallel_print("and <%s> has rank %d, dimensions ", obj2_name, rank2); + parallel_print("and <%s> has rank %d, dimensions ", opts->obj_name[1], rank2); print_dimensions(rank2, dims2); parallel_print(", max dimensions "); print_dimensions(rank2, maxdim2); parallel_print("\n"); } + opts->not_cmp = 1; H5TOOLS_GOTO_DONE(0); } @@ -719,20 +1060,21 @@ diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, hsize_t *dims1, *------------------------------------------------------------------------- */ if (dim_diff == 1) { - if ((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { - parallel_print("Not comparable: <%s> has rank %d, dimensions ", obj1_name, rank1); + if ((opts->mode_verbose || opts->mode_list_not_cmp) && opts->obj_name[0] && opts->obj_name[1]) { + parallel_print("Not comparable: <%s> has rank %d, dimensions ", opts->obj_name[0], rank1); print_dimensions(rank1, dims1); if (maxdim1 && maxdim2) { parallel_print(", max dimensions "); print_dimensions(rank1, maxdim1); parallel_print("\n"); - parallel_print("and <%s> has rank %d, dimensions ", obj2_name, rank2); + parallel_print("and <%s> has rank %d, dimensions ", opts->obj_name[1], rank2); print_dimensions(rank2, dims2); parallel_print(", max dimensions "); print_dimensions(rank2, maxdim2); parallel_print("\n"); } } + opts->not_cmp = 1; H5TOOLS_GOTO_DONE(0); } @@ -741,13 +1083,13 @@ diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, hsize_t *dims1, * maximum dimensions; just give a warning *------------------------------------------------------------------------- */ - if (maxdim1 && maxdim2 && maxdim_diff == 1 && obj1_name) { - if (opts->m_verbose) { + if (maxdim1 && maxdim2 && maxdim_diff == 1 && opts->obj_name[0]) { + if (opts->mode_verbose) { parallel_print("Warning: different maximum dimensions\n"); - parallel_print("<%s> has max dimensions ", obj1_name); + parallel_print("<%s> has max dimensions ", opts->obj_name[0]); print_dimensions(rank1, maxdim1); parallel_print("\n"); - parallel_print("<%s> has max dimensions ", obj2_name); + parallel_print("<%s> has max dimensions ", opts->obj_name[1]); print_dimensions(rank2, maxdim2); parallel_print("\n"); } @@ -756,16 +1098,17 @@ diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, hsize_t *dims1, if (tclass1 == H5T_STRING) { htri_t vstrtype1 = -1; htri_t vstrtype2 = -1; - H5TOOLS_DEBUG("diff_can_type end - H5T_STRING"); + H5TOOLS_DEBUG(" - H5T_STRING"); vstrtype1 = H5Tis_variable_str(f_tid1); vstrtype2 = H5Tis_variable_str(f_tid2); /* no compare if either one but not both are variable string type */ if (vstrtype1 != vstrtype2) { - if ((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) - parallel_print("Not comparable: <%s> or <%s> is of mixed string type\n", obj1_name, - obj2_name); + if ((opts->mode_verbose || opts->mode_list_not_cmp) && opts->obj_name[0] && opts->obj_name[1]) + parallel_print("Not comparable: <%s> or <%s> is of mixed string type\n", opts->obj_name[0], + opts->obj_name[1]); + opts->not_cmp = 1; H5TOOLS_GOTO_DONE(0); } @@ -777,17 +1120,18 @@ diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, hsize_t *dims1, int j; hid_t memb_type1 = H5I_INVALID_HID; hid_t memb_type2 = H5I_INVALID_HID; - H5TOOLS_DEBUG("diff_can_type end - H5T_COMPOUND"); + H5TOOLS_DEBUG(" - H5T_COMPOUND"); nmembs1 = H5Tget_nmembers(f_tid1); nmembs2 = H5Tget_nmembers(f_tid2); if (nmembs1 != nmembs2) { - if ((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { - parallel_print("Not comparable: <%s> has %d members ", obj1_name, nmembs1); - parallel_print("<%s> has %d members ", obj2_name, nmembs2); + if ((opts->mode_verbose || opts->mode_list_not_cmp) && opts->obj_name[0] && opts->obj_name[1]) { + parallel_print("Not comparable: <%s> has %d members ", opts->obj_name[0], nmembs1); + parallel_print("<%s> has %d members ", opts->obj_name[1], nmembs2); parallel_print("\n"); } + opts->not_cmp = 1; H5TOOLS_GOTO_DONE(0); } @@ -796,8 +1140,8 @@ diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2, hsize_t *dims1, memb_type1 = H5Tget_member_type(f_tid1, (unsigned)j); memb_type2 = H5Tget_member_type(f_tid2, (unsigned)j); - if (diff_can_type(memb_type1, memb_type2, rank1, rank2, dims1, dims2, maxdim1, maxdim2, obj1_name, - obj2_name, opts, 1) != 1) { + if (diff_can_type(memb_type1, memb_type2, rank1, rank2, dims1, dims2, maxdim1, maxdim2, opts, + 1) != 1) { opts->not_cmp = 1; H5Tclose(memb_type1); H5Tclose(memb_type2); @@ -815,13 +1159,16 @@ done: return ret_value; } +#if defined(H5DIFF_DEBUG_UNUSED) +/* this function is not currently used, but could be useful */ /*------------------------------------------------------------------------- * Function: print_sizes * * Purpose: Print datatype sizes *------------------------------------------------------------------------- */ -#if defined(H5DIFF_DEBUG) +void print_sizes(const char *obj1, const char *obj2, hid_t f_tid1, hid_t f_tid2, hid_t m_tid1, hid_t m_tid2); + void print_sizes(const char *obj1, const char *obj2, hid_t f_tid1, hid_t f_tid2, hid_t m_tid1, hid_t m_tid2) { diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 4670aaf..f0ebbe7 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -28,57 +28,56 @@ int H5tools_INDENT_g = 0; #endif /* global variables */ -hid_t H5tools_ERR_STACK_g = 0; -hid_t H5tools_ERR_CLS_g = H5I_INVALID_HID; -hid_t H5E_tools_g = H5I_INVALID_HID; -hid_t H5E_tools_min_id_g = H5I_INVALID_HID; -hid_t H5E_tools_min_info_id_g = H5I_INVALID_HID; -hid_t H5E_tools_min_dbg_id_g = H5I_INVALID_HID; -int compound_data; -FILE * rawattrstream = NULL; /* should initialize to stdout but gcc moans about it */ -FILE * rawdatastream = NULL; /* should initialize to stdout but gcc moans about it */ -FILE * rawinstream = NULL; /* should initialize to stdin but gcc moans about it */ -FILE * rawoutstream = NULL; /* should initialize to stdout but gcc moans about it */ -FILE * rawerrorstream = NULL; /* should initialize to stderr but gcc moans about it */ -int bin_output; /* binary output */ -int bin_form = 0; /* binary form, default NATIVE */ -int region_output; /* region output */ -int oid_output; /* oid output */ -int data_output; /* data output */ -int attr_data_output; /* attribute data output */ -unsigned packed_bits_num; /* number of packed bits to display */ -unsigned packed_data_offset; /* offset of packed bits to display */ -unsigned packed_data_length; /* length of packed bits to display */ -unsigned long long packed_data_mask; /* mask in which packed bits to display */ -int enable_error_stack = 0; /* re-enable error stack; disable=0 enable=1 */ +H5E_auto2_t lib_func; +H5E_auto2_t tools_func; +void * lib_edata; +void * tools_edata; + +hid_t H5tools_ERR_STACK_g = H5I_INVALID_HID; +hid_t H5tools_ERR_CLS_g = H5I_INVALID_HID; +hid_t H5E_tools_g = H5I_INVALID_HID; +hid_t H5E_tools_min_id_g = H5I_INVALID_HID; +hid_t H5E_tools_min_info_id_g = H5I_INVALID_HID; +hid_t H5E_tools_min_dbg_id_g = H5I_INVALID_HID; + +FILE *rawattrstream = NULL; /* should initialize to stdout but gcc moans about it */ +FILE *rawdatastream = NULL; /* should initialize to stdout but gcc moans about it */ +FILE *rawinstream = NULL; /* should initialize to stdin but gcc moans about it */ +FILE *rawoutstream = NULL; /* should initialize to stdout but gcc moans about it */ +FILE *rawerrorstream = NULL; /* should initialize to stderr but gcc moans about it */ + +int bin_output; /* binary output */ +int bin_form = 0; /* binary form, default NATIVE */ +int region_output; /* region output */ +int oid_output; /* oid output */ +int data_output; /* data output */ +int attr_data_output; /* attribute data output */ +int compound_data; + +unsigned packed_bits_num; /* number of packed bits to display */ +unsigned packed_data_offset; /* offset of packed bits to display */ +unsigned packed_data_length; /* length of packed bits to display */ +unsigned long long packed_data_mask; /* mask in which packed bits to display */ + +int enable_error_stack = 0; /* re-enable error stack; disable=0 enable=1 */ /* sort parameters */ -H5_index_t sort_by = H5_INDEX_NAME; /*sort_by [creation_order | name] */ -H5_iter_order_t sort_order = H5_ITER_INC; /*sort_order [ascending | descending] */ +H5_index_t sort_by = H5_INDEX_NAME; /* sort_by [creation_order | name] */ +H5_iter_order_t sort_order = H5_ITER_INC; /* sort_order [ascending | descending] */ /* module-scoped variables */ static int h5tools_init_g; /* if h5tools lib has been initialized */ -/* Names of VFDs */ -static const char *drivernames[] = { - "sec2", "family", "split", "multi", -#ifdef H5_HAVE_PARALLEL - "mpio", -#endif /* H5_HAVE_PARALLEL */ +/* Names of VFDs. These names are always available so that + * the tools can emit special messages when a VFD is asked + * for by name but is not compiled into the library or is + * somehow otherwise not enabled. + * + */ +const char *drivernames[] = { + "sec2", "direct", "log", "windows", "stdio", "core", "family", "split", "multi", "mpio", "ros3", "hdfs", }; -/* This enum should match the entries in the above drivers_list since they - * are indexes into the drivers_list array. */ -typedef enum { - SEC2_IDX = 0, - FAMILY_IDX, - SPLIT_IDX, - MULTI_IDX -#ifdef H5_HAVE_PARALLEL - , - MPIO_IDX -#endif /* H5_HAVE_PARALLEL */ -} driver_idx; #define NUM_DRIVERS (sizeof(drivernames) / sizeof(drivernames[0])) /*------------------------------------------------------------------------- @@ -94,6 +93,10 @@ typedef enum { void h5tools_init(void) { + /* Disable error reporting */ + H5Eget_auto2(H5E_DEFAULT, &lib_func, &lib_edata); + H5Eset_auto2(H5E_DEFAULT, NULL, NULL); + if (!h5tools_init_g) { H5TOOLS_INIT_ERROR(); @@ -112,6 +115,29 @@ h5tools_init(void) h5tools_init_g++; } + + /* Disable tools error reporting */ + H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); + H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); +} + +/*------------------------------------------------------------------------- + * Function: h5tools_error_report + * + * Purpose: Enable error stack reporting after command line is parsed. + * + * Return: None + *------------------------------------------------------------------------- + */ +void +h5tools_error_report(void) +{ + if (h5tools_init_g) { + if (enable_error_stack > 0) { + H5Eset_auto2(H5E_DEFAULT, lib_func, lib_edata); + H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); + } + } } /*------------------------------------------------------------------------- @@ -128,16 +154,14 @@ h5tools_init(void) void h5tools_close(void) { - H5E_auto2_t tools_func; - void * tools_edata; if (h5tools_init_g) { /* special case where only data is output to stdout */ if ((rawoutstream == NULL) && rawdatastream && (rawdatastream == stdout)) HDfprintf(rawdatastream, "\n"); - H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); - if (tools_func != NULL) + if (tools_func) H5Eprint2(H5tools_ERR_STACK_g, rawerrorstream); + if (rawattrstream && rawattrstream != stdout) { if (fclose(rawattrstream)) perror("closing rawattrstream"); @@ -172,6 +196,10 @@ h5tools_close(void) /* Clean up the reference path table, if it's been used */ term_ref_path_table(); + /* Restore error stacks from init */ + H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); + H5Eset_auto2(H5E_DEFAULT, lib_func, lib_edata); + H5TOOLS_CLOSE_ERROR(); /* Shut down the library */ @@ -422,186 +450,364 @@ h5tools_set_error_file(const char *fname, int is_bin) } /*------------------------------------------------------------------------- - * Function: h5tools_get_fapl + * Function: h5tools_set_fapl_vfd * - * Purpose: Get a FAPL for a given VFL driver name. + * Purpose: Given a VFL driver name, sets the appropriate driver on the + * specified FAPL. * * Return: positive - succeeded * negative - failed *------------------------------------------------------------------------- */ -static hid_t -h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) +static herr_t +h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info) { - hid_t new_fapl = H5I_INVALID_HID; /* Copy of file access property list passed in, or new property list */ herr_t ret_value = SUCCEED; - /* Make a copy of the FAPL, for the file open call to use, eventually */ - if (fapl == H5P_DEFAULT) { - if ((new_fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - H5TOOLS_GOTO_ERROR(FAIL, "H5Pcreate failed"); - } /* end if */ - else { - if ((new_fapl = H5Pcopy(fapl)) < 0) - H5TOOLS_GOTO_ERROR(FAIL, "H5Pcopy failed"); - } /* end else */ - - /* Determine which driver the user wants to open the file with. Try - * that driver. If it can't open it, then fail. */ - if (!HDstrcmp(driver, drivernames[SEC2_IDX])) { - /* SEC2 driver */ - if (H5Pset_fapl_sec2(new_fapl) < 0) + /* Determine which driver the user wants to open the file with */ + if (!HDstrcmp(vfd_info->name, drivernames[SEC2_VFD_IDX])) { + /* SEC2 Driver */ + if (H5Pset_fapl_sec2(fapl_id) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_sec2 failed"); + } + else if (!HDstrcmp(vfd_info->name, drivernames[DIRECT_VFD_IDX])) { +#ifdef H5_HAVE_DIRECT + /* Direct Driver */ + if (H5Pset_fapl_direct(fapl_id, 1024, 4096, 8 * 4096) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_direct failed"); +#else + H5TOOLS_GOTO_ERROR(FAIL, "Direct VFD is not enabled"); +#endif + } + else if (!HDstrcmp(vfd_info->name, drivernames[LOG_VFD_IDX])) { + unsigned long long log_flags = H5FD_LOG_LOC_IO | H5FD_LOG_ALLOC; - if (drivernum) - *drivernum = SEC2_IDX; + /* Log Driver */ + if (H5Pset_fapl_log(fapl_id, NULL, log_flags, (size_t)0) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_log failed"); } - else if (!HDstrcmp(driver, drivernames[FAMILY_IDX])) { + else if (!HDstrcmp(vfd_info->name, drivernames[WINDOWS_VFD_IDX])) { +#ifdef H5_HAVE_WINDOWS + /* There is no Windows VFD - use SEC2 */ + if (H5Pset_fapl_sec2(fapl_id) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_sec2 failed"); +#else + H5TOOLS_GOTO_ERROR(FAIL, "Windows VFD is not enabled"); +#endif + } + else if (!HDstrcmp(vfd_info->name, drivernames[STDIO_VFD_IDX])) { + /* Stdio Driver */ + if (H5Pset_fapl_stdio(fapl_id) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_stdio failed"); + } + else if (!HDstrcmp(vfd_info->name, drivernames[CORE_VFD_IDX])) { + /* Core Driver */ + if (H5Pset_fapl_core(fapl_id, (size_t)H5_MB, TRUE) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_core failed"); + } + else if (!HDstrcmp(vfd_info->name, drivernames[FAMILY_VFD_IDX])) { /* FAMILY Driver */ - /* Set member size to be 0 to indicate the current first member size * is the member size. */ - if (H5Pset_fapl_family(new_fapl, (hsize_t)0, H5P_DEFAULT) < 0) + if (H5Pset_fapl_family(fapl_id, (hsize_t)0, H5P_DEFAULT) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_family failed"); - - if (drivernum) - *drivernum = FAMILY_IDX; } - else if (!HDstrcmp(driver, drivernames[SPLIT_IDX])) { + else if (!HDstrcmp(vfd_info->name, drivernames[SPLIT_VFD_IDX])) { /* SPLIT Driver */ - if (H5Pset_fapl_split(new_fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT) < 0) + if (H5Pset_fapl_split(fapl_id, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_split failed"); - - if (drivernum) - *drivernum = SPLIT_IDX; } - else if (!HDstrcmp(driver, drivernames[MULTI_IDX])) { + else if (!HDstrcmp(vfd_info->name, drivernames[MULTI_VFD_IDX])) { /* MULTI Driver */ - if (H5Pset_fapl_multi(new_fapl, NULL, NULL, NULL, NULL, TRUE) < 0) + if (H5Pset_fapl_multi(fapl_id, NULL, NULL, NULL, NULL, TRUE) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_multi failed"); - - if (drivernum) - *drivernum = MULTI_IDX; } + else if (!HDstrcmp(vfd_info->name, drivernames[MPIO_VFD_IDX])) { #ifdef H5_HAVE_PARALLEL - else if (!HDstrcmp(driver, drivernames[MPIO_IDX])) { int mpi_initialized, mpi_finalized; /* MPI-I/O Driver */ + /* check if MPI is available. */ MPI_Initialized(&mpi_initialized); MPI_Finalized(&mpi_finalized); if (mpi_initialized && !mpi_finalized) { - if (H5Pset_fapl_mpio(new_fapl, MPI_COMM_WORLD, MPI_INFO_NULL) < 0) + if (H5Pset_fapl_mpio(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_mpio failed"); - if (drivernum) - *drivernum = MPIO_IDX; - } /* end if */ - } + } +#else + H5TOOLS_GOTO_ERROR(FAIL, "MPI-I/O VFD is not enabled"); #endif /* H5_HAVE_PARALLEL */ + } + else if (!HDstrcmp(vfd_info->name, drivernames[ROS3_VFD_IDX])) { +#ifdef H5_HAVE_ROS3_VFD + if (!vfd_info->info) + H5TOOLS_GOTO_ERROR(FAIL, "Read-only S3 VFD info is invalid"); + if (H5Pset_fapl_ros3(fapl_id, (H5FD_ros3_fapl_t *)vfd_info->info) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_ros3() failed"); +#else + H5TOOLS_GOTO_ERROR(FAIL, "Read-only S3 VFD is not enabled"); +#endif + } + else if (!HDstrcmp(vfd_info->name, drivernames[HDFS_VFD_IDX])) { +#ifdef H5_HAVE_LIBHDFS + if (!vfd_info->info) + H5TOOLS_GOTO_ERROR(FAIL, "HDFS VFD info is invalid"); + if (H5Pset_fapl_hdfs(fapl_id, (H5FD_hdfs_fapl_t *)vfd_info->info) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_hdfs() failed"); +#else + H5TOOLS_GOTO_ERROR(FAIL, "The HDFS VFD is not enabled"); +#endif + } else - ret_value = -1; + H5TOOLS_GOTO_ERROR(FAIL, "invalid VFD name"); done: - if ((new_fapl != H5P_DEFAULT) && (ret_value < 0)) { - H5Pclose(new_fapl); - new_fapl = H5I_INVALID_HID; + return ret_value; +} + +/*------------------------------------------------------------------------- + * Function: h5tools_get_fapl + * + * Purpose: Copies an input fapl and then sets a VFD on it. + * + * The returned fapl must be closed by the caller. + * + * Return: positive - succeeded + * negative - failed + *------------------------------------------------------------------------- + */ +hid_t +h5tools_get_fapl(hid_t prev_fapl_id, h5tools_vfd_info_t *vfd_info) +{ + hid_t new_fapl_id = H5I_INVALID_HID; + hid_t ret_value = H5I_INVALID_HID; + + if (prev_fapl_id < 0) + H5TOOLS_GOTO_ERROR(FAIL, "invalid FAPL"); + + /* Make a copy of the FAPL or create one if H5P_DEFAULT is specified. */ + if (H5P_DEFAULT == prev_fapl_id) { + if ((new_fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "H5Pcreate failed"); + } + else { + if ((new_fapl_id = H5Pcopy(prev_fapl_id)) < 0) + H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "H5Pcopy failed"); + } + + /* Set non-default virtual file driver, if requested */ + if (vfd_info) + if (h5tools_set_fapl_vfd(new_fapl_id, vfd_info) < 0) + H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "failed to set VFD on FAPL"); + + ret_value = new_fapl_id; + +done: + if ((new_fapl_id >= 0) && (ret_value < 0)) { + H5Pclose(new_fapl_id); + new_fapl_id = H5I_INVALID_HID; + } + + return ret_value; +} + +/*------------------------------------------------------------------------- + * Function: h5tools_get_vfd_name + * + * Purpose: Given a FAPL, retrieves the name of the VFL driver set on it + * if using a native-terminal VOL connector. If a + * non-native-terminal VOL connector is set on the FAPL, the + * first byte of the returned driver name will be set to the null + * terminator. + * + * Return: SUCCEED/FAIL + *------------------------------------------------------------------------- + */ +herr_t +h5tools_get_vfd_name(hid_t fapl_id, char *drivername, size_t drivername_size) +{ + herr_t ret_value = SUCCEED; + + if (fapl_id < 0) + H5TOOLS_GOTO_ERROR(FAIL, "invalid FAPL"); + if (!drivername) + H5TOOLS_GOTO_ERROR(FAIL, "drivername is NULL"); + if (drivername && !drivername_size) + H5TOOLS_GOTO_ERROR(FAIL, "drivername_size must be non-zero"); + + /* Initialize the driver name */ + drivername[0] = '\0'; + + if (fapl_id == H5P_DEFAULT) + fapl_id = H5P_FILE_ACCESS_DEFAULT; + + if (fapl_id >= 0) { + const char *driver_name; + hid_t driver_id; + + if ((driver_id = H5Pget_driver(fapl_id)) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "failed to retrieve VFL driver ID from FAPL"); + + if (driver_id == H5FD_SEC2) + driver_name = drivernames[SEC2_VFD_IDX]; +#ifdef H5_HAVE_DIRECT + else if (driver_id == H5FD_DIRECT) + driver_name = drivernames[DIRECT_VFD_IDX]; +#endif + else if (driver_id == H5FD_LOG) + driver_name = drivernames[LOG_VFD_IDX]; +#ifdef H5_HAVE_WINDOWS + else if (driver_id == H5FD_WINDOWS) + driver_name = drivernames[WINDOWS_VFD_IDX]; +#endif + else if (driver_id == H5FD_STDIO) + driver_name = drivernames[STDIO_VFD_IDX]; + else if (driver_id == H5FD_CORE) + driver_name = drivernames[CORE_VFD_IDX]; + else if (driver_id == H5FD_FAMILY) + driver_name = drivernames[FAMILY_VFD_IDX]; + else if (driver_id == H5FD_MULTI) + driver_name = drivernames[MULTI_VFD_IDX]; +#ifdef H5_HAVE_PARALLEL + else if (driver_id == H5FD_MPIO) + driver_name = drivernames[MPIO_VFD_IDX]; +#endif +#ifdef H5_HAVE_ROS3_VFD + else if (driver_id == H5FD_ROS3) + driver_name = drivernames[ROS3_VFD_IDX]; +#endif +#ifdef H5_HAVE_LIBHDFS + else if (driver_id == H5FD_HDFS) + driver_name = drivernames[HDFS_VFD_IDX]; +#endif + else + driver_name = "unknown"; + + HDstrncpy(drivername, driver_name, drivername_size); + drivername[drivername_size - 1] = '\0'; } - return (new_fapl); +done: + + return ret_value; } /*------------------------------------------------------------------------- * Function: h5tools_fopen * - * Purpose: Loop through the various types of VFL drivers trying to open FNAME. - * If the HDF5 library is version 1.2 or less, then we have only the SEC2 - * driver to try out. If the HDF5 library is greater than version 1.2, - * then we have the FAMILY, SPLIT, and MULTI drivers to play with. + * Purpose: Opens file FNAME using the specified flags and FAPL. + * + * The 'use_specific_driver' parameter is used to control the + * VFD connector that this routine uses to open the file + * with. If 'use_specific_driver' is set to TRUE, this routine + * assumes that the caller has already set a specific VFD + * connector on the given FAPL and will attempt to directly use + * the FAPL for opening the file. We assume that the caller knows + * what they are doing; if the file is unable to be opened using + * that FAPL, this routine will return H5I_INVALID_HID. * - * If DRIVER is non-NULL, then it will try to open the file with that - * driver first. We assume that the user knows what they are doing so, if - * we fail, then we won't try other file drivers. + * However, if 'use_specific_driver' is set to FALSE, this + * routine assumes that the caller HAS NOT set a specific VFD + * connector on the given FAPL and will instead loop through + * the various available VFL drivers and VOL connectors trying to + * open FNAME. + * + * The list of available VFL drivers is as follows: + * - If the HDF5 library is version 1.2 or less, then we have + * only the SEC2 driver to try out. + * - If the HDF5 library is greater than version 1.2, then we + * have the FAMILY, SPLIT, and MULTI drivers to play with. * * Return: - * On success, returns a file id for the opened file. If DRIVERNAME is + * On success, returns a file ID for the opened file. If DRIVERNAME is * non-null then the first DRIVERNAME_SIZE-1 characters of the driver * name are copied into the DRIVERNAME array and null terminated. * - * Otherwise, the function returns FAIL. If DRIVERNAME is non-null then - * the first byte is set to the null terminator. + * On failure, the function returns H5I_INVALID_HID and DRIVERNAME + * will not be set. *------------------------------------------------------------------------- */ hid_t -h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, const char *driver, char *drivername, +h5tools_fopen(const char *fname, unsigned flags, hid_t fapl_id, hbool_t use_specific_driver, char *drivername, size_t drivername_size) { + hid_t fid = H5I_INVALID_HID; + hid_t tmp_fapl_id = H5I_INVALID_HID; + hid_t used_fapl_id = H5I_INVALID_HID; unsigned drivernum; - hid_t fid = FAIL; - hid_t my_fapl = H5P_DEFAULT; - - if (driver && *driver) { - /* Get the correct FAPL for the given driver */ - if ((my_fapl = h5tools_get_fapl(fapl, driver, &drivernum)) < 0) - goto done; + hid_t ret_value = H5I_INVALID_HID; - /* allow error stack display if enable-error-stack has optional arg number */ - if (enable_error_stack > 1) { - fid = H5Fopen(fname, flags, my_fapl); - } - else { - H5E_BEGIN_TRY { fid = H5Fopen(fname, flags, my_fapl); } - H5E_END_TRY; - } + /* + * First try to open the file using just the given FAPL. + */ - if (fid == FAIL) - goto done; + /* Allow error stack display if --enable-error-stack has optional arg number */ + if (enable_error_stack > 1) { + fid = H5Fopen(fname, flags, fapl_id); } else { - /* Try to open the file using each of the drivers */ - for (drivernum = 0; drivernum < NUM_DRIVERS; drivernum++) { - /* Get the correct FAPL for the given driver */ - if ((my_fapl = h5tools_get_fapl(fapl, drivernames[drivernum], NULL)) < 0) - goto done; - - /* allow error stack display if enable-error-stack has optional arg number */ - if (enable_error_stack > 1) { - fid = H5Fopen(fname, flags, my_fapl); - } - else { - H5E_BEGIN_TRY { fid = H5Fopen(fname, flags, my_fapl); } - H5E_END_TRY; - } + H5E_BEGIN_TRY { fid = H5Fopen(fname, flags, fapl_id); } + H5E_END_TRY; + } - if (fid != FAIL) - break; - else { - /* Close the FAPL */ - H5Pclose(my_fapl); - my_fapl = H5P_DEFAULT; - } /* end else */ - } + /* If we succeeded in opening the file, we're done. */ + if (fid >= 0) { + used_fapl_id = fapl_id; + H5TOOLS_GOTO_DONE(fid); } - /* Save the driver name */ - if (drivername && drivername_size) { - if (fid != FAIL) { - HDstrncpy(drivername, drivernames[drivernum], drivername_size); - drivername[drivername_size - 1] = '\0'; + /* + * If we failed to open the file and the caller specified 'use_specific_driver' + * as TRUE, we should return failure now since the file couldn't be opened with + * the VFL driver that was set on the FAPL by the caller. + */ + if (fid < 0 && use_specific_driver) + H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "failed to open file using specified FAPL"); + + for (drivernum = 0; drivernum < NUM_DRIVERS; drivernum++) { + h5tools_vfd_info_t vfd_info; + + /* Skip the log VFD as it prints out to standard out + * and is fundamentally SEC2 anyway. + */ + if (drivernum == LOG_VFD_IDX) + continue; + + vfd_info.info = NULL; + vfd_info.name = drivernames[drivernum]; + + /* Get a fapl reflecting the selected VFD */ + if ((tmp_fapl_id = h5tools_get_fapl(fapl_id, &vfd_info)) < 0) + continue; + + /* Can we open the file with this combo? */ + if ((fid = h5tools_fopen(fname, flags, tmp_fapl_id, TRUE, drivername, drivername_size)) >= 0) { + used_fapl_id = tmp_fapl_id; + H5TOOLS_GOTO_DONE(fid); } else { - /*no file opened*/ - drivername[0] = '\0'; + /* Close the temporary fapl */ + H5Pclose(tmp_fapl_id); + tmp_fapl_id = H5I_INVALID_HID; } } + /* File was unable to be opened at all */ + ret_value = H5I_INVALID_HID; + done: - if (my_fapl != H5P_DEFAULT) - H5Pclose(my_fapl); + /* Save the driver name */ + if (drivername && drivername_size && ret_value >= 0) + if (used_fapl_id >= 0 && h5tools_get_vfd_name(used_fapl_id, drivername, drivername_size) < 0) + H5TOOLS_ERROR(H5I_INVALID_HID, "failed to retrieve name of VFD used to open file"); - return fid; + if (tmp_fapl_id >= 0) + H5Pclose(tmp_fapl_id); + + return ret_value; } /*------------------------------------------------------------------------- @@ -757,7 +963,7 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_context H5TOOLS_DEBUG("after CR elmtno=%ld, ctx->ndims=%d", elmtno, ctx->ndims); /* Calculate new prefix */ - h5tools_str_prefix(&prefix, info, elmtno, ctx->ndims, ctx); + h5tools_str_prefix(&prefix, info, elmtno, ctx); H5TOOLS_DEBUG("prefix=%s - str=%s", prefix.s, str.s); /* Write new prefix to output */ @@ -849,7 +1055,7 @@ h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_ } /* Calculate new prefix */ - h5tools_str_region_prefix(&prefix, info, elmtno, ptdata, ctx->ndims, ctx->p_max_idx, ctx); + h5tools_str_region_prefix(&prefix, info, elmtno, ptdata, ctx); /* Write new prefix to output */ if (ctx->indent_level > 0) @@ -1224,27 +1430,65 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools *------------------------------------------------------------------------- */ void -init_acc_pos(h5tools_context_t *ctx, hsize_t *dims) +init_acc_pos(unsigned ndims, hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t *p_min_idx) { int i; unsigned j; H5TOOLS_START_DEBUG(""); - if (ctx->ndims > 0) { - ctx->acc[ctx->ndims - 1] = 1; - for (i = ((int)ctx->ndims - 2); i >= 0; i--) { - ctx->acc[i] = ctx->acc[i + 1] * dims[i + 1]; - H5TOOLS_DEBUG("ctx->acc[%d]=%ld", i, ctx->acc[i]); + for (i = 0; (unsigned)i < ndims; i++) + p_min_idx[i] = 0; + + if (ndims > 0) { + acc[ndims - 1] = 1; + for (i = ((int)ndims - 2); i >= 0; i--) { + acc[i] = acc[i + 1] * dims[i + 1]; + H5TOOLS_DEBUG("acc[%d]=%ld", i, acc[i]); } - for (j = 0; j < ctx->ndims; j++) - ctx->pos[j] = 0; + for (j = 0; j < ndims; j++) + pos[j] = 0; } H5TOOLS_ENDDEBUG(""); } /*------------------------------------------------------------------------- + * Function: calc_acc_pos + * + * Purpose: Calculate the number of elements represented by a unit change + * in a certain index position. + * + * Return: void + *------------------------------------------------------------------------- + */ +hsize_t +calc_acc_pos(unsigned ndims, hsize_t elmtno, hsize_t *acc, hsize_t *pos) +{ + int i; + hsize_t curr_pos = elmtno; + + H5TOOLS_START_DEBUG(""); + + if (ndims > 0) { + for (i = 0; i < (int)ndims; i++) { + if (curr_pos > 0) { + H5TOOLS_DEBUG("curr_pos=%ld - ctx->acc[%d]=%ld", curr_pos, i, acc[i]); + pos[i] = curr_pos / acc[i]; + curr_pos -= acc[i] * pos[i]; + } + else + pos[i] = 0; + H5TOOLS_DEBUG("curr_pos=%ld - pos[%d]=%ld - acc[%d]=%ld", curr_pos, i, pos[i], i, acc[i]); + } + } + + H5TOOLS_ENDDEBUG(""); + + return curr_pos; +} + +/*------------------------------------------------------------------------- * Function: render_bin_output * * Purpose: Write one element of memory buffer to a binary file stream @@ -1435,7 +1679,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t H5Sclose(region_space); } /* end if (region_space >= 0) */ H5Dclose(region_id); - } /* end if (region_id >= 0) */ + } } } /* end if (region_output... */ } diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index df00067..10acea3 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, July 23, 1998 * * Purpose: Support functions for the various tools. @@ -521,20 +521,56 @@ typedef struct h5tools_context_t { int display_char; /* */ } h5tools_context_t; +/* VFD info structs used to set the file access property + * lists in the tools. + */ + +typedef struct h5tools_vfd_info_t { + + /* Pointer to information to be passed to the driver for its setup */ + const void *info; + + /* Name of the VFD */ + const char *name; +} h5tools_vfd_info_t; + +/* This enum should match the entries in the above 'drivernames' + * since they are indices into the 'drivernames' array. */ +typedef enum { + SEC2_VFD_IDX = 0, + DIRECT_VFD_IDX, + LOG_VFD_IDX, + WINDOWS_VFD_IDX, + STDIO_VFD_IDX, + CORE_VFD_IDX, + FAMILY_VFD_IDX, + SPLIT_VFD_IDX, + MULTI_VFD_IDX, + MPIO_VFD_IDX, + ROS3_VFD_IDX, + HDFS_VFD_IDX, +} driver_idx; + /* The following include, h5tools_str.h, must be after the * above stucts are defined. There is a dependency in the following * include that hasn't been identified yet. */ #include "h5tools_str.h" -H5TOOLS_DLLVAR h5tool_format_t h5tools_dataformat; -H5TOOLS_DLLVAR const h5tools_dump_header_t h5tools_standardformat; -H5TOOLS_DLLVAR const h5tools_dump_header_t *h5tools_dump_header_format; - #ifdef __cplusplus extern "C" { #endif +H5TOOLS_DLLVAR const char *drivernames[]; + +H5TOOLS_DLLVAR h5tool_format_t h5tools_dataformat; +H5TOOLS_DLLVAR const h5tools_dump_header_t h5tools_standardformat; +H5TOOLS_DLLVAR const h5tools_dump_header_t *h5tools_dump_header_format; +H5TOOLS_DLLVAR H5E_auto2_t lib_func; +H5TOOLS_DLLVAR H5E_auto2_t tools_func; +H5TOOLS_DLLVAR void * lib_edata; +H5TOOLS_DLLVAR void * tools_edata; + H5TOOLS_DLLVAR unsigned packed_bits_num; /* number of packed bits to display */ H5TOOLS_DLLVAR unsigned packed_data_offset; /* offset of packed bits to display */ H5TOOLS_DLLVAR unsigned packed_data_length; /* length of packed bits to display */ @@ -566,21 +602,27 @@ H5TOOLS_DLLVAR int enable_error_stack; /* re-enable error stack; disable=0 enabl #define H5_TOOLS_UNKNOWN "UNKNOWN" /* Definitions of useful routines */ -H5TOOLS_DLL void h5tools_init(void); -H5TOOLS_DLL void h5tools_close(void); -H5TOOLS_DLL int h5tools_set_data_output_file(const char *fname, int is_bin); -H5TOOLS_DLL int h5tools_set_attr_output_file(const char *fname, int is_bin); -H5TOOLS_DLL int h5tools_set_input_file(const char *fname, int is_bin); -H5TOOLS_DLL int h5tools_set_output_file(const char *fname, int is_bin); -H5TOOLS_DLL int h5tools_set_error_file(const char *fname, int is_bin); -H5TOOLS_DLL hid_t h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, const char *driver, - char *drivername, size_t drivername_len); +H5TOOLS_DLL void h5tools_init(void); +H5TOOLS_DLL void h5tools_close(void); + +H5TOOLS_DLL void h5tools_error_report(void); +H5TOOLS_DLL int h5tools_set_data_output_file(const char *fname, int is_bin); +H5TOOLS_DLL int h5tools_set_attr_output_file(const char *fname, int is_bin); +H5TOOLS_DLL int h5tools_set_input_file(const char *fname, int is_bin); +H5TOOLS_DLL int h5tools_set_output_file(const char *fname, int is_bin); +H5TOOLS_DLL int h5tools_set_error_file(const char *fname, int is_bin); + +H5TOOLS_DLL hid_t h5tools_get_fapl(hid_t prev_fapl_id, h5tools_vfd_info_t *vfd_info); +H5TOOLS_DLL herr_t h5tools_get_vfd_name(hid_t fapl_id, char *drivername, size_t drivername_size); +H5TOOLS_DLL hid_t h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, hbool_t use_specific_driver, + char *drivername, size_t drivername_size); H5TOOLS_DLL hid_t h5tools_get_little_endian_type(hid_t type); H5TOOLS_DLL hid_t h5tools_get_big_endian_type(hid_t type); H5TOOLS_DLL htri_t h5tools_detect_vlen(hid_t tid); H5TOOLS_DLL htri_t h5tools_detect_vlen_str(hid_t tid); H5TOOLS_DLL hbool_t h5tools_is_obj_same(hid_t loc_id1, const char *name1, hid_t loc_id2, const char *name2); -H5TOOLS_DLL void init_acc_pos(h5tools_context_t *ctx, hsize_t *dims); +H5TOOLS_DLL void init_acc_pos(unsigned ndims, hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t *p_min_idx); +H5TOOLS_DLL hsize_t calc_acc_pos(unsigned ndims, hsize_t elemtno, hsize_t *acc, hsize_t *pos); H5TOOLS_DLL hbool_t h5tools_is_zero(const void *_mem, size_t size); H5TOOLS_DLL int h5tools_canreadf(const char *name, hid_t dcpl_id); H5TOOLS_DLL int h5tools_can_encode(H5Z_filter_t filtn); @@ -607,12 +649,9 @@ H5TOOLS_DLL hbool_t h5tools_render_element(FILE *stream, const h5tool_format_t * h5tools_str_t *buffer, hsize_t *curr_pos, size_t ncols, hsize_t local_elmt_counter, hsize_t elmt_counter); H5TOOLS_DLL hbool_t h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx, /*in,out*/ - h5tools_str_t * buffer, /*string into which to render */ - hsize_t * curr_pos, /*total data element position*/ - size_t ncols, hsize_t *ptdata, - hsize_t local_elmt_counter, /*element counter*/ - hsize_t elmt_counter); + h5tools_context_t *ctx, h5tools_str_t *buffer, + hsize_t *curr_pos, size_t ncols, hsize_t *ptdata, + hsize_t local_elmt_counter, hsize_t elmt_counter); #ifdef __cplusplus } diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 65c0bc4..010f4cf 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -238,9 +238,8 @@ h5tools_dump_init(void) *------------------------------------------------------------------------- */ int -h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t container, - h5tools_context_t *ctx, /* in,out */ - unsigned flags, hsize_t nelmts, hid_t type, void *_mem) +h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, /* in,out */ + hid_t container, unsigned flags, hsize_t nelmts, hid_t type, void *_mem) { unsigned char *mem = (unsigned char *)_mem; hsize_t i; /* element counter */ @@ -414,9 +413,11 @@ h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_for ctx.indent_level++; if (H5Sget_simple_extent_dims(mem_space, total_size, NULL) >= 0) { /* assume entire data space to be printed */ + init_acc_pos(ctx.ndims, total_size, ctx.acc, ctx.pos, ctx.p_min_idx); + + /* reset data space to be printed */ for (indx = 0; indx < (unsigned)ctx.ndims; indx++) ctx.p_min_idx[indx] = start[indx]; - init_acc_pos(&ctx, total_size); /* print the data */ region_flags = START_OF_DATA; @@ -789,9 +790,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, FILE *stre if (H5Sget_simple_extent_dims(mem_space, total_size, NULL) >= 0) { /* assume entire data space to be printed */ - for (indx = 0; indx < ctx.ndims; indx++) - ctx.p_min_idx[indx] = 0; - init_acc_pos(&ctx, total_size); + init_acc_pos(ctx.ndims, total_size, ctx.acc, ctx.pos, ctx.p_min_idx); /* print the data */ region_flags = START_OF_DATA; @@ -1107,7 +1106,6 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c size_t j; /* counters */ hsize_t zero[1] = {0}; /* vector of zeros */ unsigned int flags; /* buffer extent flags */ - hsize_t elmtno; /* elemnt index */ hsize_t low[H5S_MAX_RANK]; /* low bound of hyperslab */ hsize_t high[H5S_MAX_RANK]; /* higher bound of hyperslab */ size_t p_type_nbytes; /* size of memory type */ @@ -1128,9 +1126,6 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c if ((size_t)ctx->ndims > NELMTS(sm_size)) H5TOOLS_THROW(FAIL, "ndims and sm_size comparision failed"); - if (ctx->ndims > 0) - init_acc_pos(ctx, total_size); - size_row_block = ctx->sset->block.data[row_dim]; /* Check if we have VL data in the dataset's datatype */ @@ -1200,27 +1195,24 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c for (i = 0; i < ctx->ndims; i++) ctx->p_max_idx[i] = ctx->p_min_idx[i] + MIN(total_size[i], sm_size[i]); - /* print array indices. get the lower bound of the hyperslab and calulate - the element position at the start of hyperslab */ + /* print array indices. get the lower bound of the hyperslab and calculate + the element position at the start of hyperslab */ if (H5Sget_select_bounds(f_space, low, high) < 0) H5TOOLS_THROW(FAIL, "H5Sget_select_bounds failed"); - elmtno = 0; + /* initialize the current stripmine position; this is necessary to print the array indices */ + ctx->sm_pos = 0; for (i = 0; i < (size_t)ctx->ndims - 1; i++) { hsize_t offset = 1; /* accumulation of the previous dimensions */ for (j = i + 1; j < (size_t)ctx->ndims; j++) offset *= total_size[j]; - elmtno += low[i] * offset; + ctx->sm_pos += low[i] * offset; } - elmtno += low[ctx->ndims - 1]; - - /* initialize the current stripmine position; this is necessary to print the array - indices */ - ctx->sm_pos = elmtno; + ctx->sm_pos += low[ctx->ndims - 1]; ctx->need_prefix = TRUE; - if (h5tools_dump_simple_data(stream, info, dset, ctx, flags, sm_nelmts, p_type, sm_buf) < 0) + if (h5tools_dump_simple_data(stream, info, ctx, dset, flags, sm_nelmts, p_type, sm_buf) < 0) H5TOOLS_THROW(FAIL, "h5tools_dump_simple_data failed"); /* Reclaim any VL memory, if necessary */ @@ -1425,7 +1417,6 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_co { int sndims; hid_t f_space = H5I_INVALID_HID; /* file data space */ - size_t i; /* counters */ hsize_t total_size[H5S_MAX_RANK]; /* total size of dataset*/ hbool_t past_catch = FALSE; herr_t ret_value = SUCCEED; @@ -1439,12 +1430,10 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_co ctx->ndims = (unsigned)sndims; /* assume entire data space to be printed */ - if (ctx->ndims > 0) - for (i = 0; i < (size_t)ctx->ndims; i++) - ctx->p_min_idx[i] = 0; - if (H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0) H5TOOLS_THROW(FAIL, "H5Sget_simple_extent_dims failed"); + init_acc_pos(ctx->ndims, total_size, ctx->acc, ctx->pos, ctx->p_min_idx); + ctx->size_last_dim = total_size[ctx->ndims - 1]; h5tools_display_simple_subset(stream, info, ctx, dset, p_type, f_space, total_size); @@ -1478,7 +1467,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont { hid_t f_space = H5I_INVALID_HID; /* file data space */ hsize_t elmtno; /* counter */ - size_t i; /* counter */ + size_t i = 0; /* counter */ int sndims; /* rank of dataspace */ int carry; /* counter carry value */ hsize_t zero[8]; /* vector of zeros */ @@ -1520,11 +1509,8 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont H5TOOLS_GOTO_ERROR((-1), "ctx->ndims > NELMTS(sm_size) failed"); /* Assume entire data space to be printed */ - if (ctx->ndims > 0) - for (i = 0; i < (size_t)ctx->ndims; i++) - ctx->p_min_idx[i] = 0; - H5Sget_simple_extent_dims(f_space, total_size, NULL); + init_acc_pos(ctx->ndims, total_size, ctx->acc, ctx->pos, ctx->p_min_idx); /* calculate the number of elements we're going to print */ p_nelmts = 1; @@ -1570,8 +1556,6 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont sm_space = H5Screate_simple(1, &sm_nelmts, NULL); H5TOOLS_DEBUG("sm_nelmts size:%ld", sm_nelmts); - if (ctx->ndims > 0) - init_acc_pos(ctx, total_size); H5TOOLS_DEBUG("ctx->ndims:%d", ctx->ndims); /* The stripmine loop */ @@ -1612,7 +1596,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont indices */ ctx->sm_pos = elmtno; - if (h5tools_dump_simple_data(stream, info, dset, ctx, flags, hs_nelmts, p_type, sm_buf) < 0) + if (h5tools_dump_simple_data(stream, info, ctx, dset, flags, hs_nelmts, p_type, sm_buf) < 0) H5TOOLS_ERROR((-1), "h5tools_dump_simple_data failed"); /* Reclaim any VL memory, if necessary */ @@ -1691,11 +1675,8 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte H5TOOLS_THROW((-1), "ctx->ndims > NELMTS(ctx->p_min_idx) failed"); /* Assume entire data space to be printed */ - if (ctx->ndims > 0) - for (i = 0; i < (size_t)ctx->ndims; i++) - ctx->p_min_idx[i] = 0; - H5Sget_simple_extent_dims(f_space, total_size, NULL); + init_acc_pos(ctx->ndims, total_size, ctx->acc, ctx->pos, ctx->p_min_idx); /* calculate the number of elements we're going to print */ p_nelmts = 1; @@ -1718,14 +1699,12 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte alloc_size = p_nelmts * H5Tget_size(p_type); HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ if (NULL != (buf = (unsigned char *)HDmalloc((size_t)alloc_size))) { - if (ctx->ndims > 0) - init_acc_pos(ctx, total_size); H5TOOLS_DEBUG("ctx->ndims:%d", ctx->ndims); H5TOOLS_DEBUG("Read the data"); /* Read the data */ if (H5Aread(attr_id, p_type, buf) >= 0) { - if (h5tools_dump_simple_data(stream, info, attr_id, ctx, START_OF_DATA | END_OF_DATA, p_nelmts, + if (h5tools_dump_simple_data(stream, info, ctx, attr_id, START_OF_DATA | END_OF_DATA, p_nelmts, p_type, buf) < 0) H5TOOLS_ERROR((-1), "h5tools_dump_simple_data failed"); @@ -2394,9 +2373,12 @@ found_string_type: if (H5Tequal(type, H5T_STD_REF_DSETREG) == TRUE) { h5tools_str_append(buffer, " { H5T_STD_REF_DSETREG }"); } - else { + else if (H5Tequal(type, H5T_STD_REF_OBJ) == TRUE) { h5tools_str_append(buffer, " { H5T_STD_REF_OBJECT }"); } + else { + h5tools_str_append(buffer, " { UNDEFINED }"); + } break; case H5T_ENUM: @@ -2891,7 +2873,7 @@ h5tools_print_fill_value(h5tools_str_t *buffer /*in,out*/, const h5tool_format_t */ void h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t dcpl_id, - hid_t type_id, hid_t obj_id) + hid_t type_id, hid_t dset_id) { int nfilters; /* number of filters */ int rank; /* rank */ @@ -2922,7 +2904,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * if (info->line_ncols > 0) ncols = info->line_ncols; - storage_size = H5Dget_storage_size(obj_id); + storage_size = H5Dget_storage_size(dset_id); nfilters = H5Pget_nfilters(dcpl_id); HDstrcpy(f_name, "\0"); @@ -2965,8 +2947,8 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * double ratio = 0; int ok = 0; - hid_t tid = H5Dget_type(obj_id); - hid_t sid = H5Dget_space(obj_id); + hid_t tid = H5Dget_type(dset_id); + hid_t sid = H5Dget_space(dset_id); size_t datum_size = H5Tget_size(tid); int ndims = H5Sget_simple_extent_dims(sid, dims, NULL); @@ -3025,16 +3007,15 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * ctx->indent_level--; break; case H5D_CONTIGUOUS: { - int next; + int n_external; - next = H5Pget_external_count(dcpl_id); + n_external = H5Pget_external_count(dcpl_id); - /*------------------------------------------------------------------------- - * EXTERNAL_FILE - *------------------------------------------------------------------------- - */ ctx->indent_level++; - if (next) { + if (n_external) { + + /* EXTERNAL FILE */ + ctx->need_prefix = TRUE; h5tools_str_reset(&buffer); @@ -3050,7 +3031,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * (hsize_t)0); ctx->indent_level++; - for (j = 0; j < (unsigned)next; j++) { + for (j = 0; j < (unsigned)n_external; j++) { H5Pget_external(dcpl_id, j, sizeof(name), name, &offset, &size); ctx->need_prefix = TRUE; @@ -3073,6 +3054,8 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * else { haddr_t ioffset; + /* NORMAL FILE */ + ctx->need_prefix = TRUE; h5tools_str_reset(&buffer); @@ -3090,7 +3073,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * ctx->need_prefix = TRUE; h5tools_str_reset(&buffer); - ioffset = H5Dget_offset(obj_id); + ioffset = H5Dget_offset(dset_id); h5tools_str_append(&buffer, "OFFSET " H5_PRINTF_HADDR_FMT, ioffset); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -3342,7 +3325,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t * break; case H5D_FILL_VALUE_USER_DEFINED: ctx->indent_level--; - h5tools_print_fill_value(&buffer, info, ctx, dcpl_id, type_id, obj_id); + h5tools_print_fill_value(&buffer, info, ctx, dcpl_id, type_id, dset_id); ctx->indent_level++; break; case H5D_FILL_VALUE_ERROR: @@ -3434,8 +3417,7 @@ h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, h5tools_context_ cmt_bufsize = H5Oget_comment(obj_id, comment, buf_size); - /* call H5Oget_comment again with the correct value. - * If the call to H5Oget_comment returned an error, skip this block */ + /* call H5Oget_comment again with the correct value */ if (cmt_bufsize > 0) { comment = (char *)HDmalloc((size_t)(cmt_bufsize + 1)); /* new_size including null terminator */ if (comment) { @@ -3451,7 +3433,7 @@ h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, h5tools_context_ (hsize_t)0); h5tools_str_close(&buffer); - } /* end if */ + } HDfree(comment); } } @@ -3691,6 +3673,103 @@ h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, h5tool } /*------------------------------------------------------------------------- + * Function: dump_reference + * + * Purpose: Dump reference data + * + * Return: void + *------------------------------------------------------------------------- + */ +void +h5tools_dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t container, + hid_t f_type, unsigned char *region_buf, int ndims) +{ + hid_t region_id = H5I_INVALID_HID; + hid_t region_sid = H5I_INVALID_HID; + hsize_t elmt_counter = 0; /*counts the # elements printed. */ + size_t ncols = 80; /* available output width */ + int i; + size_t nsize; + hsize_t curr_pos = 0; /* total data element position */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t datactx; /* print context */ + + H5TOOLS_START_DEBUG(""); + + datactx = *ctx; /* print context */ + /* Assume entire data space to be printed */ + datactx.need_prefix = TRUE; + + nsize = H5Tget_size(f_type); + + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + for (i = 0; i < ndims; i++, datactx.cur_elmt++, elmt_counter++) { + void *memref = region_buf + i * nsize; + + H5TOOLS_DEBUG("reference loop:%d with curr_pos=%ld", i, curr_pos); + + datactx.need_prefix = TRUE; + h5tools_str_reset(&buffer); + H5TOOLS_DEBUG("reference loop - h5tools_str_sprint with H5T_STD_REF_DSETREG:%d", i); + h5tools_str_sprint(&buffer, info, container, f_type, memref, &datactx); + h5tools_render_element(stream, info, &datactx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)i, + (hsize_t)ndims); + + if (!h5tools_is_zero(memref, H5Tget_size(f_type))) { + if (nsize == H5R_OBJ_REF_BUF_SIZE) { + if ((region_id = H5Rdereference(container, H5R_OBJECT, memref)) >= 0) { + datactx.indent_level++; + h5tools_dump_data(stream, info, &datactx, region_id, TRUE); + datactx.indent_level--; + } + } + else { + if ((region_id = H5Rdereference(container, H5R_DATASET_REGION, memref)) >= 0) { + if ((region_sid = H5Rget_region(container, H5R_DATASET_REGION, memref)) >= 0) { + H5S_sel_type region_type; + + region_type = H5Sget_select_type(region_sid); + if (region_type == H5S_SEL_POINTS) { + /* Print point information */ + H5TOOLS_DEBUG("H5S_SEL_POINTS H5R_DATASET_REGION"); + h5tools_dump_region_data_points(region_sid, region_id, stream, info, &datactx, + &buffer, &curr_pos, ncols, (hsize_t)i, + elmt_counter); + } + else if (region_type == H5S_SEL_HYPERSLABS) { + /* Print block information */ + H5TOOLS_DEBUG("H5S_SEL_HYPERSLABS H5R_DATASET_REGION"); + h5tools_dump_region_data_blocks(region_sid, region_id, stream, info, &datactx, + &buffer, &curr_pos, ncols, (hsize_t)i, + elmt_counter); + } + else + H5TOOLS_INFO("invalid region type"); + if (H5Sclose(region_sid) < 0) + H5TOOLS_INFO("H5Sclose H5R_DATASET_REGION failed"); + } /* end if (region_space >= 0) */ + else + H5TOOLS_INFO("H5Rget_region H5R_DATASET_REGION failed"); + if (H5Dclose(region_id) < 0) + H5TOOLS_INFO("H5Dclose H5R_DATASET_REGION failed"); + } /* if (region_id >= 0) */ + else { + /* if (region_id < 0) - could mean that no reference was written do not throw failure */ + H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, + H5E_tools_min_id_g, "H5Rdereference failed"); + } + } + } /* end else to if (h5tools_is_zero(... */ + + H5TOOLS_DEBUG("finished reference loop:%d", i); + } /* end for(i = 0; i < ndims; i++, ctx->cur_elmt++, elmt_counter++) */ + + h5tools_str_close(&buffer); + + H5TOOLS_ENDDEBUG(""); +} + +/*------------------------------------------------------------------------- * Function: dump_data * * Purpose: Dump attribute, obj_data is FALSE, or dataset data, obj_data is TRUE @@ -3704,15 +3783,11 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t * { H5S_class_t space_type; int ndims; - size_t i; size_t nsize; - hid_t space = H5I_INVALID_HID; - hid_t f_type = H5I_INVALID_HID; - hid_t region_id = H5I_INVALID_HID; - hid_t region_space = H5I_INVALID_HID; + hid_t space = H5I_INVALID_HID; + hid_t f_type = H5I_INVALID_HID; hsize_t total_size[H5S_MAX_RANK]; - hsize_t elmt_counter = 0; /*counts the # elements printed. */ - int status = -1; + int status = -1; h5tools_context_t datactx; /* print context */ h5tools_str_t buffer; /* string into which to render */ hsize_t curr_pos = 0; /* total data element position */ @@ -3720,7 +3795,6 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t * h5tool_format_t string_dataformat; h5tool_format_t outputformat; unsigned char * region_buf = NULL; - int ret_value = 0; H5TOOLS_START_DEBUG(" file=%p", (void *)stream); H5TOOLS_DEBUG("rawdata file=%p", (void *)rawdatastream); @@ -3780,13 +3854,9 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t * H5TOOLS_DEBUG("ndims=%d - datactx.ndims=%d", ndims, datactx.ndims); /* Assume entire data space to be printed */ - if (datactx.ndims > 0) - for (i = 0; i < (size_t)datactx.ndims; i++) - datactx.p_min_idx[i] = 0; - H5Sget_simple_extent_dims(space, total_size, NULL); - if (datactx.ndims > 0) - init_acc_pos(&datactx, total_size); + init_acc_pos(datactx.ndims, total_size, datactx.acc, datactx.pos, datactx.p_min_idx); + datactx.need_prefix = TRUE; if (NULL != (region_buf = (void *)HDcalloc(nsize, (size_t)ndims))) { @@ -3804,67 +3874,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t * H5TOOLS_GOTO_DONE_NO_RET(); } } - for (i = 0; i < ndims; i++, datactx.cur_elmt++, elmt_counter++) { - void *memref = region_buf + i * nsize; - - H5TOOLS_DEBUG("reference loop:%d with curr_pos=%ld", i, curr_pos); - - datactx.need_prefix = TRUE; - h5tools_str_reset(&buffer); - H5TOOLS_DEBUG("reference loop - h5tools_str_sprint with H5T_STD_REF_DSETREG:%d", i); - h5tools_str_sprint(&buffer, &outputformat, obj_id, f_type, memref, &datactx); - h5tools_render_element(stream, &outputformat, &datactx, &buffer, &curr_pos, (size_t)ncols, - (hsize_t)0, (hsize_t)0); - - if (!h5tools_is_zero(memref, H5Tget_size(f_type))) { - if (nsize == H5R_OBJ_REF_BUF_SIZE) { - if ((region_id = H5Rdereference(obj_id, H5R_OBJECT, memref)) >= 0) { - datactx.indent_level++; - h5tools_dump_data(stream, &outputformat, &datactx, region_id, TRUE); - datactx.indent_level--; - } - } - else { - if ((region_id = H5Rdereference(obj_id, H5R_DATASET_REGION, memref)) >= 0) { - if ((region_space = H5Rget_region(obj_id, H5R_DATASET_REGION, memref)) >= 0) { - H5S_sel_type region_type; - - region_type = H5Sget_select_type(region_space); - if (region_type == H5S_SEL_POINTS) { - /* Print point information */ - H5TOOLS_DEBUG("H5S_SEL_POINTS H5R_DATASET_REGION"); - h5tools_dump_region_data_points( - region_space, region_id, stream, &outputformat, &datactx, &buffer, - &curr_pos, ncols, (hsize_t)i, elmt_counter); - } - else if (region_type == H5S_SEL_HYPERSLABS) { - /* Print block information */ - H5TOOLS_DEBUG("H5S_SEL_HYPERSLABS H5R_DATASET_REGION"); - h5tools_dump_region_data_blocks( - region_space, region_id, stream, &outputformat, &datactx, &buffer, - &curr_pos, ncols, (hsize_t)i, elmt_counter); - } - else - H5TOOLS_INFO("invalid region type"); - if (H5Sclose(region_space) < 0) - H5TOOLS_INFO("H5Sclose H5R_DATASET_REGION failed"); - } /* end if (region_space >= 0) */ - else - H5TOOLS_INFO("H5Rget_region H5R_DATASET_REGION failed"); - if (H5Dclose(region_id) < 0) - H5TOOLS_INFO("H5Dclose H5R_DATASET_REGION failed"); - } /* if (region_id >= 0) */ - else { - /* if (region_id < 0) - could mean that no reference was written do not throw - * failure */ - H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, - H5E_tools_g, H5E_tools_min_id_g, "H5Rdereference failed"); - } - } - } /* end else to if (h5tools_is_zero(... */ - - H5TOOLS_DEBUG("finished reference loop:%d", i); - } /* end for(i = 0; i < ndims; i++, datactx->cur_elmt++, elmt_counter++) */ + h5tools_dump_reference(stream, &outputformat, &datactx, obj_id, f_type, region_buf, ndims); HDfree(region_buf); } ctx->indent_level--; diff --git a/tools/lib/h5tools_dump.h b/tools/lib/h5tools_dump.h index 21224ca..c69c583 100644 --- a/tools/lib/h5tools_dump.h +++ b/tools/lib/h5tools_dump.h @@ -40,9 +40,9 @@ H5TOOLS_DLL int h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx /*in,out*/, hid_t dset); H5TOOLS_DLL int h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx /*in,out*/, hid_t obj_id); -H5TOOLS_DLL int h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t container, - h5tools_context_t *ctx /*in,out*/, unsigned flags, hsize_t nelmts, - hid_t type, void *_mem); +H5TOOLS_DLL int h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx /*in,out*/, hid_t container, unsigned flags, + hsize_t nelmts, hid_t type, void *_mem); H5TOOLS_DLL void h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx /*in,out*/, hid_t type); H5TOOLS_DLL void h5tools_dump_dataspace(FILE *stream, const h5tool_format_t *info, @@ -59,18 +59,20 @@ H5TOOLS_DLL void h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx /*in,out*/, hid_t obj_id); H5TOOLS_DLL void h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t obj_id, int obj_data); +H5TOOLS_DLL void h5tools_dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, + hid_t container, hid_t f_type, unsigned char *region_buf, int ndims); -H5TOOLS_DLL hbool_t h5tools_dump_region_data_points( - hid_t region_space, hid_t region_id, FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx /*in,out*/, h5tools_str_t *buffer /*string into which to render */, - hsize_t *curr_pos /*total data element position*/, size_t ncols, - hsize_t region_elmt_counter /*element counter*/, hsize_t elmt_counter); +H5TOOLS_DLL hbool_t h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *stream, + const h5tool_format_t *info, + h5tools_context_t *ctx /*in,out*/, h5tools_str_t *buffer, + hsize_t *curr_pos, size_t ncols, + hsize_t region_elmt_counter, hsize_t elmt_counter); -H5TOOLS_DLL hbool_t h5tools_dump_region_data_blocks( - hid_t region_space, hid_t region_id, FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx /*in,out*/, h5tools_str_t *buffer /*string into which to render */, - hsize_t *curr_pos /*total data element position*/, size_t ncols, - hsize_t region_elmt_counter /*element counter*/, hsize_t elmt_counter); +H5TOOLS_DLL hbool_t h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *stream, + const h5tool_format_t *info, + h5tools_context_t *ctx /*in,out*/, h5tools_str_t *buffer, + hsize_t *curr_pos, size_t ncols, + hsize_t region_elmt_counter, hsize_t elmt_counter); H5TOOLS_DLL int h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer /*in,out*/, const h5tool_format_t *info, h5tools_context_t *ctx /*in,out*/, @@ -83,6 +85,7 @@ H5TOOLS_DLL void h5tools_print_fill_value(h5tools_str_t *buffer /*in,out*/, cons h5tools_context_t *ctx /*in,out*/, hid_t dcpl, hid_t type_id, hid_t obj_id); H5TOOLS_DLL void h5tools_print_packed_bits(h5tools_str_t *buffer /*in,out*/, hid_t type); + #ifdef __cplusplus } #endif diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h index 0dc07d0..b8e5339 100644 --- a/tools/lib/h5tools_error.h +++ b/tools/lib/h5tools_error.h @@ -103,11 +103,13 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g; */ #define H5TOOLS_PUSH_ERROR(estack_id, err_cls, maj_err_id, min_err_id, ...) \ do { \ - if (estack_id >= 0 && err_cls >= 0) \ - H5Epush2(estack_id, __FILE__, FUNC, __LINE__, err_cls, maj_err_id, min_err_id, __VA_ARGS__); \ - else { \ - HDfprintf(stderr, __VA_ARGS__); \ - HDfprintf(stderr, "\n"); \ + if (enable_error_stack > 0) { \ + if (estack_id >= 0 && err_cls >= 0) \ + H5Epush2(estack_id, __FILE__, FUNC, __LINE__, err_cls, maj_err_id, min_err_id, __VA_ARGS__); \ + else { \ + HDfprintf(stderr, __VA_ARGS__); \ + HDfprintf(stderr, "\n"); \ + } \ } \ } while (0) diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index d3b3dc4..25876e8 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -269,42 +269,24 @@ h5tools_str_fmt(h5tools_str_t *str /*in,out*/, size_t start, const char *fmt) * Purpose: Renders the line prefix value into string STR. * * Return: Success: Pointer to the prefix. - * * Failure: NULL - * - * Programmer: Robb Matzke - * Thursday, July 23, 1998 *------------------------------------------------------------------------- */ char * -h5tools_str_prefix(h5tools_str_t *str /*in,out*/, const h5tool_format_t *info, hsize_t elmtno, unsigned ndims, +h5tools_str_prefix(h5tools_str_t *str /*in,out*/, const h5tool_format_t *info, hsize_t elmtno, h5tools_context_t *ctx) { - size_t i = 0; - hsize_t curr_pos = elmtno; + size_t i = 0; H5TOOLS_START_DEBUG(""); H5TOOLS_DEBUG("elmtno=%ld, ctx->ndims=%d", elmtno, ctx->ndims); h5tools_str_reset(str); - H5TOOLS_DEBUG("ndims=%d", ndims); - if (ndims > 0) { - /* - * Calculate the number of elements represented by a unit change in a - * certain index position. - */ - for (i = 0; i < (size_t)ndims; i++) { - H5TOOLS_DEBUG("curr_pos=%ld - ctx->acc[%d]=%ld", curr_pos, i, ctx->acc[i]); - ctx->pos[i] = curr_pos / ctx->acc[i]; - curr_pos -= ctx->acc[i] * ctx->pos[i]; - H5TOOLS_DEBUG("curr_pos=%ld - ctx->pos[%d]=%ld - ctx->acc[%d]=%ld", curr_pos, i, ctx->pos[i], i, - ctx->acc[i]); - } - HDassert(curr_pos == 0); - + calc_acc_pos(ctx->ndims, elmtno, ctx->acc, ctx->pos); + if (ctx->ndims > 0) { /* Print the index values */ - for (i = 0; i < (size_t)ndims; i++) { + for (i = 0; i < (size_t)ctx->ndims; i++) { if (i) h5tools_str_append(str, "%s", OPT(info->idx_sep, ",")); @@ -328,50 +310,35 @@ h5tools_str_prefix(h5tools_str_t *str /*in,out*/, const h5tool_format_t *info, h * * Return: Success: Pointer to the prefix. * Failure: NULL - * - * In/Out: - * h5tools_context_t *ctx - * h5tools_str_t *str *------------------------------------------------------------------------- */ char * -h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info, hsize_t elmtno, hsize_t *ptdata, - unsigned ndims, hsize_t max_idx[], h5tools_context_t *ctx) +h5tools_str_region_prefix(h5tools_str_t *str /*in,out*/, const h5tool_format_t *info, hsize_t elmtno, + hsize_t *ptdata, h5tools_context_t *ctx) { - size_t i = 0; - hsize_t curr_pos = elmtno; - hsize_t p_prod[H5S_MAX_RANK]; + size_t i = 0; - h5tools_str_reset(str); - - if (ndims > 0) { - /* - * Calculate the number of elements represented by a unit change in a - * certain index position. - */ - for (i = ndims - 1, p_prod[ndims - 1] = 1; i > 0; --i) - p_prod[i - 1] = (max_idx[i]) * p_prod[i]; + H5TOOLS_START_DEBUG(""); - for (i = 0; i < (size_t)ndims; i++) { - if (curr_pos > 0) { - ctx->pos[i] = curr_pos / p_prod[i]; - curr_pos -= p_prod[i] * ctx->pos[i]; - } - else - ctx->pos[i] = 0; - ctx->pos[i] += (unsigned long)ptdata[ctx->sm_pos + i]; - } + H5TOOLS_DEBUG("elmtno=%ld, ctx->ndims=%d", elmtno, ctx->ndims); + h5tools_str_reset(str); + calc_acc_pos(ctx->ndims, elmtno, ctx->acc, ctx->pos); + if (ctx->ndims > 0) { /* Print the index values */ - for (i = 0; i < (size_t)ndims; i++) { + for (i = 0; i < (size_t)ctx->ndims; i++) { + ctx->pos[i] += (unsigned long)ptdata[ctx->sm_pos + i]; if (i) h5tools_str_append(str, "%s", OPT(info->idx_sep, ",")); h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t)ctx->pos[i]); } - } /* if (ndims > 0) */ + } else /* Scalar */ h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t)0); + H5TOOLS_DEBUG("str=%s", str->s); + + H5TOOLS_ENDDEBUG(""); /* Add prefix and suffix to the index */ return h5tools_str_fmt(str, (size_t)0, OPT(info->idx_fmt, "%s: ")); @@ -896,43 +863,47 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai case H5T_COMPOUND: H5TOOLS_DEBUG("H5T_COMPOUND"); { - unsigned nmembs; - unsigned j; + int retvalue; - nmembs = (unsigned)H5Tget_nmembers(type); - h5tools_str_append(str, "%s", OPT(info->cmpd_pre, "{")); + retvalue = H5Tget_nmembers(type); + if (retvalue >= 0) { + unsigned j; + unsigned nmembs = (unsigned)retvalue; - ctx->indent_level++; + h5tools_str_append(str, "%s", OPT(info->cmpd_pre, "{")); - for (j = 0; j < nmembs; j++) { - if (j) - h5tools_str_append(str, "%s", OPT(info->cmpd_sep, ", " OPTIONAL_LINE_BREAK)); - else - h5tools_str_append(str, "%s", OPT(info->cmpd_end, "")); + ctx->indent_level++; - if (info->arr_linebreak) - h5tools_str_indent(str, info, ctx); + for (j = 0; j < nmembs; j++) { + if (j) + h5tools_str_append(str, "%s", OPT(info->cmpd_sep, ", " OPTIONAL_LINE_BREAK)); + else + h5tools_str_append(str, "%s", OPT(info->cmpd_end, "")); - /* The name */ - name = H5Tget_member_name(type, j); - h5tools_str_append(str, OPT(info->cmpd_name, ""), name); - H5free_memory(name); + if (info->arr_linebreak) + h5tools_str_indent(str, info, ctx); - /* The value */ - offset = H5Tget_member_offset(type, j); - memb = H5Tget_member_type(type, j); + /* The name */ + name = H5Tget_member_name(type, j); + h5tools_str_append(str, OPT(info->cmpd_name, ""), name); + H5free_memory(name); - h5tools_str_sprint(str, info, container, memb, cp_vp + offset, ctx); + /* The value */ + offset = H5Tget_member_offset(type, j); + memb = H5Tget_member_type(type, j); - H5Tclose(memb); - } - ctx->indent_level--; + h5tools_str_sprint(str, info, container, memb, cp_vp + offset, ctx); - if (info->arr_linebreak) { - h5tools_str_append(str, "%s", OPT(info->cmpd_end, "")); - h5tools_str_indent(str, info, ctx); + H5Tclose(memb); + } + ctx->indent_level--; + + if (info->arr_linebreak) { + h5tools_str_append(str, "%s", OPT(info->cmpd_end, "")); + h5tools_str_indent(str, info, ctx); + } + h5tools_str_append(str, "%s", OPT(info->cmpd_suf, "}")); } - h5tools_str_append(str, "%s", OPT(info->cmpd_suf, "}")); } break; @@ -1136,7 +1107,6 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai break; } /* end switch */ } - H5TOOLS_DEBUG("switch done"); ret_value = h5tools_str_fmt(str, start, OPT(info->elmt_fmt, "%s")); diff --git a/tools/lib/h5tools_str.h b/tools/lib/h5tools_str.h index b916692..1c3301a 100644 --- a/tools/lib/h5tools_str.h +++ b/tools/lib/h5tools_str.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Bill Wendling + * Programmer: Bill Wendling * Monday, 19. February 2001 */ #ifndef H5TOOLS_STR_H__ @@ -31,13 +31,12 @@ H5TOOLS_DLL char * h5tools_str_reset(h5tools_str_t *str); H5TOOLS_DLL char * h5tools_str_trunc(h5tools_str_t *str, size_t size); H5TOOLS_DLL char * h5tools_str_fmt(h5tools_str_t *str, size_t start, const char *fmt); H5TOOLS_DLL char * h5tools_str_prefix(h5tools_str_t *str, const h5tool_format_t *info, hsize_t elmtno, - unsigned ndims, h5tools_context_t *ctx); + h5tools_context_t *ctx); /* * new functions needed to display region reference data */ H5TOOLS_DLL char *h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info, hsize_t elmtno, - hsize_t *ptdata, unsigned ndims, hsize_t max_idx[], - h5tools_context_t *ctx); + hsize_t *ptdata, h5tools_context_t *ctx); H5TOOLS_DLL void h5tools_str_dump_space_slabs(h5tools_str_t *, hid_t, const h5tool_format_t *, h5tools_context_t *ctx); H5TOOLS_DLL void h5tools_str_dump_space_blocks(h5tools_str_t *, hid_t, const h5tool_format_t *); diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index 19489d7..f6201e8 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -194,44 +194,50 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti if (sp == 1 && argv[opt_ind][0] == '-' && argv[opt_ind][1] == '-') { /* long command line option */ - const char *arg = &argv[opt_ind][2]; - int i; + int i; + const char ch = '='; + char * arg = &argv[opt_ind][2]; + size_t arg_len = 0; + + opt_arg = strchr(&argv[opt_ind][2], ch); + arg_len = HDstrlen(&argv[opt_ind][2]); + if (opt_arg) { + arg_len -= HDstrlen(opt_arg); + opt_arg++; /* skip the equal sign */ + } + arg[arg_len] = 0; for (i = 0; l_opts && l_opts[i].name; i++) { size_t len = HDstrlen(l_opts[i].name); - if (HDstrncmp(arg, l_opts[i].name, len) == 0) { + if (HDstrcmp(arg, l_opts[i].name) == 0) { /* we've found a matching long command line flag */ opt_opt = l_opts[i].shortval; if (l_opts[i].has_arg != no_arg) { - if (arg[len] == '=') { - opt_arg = &arg[len + 1]; - } - else if (l_opts[i].has_arg != optional_arg) { - if (opt_ind < (argc - 1)) - if (argv[opt_ind + 1][0] != '-') - opt_arg = argv[++opt_ind]; + if (opt_arg == NULL) { + if (l_opts[i].has_arg != optional_arg) { + if (opt_ind < (argc - 1)) + if (argv[opt_ind + 1][0] != '-') + opt_arg = argv[++opt_ind]; + } + else if (l_opts[i].has_arg == require_arg) { + if (opt_err) + HDfprintf(rawerrorstream, "%s: option required for \"--%s\" flag\n", argv[0], + arg); + + opt_opt = '?'; + } } - else if (l_opts[i].has_arg == require_arg) { - if (opt_err) - HDfprintf(rawerrorstream, "%s: option required for \"--%s\" flag\n", argv[0], - arg); - - opt_opt = '?'; - } - else - opt_arg = NULL; } else { - if (arg[len] == '=') { + if (opt_arg) { if (opt_err) HDfprintf(rawerrorstream, "%s: no option required for \"%s\" flag\n", argv[0], arg); opt_opt = '?'; } - opt_arg = NULL; } break; } @@ -378,8 +384,6 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti * Programmer: Jacob Smith * 2017-11-10 * - * Changes: None. - * ***************************************************************************** */ herr_t @@ -1040,6 +1044,51 @@ done: return ret_value; } +#ifdef H5_HAVE_ROS3_VFD +/*---------------------------------------------------------------------------- + * + * Function: h5tools_parse_ros3_fapl_tuple + * + * Purpose: A convenience function that parses a string containing a tuple + * of S3 VFD credential information and then passes the result to + * `h5tools_populate_ros3_fapl()` in order to setup a valid + * configuration for the S3 VFD. + * + * Return: SUCCEED/FAIL + * + *---------------------------------------------------------------------------- + */ +herr_t +h5tools_parse_ros3_fapl_tuple(const char *tuple_str, int delim, H5FD_ros3_fapl_t *fapl_config_out) +{ + const char *ccred[3]; + unsigned nelems = 0; + char * s3cred_src = NULL; + char ** s3cred = NULL; + herr_t ret_value = SUCCEED; + + /* Attempt to parse S3 credentials tuple */ + if (parse_tuple(tuple_str, delim, &s3cred_src, &nelems, &s3cred) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "failed to parse S3 VFD info tuple"); + + /* Sanity-check tuple count */ + if (nelems != 3) + H5TOOLS_GOTO_ERROR(FAIL, "invalid S3 VFD credentials"); + + ccred[0] = (const char *)s3cred[0]; + ccred[1] = (const char *)s3cred[1]; + ccred[2] = (const char *)s3cred[2]; + + if (h5tools_populate_ros3_fapl(fapl_config_out, ccred) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "failed to populate S3 VFD FAPL config"); + +done: + HDfree(s3cred); + HDfree(s3cred_src); + + return ret_value; +} + /*---------------------------------------------------------------------------- * * Function: h5tools_populate_ros3_fapl() @@ -1068,7 +1117,7 @@ done: * * Return: * - * 0 (failure) if... + * FAIL if... * * Read-Only S3 VFD is not enabled. * * NULL fapl pointer: (NULL, {...} ) * * Warning: In all cases below, fapl will be set as "default" @@ -1085,7 +1134,7 @@ done: * * (&fa, {"...", "", "...") * * Any string would overflow allowed space in fapl definition. * or - * 1 (success) + * SUCCEED * * Sets components in fapl_t pointer, copying strings as appropriate. * * "Default" fapl (valid version, authenticate->False, empty strings) * * `values` pointer is NULL @@ -1102,173 +1151,113 @@ done: * *---------------------------------------------------------------------------- */ -#ifdef H5_HAVE_ROS3_VFD -int +herr_t h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, const char **values) { - int show_progress = 0; /* set to 1 for debugging */ - int ret_value = 1; /* 1 for success, 0 for failure */ - /* e.g.? if (!populate()) { then failed } */ - - if (show_progress) { - HDprintf("called h5tools_populate_ros3_fapl\n"); - } + herr_t ret_value = SUCCEED; - if (fa == NULL) { - if (show_progress) { - HDprintf(" ERROR: null pointer to fapl_t\n"); - } - ret_value = 0; - goto done; - } + if (fa == NULL) + H5TOOLS_GOTO_ERROR(FAIL, "fa cannot be NULL"); - if (show_progress) { - HDprintf(" preset fapl with default values\n"); - } fa->version = H5FD_CURR_ROS3_FAPL_T_VERSION; fa->authenticate = FALSE; *(fa->aws_region) = '\0'; *(fa->secret_id) = '\0'; *(fa->secret_key) = '\0'; - /* sanity-check supplied values - */ + /* Sanity checks */ if (values != NULL) { - if (values[0] == NULL) { - if (show_progress) { - HDprintf(" ERROR: aws_region value cannot be NULL\n"); - } - ret_value = 0; - goto done; - } - if (values[1] == NULL) { - if (show_progress) { - HDprintf(" ERROR: secret_id value cannot be NULL\n"); - } - ret_value = 0; - goto done; - } - if (values[2] == NULL) { - if (show_progress) { - HDprintf(" ERROR: secret_key value cannot be NULL\n"); - } - ret_value = 0; - goto done; - } + if (values[0] == NULL || values[1] == NULL || values[2] == NULL) + H5TOOLS_GOTO_ERROR(FAIL, "values data cannot be NULL"); /* if region and ID are supplied (key optional), write to fapl... * fail if value would overflow */ if (*values[0] != '\0' && *values[1] != '\0') { - if (HDstrlen(values[0]) > H5FD_ROS3_MAX_REGION_LEN) { - if (show_progress) { - HDprintf(" ERROR: aws_region value too long\n"); - } - ret_value = 0; - goto done; - } + if (HDstrlen(values[0]) > H5FD_ROS3_MAX_REGION_LEN) + H5TOOLS_GOTO_ERROR(FAIL, "can't exceed max region length"); HDmemcpy(fa->aws_region, values[0], (HDstrlen(values[0]) + 1)); - if (show_progress) { - HDprintf(" aws_region set\n"); - } - if (HDstrlen(values[1]) > H5FD_ROS3_MAX_SECRET_ID_LEN) { - if (show_progress) { - HDprintf(" ERROR: secret_id value too long\n"); - } - ret_value = 0; - goto done; - } + if (HDstrlen(values[1]) > H5FD_ROS3_MAX_SECRET_ID_LEN) + H5TOOLS_GOTO_ERROR(FAIL, "can't exceed max secret ID length"); HDmemcpy(fa->secret_id, values[1], (HDstrlen(values[1]) + 1)); - if (show_progress) { - HDprintf(" secret_id set\n"); - } - if (HDstrlen(values[2]) > H5FD_ROS3_MAX_SECRET_KEY_LEN) { - if (show_progress) { - HDprintf(" ERROR: secret_key value too long\n"); - } - ret_value = 0; - goto done; - } + if (HDstrlen(values[2]) > H5FD_ROS3_MAX_SECRET_KEY_LEN) + H5TOOLS_GOTO_ERROR(FAIL, "can't exceed max secret key length"); HDmemcpy(fa->secret_key, values[2], (HDstrlen(values[2]) + 1)); - if (show_progress) { - HDprintf(" secret_key set\n"); - } fa->authenticate = TRUE; - if (show_progress) { - HDprintf(" set to authenticate\n"); - } } - else if (*values[0] != '\0' || *values[1] != '\0' || *values[2] != '\0') { - if (show_progress) { - HDprintf(" ERROR: invalid assortment of empty/non-empty values\n"); - } - ret_value = 0; - goto done; - } - } /* values != NULL */ + else if (*values[0] != '\0' || *values[1] != '\0' || *values[2] != '\0') + H5TOOLS_GOTO_ERROR(FAIL, "all values cannot be empty strings"); + } done: return ret_value; - } /* h5tools_populate_ros3_fapl */ #endif /* H5_HAVE_ROS3_VFD */ -/*----------------------------------------------------------------------------- - * - * Function: h5tools_set_configured_fapl - * - * Purpose: prepare fapl_id with the given property list, according to - * VFD prototype. +#ifdef H5_HAVE_LIBHDFS +/*---------------------------------------------------------------------------- * - * Return: 0 on failure, 1 on success + * Function: h5tools_parse_hdfs_fapl_tuple * - * Programmer: Jacob Smith - * 2018-05-21 + * Purpose: A convenience function that parses a string containing a tuple + * of HDFS VFD configuration information. * - * Changes: None. + * Return: SUCCEED/FAIL * - *----------------------------------------------------------------------------- + *---------------------------------------------------------------------------- */ -int -h5tools_set_configured_fapl(hid_t fapl_id, const char vfd_name[], void *fapl_t_ptr) +herr_t +h5tools_parse_hdfs_fapl_tuple(const char *tuple_str, int delim, H5FD_hdfs_fapl_t *fapl_config_out) { - int ret_value = 1; - - if (fapl_id < 0) { - return 0; + unsigned long k = 0; + unsigned nelems = 0; + char * props_src = NULL; + char ** props = NULL; + herr_t ret_value = SUCCEED; + + /* Attempt to parse HDFS configuration tuple */ + if (parse_tuple(tuple_str, delim, &props_src, &nelems, &props) < 0) + H5TOOLS_GOTO_ERROR(FAIL, "failed to parse HDFS VFD configuration tuple"); + + /* Sanity-check tuple count */ + if (nelems != 5) + H5TOOLS_GOTO_ERROR(FAIL, "invalid HDFS VFD configuration"); + + /* Populate fapl configuration structure with given properties. + * WARNING: No error-checking is done on length of input strings... + * Silent overflow is possible, albeit unlikely. + */ + if (HDstrncmp(props[0], "", 1)) { + HDstrncpy(fapl_config_out->namenode_name, (const char *)props[0], HDstrlen(props[0])); } - - if (!strcmp("", vfd_name)) { - goto done; - -#ifdef H5_HAVE_ROS3_VFD + if (HDstrncmp(props[1], "", 1)) { + k = strtoul((const char *)props[1], NULL, 0); + if (errno == ERANGE) + H5TOOLS_GOTO_ERROR(FAIL, "supposed port number wasn't"); + fapl_config_out->namenode_port = (int32_t)k; } - else if (!strcmp("ros3", vfd_name)) { - if ((fapl_id == H5P_DEFAULT) || (fapl_t_ptr == NULL) || - (FAIL == H5Pset_fapl_ros3(fapl_id, (H5FD_ros3_fapl_t *)fapl_t_ptr))) { - ret_value = 0; - goto done; - } -#endif /* H5_HAVE_ROS3_VFD */ - -#ifdef H5_HAVE_LIBHDFS + if (HDstrncmp(props[2], "", 1)) { + HDstrncpy(fapl_config_out->kerberos_ticket_cache, (const char *)props[2], HDstrlen(props[2])); } - else if (!strcmp("hdfs", vfd_name)) { - if ((fapl_id == H5P_DEFAULT) || (fapl_t_ptr == NULL) || - (FAIL == H5Pset_fapl_hdfs(fapl_id, (H5FD_hdfs_fapl_t *)fapl_t_ptr))) { - ret_value = 0; - goto done; - } -#endif /* H5_HAVE_LIBHDFS */ + if (HDstrncmp(props[3], "", 1)) { + HDstrncpy(fapl_config_out->user_name, (const char *)props[3], HDstrlen(props[3])); } - else { - ret_value = 0; /* unrecognized fapl type "name" */ + if (HDstrncmp(props[4], "", 1)) { + k = HDstrtoul((const char *)props[4], NULL, 0); + if (errno == ERANGE) + H5TOOLS_GOTO_ERROR(FAIL, "supposed buffersize number wasn't"); + fapl_config_out->stream_buffer_size = (int32_t)k; } done: - return ret_value; + if (props) + HDfree(props); + if (props_src) + HDfree(props_src); -} /* h5tools_set_configured_fapl() */ + return ret_value; +} +#endif /* H5_HAVE_LIBHDFS */ diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h index 7d78901..d38abce 100644 --- a/tools/lib/h5tools_utils.h +++ b/tools/lib/h5tools_utils.h @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Bill Wendling + * Programmer: Bill Wendling * Tuesday, 6. March 2001 * * Purpose: Support functions for the various tools. @@ -176,10 +176,15 @@ H5TOOLS_DLL void h5tools_setprogname(const char *progname); H5TOOLS_DLL int h5tools_getstatus(void); H5TOOLS_DLL void h5tools_setstatus(int d_status); H5TOOLS_DLL int h5tools_getenv_update_hyperslab_bufsize(void); -H5TOOLS_DLL int h5tools_set_configured_fapl(hid_t fapl_id, const char vfd_name[], void *fapl_t_ptr); #ifdef H5_HAVE_ROS3_VFD -H5TOOLS_DLL int h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, const char **values); +H5TOOLS_DLL herr_t h5tools_parse_ros3_fapl_tuple(const char *tuple_str, int delim, + H5FD_ros3_fapl_t *fapl_config_out); +H5TOOLS_DLL herr_t h5tools_populate_ros3_fapl(H5FD_ros3_fapl_t *fa, const char **values); #endif /* H5_HAVE_ROS3_VFD */ +#ifdef H5_HAVE_LIBHDFS +H5TOOLS_DLL herr_t h5tools_parse_hdfs_fapl_tuple(const char *tuple_str, int delim, + H5FD_hdfs_fapl_t *fapl_config_out); +#endif #ifdef __cplusplus } diff --git a/tools/lib/io_timer.c b/tools/lib/io_timer.c index 58d3b65..7c01814 100644 --- a/tools/lib/io_timer.c +++ b/tools/lib/io_timer.c @@ -23,7 +23,6 @@ */ #include "H5private.h" -#include "hdf5.h" #include "io_timer.h" diff --git a/tools/libtest/Makefile.am b/tools/libtest/Makefile.am index a93e25d..87cb6fa 100644 --- a/tools/libtest/Makefile.am +++ b/tools/libtest/Makefile.am @@ -22,13 +22,12 @@ include $(top_srcdir)/config/commence.am # Include src and tools/lib directories AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib -# All programs depend on the hdf5 and h5tools libraries -LDADD=$(LIBH5TOOLS) $(LIBHDF5) - +#test programs +TEST_PROG=h5tools_test_utils -# main target -bin_PROGRAMS=h5tools_test_utils -# check_PROGRAMS=$(TEST_PROG) +check_PROGRAMS=$(TEST_PROG) +# All programs depend on the hdf5 and h5tools libraries +LDADD=$(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) include $(top_srcdir)/config/conclude.am diff --git a/tools/libtest/Makefile.in b/tools/libtest/Makefile.in index 496af04..7184399 100644 --- a/tools/libtest/Makefile.in +++ b/tools/libtest/Makefile.in @@ -29,7 +29,6 @@ # # HDF5 Library Makefile(.in) # - VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ @@ -104,8 +103,8 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -bin_PROGRAMS = h5tools_test_utils$(EXEEXT) -TESTS = +check_PROGRAMS = $(am__EXEEXT_1) +TESTS = $(am__EXEEXT_1) subdir = tools/libtest ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \ @@ -117,12 +116,12 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/H5config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" -PROGRAMS = $(bin_PROGRAMS) +am__EXEEXT_1 = h5tools_test_utils$(EXEEXT) h5tools_test_utils_SOURCES = h5tools_test_utils.c h5tools_test_utils_OBJECTS = h5tools_test_utils.$(OBJEXT) h5tools_test_utils_LDADD = $(LDADD) -h5tools_test_utils_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5) +h5tools_test_utils_DEPENDENCIES = $(LIBH5TOOLS) $(LIBH5TEST) \ + $(LIBHDF5) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -372,11 +371,8 @@ am__set_TESTS_bases = \ RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log -am__test_logs1 = $(TESTS:=.log) -am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) -TEST_LOGS = $(am__test_logs2:.sh.log=.log) -SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/bin/test-driver -SH_LOG_COMPILE = $(SH_LOG_COMPILER) $(AM_SH_LOG_FLAGS) $(SH_LOG_FLAGS) +LOG_DRIVER = $(SHELL) $(top_srcdir)/bin/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ @@ -387,6 +383,11 @@ am__set_b = \ *) \ b='$*';; \ esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.sh.log=.log) +SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/bin/test-driver +SH_LOG_COMPILE = $(SH_LOG_COMPILER) $(AM_SH_LOG_FLAGS) $(SH_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/bin/depcomp \ $(top_srcdir)/bin/mkinstalldirs $(top_srcdir)/bin/test-driver \ $(top_srcdir)/config/commence.am \ @@ -398,19 +399,18 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ # Include src and tools/lib directories AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/tools/lib -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -441,6 +441,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -468,8 +469,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -648,15 +647,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -677,8 +676,11 @@ TRACE = perl $(top_srcdir)/bin/trace # *.clog and *.clog2 are from the MPE option. CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 +#test programs +TEST_PROG = h5tools_test_utils + # All programs depend on the hdf5 and h5tools libraries -LDADD = $(LIBH5TOOLS) $(LIBHDF5) +LDADD = $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) # Automake needs to be taught how to build lib, progs and tests targets. # These will be filled in automatically for the most part (e.g., @@ -691,7 +693,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -734,49 +736,9 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - || test -f $$p1 \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' \ - `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ @@ -994,7 +956,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 -recheck: all +recheck: all $(check_PROGRAMS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ @@ -1005,6 +967,13 @@ recheck: all am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? +h5tools_test_utils.log: h5tools_test_utils$(EXEEXT) + @p='h5tools_test_utils$(EXEEXT)'; \ + b='h5tools_test_utils'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) .sh.log: @p='$<'; \ $(am__set_b); \ @@ -1051,13 +1020,11 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am -all-am: Makefile $(PROGRAMS) all-local +all-am: Makefile all-local installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -1093,7 +1060,8 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -1119,7 +1087,7 @@ install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-binPROGRAMS +install-exec-am: install-html: install-html-am @@ -1159,24 +1127,23 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binPROGRAMS +uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \ - check-am clean clean-binPROGRAMS clean-generic clean-libtool \ + check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - mostlyclean-local pdf pdf-am ps ps-am recheck tags tags-am \ - uninstall uninstall-am uninstall-binPROGRAMS + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \ + pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am .PRECIOUS: Makefile @@ -1186,8 +1153,9 @@ uninstall-am: uninstall-binPROGRAMS # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp @@ -1420,7 +1388,6 @@ check-vfd: $(LIB) $(PROGS) $(chk_TESTS) HDF5_DRIVER=$$vfd $(MAKE) $(AM_MAKEFLAGS) check || exit 1; \ fi; \ done -# check_PROGRAMS=$(TEST_PROG) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c index 8543feb..069d62f 100644 --- a/tools/libtest/h5tools_test_utils.c +++ b/tools/libtest/h5tools_test_utils.c @@ -16,6 +16,7 @@ * Jacob Smith 2017-11-10 */ +#include "h5tools.h" #include "h5tools_utils.h" #include "h5test.h" diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in index 31298b7..24e1579 100644 --- a/tools/misc/Makefile.in +++ b/tools/misc/Makefile.in @@ -420,19 +420,18 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ # Include src directory AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/tools/lib -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -463,6 +462,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -490,8 +490,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -670,15 +668,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -728,7 +726,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1255,8 +1253,9 @@ uninstall-am: uninstall-binPROGRAMS # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/tools/misc/h5mkgrp.c b/tools/misc/h5mkgrp.c index f3af4ed..7e92c83 100644 --- a/tools/misc/h5mkgrp.c +++ b/tools/misc/h5mkgrp.c @@ -28,15 +28,17 @@ static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"latest", no_a {"version", no_arg, 'V'}, {NULL, 0, '\0'}}; /* Command line parameter settings */ -typedef struct { +typedef struct mkgrp_opt_t { char * fname; /* File name to operate on */ hbool_t latest; /* Whether file should use latest format versions */ hbool_t verbose; /* Whether output should be verbose */ hbool_t parents; /* Whether to create intermediate groups */ size_t ngroups; /* Number of groups to create */ char ** groups; /* Pointer to array of group names */ -} param_t; -param_t params; /* Command line parameter settings */ + hid_t fapl_id; /* fapl to use when opening the file */ +} mkgrp_opt_t; + +mkgrp_opt_t params_g; /* Command line parameter settings */ /*------------------------------------------------------------------------- * Function: leave @@ -54,13 +56,17 @@ leave(int ret) { size_t curr_group; - if (params.fname) - HDfree(params.fname); - if (params.ngroups) { - for (curr_group = 0; curr_group < params.ngroups; curr_group++) - HDfree(params.groups[curr_group]); - HDfree(params.groups); + if (params_g.fname) + HDfree(params_g.fname); + if (params_g.ngroups) { + for (curr_group = 0; curr_group < params_g.ngroups; curr_group++) + HDfree(params_g.groups[curr_group]); + HDfree(params_g.groups); } + if (H5I_INVALID_HID != params_g.fapl_id && H5P_DEFAULT != params_g.fapl_id) + if (H5Pclose(params_g.fapl_id) < 0) + error_msg("Could not close file access property list\n"); + h5tools_close(); HDexit(ret); } /* end leave() */ @@ -77,64 +83,68 @@ leave(int ret) *------------------------------------------------------------------------- */ static void -usage(void) +usage(const char *prog) { - HDfprintf(stdout, "\ -usage: h5mkgrp [OPTIONS] FILE GROUP...\n\ - OPTIONS\n\ - -h, --help Print a usage message and exit\n\ - -l, --latest Use latest version of file format to create groups\n\ - -p, --parents No error if existing, make parent groups as needed\n\ - -v, --verbose Print information about OBJECTS and OPTIONS\n\ - -V, --version Print version number and exit\n"); + FLUSHSTREAM(rawoutstream); + PRINTSTREAM(rawoutstream, "usage: %s [OPTIONS] FILE GROUP...\n", prog); + PRINTVALSTREAM(rawoutstream, " OPTIONS\n"); + PRINTVALSTREAM(rawoutstream, " -h, --help Print a usage message and exit\n"); + PRINTVALSTREAM(rawoutstream, + " -l, --latest Use latest version of file format to create groups\n"); + PRINTVALSTREAM(rawoutstream, + " -p, --parents No error if existing, make parent groups as needed\n"); + PRINTVALSTREAM(rawoutstream, " -v, --verbose Print information about OBJECTS and OPTIONS\n"); + PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n"); + PRINTVALSTREAM(rawoutstream, "\n"); } /* end usage() */ /*------------------------------------------------------------------------- - * Function: parse_command_line + * Function: parse_command_line * - * Purpose: Parses command line and sets up global variable to control output + * Purpose: Parses command line and sets up global variable to control + * output * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * * Programmer: Quincey Koziol, 2/13/2007 * *------------------------------------------------------------------------- */ static int -parse_command_line(int argc, const char *argv[], param_t *parms) +parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options) { int opt; /* Option from command line */ size_t curr_group; /* Current group name to copy */ /* Check for empty command line */ if (argc == 1) { - usage(); + usage(h5tools_getprogname()); leave(EXIT_SUCCESS); - } /* end if */ + } /* Parse command line options */ while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { /* Display 'help' */ case 'h': - usage(); + usage(h5tools_getprogname()); leave(EXIT_SUCCESS); break; /* Create objects with the latest version of the format */ case 'l': - parms->latest = TRUE; + options->latest = TRUE; break; /* Create parent groups */ case 'p': - parms->parents = TRUE; + options->parents = TRUE; break; /* Verbose output */ case 'v': - parms->verbose = TRUE; + options->verbose = TRUE; break; /* Display version */ @@ -145,7 +155,7 @@ parse_command_line(int argc, const char *argv[], param_t *parms) /* Bad command line argument */ default: - usage(); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); } /* end switch */ } /* end while */ @@ -153,43 +163,34 @@ parse_command_line(int argc, const char *argv[], param_t *parms) /* Check for file name to be processed */ if (argc <= opt_ind) { error_msg("missing file name\n"); - usage(); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); - } /* end if */ + } /* Retrieve file name */ - parms->fname = HDstrdup(argv[opt_ind]); + options->fname = HDstrdup(argv[opt_ind]); opt_ind++; /* Check for group(s) to be created */ if (argc <= opt_ind) { error_msg("missing group name(s)\n"); - usage(); + usage(h5tools_getprogname()); leave(EXIT_FAILURE); - } /* end if */ + } /* Allocate space for the group name pointers */ - parms->ngroups = (size_t)(argc - opt_ind); - parms->groups = (char **)HDmalloc(parms->ngroups * sizeof(char *)); + options->ngroups = (size_t)(argc - opt_ind); + options->groups = (char **)HDmalloc(options->ngroups * sizeof(char *)); /* Retrieve the group names */ curr_group = 0; while (opt_ind < argc) { - parms->groups[curr_group] = HDstrdup(argv[opt_ind]); + options->groups[curr_group] = HDstrdup(argv[opt_ind]); curr_group++; opt_ind++; - } /* end while */ - -#ifdef QAK - HDfprintf(stderr, "parms->parents = %t\n", parms->parents); - HDfprintf(stderr, "parms->verbose = %t\n", parms->verbose); - HDfprintf(stderr, "parms->fname = '%s'\n", parms->fname); - HDfprintf(stderr, "parms->ngroups = %Zu\n", parms->ngroups); - for (curr_group = 0; curr_group < parms->ngroups; curr_group++) - HDfprintf(stderr, "parms->group[%Zu] = '%s'\n", curr_group, parms->groups[curr_group]); -#endif /* QAK */ - - return (0); + } + + return 0; } /* parse_command_line() */ /*------------------------------------------------------------------------- @@ -204,117 +205,112 @@ parse_command_line(int argc, const char *argv[], param_t *parms) int main(int argc, const char *argv[]) { - hid_t fid; /* HDF5 file ID */ - hid_t fapl_id; /* File access property list ID */ - hid_t lcpl_id; /* Link creation property list ID */ - size_t curr_group; /* Current group to create */ + hid_t fid = H5I_INVALID_HID; /* HDF5 file ID */ + hid_t lcpl_id = H5I_INVALID_HID; /* Link creation property list ID */ + size_t curr_group; /* Current group to create */ h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* Disable the HDF5 library's error reporting */ - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ h5tools_init(); - /* Parse command line */ - HDmemset(¶ms, 0, sizeof(params)); - if (parse_command_line(argc, argv, ¶ms) < 0) { - error_msg("unable to parse command line arguments\n"); - leave(EXIT_FAILURE); - } /* end if */ + /* Initialize the parameters */ + HDmemset(¶ms_g, 0, sizeof(params_g)); /* Create file access property list */ - if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) { + if ((params_g.fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) { error_msg("Could not create file access property list\n"); leave(EXIT_FAILURE); - } /* end if */ + } + + /* Parse command line */ + if (parse_command_line(argc, argv, ¶ms_g) < 0) { + error_msg("unable to parse command line arguments\n"); + leave(EXIT_FAILURE); + } + + /* enable error reporting if command line option */ + h5tools_error_report(); /* Check for creating groups with new format version */ - if (params.latest) { + if (params_g.latest) { /* Set the "use the latest version of the format" bounds */ - if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) { + if (H5Pset_libver_bounds(params_g.fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) { error_msg("Could not set property for using latest version of the format\n"); leave(EXIT_FAILURE); - } /* end if */ + } /* Display some output if requested */ - if (params.verbose) + if (params_g.verbose) HDprintf("%s: Creating groups with latest version of the format\n", h5tools_getprogname()); - } /* end if */ + } /* Attempt to open an existing HDF5 file first */ - fid = h5tools_fopen(params.fname, H5F_ACC_RDWR, fapl_id, NULL, NULL, 0); + fid = h5tools_fopen(params_g.fname, H5F_ACC_RDWR, params_g.fapl_id, FALSE, NULL, 0); /* If we couldn't open an existing file, try creating file */ /* (use "EXCL" instead of "TRUNC", so we don't blow away existing non-HDF5 file) */ if (fid < 0) - fid = H5Fcreate(params.fname, H5F_ACC_EXCL, H5P_DEFAULT, fapl_id); + fid = H5Fcreate(params_g.fname, H5F_ACC_EXCL, H5P_DEFAULT, params_g.fapl_id); /* Test for error in opening file */ if (fid < 0) { - error_msg("Could not open output file '%s'\n", params.fname); + error_msg("Could not open output file '%s'\n", params_g.fname); leave(EXIT_FAILURE); - } /* end if */ + } /* Create link creation property list */ if ((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0) { error_msg("Could not create link creation property list\n"); leave(EXIT_FAILURE); - } /* end if */ + } /* Check for creating intermediate groups */ - if (params.parents) { + if (params_g.parents) { /* Set the intermediate group creation property */ if (H5Pset_create_intermediate_group(lcpl_id, TRUE) < 0) { error_msg("Could not set property for creating parent groups\n"); leave(EXIT_FAILURE); - } /* end if */ + } /* Display some output if requested */ - if (params.verbose) + if (params_g.verbose) HDprintf("%s: Creating parent groups\n", h5tools_getprogname()); - } /* end if */ + } /* Loop over creating requested groups */ - for (curr_group = 0; curr_group < params.ngroups; curr_group++) { + for (curr_group = 0; curr_group < params_g.ngroups; curr_group++) { hid_t gid; /* Group ID */ /* Attempt to create a group */ - if ((gid = H5Gcreate2(fid, params.groups[curr_group], lcpl_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - error_msg("Could not create group '%s'\n", params.groups[curr_group]); + if ((gid = H5Gcreate2(fid, params_g.groups[curr_group], lcpl_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) { + error_msg("Could not create group '%s'\n", params_g.groups[curr_group]); leave(EXIT_FAILURE); - } /* end if */ + } /* Close the group */ if (H5Gclose(gid) < 0) { - error_msg("Could not close group '%s'??\n", params.groups[curr_group]); + error_msg("Could not close group '%s'??\n", params_g.groups[curr_group]); leave(EXIT_FAILURE); - } /* end if */ + } /* Display some output if requested */ - if (params.verbose) - HDprintf("%s: created group '%s'\n", h5tools_getprogname(), params.groups[curr_group]); + if (params_g.verbose) + HDprintf("%s: created group '%s'\n", h5tools_getprogname(), params_g.groups[curr_group]); } /* end for */ /* Close link creation property list */ if (H5Pclose(lcpl_id) < 0) { error_msg("Could not close link creation property list\n"); leave(EXIT_FAILURE); - } /* end if */ + } /* Close file */ if (H5Fclose(fid) < 0) { - error_msg("Could not close output file '%s'??\n", params.fname); + error_msg("Could not close output file '%s'??\n", params_g.fname); leave(EXIT_FAILURE); - } /* end if */ - - /* Close file access property list */ - if (H5Pclose(fapl_id) < 0) { - error_msg("Could not close file access property list\n"); - leave(EXIT_FAILURE); - } /* end if */ + } leave(EXIT_SUCCESS); } /* end main() */ diff --git a/tools/misc/h5repart.c b/tools/misc/h5repart.c index f13f801..93b6abf 100644 --- a/tools/misc/h5repart.c +++ b/tools/misc/h5repart.c @@ -12,7 +12,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, May 13, 1998 * * Purpose: Repartitions a file family. This program can be used to diff --git a/tools/misc/testfiles/h5mkgrp_help.txt b/tools/misc/testfiles/h5mkgrp_help.txt index ba130f6..2f67c4b 100644 --- a/tools/misc/testfiles/h5mkgrp_help.txt +++ b/tools/misc/testfiles/h5mkgrp_help.txt @@ -5,3 +5,4 @@ usage: h5mkgrp [OPTIONS] FILE GROUP... -p, --parents No error if existing, make parent groups as needed -v, --verbose Print information about OBJECTS and OPTIONS -V, --version Print version number and exit + diff --git a/tools/perform/Makefile.in b/tools/perform/Makefile.in index cabd9dd..221752d 100644 --- a/tools/perform/Makefile.in +++ b/tools/perform/Makefile.in @@ -441,17 +441,16 @@ AMTAR = @AMTAR@ # H5_CFLAGS holds flags that should be used when building hdf5, # but which should not be exported to h5cc for building other programs. -# AM_CFLAGS is an automake construct which should be used by Makefiles +# AM_CFLAGS is an automake construct which should be used by Makefiles # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/test -I$(top_srcdir)/tools/lib -AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ -AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -482,6 +481,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@ DEV_WARNINGS = @DEV_WARNINGS@ +DIAGS = @DIAGS@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ @@ -509,8 +509,6 @@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_ECFLAGS = @H5_ECFLAGS@ -H5_ECXXFLAGS = @H5_ECXXFLAGS@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ @@ -689,15 +687,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la -# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below -# has been removed. According to the official description of DESTDIR by Gnu at -# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is -# prepended to the normal and complete install path that it precedes for the -# purpose of installing in a temporary directory which is useful for building -# rpms and other packages. The '/' after ${DESTDIR} will be followed by another -# '/' at the beginning of the normal install path. When DESTDIR is empty the -# path then begins with '//', which is incorrect and causes problems at least for -# Cygwin. +# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below +# has been removed. According to the official description of DESTDIR by Gnu at +# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is +# prepended to the normal and complete install path that it precedes for the +# purpose of installing in a temporary directory which is useful for building +# rpms and other packages. The '/' after ${DESTDIR} will be followed by another +# '/' at the beginning of the normal install path. When DESTDIR is empty the +# path then begins with '//', which is incorrect and causes problems at least for +# Cygwin. # Scripts used to build examples # If only shared libraries have been installed, have h5cc build examples with @@ -763,7 +761,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \ PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \ $(EXTRA_PROG) -chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) +chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) AM_SH_LOG_FLAGS = @@ -1350,8 +1348,9 @@ uninstall-am: uninstall-binPROGRAMS # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - install-doc lib progs tests uninstall-doc _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp -- cgit v0.12