diff --git a/.github/workflows/cmake-bintest.yml b/.github/workflows/cmake-bintest.yml index ca55ef04b8f..4c8510e3f5a 100644 --- a/.github/workflows/cmake-bintest.yml +++ b/.github/workflows/cmake-bintest.yml @@ -147,7 +147,7 @@ jobs: # MacOS w/ Clang + CMake # name: "MacOS Clang Binary Test" - runs-on: macos-latest + runs-on: macos-13 steps: - name: Install Dependencies (MacOS) run: brew install ninja doxygen @@ -161,7 +161,7 @@ jobs: - name: Get published binary (MacOS) uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: - name: tgz-osx-${{ inputs.build_mode }}-binary + name: tgz-osx13-${{ inputs.build_mode }}-binary path: ${{ github.workspace }} - name: Uncompress hdf5 binary (MacOS) @@ -204,3 +204,64 @@ jobs: cmake --workflow --preset=ci-StdShar-OSX-Clang --fresh shell: bash + test_binary_mac_latest: + # MacOS w/ Clang + CMake + # + name: "MacOS Clang Binary Test" + runs-on: macos-latest + steps: + - name: Install Dependencies (MacOS_latest) + run: brew install ninja doxygen + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + + - name: Get published binary (MacOS_latest) + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + with: + name: tgz-osx-${{ inputs.build_mode }}-binary + path: ${{ github.workspace }} + + - name: Uncompress hdf5 binary (MacOS_latest) + run: | + cd "${{ github.workspace }}" + tar -zxvf ${{ github.workspace }}/HDF5-*-Darwin.tar.gz --strip-components 1 + + - name: set hdf5lib name + id: set-hdf5lib-name + run: | + HDF5DIR=${{ github.workspace }}/HDF_Group/HDF5/ + FILE_NAME_HDF5=$(ls ${{ github.workspace }}/HDF_Group/HDF5) + echo "HDF5_ROOT=$HDF5DIR$FILE_NAME_HDF5" >> $GITHUB_OUTPUT + echo "HDF5_PLUGIN_PATH=$HDF5_ROOT/lib/plugin" >> $GITHUB_OUTPUT + + - name: List files for the binaries (MacOS_latest) + run: | + ls -l ${{ github.workspace }}/HDF_Group/HDF5 + + - name: List files for the space (MacOS_latest) + run: | + ls ${{ github.workspace }} + ls ${{ runner.workspace }} + + # symlinks the compiler executables to a common location + - name: Setup GNU Fortran + uses: fortran-lang/setup-fortran@v1 + id: setup-fortran + with: + compiler: gcc + version: 12 + + - name: Run ctest (MacOS_latest) + id: run-ctest + env: + HDF5_ROOT: ${{ steps.set-hdf5lib-name.outputs.HDF5_ROOT }} + HDF5_PLUGIN_PATH: ${{ steps.set-hdf5lib-name.outputs.HDF5_PLUGIN_PATH }} + run: | + cd "${{ steps.set-hdf5lib-name.outputs.HDF5_ROOT }}/share/HDF5Examples" + cmake --workflow --preset=ci-StdShar-OSX-Clang --fresh + shell: bash + diff --git a/.github/workflows/cmake-ctest.yml b/.github/workflows/cmake-ctest.yml index 728763d8b4f..d91e10cab60 100644 --- a/.github/workflows/cmake-ctest.yml +++ b/.github/workflows/cmake-ctest.yml @@ -86,11 +86,15 @@ jobs: cmake --workflow --preset=${{ inputs.preset_name }}-MSVC --fresh shell: bash - - name: Publish binary (Windows) - id: publish-ctest-binary + - name: Create build folders (Windows) run: | mkdir "${{ runner.workspace }}/build114" mkdir "${{ runner.workspace }}/build114/hdf5" + shell: bash + + - name: Publish binary (Windows) + id: publish-ctest-binary + run: | Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING -Destination ${{ runner.workspace }}/build114/hdf5/ Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 -Destination ${{ runner.workspace }}/build114/hdf5/ Copy-Item -Path ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-MSVC/README.md -Destination ${{ runner.workspace }}/build114/hdf5/ @@ -99,6 +103,17 @@ jobs: 7z a -tzip ${{ steps.set-file-base.outputs.FILE_BASE }}-win-vs2022_cl.zip hdf5 shell: pwsh + - name: Publish msi binary (Windows) + id: publish-ctest-msi-binary + run: | + Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING -Destination ${{ runner.workspace }}/build/hdf5/ + Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 -Destination ${{ runner.workspace }}/build/hdf5/ + Copy-Item -Path ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-MSVC/README.md -Destination ${{ runner.workspace }}/build/hdf5/ + Copy-Item -Path ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-MSVC/* -Destination ${{ runner.workspace }}/build/hdf5/ -Include *.msi + cd "${{ runner.workspace }}/build" + 7z a -tzip ${{ steps.set-file-base.outputs.FILE_BASE }}-win-vs2022_cl.msi.zip hdf5 + shell: pwsh + - name: List files in the space (Windows) run: | Get-ChildItem -Path ${{ github.workspace }} @@ -113,6 +128,13 @@ jobs: path: ${{ runner.workspace }}/build114/${{ steps.set-file-base.outputs.FILE_BASE }}-win-vs2022_cl.zip if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + - name: Save published msi binary (Windows) + uses: actions/upload-artifact@v4 + with: + name: msi-vs2022_cl-binary + path: ${{ runner.workspace }}/build/${{ steps.set-file-base.outputs.FILE_BASE }}-win-vs2022_cl.msi.zip + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + build_and_test_linux: # Linux (Ubuntu) w/ gcc + CMake # @@ -253,6 +275,12 @@ jobs: with: version: "1.9.7" + - name: Set up JDK 19 + uses: actions/setup-java@v4 + with: + java-version: '19' + distribution: 'temurin' + - name: Set file base name (MacOS) id: set-file-base run: | @@ -306,7 +334,7 @@ jobs: cp ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-Clang/README.md ${{ runner.workspace }}/build114/hdf5 cp ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-Clang/*.tar.gz ${{ runner.workspace }}/build114/hdf5 cd "${{ runner.workspace }}/build114" - tar -zcvf ${{ steps.set-file-base.outputs.FILE_BASE }}-osx.tar.gz hdf5 + tar -zcvf ${{ steps.set-file-base.outputs.FILE_BASE }}-osx13.tar.gz hdf5 shell: bash - name: List files in the space (MacOS) @@ -316,6 +344,95 @@ jobs: # Save files created by ctest script - name: Save published binary (MacOS) + uses: actions/upload-artifact@v4 + with: + name: tgz-osx13-binary + path: ${{ runner.workspace }}/build/${{ steps.set-file-base.outputs.FILE_BASE }}-osx13.tar.gz + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + + build_and_test_mac_latest: + # MacOS w/ Clang + CMake + # + name: "MacOS Clang CMake" + runs-on: macos-latest + steps: + - name: Install Dependencies (MacOS_latest) + run: brew install ninja + + - name: Install Dependencies + uses: ssciwr/doxygen-install@v1 + with: + version: "1.9.7" + + - name: Set up JDK 19 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + + - name: Set file base name (MacOS_latest) + id: set-file-base + run: | + FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") + echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT + if [[ '${{ inputs.use_environ }}' == 'release' ]] + then + SOURCE_NAME_BASE=$(echo "${{ inputs.snap_name }}") + else + SOURCE_NAME_BASE=$(echo "hdfsrc") + fi + echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT + + # Get files created by release script + - name: Get tgz-tarball (MacOS_latest) + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + with: + name: tgz-tarball + path: ${{ github.workspace }} + + - name: List files for the space (MacOS_latest) + run: | + ls ${{ github.workspace }} + ls ${{ runner.workspace }} + + - name: Uncompress source (MacOS_latest) + run: tar -zxvf ${{ github.workspace }}/${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz + + # symlinks the compiler executables to a common location + - name: Setup GNU Fortran + uses: fortran-lang/setup-fortran@v1 + id: setup-fortran + with: + compiler: gcc + version: 12 + + - name: Run ctest (MacOS_latest) + id: run-ctest + run: | + cd "${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}" + cmake --workflow --preset=${{ inputs.preset_name }}-OSX-Clang --fresh + shell: bash + + - name: Publish binary (MacOS_latest) + id: publish-ctest-binary + run: | + mkdir "${{ runner.workspace }}/build" + mkdir "${{ runner.workspace }}/build/hdf5" + cp ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING ${{ runner.workspace }}/build/hdf5 + cp ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 ${{ runner.workspace }}/build/hdf5 + cp ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-Clang/README.md ${{ runner.workspace }}/build/hdf5 + cp ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-Clang/*.tar.gz ${{ runner.workspace }}/build/hdf5 + cd "${{ runner.workspace }}/build" + tar -zcvf ${{ steps.set-file-base.outputs.FILE_BASE }}-osx.tar.gz hdf5 + shell: bash + + - name: List files in the space (MacOS_latest) + run: | + ls ${{ github.workspace }} + ls -l ${{ runner.workspace }} + + # Save files created by ctest script + - name: Save published binary (MacOS_latest) uses: actions/upload-artifact@v4 with: name: tgz-osx-binary @@ -457,11 +574,15 @@ jobs: cmake --workflow --preset=${{ inputs.preset_name }}-win-Intel --fresh shell: pwsh - - name: Publish binary (Windows_intel) - id: publish-ctest-binary + - name: Create build folders (Windows_intel) run: | mkdir "${{ runner.workspace }}/build114" mkdir "${{ runner.workspace }}/build114/hdf5" + shell: bash + + - name: Publish binary (Windows_intel) + id: publish-ctest-binary + run: | Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING -Destination ${{ runner.workspace }}/build114/hdf5/ Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 -Destination ${{ runner.workspace }}/build114/hdf5/ Copy-Item -Path ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-Intel/README.md -Destination ${{ runner.workspace }}/build114/hdf5/ @@ -470,6 +591,17 @@ jobs: 7z a -tzip ${{ steps.set-file-base.outputs.FILE_BASE }}-win-vs2022_intel.zip hdf5 shell: pwsh + - name: Publish msi binary (Windows_intel) + id: publish-ctest-msi-binary + run: | + Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING -Destination ${{ runner.workspace }}/build/hdf5/ + Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 -Destination ${{ runner.workspace }}/build/hdf5/ + Copy-Item -Path ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-Intel/README.md -Destination ${{ runner.workspace }}/build/hdf5/ + Copy-Item -Path ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-Intel/* -Destination ${{ runner.workspace }}/build/hdf5/ -Include *.msi + cd "${{ runner.workspace }}/build" + 7z a -tzip ${{ steps.set-file-base.outputs.FILE_BASE }}-win-vs2022_intel.msi.zip hdf5 + shell: pwsh + - name: List files in the space (Windows_intel) run: | Get-ChildItem -Path ${{ github.workspace }} @@ -484,6 +616,13 @@ jobs: path: ${{ runner.workspace }}/build114/${{ steps.set-file-base.outputs.FILE_BASE }}-win-vs2022_intel.zip if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + - name: Save published msi binary (Windows_intel) + uses: actions/upload-artifact@v4 + with: + name: msi-vs2022_intel-binary + path: ${{ runner.workspace }}/build/${{ steps.set-file-base.outputs.FILE_BASE }}-win-vs2022_intel.msi.zip + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + build_and_test_linux_intel: # Linux (Ubuntu) w/ OneAPI + CMake # diff --git a/.github/workflows/main-cmake.yml b/.github/workflows/main-cmake.yml index 7001ba0e0f8..0aedeb5b093 100644 --- a/.github/workflows/main-cmake.yml +++ b/.github/workflows/main-cmake.yml @@ -286,6 +286,14 @@ jobs: if: ${{ (matrix.os == 'ubuntu-latest') && (inputs.thread_safety != 'TS') }} - name: Save published binary (Mac) + uses: actions/upload-artifact@v4 + with: + name: tgz-osx13-${{ inputs.build_mode }}-binary + path: ${{ runner.workspace }}/build/HDF5-*-Darwin.tar.gz + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + if: ${{ (matrix.os == 'macos-13') && (inputs.thread_safety != 'TS') }} + + - name: Save published binary (Mac_latest) uses: actions/upload-artifact@v4 with: name: tgz-osx-${{ inputs.build_mode }}-binary diff --git a/.github/workflows/publish-branch.yml b/.github/workflows/publish-branch.yml new file mode 100644 index 00000000000..1e5b99bd0b0 --- /dev/null +++ b/.github/workflows/publish-branch.yml @@ -0,0 +1,45 @@ +name: hdf5 publish files in HDF5 folder from branch to S3 + +# Triggers the workflow on demand +on: + workflow_dispatch: + inputs: + local_dir: + description: 'HDF5 local directory' + type: string + required: true + target_dir: + description: 'hdf5 target bucket directory' + type: string + required: true + +permissions: + contents: read + +jobs: + publish-tag: + runs-on: ubuntu-latest + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Get Sources + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + fetch-depth: 0 + ref: '${{ github.head_ref || github.ref_name }}' + + - name: List files for the space + run: | + ls -l ${{ github.workspace }} + ls ${{ github.workspace }}/HDF5 + + - name: Setup AWS CLI + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Sync dir to S3 bucket + run: | + aws s3 sync ./HDF5/${{ inputs.local_dir }} s3://${{ secrets.AWS_S3_BUCKET }}/${{ vars.TARGET_PATH }}/${{ inputs.target_dir }} + diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 57922e80c5e..725c2b09c44 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -12,8 +12,9 @@ on: description: 'HDF5 target bucket directory' type: string required: true - permissions: - contents: read + +permissions: + contents: read jobs: publish-tag: @@ -47,9 +48,9 @@ jobs: aws s3 sync ./HDF5 s3://${{ secrets.AWS_S3_BUCKET }}/${{ vars.TARGET_PATH }}/${{ inputs.target_dir }}/downloads --delete - name: Uncompress source (Linux) - run: tar -zxvf ${{ github.workspace }}/${{ inputs.use_hdf }}.doxygen.tar.gz + run: tar -zxvf ${{ github.workspace }}/HDF5/${{ inputs.use_hdf }}.doxygen.tar.gz - name: Sync userguide to S3 bucket run: | - aws s3 sync ./doxygen s3://${{ secrets.AWS_S3_BUCKET }}/${{ vars.TARGET_PATH }}/${{ inputs.target_dir }}/documentation --delete + aws s3 sync ./HDF5/doxygen s3://${{ secrets.AWS_S3_BUCKET }}/${{ vars.TARGET_PATH }}/${{ inputs.target_dir }}/documentation/doxygen --delete diff --git a/.github/workflows/release-files.yml b/.github/workflows/release-files.yml index ea48b32a390..0f0ce783f49 100644 --- a/.github/workflows/release-files.yml +++ b/.github/workflows/release-files.yml @@ -100,6 +100,12 @@ jobs: name: zip-vs2022_cl-binary path: ${{ github.workspace }} + - name: Get published msi binary (Windows) + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + with: + name: msi-vs2022_cl-binary + path: ${{ github.workspace }} + - name: Get published binary (MacOS) uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: @@ -136,6 +142,12 @@ jobs: name: zip-vs2022_intel-binary path: ${{ github.workspace }} + - name: Get published msi binary (Windows_intel) + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + with: + name: msi-vs2022_intel-binary + path: ${{ github.workspace }} + - name: Get published binary (Linux_intel) uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: @@ -173,8 +185,10 @@ jobs: sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc.rpm.tar.gz >> ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc_s3.tar.gz >> ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_cl.zip >> ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt + sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_cl.msi.zip >> ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_intel.tar.gz >> ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_intel.zip >> ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt + sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_intel.msi.zip >> ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt sha256sum ${{ steps.get-file-base.outputs.FILE_BASE }}.html.abi.reports.tar.gz >> ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt - name: Create sha256 sums for files for nonversioned files @@ -216,8 +230,10 @@ jobs: ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc.rpm.tar.gz ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc_s3.tar.gz ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_cl.zip + ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_cl.msi.zip ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_intel.tar.gz ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_intel.zip + ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_intel.msi.zip ${{ steps.get-file-base.outputs.FILE_BASE }}.html.abi.reports.tar.gz ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` @@ -242,8 +258,10 @@ jobs: ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc.rpm.tar.gz ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc_s3.tar.gz ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_cl.zip + ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_cl.msi.zip ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_intel.tar.gz ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_intel.zip + ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_intel.msi.zip ${{ steps.get-file-base.outputs.FILE_BASE }}.html.abi.reports.tar.gz ${{ steps.get-file-base.outputs.FILE_BASE }}.sha256sums.txt if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` diff --git a/.github/workflows/remove-files.yml b/.github/workflows/remove-files.yml index 5f12525714a..e72a645eb1f 100644 --- a/.github/workflows/remove-files.yml +++ b/.github/workflows/remove-files.yml @@ -56,5 +56,7 @@ jobs: ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc.rpm.tar.gz ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc_s3.tar.gz ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_cl.zip + ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_cl.msi.zip ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_intel.tar.gz ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_intel.zip + ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_intel.msi.zip diff --git a/HDF5Examples/C/H5G/test-pc.sh b/HDF5Examples/C/H5G/test-pc.sh index 4c996a45a58..4cff7780fe7 100755 --- a/HDF5Examples/C/H5G/test-pc.sh +++ b/HDF5Examples/C/H5G/test-pc.sh @@ -1,7 +1,6 @@ #! /bin/sh # # Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including diff --git a/HDF5Examples/C/H5T/test-pc.sh b/HDF5Examples/C/H5T/test-pc.sh index 5a773f6097b..69c948759d2 100755 --- a/HDF5Examples/C/H5T/test-pc.sh +++ b/HDF5Examples/C/H5T/test-pc.sh @@ -1,7 +1,6 @@ #! /bin/sh # # Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including diff --git a/HDF5Examples/CMakePresets.json b/HDF5Examples/CMakePresets.json index d9fdd04201a..1dc335ea715 100644 --- a/HDF5Examples/CMakePresets.json +++ b/HDF5Examples/CMakePresets.json @@ -49,6 +49,8 @@ "description": "MSVC Standard Config for x64 (Release)", "inherits": [ "ci-x64-Release-MSVC", + "ci-StdJava", + "ci-StdFortran", "ci-StdShar" ] }, @@ -57,6 +59,8 @@ "description": "Clang Standard Config for x64 (Release)", "inherits": [ "ci-x64-Release-Clang", + "ci-StdJava", + "ci-StdFortran", "ci-StdShar" ] }, @@ -65,6 +69,8 @@ "description": "GNUC Standard Config for x64 (Release)", "inherits": [ "ci-x64-Release-GNUC", + "ci-StdJava", + "ci-StdFortran", "ci-StdShar" ] }, @@ -73,6 +79,8 @@ "description": "Intel Standard Config for x64 (Release)", "inherits": [ "ci-x64-Release-Intel", + "ci-StdJava", + "ci-StdFortran", "ci-StdShar" ] } @@ -98,7 +106,7 @@ "name": "ci-StdShar-GNUC", "description": "GNUC Standard Build for x64 (Release)", "configurePreset": "ci-StdShar-GNUC", - "verbose": false, + "verbose": true, "inherits": [ "ci-x64-Release-GNUC" ] @@ -107,7 +115,7 @@ "name": "ci-StdShar-Intel", "description": "Intel Standard Build for x64 (Release)", "configurePreset": "ci-StdShar-Intel", - "verbose": false, + "verbose": true, "inherits": [ "ci-x64-Release-Intel" ] diff --git a/HDF5Examples/FORTRAN/H5G/test-pc.sh b/HDF5Examples/FORTRAN/H5G/test-pc.sh index 90b02f117dd..29781f3565d 100755 --- a/HDF5Examples/FORTRAN/H5G/test-pc.sh +++ b/HDF5Examples/FORTRAN/H5G/test-pc.sh @@ -1,7 +1,6 @@ #! /bin/sh # # Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including diff --git a/HDF5Examples/FORTRAN/H5T/test-pc.sh b/HDF5Examples/FORTRAN/H5T/test-pc.sh index c11fa1d8297..12163a6f1f4 100755 --- a/HDF5Examples/FORTRAN/H5T/test-pc.sh +++ b/HDF5Examples/FORTRAN/H5T/test-pc.sh @@ -1,7 +1,6 @@ #! /bin/sh # # Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including diff --git a/HDF5Examples/config/cmake/HDFExampleMacros.cmake b/HDF5Examples/config/cmake/HDFExampleMacros.cmake index c5e7b70c6bb..9888c06d36a 100644 --- a/HDF5Examples/config/cmake/HDFExampleMacros.cmake +++ b/HDF5Examples/config/cmake/HDFExampleMacros.cmake @@ -191,9 +191,17 @@ macro (HDF5_SUPPORT) endif () set (H5EX_HDF5_DUMP_EXECUTABLE $) else () + if (HDF5_BUILD_MODE) + string (TOUPPER "_${HDF5_BUILD_MODE}" UPPER_BUILD_TYPE) + elseif (HDF_CFG_NAME) + string (TOUPPER "_${HDF_CFG_NAME}" UPPER_BUILD_TYPE) + else () + set (UPPER_BUILD_TYPE "") + endif () + get_filename_component (_LIBRARY_PATH ${HDF5_INCLUDE_DIR} DIRECTORY) + set (HDF5_LIBRARY_PATH "${_LIBRARY_PATH}/lib") if (USE_SHARED_LIBS AND HDF5_shared_C_FOUND) set (H5EX_HDF5_LINK_LIBS ${H5EX_HDF5_LINK_LIBS} ${HDF5_C_SHARED_LIBRARY}) - set (HDF5_LIBRARY_PATH ${PACKAGE_PREFIX_DIR}/lib) else () set (H5EX_HDF5_LINK_LIBS ${H5EX_HDF5_LINK_LIBS} ${HDF5_C_STATIC_LIBRARY}) endif () @@ -227,20 +235,11 @@ macro (HDF5_SUPPORT) if (HDF_BUILD_JAVA AND HDF5_Java_FOUND) if (${HDF5_BUILD_JAVA}) set (CMAKE_JAVA_INCLUDE_PATH "${CMAKE_JAVA_INCLUDE_PATH};${HDF5_JAVA_INCLUDE_DIRS}") - if (HDF5_BUILD_MODE) - string(TOUPPER "${HDF5_BUILD_MODE}" UPPER_BUILD_TYPE) - get_target_property(libsoname ${HDF5_JAVA_LIBRARY} IMPORTED_SONAME_${UPPER_BUILD_TYPE}) - elseif (HDF_CFG_NAME) - string(TOUPPER "${HDF_CFG_NAME}" UPPER_BUILD_TYPE) - get_target_property(libsoname ${HDF5_JAVA_LIBRARY} IMPORTED_SONAME_${UPPER_BUILD_TYPE}) - else() - get_target_property(libsoname ${HDF5_JAVA_LIBRARY} IMPORTED_SONAME) - endif() + get_target_property (libsoname ${HDF5_JAVA_LIBRARY} IMPORTED_SONAME${UPPER_BUILD_TYPE}) get_filename_component (libname ${libsoname} NAME_WE) string (REGEX REPLACE "^lib" "" libname ${libname}) message (STATUS "HDF5 lib:${HDF5_JAVA_LIBRARY} OR ${libsoname} OR ${libname}") set (H5EX_JAVA_LIBRARY ${libname}) -# set (H5EX_JAVA_LIBRARY $) set (H5EX_JAVA_LIBRARIES ${HDF5_JAVA_LIBRARY}) message (STATUS "HDF5 lib:${H5EX_JAVA_LIBRARY} jars:${HDF5_JAVA_INCLUDE_DIRS}}") else () diff --git a/src/H5D.c b/src/H5D.c index e7c3f4df0b3..7416405e7f9 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -1874,7 +1874,7 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *s FUNC_ENTER_API(FAIL) /* Check args */ - if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(dataset_id))) + if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dataset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataset identifier"); if (H5I_DATATYPE != H5I_get_type(type_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid datatype identifier"); diff --git a/src/H5F.c b/src/H5F.c index 5dcda189241..390f667648b 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -118,7 +118,7 @@ H5Fget_create_plist(hid_t file_id) FUNC_ENTER_API(H5I_INVALID_HID) /* check args */ - if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id))) + if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid file identifier"); /* Set up VOL callback arguments */ @@ -164,7 +164,7 @@ H5Fget_access_plist(hid_t file_id) FUNC_ENTER_API(H5I_INVALID_HID) /* Check args */ - if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id))) + if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid file identifier"); /* Set up VOL callback arguments */ @@ -439,7 +439,7 @@ H5Fget_vfd_handle(hid_t file_id, hid_t fapl_id, void **file_handle /*out*/) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file handle pointer"); /* Get the file object */ - if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id))) + if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier"); /* Set up VOL callback arguments */ @@ -1555,7 +1555,7 @@ H5Fget_intent(hid_t file_id, unsigned *intent_flags /*out*/) H5VL_file_get_args_t vol_cb_args; /* Arguments to VOL callback */ /* Get the internal file structure */ - if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id))) + if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier"); /* Set up VOL callback arguments */ @@ -1594,7 +1594,7 @@ H5Fget_fileno(hid_t file_id, unsigned long *fnumber /*out*/) H5VL_file_get_args_t vol_cb_args; /* Arguments to VOL callback */ /* Get the internal file structure */ - if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id))) + if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier"); /* Set up VOL callback arguments */ @@ -1631,7 +1631,7 @@ H5Fget_freespace(hid_t file_id) FUNC_ENTER_API((-1)) /* Get the file object */ - if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id))) + if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "invalid file identifier"); /* Set up VOL callback arguments */ @@ -1789,7 +1789,7 @@ H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config /*out*/) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad config ptr"); /* Get the file object */ - if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id))) + if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier"); /* Set up VOL callback arguments */ @@ -1827,7 +1827,7 @@ H5Fset_mdc_config(hid_t file_id, const H5AC_cache_config_t *config_ptr) FUNC_ENTER_API(FAIL) /* Get the file object */ - if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id))) + if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier"); /* Set up VOL callback arguments */ @@ -1959,7 +1959,7 @@ H5Freset_mdc_hit_rate_stats(hid_t file_id) FUNC_ENTER_API(FAIL) /* Get the file object */ - if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id))) + if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier"); /* Set up VOL callback arguments */ diff --git a/test/cache_api.c b/test/cache_api.c index de636cf4bb2..cf0df5d4647 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -1858,6 +1858,15 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) /* test H5Fget_mdc_config(). */ + /* Create an ID to use in the H5Fset_mdc_config/H5Fget_mdc_config tests */ + hid_t dtype_id = H5Tcopy(H5T_NATIVE_INT); + + if (dtype_id < 0) { + + pass = false; + failure_mssg = "H5Tcopy() failed.\n"; + } + scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER; if (pass) { @@ -1877,6 +1886,18 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) pass = false; failure_mssg = "H5Fget_mdc_config() accepted invalid file_id."; } + + H5E_BEGIN_TRY + { + result = H5Fget_mdc_config(dtype_id, &scratch); /* not a file ID */ + } + H5E_END_TRY + + if (result >= 0) { + + pass = false; + failure_mssg = "H5Fget_mdc_config() accepted an ID that is not a file ID."; + } } if (pass) { @@ -1941,6 +1962,27 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) pass = false; failure_mssg = "H5Fset_mdc_config() accepted bad invalid file_id."; } + + H5E_BEGIN_TRY + { + result = H5Fset_mdc_config(dtype_id, &default_config); + } + H5E_END_TRY + + if (result >= 0) { + + pass = false; + failure_mssg = "H5Fset_mdc_config() accepted an ID that is not a file ID."; + } + } + + /* Close the temporary datatype */ + result = H5Tclose(dtype_id); + + if (result < 0) { + + pass = false; + failure_mssg = "H5Tclose() failed.\n"; } if (pass) { @@ -2050,6 +2092,37 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) pass = false; failure_mssg = "H5Freset_mdc_hit_rate_stats() accepted bad file_id."; } + + /* Create an ID to use in the next test */ + hid_t scalarsp_id = H5Screate(H5S_SCALAR); + + if (scalarsp_id < 0) { + + pass = false; + failure_mssg = "H5Screate() failed.\n"; + } + + /* Try to call H5Freset_mdc_hit_rate_stats with an inappropriate ID */ + H5E_BEGIN_TRY + { + result = H5Freset_mdc_hit_rate_stats(scalarsp_id); + } + H5E_END_TRY + + if (result >= 0) { + + pass = false; + failure_mssg = "H5Freset_mdc_hit_rate_stats() accepted an ID that is not a file_id."; + } + + /* Close the temporary dataspace */ + result = H5Sclose(scalarsp_id); + + if (result < 0) { + + pass = false; + failure_mssg = "H5Sclose() failed.\n"; + } } /* test H5Fget_mdc_size() */ diff --git a/test/testframe.c b/test/testframe.c index ff12413a62e..50daede8eea 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -590,7 +590,7 @@ TestErrPrintf(const char *format, ...) * Set (control) which test will be tested. * SKIPTEST: skip this test * ONLYTEST: do only this test - * BEGINETEST: skip all tests before this test + * BEGINTEST: skip all tests before this test * */ void diff --git a/test/tid.c b/test/tid.c index ccc61ba854d..0a2f658e4c2 100644 --- a/test/tid.c +++ b/test/tid.c @@ -18,6 +18,10 @@ #define H5I_FRIEND /*suppress error about including H5Ipkg */ #include "H5Ipkg.h" +/* Defines used in test_appropriate_ids */ +#define FILE_NAME "tid.h5" +#define DSET_NAME "Dataset 1" + static herr_t free_wrapper(void *p, void H5_ATTR_UNUSED **_ctx) { @@ -1369,6 +1373,127 @@ test_future_ids(void) return -1; } /* end test_future_ids() */ +/*------------------------------------------------------------------------- + * Function: test_appropriate_ids + * + * Purpose: Tests several API functions on detecting inappropriate ID. + * + * Return: Success: 0 + * Failure: number of errors + * + *------------------------------------------------------------------------- + */ +static int +test_appropriate_ids(void) +{ + hid_t file_id = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; + hid_t fcpl_id = H5I_INVALID_HID; + hid_t plist = H5I_INVALID_HID; + hid_t dset_id = H5I_INVALID_HID; + hid_t space_id = H5I_INVALID_HID; + hsize_t dims = 2; + hssize_t free_space; + herr_t ret = SUCCEED; /* Generic return value */ + + /* Create file create property list */ + fcpl_id = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl_id, H5I_INVALID_HID, "H5Pcreate"); + + file_id = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT); + CHECK(file_id, H5I_INVALID_HID, "H5Fcreate"); + + /* Create a dataset in the file */ + space_id = H5Screate_simple(1, &dims, NULL); + CHECK(space_id, H5I_INVALID_HID, "H5Screate_simple"); + dset_id = H5Dcreate2(file_id, DSET_NAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dset_id, H5I_INVALID_HID, "H5Dcreate2"); + + /* Close IDs */ + ret = H5Pclose(fcpl_id); + CHECK(ret, FAIL, "H5Pclose"); + ret = H5Sclose(space_id); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Dclose(dset_id); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Fclose(file_id); + CHECK(ret, FAIL, "H5Fclose"); + + file_id = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT); + CHECK(file_id, H5I_INVALID_HID, "H5Fopen"); + + /* Get the file create property */ + fcpl_id = H5Fget_create_plist(file_id); + CHECK(fcpl_id, H5I_INVALID_HID, "H5Fget_create_plist"); + + /* Get the file access property */ + fapl_id = H5Fget_access_plist(file_id); + CHECK(fapl_id, H5I_INVALID_HID, "H5Fget_access_plist"); + + dset_id = H5Dopen2(file_id, DSET_NAME, H5P_DEFAULT); + CHECK(dset_id, H5I_INVALID_HID, "H5Dopen2"); + + /*------------------------------------------------------------- + * Try to call functions passing in a wrong ID + *-----------------------------------------------------------*/ + H5E_BEGIN_TRY + { + plist = H5Fget_create_plist(dset_id); /* dset_id is not file ID */ + } + H5E_END_TRY + VERIFY(plist, H5I_INVALID_HID, "H5Fget_create_plist"); + + H5E_BEGIN_TRY + { + plist = H5Fget_access_plist(fapl_id); /* fapl_id is not file ID */ + } + H5E_END_TRY + VERIFY(plist, H5I_INVALID_HID, "H5Fget_access_plist"); + + H5E_BEGIN_TRY + { + unsigned intent; /* File access flags */ + ret = H5Fget_intent(dset_id, &intent); /* dset_id is not file ID */ + } + H5E_END_TRY + VERIFY(ret, FAIL, "H5Fget_intent"); + + H5E_BEGIN_TRY + { + unsigned long fileno = 0; + ret = H5Fget_fileno(dset_id, &fileno); /* dset_id is not file ID */ + } + H5E_END_TRY + VERIFY(ret, FAIL, "H5Fget_fileno"); + + H5E_BEGIN_TRY + { + free_space = H5Fget_freespace(dset_id); /* dset_id is not file ID */ + } + H5E_END_TRY + VERIFY(free_space, FAIL, "H5Fget_freespace"); + + H5E_BEGIN_TRY + { + void *os_file_handle = NULL; /* OS file handle */ + ret = H5Fget_vfd_handle(fapl_id, H5P_DEFAULT, &os_file_handle); /* fapl_id is not file ID */ + } + H5E_END_TRY + VERIFY(ret, FAIL, "H5Fget_vfd_handle"); + + /* Close IDs */ + ret = H5Pclose(fapl_id); + CHECK(ret, FAIL, "H5Pclose"); + ret = H5Pclose(fcpl_id); + CHECK(ret, FAIL, "H5Pclose"); + ret = H5Dclose(dset_id); + CHECK(ret, FAIL, "H5Dclose"); + ret = H5Fclose(file_id); + CHECK(ret, FAIL, "H5Fclose"); + + return 0; +} + void test_ids(void) { @@ -1389,4 +1514,6 @@ test_ids(void) TestErrPrintf("ID remove during H5Iclear_type test failed\n"); if (test_future_ids() < 0) TestErrPrintf("Future ID test failed\n"); + if (test_appropriate_ids() < 0) + TestErrPrintf("Detection of inappropriate ID test failed\n"); } diff --git a/test/tvltypes.c b/test/tvltypes.c index 4c8813037d1..1ca7de3bd83 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -491,6 +491,22 @@ test_vltypes_vlen_atomic(void) H5E_END_TRY VERIFY(ret, FAIL, "H5Dvlen_get_buf_size"); + /* Try to call H5Dvlen_get_buf_size with a wrong ID */ + H5E_BEGIN_TRY + { + ret = H5Dvlen_get_buf_size(tid1, dataset, sid2, &size); /* IDs in wrong order */ + } + H5E_END_TRY + VERIFY(ret, FAIL, "H5Dvlen_get_buf_size"); + + /* Try to call H5Dvlen_get_buf_size with a wrong ID */ + H5E_BEGIN_TRY + { + ret = H5Dvlen_get_buf_size(fid1, tid1, sid2, &size); /* not a dataset ID */ + } + H5E_END_TRY + VERIFY(ret, FAIL, "H5Dvlen_get_buf_size"); + /* Read dataset from disk */ ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, xfer_pid, rdata); CHECK(ret, FAIL, "H5Dread");