From 392fd205c6cc4d03510c687ddd9b49f52bb42027 Mon Sep 17 00:00:00 2001 From: "H. Joe Lee" Date: Thu, 26 Sep 2024 06:53:35 -0500 Subject: [PATCH 1/3] Remove Windows oneAPI warning for unused function (#4878) --- testpar/t_mpi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index c0dabf54431..1978303a6d3 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -175,6 +175,8 @@ test_mpio_overlap_writes(char *filename) #define GB 1073741824 /* 1024**3 == 2**30 */ #define TWO_GB_LESS1 2147483647 /* 2**31 - 1 */ #define FOUR_GB_LESS1 4294967295L /* 2**32 - 1 */ + +#ifndef H5_HAVE_WIN32_API /* * Verify that MPI_Offset exceeding 2**31 can be computed correctly. * Print any failure as information only, not as an error so that this @@ -409,6 +411,7 @@ test_mpio_gb_file(char *filename) free(buf); return (nerrs); } +#endif /* * MPI-IO Test: One writes, Many reads. From e590960f86ec040cbdd141a9fcecad8a268c53e1 Mon Sep 17 00:00:00 2001 From: Matt L <124107509+mattjala@users.noreply.github.com> Date: Thu, 26 Sep 2024 06:57:11 -0500 Subject: [PATCH 2/3] Add threadsafety warning doc (#4877) --- doc/threadsafety-warning.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/threadsafety-warning.md diff --git a/doc/threadsafety-warning.md b/doc/threadsafety-warning.md new file mode 100644 index 00000000000..49abcb00af9 --- /dev/null +++ b/doc/threadsafety-warning.md @@ -0,0 +1,16 @@ +## A Warning + +Any application that creates threads that use the HDF5 library must join those threads before either process exit or library close through H5close(). If all HDF5-using threads aren't joined, the threads may exhibit undefined behavior. + +## Discussion for Developers on Potential Improvements + +It would in principle be possible to make it safe to have threads continue using HDF5 resources after a call to H5close() by keeping a count of threads within the library. (There is probably no solution to an early process exit producing undefined behavior within threads.) This method would only be able to count (and presumably, only _need_ to count) threads that directly interact with the library. Because each thread would need to be counted exactly once, this would most likely be done by use of a thread-local key with e.g. a boolean value used to track whether the a global atomic thread counter has already counted this thread. Then, if H5close() is invoked while this thread counter is above one (because one thread must be doing the closing), the library would not close, and instead keep its resources valid to hopefully avoid bad behavior with the threads. + +The issues with this approach are as follows: + +1. The process of checking for the existence/value of the thread-local key is slow, or at least slow enough that it's probably not worth adding this to almost every single API call to prevent this particular edge case. +2. Even with this approach, bad behavior would still be possible if the application does something like expose HDF5 resources to threads indirectly via a global variable. +3. How to allow H5close() to fail is nonobvious. H5close() could be allowed to return an error indicating a failure to close, but the number of applications which could usefully respond to such an error by joining threads is small. If an application were able/willing to join its created threads, presumably it would have done so before calling H5close(). Alternatively, H5close() could succeed but silently leave the library open. This creates the potential for confusing, unexpected behavior when the user thinks they are closing and re-opening the library, e.g. if environment variables are modified between close and re-open, or if resources such as default property lists are modified. +4. Applications should join threads before closing libraries that those threads are using, so all of this work would constitute an above-and-beyond effort to maintain safe and defined behavior in the face of an unsafe application. + +Despite these issues, if a more performant method was found to perform threadcounting like this, it might still constitute a worthwhile change. \ No newline at end of file From a8520298e910bd073948fc8fad583743a884ea9c Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:06:05 -0500 Subject: [PATCH 3/3] Add workflow that reports to CDash (#4864) --- .github/workflows/cmake-bintest.yml | 2 +- .github/workflows/cmake-script.yml | 597 ++++++++++++++++++ .github/workflows/daily-build.yml | 36 +- .github/workflows/tarball.yml | 11 +- HDF5Examples/CMakePresets.json | 69 +- HDF5Examples/Using_CMake.txt | 10 +- .../config/cmake-presets/hidden-presets.json | 203 +++++- .../config/cmake/HDFExampleMacros.cmake | 2 +- config/cmake/examples/CTestScript.cmake | 46 +- config/cmake/scripts/CTestScript.cmake | 11 +- config/cmake/scripts/HDF5config.cmake | 12 +- 11 files changed, 925 insertions(+), 74 deletions(-) create mode 100644 .github/workflows/cmake-script.yml diff --git a/.github/workflows/cmake-bintest.yml b/.github/workflows/cmake-bintest.yml index 379db3a2ca5..3952cf80fa8 100644 --- a/.github/workflows/cmake-bintest.yml +++ b/.github/workflows/cmake-bintest.yml @@ -201,6 +201,6 @@ jobs: 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-MACOS-Clang --fresh + cmake --workflow --preset=ci-StdShar-macos-Clang --fresh shell: bash diff --git a/.github/workflows/cmake-script.yml b/.github/workflows/cmake-script.yml new file mode 100644 index 00000000000..7c1d4274654 --- /dev/null +++ b/.github/workflows/cmake-script.yml @@ -0,0 +1,597 @@ +name: hdf5 dev ctest script runs + +# Triggers the workflow on a call from another workflow +on: + workflow_call: + inputs: + snap_name: + description: 'The name in the source tarballs' + type: string + required: false + default: hdfsrc + file_base: + description: "The common base name of the source tarballs" + required: true + type: string + use_environ: + description: 'Environment to locate files' + type: string + required: true + default: snapshots + +permissions: + contents: read + +jobs: + build_and_test_win: + # Windows w/ MSVC + CMake + # + name: "Windows MSVC CTest" + runs-on: windows-latest + steps: + - name: Install Dependencies (Windows) + run: choco install ninja + + - name: Install Dependencies + uses: ssciwr/doxygen-install@v1 + with: + version: "1.9.7" + + - name: Enable Developer Command Prompt + uses: ilammy/msvc-dev-cmd@v1.13.0 + + - name: Set file base name (Windows) + 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 + shell: bash + + # Get files created by release script + - name: Get zip-tarball (Windows) + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: zip-tarball + path: ${{ github.workspace }} + + - name: using powershell + shell: pwsh + run: Get-Location + + - name: List files for the space (Windows) + run: | + Get-ChildItem -Path ${{ github.workspace }} + Get-ChildItem -Path ${{ runner.workspace }} + shell: pwsh + + - name: Uncompress source (Windows) + working-directory: ${{ github.workspace }} + run: 7z x ${{ steps.set-file-base.outputs.FILE_BASE }}.zip + shell: bash + + - name: Copy script files for the space (Windows) + run: | + Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/CTestScript.cmake -Destination ${{ runner.workspace }}/hdf5/ + Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/HDF5config.cmake -Destination ${{ runner.workspace }}/hdf5/ + shell: pwsh + + - name: List files for the hdf5 (Windows) + run: | + Get-ChildItem -Path ${{ runner.workspace }}/hdf5 + shell: pwsh + + - name: Create options file (Windows) + uses: "DamianReeves/write-file-action@master" + with: + path: ${{ runner.workspace }}/hdf5/HDF5options.cmake + write-mode: overwrite + contents: | + set (CTEST_DROP_SITE_INIT "my.cdash.org") + # Change following line to submit to your CDash dashboard to a different CDash project + #set (CTEST_DROP_LOCATION_INIT "/submit.php?project=HDF5") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PLUGIN_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_USE_LOCALCONTENT:BOOL=OFF") + + - name: Run ctest script (Windows) + run: | + cd "${{ runner.workspace }}/hdf5" + ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH,LOCAL_SUBMIT=ON,BUILD_GENERATOR=VS202264,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log + shell: bash + continue-on-error: true + + # Save log files created by ctest script + - name: Save log (Windows_intel) + uses: actions/upload-artifact@v4 + with: + name: cl-win-log + path: ${{ runner.workspace }}/hdf5/hdf5.log + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + + build_and_test_linux: + # Linux (Ubuntu) w/ gcc + CMake + # + name: "Ubuntu gcc CMake" + runs-on: ubuntu-latest + steps: + - name: Install CMake Dependencies (Linux) + run: | + sudo apt-get update + sudo apt-get install ninja-build graphviz curl + + - name: Install Dependencies + uses: ssciwr/doxygen-install@v1 + with: + version: "1.9.7" + + - name: Set file base name (Linux) + 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 (Linux) + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: tgz-tarball + path: ${{ github.workspace }} + + - name: List files for the space (Linux) + run: | + ls -l ${{ github.workspace }} + ls ${{ runner.workspace }} + + - name: Uncompress source (Linux) + run: tar -zxvf ${{ github.workspace }}/${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz + + - name: Copy script files for the space (Linux) + run: | + cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/CTestScript.cmake ${{ runner.workspace }}/hdf5 + cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/HDF5config.cmake ${{ runner.workspace }}/hdf5 + + - name: List files for the hdf5 (Linux) + run: | + ls ${{ runner.workspace }}/hdf5 + + - name: Create options file (Linux) + uses: "DamianReeves/write-file-action@master" + with: + path: ${{ runner.workspace }}/hdf5/HDF5options.cmake + write-mode: overwrite + contents: | + set (CTEST_DROP_SITE_INIT "my.cdash.org") + # Change following line to submit to your CDash dashboard to a different CDash project + #set (CTEST_DROP_LOCATION_INIT "/submit.php?project=HDF5") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PLUGIN_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_USE_LOCALCONTENT:BOOL=OFF") + + - name: Run ctest (Linux) + run: | + cd "${{ runner.workspace }}/hdf5" + ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-GCC,LOCAL_SUBMIT=ON,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log + shell: bash + continue-on-error: true + + # Save log files created by ctest script + - name: Save log (Linux) + uses: actions/upload-artifact@v4 + with: + name: gcc-ubuntu-log + path: ${{ runner.workspace }}/hdf5/hdf5.log + 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 curl + + - 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@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + 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 + + - name: Copy script files for the space (MacOS_latest) + run: | + cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/CTestScript.cmake ${{ runner.workspace }}/hdf5 + cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/HDF5config.cmake ${{ runner.workspace }}/hdf5 + + # 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: 14 + + - name: List files for the hdf5 (MacOS_latest) + run: | + ls ${{ runner.workspace }}/hdf5 + + - name: Create options file (MacOS_latest) + uses: "DamianReeves/write-file-action@master" + with: + path: ${{ runner.workspace }}/hdf5/HDF5options.cmake + write-mode: overwrite + contents: | + set (CTEST_DROP_SITE_INIT "my.cdash.org") + # Change following line to submit to your CDash dashboard to a different CDash project + #set (CTEST_DROP_LOCATION_INIT "/submit.php?project=HDF5") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PLUGIN_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_USE_LOCALCONTENT:BOOL=OFF") + + - name: Run ctest (MacOS_latest) + id: run-ctest + run: | + cd "${{ runner.workspace }}/hdf5" + ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-Clang,LOCAL_SUBMIT=ON,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log + shell: bash + continue-on-error: true + + # Save log files created by ctest script + - name: Save log (MacOS_latest) + uses: actions/upload-artifact@v4 + with: + name: macos-log + path: ${{ runner.workspace }}/hdf5/hdf5.log + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + + build_and_test_S3_linux: + # Linux S3 (Ubuntu) w/ gcc + CMake + # + name: "Ubuntu gcc CMake S3" + runs-on: ubuntu-latest + steps: + - name: Install CMake Dependencies (Linux S3) + run: | + sudo apt-get update + sudo apt-get install ninja-build doxygen graphviz curl + sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev + + - name: Set file base name (Linux S3) + 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 (Linux S3) + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: tgz-tarball + path: ${{ github.workspace }} + + - name: List files for the space (Linux S3) + run: | + ls -l ${{ github.workspace }} + ls ${{ runner.workspace }} + + - name: Uncompress source (Linux S3) + run: tar -zxvf ${{ github.workspace }}/${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz + + - name: Copy script files for the space (Linux S3) + run: | + cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/CTestScript.cmake ${{ runner.workspace }}/hdf5 + cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/HDF5config.cmake ${{ runner.workspace }}/hdf5 + + - name: List files for the hdf5 (Linux S3) + run: | + ls ${{ runner.workspace }}/hdf5 + + - name: Create options file (Linux S3) + uses: "DamianReeves/write-file-action@master" + with: + path: ${{ runner.workspace }}/hdf5/HDF5options.cmake + write-mode: overwrite + contents: | + set (CTEST_DROP_SITE_INIT "my.cdash.org") + # Change following line to submit to your CDash dashboard to a different CDash project + #set (CTEST_DROP_LOCATION_INIT "/submit.php?project=HDF5") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PLUGIN_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_USE_LOCALCONTENT:BOOL=OFF") + + - name: Run ctest (Linux S3) + run: | + cd "${{ runner.workspace }}/hdf5" + ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-S3,LOCAL_SUBMIT=ON,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log + shell: bash + continue-on-error: true + + # Save log files created by ctest script + - name: Save log (Linux S3) + uses: actions/upload-artifact@v4 + with: + name: s3-ubuntu-log + path: ${{ runner.workspace }}/hdf5/hdf5.log + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + +####### intel builds + build_and_test_win_intel: + # Windows w/ OneAPI + CMake + # + name: "Windows Intel CTest" + runs-on: windows-latest + steps: + - name: Install Dependencies (Windows_intel) + run: choco install ninja + + - name: add oneAPI to env + uses: fortran-lang/setup-fortran@v1 + id: setup-fortran + with: + compiler: intel + version: '2024.1' + + - name: Set file base name (Windows_intel) + 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 + shell: bash + + # Get files created by release script + - name: Get zip-tarball (Windows_intel) + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: zip-tarball + path: ${{ github.workspace }} + + - name: using powershell + shell: pwsh + run: Get-Location + + - name: List files for the space (Windows_intel) + run: | + Get-ChildItem -Path ${{ github.workspace }} + Get-ChildItem -Path ${{ runner.workspace }} + shell: pwsh + + - name: Uncompress source (Windows_intel) + working-directory: ${{ github.workspace }} + run: 7z x ${{ steps.set-file-base.outputs.FILE_BASE }}.zip + shell: bash + + - name: Copy script files for the space (Windows_intel) + run: | + Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/CTestScript.cmake -Destination ${{ runner.workspace }}/hdf5/ + Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/HDF5config.cmake -Destination ${{ runner.workspace }}/hdf5/ + shell: pwsh + + - name: List files for the hdf5 (Windows_intel) + run: | + Get-ChildItem -Path ${{ runner.workspace }}/hdf5 + shell: pwsh + + - name: Create options file (Windows_intel) + uses: "DamianReeves/write-file-action@master" + with: + path: ${{ runner.workspace }}/hdf5/HDF5options.cmake + write-mode: overwrite + contents: | + set (CTEST_DROP_SITE_INIT "my.cdash.org") + # Change following line to submit to your CDash dashboard to a different CDash project + #set (CTEST_DROP_LOCATION_INIT "/submit.php?project=HDF5") + set (CMAKE_GENERATOR_TOOLSET "Intel C++ Compiler 2024,fortran=ifx") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/intel.cmake") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PLUGIN_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_USE_LOCALCONTENT:BOOL=OFF") + + - name: Run ctest (Windows_intel) with oneapi + env: + FC: ${{ steps.setup-fortran.outputs.fc }} + CC: ${{ steps.setup-fortran.outputs.cc }} + CXX: ${{ steps.setup-fortran.outputs.cxx }} + BINSIGN: ${{ needs.check-secret.outputs.sign-state }} + SIGNTOOLDIR: ${{ github.workspace }}/Microsoft.Windows.SDK.BuildTools/bin/10.0.22621.0/x64 + run: | + cd "${{ runner.workspace }}/hdf5" + ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-Intel,LOCAL_SUBMIT=ON,BUILD_GENERATOR=VS202264,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log + shell: pwsh + continue-on-error: true + + # Save log files created by ctest script + - name: Save log (Windows_intel) + uses: actions/upload-artifact@v4 + with: + name: intel-win-log + path: ${{ runner.workspace }}/hdf5/hdf5.log + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + + build_and_test_linux_intel: + # Linux (Ubuntu) w/ OneAPI + CMake + # + name: "Ubuntu Intel CMake" + runs-on: ubuntu-latest + steps: + - name: Install CMake Dependencies (Linux_intel) + run: | + sudo apt-get update + sudo apt-get install ninja-build doxygen graphviz curl + + - name: add oneAPI to env + uses: fortran-lang/setup-fortran@v1 + id: setup-fortran + with: + compiler: intel + version: '2024.1' + + - name: Set file base name (Linux_intel) + 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 (Linux_intel) + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + with: + name: tgz-tarball + path: ${{ github.workspace }} + + - name: List files for the space (Linux_intel) + run: | + ls -l ${{ github.workspace }} + ls ${{ runner.workspace }} + + - name: Uncompress source (Linux_intel) + run: tar -zxvf ${{ github.workspace }}/${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz + + - name: Copy script files for the space (Linux_intel) + run: | + cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/CTestScript.cmake ${{ runner.workspace }}/hdf5 + cp ${{ github.workspace }}/${{ steps.set-file-base.outputs.SOURCE_BASE }}/config/cmake/scripts/HDF5config.cmake ${{ runner.workspace }}/hdf5 + + - name: List files for the hdf5 (Linux_Linux) + run: | + ls ${{ runner.workspace }}/hdf5 + + - name: Create options file (Linux_intel) + uses: "DamianReeves/write-file-action@master" + with: + path: ${{ runner.workspace }}/hdf5/HDF5options.cmake + write-mode: overwrite + contents: | + set (CTEST_DROP_SITE_INIT "my.cdash.org") + # Change following line to submit to your CDash dashboard to a different CDash project + #set (CTEST_DROP_LOCATION_INIT "/submit.php?project=HDF5") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} --log-level=VERBOSE") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PLUGIN_SUPPORT:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_USE_LOCALCONTENT:BOOL=OFF") + + - name: Run ctest (Linux_intel) + env: + FC: ${{ steps.setup-fortran.outputs.fc }} + CC: ${{ steps.setup-fortran.outputs.cc }} + CXX: ${{ steps.setup-fortran.outputs.cxx }} + run: | + cd "${{ runner.workspace }}/hdf5" + ctest -S HDF5config.cmake,CTEST_SITE_EXT=GH-Intel,LOCAL_SUBMIT=ON,BUILD_GENERATOR=Unix,CTEST_SOURCE_NAME=${{ steps.set-file-base.outputs.SOURCE_BASE }} -C Release -VV -O hdf5.log + shell: bash + continue-on-error: true + + # Save log files created by ctest script + - name: Save log (Linux_intel) + uses: actions/upload-artifact@v4 + with: + name: intel-ubuntu-log + path: ${{ runner.workspace }}/hdf5/hdf5.log + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` diff --git a/.github/workflows/daily-build.yml b/.github/workflows/daily-build.yml index 2b7d6aef3bf..d3e50b41f65 100644 --- a/.github/workflows/daily-build.yml +++ b/.github/workflows/daily-build.yml @@ -3,6 +3,12 @@ name: hdf5 dev daily build # Triggers the workflow on a schedule or on demand on: workflow_dispatch: + inputs: + use_ignore: + description: 'Ignore has_changes check' + type: string + required: false + default: check schedule: - cron: "6 0 * * *" @@ -14,6 +20,7 @@ jobs: runs-on: ubuntu-latest outputs: hdf5-name: ${{ steps.gethdf5base.outputs.HDF5_NAME_BASE }} + run-ignore: ${{ steps.getinputs.outputs.INPUTS_IGNORE }} steps: - uses: actions/checkout@v4.1.7 @@ -30,14 +37,31 @@ jobs: - run: echo "hdf5 base name is ${{ steps.gethdf5base.outputs.HDF5_NAME_BASE }}." + - name: Read inputs + id: getinputs + run: | + echo "INPUTS_IGNORE=${{ github.event.inputs.use_ignore }}" >> $GITHUB_OUTPUT + + - run: echo "use_ignore is ${{ steps.getinputs.outputs.INPUTS_IGNORE }}." + call-workflow-tarball: + needs: [get-old-names] uses: ./.github/workflows/tarball.yml with: + use_ignore: ${{ needs.get-old-names.outputs.run-ignore }} use_tag: snapshot use_environ: snapshots + call-workflow-c-script: + needs: [get-old-names, call-workflow-tarball] + uses: ./.github/workflows/cmake-script.yml + with: + file_base: ${{ needs.call-workflow-tarball.outputs.file_base }} + use_environ: snapshots + if: ${{ ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-old-names.outputs.run-ignore == 'ignore')) }} + call-workflow-ctest: - needs: call-workflow-tarball + needs: [get-old-names, call-workflow-tarball] uses: ./.github/workflows/cmake-ctest.yml with: preset_name: ci-StdShar @@ -54,17 +78,17 @@ jobs: AZURE_ENDPOINT: ${{ secrets.AZURE_ENDPOINT }} AZURE_CODE_SIGNING_NAME: ${{ secrets.AZURE_CODE_SIGNING_NAME }} AZURE_CERT_PROFILE_NAME: ${{ secrets.AZURE_CERT_PROFILE_NAME }} - if: ${{ needs.call-workflow-tarball.outputs.has_changes == 'true' }} + if: ${{ ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-old-names.outputs.run-ignore == 'ignore')) }} call-workflow-abi: - needs: [call-workflow-tarball, call-workflow-ctest] + needs: [get-old-names, call-workflow-tarball, call-workflow-ctest] uses: ./.github/workflows/abi-report.yml with: file_ref: '1.14.4.3' file_base: ${{ needs.call-workflow-tarball.outputs.file_base }} use_tag: snapshot use_environ: snapshots - if: ${{ needs.call-workflow-tarball.outputs.has_changes == 'true' }} + if: ${{ ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-old-names.outputs.run-ignore == 'ignore')) }} call-workflow-release: needs: [get-old-names, call-workflow-tarball, call-workflow-ctest, call-workflow-abi] @@ -77,7 +101,7 @@ jobs: file_sha: ${{ needs.call-workflow-tarball.outputs.file_sha }} use_tag: snapshot use_environ: snapshots - if: ${{ needs.call-workflow-tarball.outputs.has_changes == 'true' }} + if: ${{ ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-old-names.outputs.run-ignore == 'ignore')) }} call-workflow-remove: needs: [get-old-names, call-workflow-tarball, call-workflow-ctest, call-workflow-abi, call-workflow-release] @@ -88,5 +112,5 @@ jobs: file_base: ${{ needs.get-old-names.outputs.hdf5-name }} use_tag: snapshot use_environ: snapshots - if: ${{ (needs.call-workflow-tarball.outputs.has_changes == 'true') && (needs.get-old-names.outputs.hdf5-name != needs.call-workflow-tarball.outputs.file_base) }} + if: ${{ ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-old-names.outputs.run-ignore == 'ignore')) && (needs.get-old-names.outputs.hdf5-name != needs.call-workflow-tarball.outputs.file_base) }} diff --git a/.github/workflows/tarball.yml b/.github/workflows/tarball.yml index a77c0418d45..483547f8af1 100644 --- a/.github/workflows/tarball.yml +++ b/.github/workflows/tarball.yml @@ -4,6 +4,11 @@ name: hdf5 dev tarball on: workflow_call: inputs: + use_ignore: + description: 'Ignore has_changes check' + type: string + required: false + default: check use_tag: description: 'Release version tag' type: string @@ -43,6 +48,8 @@ jobs: branch_ref: ${{ steps.get-branch-name.outputs.BRANCH_REF }} branch_sha: ${{ steps.get-branch-sha.outputs.BRANCH_SHA }} steps: + - uses: actions/checkout@v4 + - name: Get branch name id: get-branch-name env: @@ -67,7 +74,7 @@ jobs: with: seconds: 86400 # One day in seconds branch: '${{ steps.get-branch-name.outputs.branch_ref }}' - if: ${{ inputs.use_environ == 'snapshots' }} + if: ${{ (inputs.use_environ == 'snapshots' && inputs.use_ignore == 'check') }} - run: echo "You have ${{ steps.check-new-commits.outputs.new-commits-number }} new commit(s) in ${{ steps.get-branch-name.outputs.BRANCH_REF }} ✅!" if: ${{ steps.check-new-commits.outputs.has-new-commits == 'true' }} @@ -78,7 +85,7 @@ jobs: name: Create a source tarball runs-on: ubuntu-latest needs: check_commits - if: ${{ ((inputs.use_environ == 'snapshots') && (needs.check_commits.outputs.has_changes == 'true')) || (inputs.use_environ == 'release') }} + if: ${{ ((inputs.use_environ == 'snapshots') && ((needs.check_commits.outputs.has_changes == 'true') || (inputs.use_ignore == 'ignore'))) || (inputs.use_environ == 'release') }} outputs: file_base: ${{ steps.set-file-base.outputs.FILE_BASE }} source_base: ${{ steps.version.outputs.SOURCE_TAG }} diff --git a/HDF5Examples/CMakePresets.json b/HDF5Examples/CMakePresets.json index 0f2c1b5e013..1f722cc4e20 100644 --- a/HDF5Examples/CMakePresets.json +++ b/HDF5Examples/CMakePresets.json @@ -74,6 +74,24 @@ "ci-StdShar" ] }, + { + "name": "ci-StdShar-macos-Clang", + "description": "Clang Standard Config for macos (Release)", + "inherits": [ + "ci-macos-arm64-Release-Clang", + "ci-StdJava", + "ci-StdShar" + ] + }, + { + "name": "ci-StdShar-macos-GNUC", + "description": "GNUC Standard Config for macos (Release)", + "inherits": [ + "ci-macos-arm64-Release-GNUC", + "ci-StdJava", + "ci-StdShar" + ] + }, { "name": "ci-StdShar-Intel", "description": "Intel Standard Config for x64 (Release)", @@ -111,6 +129,23 @@ "ci-x64-Release-GNUC" ] }, + { + "name": "ci-StdShar-macos-Clang", + "description": "Clang Standard Build for macos-arm64 (Release)", + "configurePreset": "ci-StdShar-macos-Clang", + "inherits": [ + "ci-macos-arm64-Release-Clang" + ] + }, + { + "name": "ci-StdShar-macos-GNUC", + "description": "GNUC Standard Build for macos-arm64 (Release)", + "configurePreset": "ci-StdShar-macos-GNUC", + "verbose": true, + "inherits": [ + "ci-macos-arm64-Release-GNUC" + ] + }, { "name": "ci-StdShar-Intel", "description": "Intel Standard Build for x64 (Release)", @@ -137,22 +172,24 @@ ] }, { - "name": "ci-StdShar-MACOS-Clang", - "configurePreset": "ci-StdShar-Clang", + "name": "ci-StdShar-macos-Clang", + "configurePreset": "ci-StdShar-macos-Clang", "inherits": [ - "ci-x64-Release-Clang" + "ci-macos-arm64-Release-Clang" ], "execution": { "noTestsAction": "error", "timeout": 180, "jobs": 2 - }, - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Darwin" } }, + { + "name": "ci-StdShar-macos-GNUC", + "configurePreset": "ci-StdShar-macos-GNUC", + "inherits": [ + "ci-macos-arm64-Release-GNUC" + ] + }, { "name": "ci-StdShar-GNUC", "configurePreset": "ci-StdShar-GNUC", @@ -203,11 +240,11 @@ ] }, { - "name": "ci-StdShar-MACOS-Clang", + "name": "ci-StdShar-macos-Clang", "steps": [ - {"type": "configure", "name": "ci-StdShar-Clang"}, - {"type": "build", "name": "ci-StdShar-Clang"}, - {"type": "test", "name": "ci-StdShar-MACOS-Clang"} + {"type": "configure", "name": "ci-StdShar-macos-Clang"}, + {"type": "build", "name": "ci-StdShar-macos-Clang"}, + {"type": "test", "name": "ci-StdShar-macos-Clang"} ] }, { @@ -218,6 +255,14 @@ {"type": "test", "name": "ci-StdShar-GNUC"} ] }, + { + "name": "ci-StdShar-macos-GNUC", + "steps": [ + {"type": "configure", "name": "ci-StdShar-macos-GNUC"}, + {"type": "build", "name": "ci-StdShar-macos-GNUC"}, + {"type": "test", "name": "ci-StdShar-macos-GNUC"} + ] + }, { "name": "ci-StdShar-Intel", "steps": [ diff --git a/HDF5Examples/Using_CMake.txt b/HDF5Examples/Using_CMake.txt index baef3565194..c543300092b 100644 --- a/HDF5Examples/Using_CMake.txt +++ b/HDF5Examples/Using_CMake.txt @@ -90,11 +90,11 @@ These steps are described in more detail below. * MinGW Makefiles * NMake Makefiles * Unix Makefiles - * Visual Studio 15 2017 - * Visual Studio 15 2017 Win64 - * Visual Studio 16 2019 - * Visual Studio 17 2022 - + * Visual Studio 15 + * Visual Studio 15 Win64 + * Visual Studio 17 + * Visual Studio 17 Win64 + * Visual Studio 19 is: * H5EX_BUILD_TESTING:BOOL=ON diff --git a/HDF5Examples/config/cmake-presets/hidden-presets.json b/HDF5Examples/config/cmake-presets/hidden-presets.json index 590e7ec7e1f..d38e802f1f6 100644 --- a/HDF5Examples/config/cmake-presets/hidden-presets.json +++ b/HDF5Examples/config/cmake-presets/hidden-presets.json @@ -10,7 +10,7 @@ "binaryDir": "${sourceParentDir}/build/${presetName}", "installDir": "${sourceParentDir}/install/${presetName}" }, - { + { "name": "ci-x64", "architecture": { "value": "x64", @@ -21,7 +21,15 @@ { "name": "ci-x86", "architecture": { - "value": "x86", + "value": "Win32", + "strategy": "external" + }, + "hidden": true + }, + { + "name": "ci-arm64", + "architecture": { + "value": "ARM64", "strategy": "external" }, "hidden": true @@ -47,25 +55,41 @@ "CMAKE_C_COMPILER": "cl", "CMAKE_CXX_COMPILER": "cl" }, - "toolset": { - "value": "host=x64", - "strategy": "external" - }, "condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows" } }, + { + "name": "ci-macos-arm64", + "hidden": true, + "cacheVariables": { + "CMAKE_OSX_ARCHITECTURES": "arm64" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + } + }, + { + "name": "ci-macos-x86_64", + "hidden": true, + "cacheVariables": { + "CMAKE_OSX_ARCHITECTURES": "x86_64" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + } + }, { "name": "ci-Clang", "hidden": true, "cacheVariables": { "CMAKE_TOOLCHAIN_FILE": "config/toolchain/clang.cmake" - }, - "toolset": { - "value": "host=x64", - "strategy": "external" } }, { @@ -78,21 +102,44 @@ "type": "equals", "lhs": "${hostSystemName}", "rhs": "Linux" - }, - "toolset": { - "value": "host=x64", - "strategy": "external" } }, { "name": "ci-Intel", + "hidden": true + }, + { + "name": "ci-Fortran", + "hidden": true, + "cacheVariables": { + "H5EX_BUILD_FORTRAN": "ON" + } + }, + { + "name": "ci-Fortran-Clang", "hidden": true, + "inherits": "ci-Fortran", "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": "config/toolchain/intel.cmake" + "CMAKE_Fortran_COMPILER": {"type": "FILEPATH", "value": "gfortran"} }, - "toolset": { - "value": "host=x64", - "strategy": "external" + "condition": { + "type": "matches", + "string": "${presetName}", + "regex": ".*-Clang" + } + }, + { + "name": "ci-CPP", + "hidden": true, + "cacheVariables": { + "H5EX_BUILD_CPP_LIB": "ON" + } + }, + { + "name": "ci-Java", + "hidden": true, + "cacheVariables": { + "H5EX_BUILD_JAVA": "ON" } }, { @@ -161,6 +208,50 @@ "ci-GNUC" ] }, + { + "name": "ci-macos-arm64-Debug-Clang", + "description": "Clang/LLVM for x64 (Debug)", + "hidden": true, + "inherits": [ + "ci-base", + "ci-macos-arm64", + "ci-Debug", + "ci-Clang" + ] + }, + { + "name": "ci-macos-arm64-Release-Clang", + "description": "Clang/LLVM for x64 (Release)", + "hidden": true, + "inherits": [ + "ci-base", + "ci-macos-arm64", + "ci-Release", + "ci-Clang" + ] + }, + { + "name": "ci-macos-arm64-Debug-GNUC", + "description": "GNUC for x64 (Debug)", + "hidden": true, + "inherits": [ + "ci-base", + "ci-macos-arm64", + "ci-Debug", + "ci-GNUC" + ] + }, + { + "name": "ci-macos-arm64-Release-GNUC", + "description": "GNUC for x64 (Release)", + "hidden": true, + "inherits": [ + "ci-base", + "ci-macos-arm64", + "ci-Release", + "ci-GNUC" + ] + }, { "name": "ci-x64-Debug-Intel", "description": "Intel for x64 (Debug)", @@ -242,6 +333,38 @@ "ci-base" ] }, + { + "name": "ci-macos-arm64-Debug-Clang", + "configurePreset": "ci-macos-arm64-Debug-Clang", + "hidden": true, + "inherits": [ + "ci-base" + ] + }, + { + "name": "ci-macos-arm64-Release-Clang", + "configurePreset": "ci-macos-arm64-Release-Clang", + "hidden": true, + "inherits": [ + "ci-base" + ] + }, + { + "name": "ci-macos-arm64-Debug-GNUC", + "configurePreset": "ci-macos-arm64-Debug-GNUC", + "hidden": true, + "inherits": [ + "ci-base" + ] + }, + { + "name": "ci-macos-arm64-Release-GNUC", + "configurePreset": "ci-macos-arm64-Release-GNUC", + "hidden": true, + "inherits": [ + "ci-base" + ] + }, { "name": "ci-x64-Debug-Intel", "configurePreset": "ci-x64-Debug-Intel", @@ -327,6 +450,38 @@ "ci-base" ] }, + { + "name": "ci-macos-Debug-Clang", + "configurePreset": "ci-macos-Debug-Clang", + "hidden": true, + "inherits": [ + "ci-base" + ] + }, + { + "name": "ci-macos-arm64-Release-Clang", + "configurePreset": "ci-macos-arm64-Release-Clang", + "hidden": true, + "inherits": [ + "ci-base" + ] + }, + { + "name": "ci-macos-arm64-Debug-GNUC", + "configurePreset": "ci-macos-arm64-Debug-GNUC", + "hidden": true, + "inherits": [ + "ci-base" + ] + }, + { + "name": "ci-macos-arm64-Release-GNUC", + "configurePreset": "ci-macos-arm64-Release-GNUC", + "hidden": true, + "inherits": [ + "ci-base" + ] + }, { "name": "ci-x64-Debug-Intel", "configurePreset": "ci-x64-Debug-Intel", @@ -371,6 +526,18 @@ "hidden": true, "inherits": "ci-base" }, + { + "name": "ci-macos-arm64-Release-Clang", + "configurePreset": "ci-macos-arm64-Release-Clang", + "hidden": true, + "inherits": "ci-base" + }, + { + "name": "ci-macos-arm64-Release-GNUC", + "configurePreset": "ci-macos-arm64-Release-GNUC", + "hidden": true, + "inherits": "ci-base" + }, { "name": "ci-x64-Release-Intel", "configurePreset": "ci-x64-Release-Intel", diff --git a/HDF5Examples/config/cmake/HDFExampleMacros.cmake b/HDF5Examples/config/cmake/HDFExampleMacros.cmake index bbb042177a3..dd2c46fba67 100644 --- a/HDF5Examples/config/cmake/HDFExampleMacros.cmake +++ b/HDF5Examples/config/cmake/HDFExampleMacros.cmake @@ -137,7 +137,7 @@ macro (HDF5_SUPPORT) set (FIND_HDF_COMPONENTS C shared) else () set (FIND_HDF_COMPONENTS C static) - set (HDEXF_BUILD_JAVA OFF CACHE BOOL "Build Java support" FORCE) + set (H5EX_BUILD_JAVA OFF CACHE BOOL "Build Java support" FORCE) message (STATUS "Using static HDF5 - disable build of Java examples") endif () if (H5EX_BUILD_FORTRAN) diff --git a/config/cmake/examples/CTestScript.cmake b/config/cmake/examples/CTestScript.cmake index f41beb5973f..5e7259d7cf9 100644 --- a/config/cmake/examples/CTestScript.cmake +++ b/config/cmake/examples/CTestScript.cmake @@ -22,16 +22,19 @@ if (NOT SITE_OS_NAME) ## -- set hostname ## -------------------------- find_program (HOSTNAME_CMD NAMES hostname) - exec_program (${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME) + execute_process (COMMAND ${HOSTNAME_CMD} OUTPUT_VARIABLE HOSTNAME OUTPUT_STRIP_TRAILING_WHITESPACE) set (CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}") find_program (UNAME NAMES uname) macro (getuname name flag) - exec_program ("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}") + execute_process (COMMAND "${UNAME}" "${flag}" OUTPUT_VARIABLE "${name}" OUTPUT_STRIP_TRAILING_WHITESPACE) endmacro () getuname (osname -s) + string(STRIP ${osname} osname) getuname (osrel -r) + string(STRIP ${osrel} osrel) getuname (cpu -m) + string(STRIP ${cpu} cpu) message (STATUS "Dashboard script uname output: ${osname}-${osrel}-${cpu}\n") set (CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}") @@ -50,15 +53,15 @@ endif () set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") # Launchers work only with Makefile and Ninja generators. -if(NOT "${CTEST_CMAKE_GENERATOR}" MATCHES "Make|Ninja" OR LOCAL_SKIP_TEST) - set(CTEST_USE_LAUNCHERS 0) - set(ENV{CTEST_USE_LAUNCHERS_DEFAULT} 0) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=OFF") -else() - set(CTEST_USE_LAUNCHERS 1) - set(ENV{CTEST_USE_LAUNCHERS_DEFAULT} 1) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON") -endif() +if (NOT "${CTEST_CMAKE_GENERATOR}" MATCHES "Make|Ninja" OR LOCAL_SKIP_TEST) + set (CTEST_USE_LAUNCHERS 0) + set (ENV{CTEST_USE_LAUNCHERS_DEFAULT} 0) + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=OFF") +else () + set (CTEST_USE_LAUNCHERS 1) + set (ENV{CTEST_USE_LAUNCHERS_DEFAULT} 1) + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON") +endif () #----------------------------------------------------------------------------- # MacOS machines need special options @@ -77,7 +80,6 @@ endif () set (NEED_REPOSITORY_CHECKOUT 0) set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") if (CTEST_USE_TAR_SOURCE) - ## Uncompress source if tar or zip file provided ## -------------------------- if (WIN32 AND NOT MINGW) message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]") @@ -98,10 +100,10 @@ endif () ## Clear the build directory ## -------------------------- set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) -if (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") - ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY}) -else () +if (NOT EXISTS "${CTEST_BINARY_DIRECTORY}") file (MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") +else () + ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY}) endif () # Use multiple CPU cores to build @@ -122,13 +124,15 @@ endif () #----------------------------------------------------------------------------- # Initialize the CTEST commands #------------------------------ -set(CTEST_CONFIGURE_TOOLSET "") -if(CMAKE_GENERATOR_TOOLSET) - set(CTEST_CONFIGURE_TOOLSET "-T${CMAKE_GENERATOR_TOOLSET}") +if (CMAKE_GENERATOR_TOOLSET) + set (CTEST_CONFIGURE_TOOLSET "\"-T${CMAKE_GENERATOR_TOOLSET}\"") +else () + set (CTEST_CONFIGURE_TOOLSET) endif() -set(CTEST_CONFIGURE_ARCHITECTURE "") -if(CMAKE_GENERATOR_ARCHITECTURE) - set(CTEST_CONFIGURE_ARCHITECTURE "-A${CMAKE_GENERATOR_ARCHITECTURE}") +if (CMAKE_GENERATOR_ARCHITECTURE) + set (CTEST_CONFIGURE_ARCHITECTURE "\"-A${CMAKE_GENERATOR_ARCHITECTURE}\"") +else () + set (CTEST_CONFIGURE_ARCHITECTURE) endif() set (CTEST_CONFIGURE_COMMAND "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_CONFIGURE_ARCHITECTURE}\" \"${CTEST_CONFIGURE_TOOLSET}\" \"${CTEST_SOURCE_DIRECTORY}\"" diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index bf325186157..45ca77b73d9 100644 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -11,7 +11,6 @@ # cmake_minimum_required (VERSION 3.18) ######################################################## -# This dashboard is maintained by The HDF Group # For any comments please contact help@hdfgroup.org # ######################################################## @@ -23,16 +22,19 @@ if (NOT SITE_OS_NAME) ## -- set hostname ## -------------------------- find_program (HOSTNAME_CMD NAMES hostname) - exec_program (${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME) + execute_process (COMMAND ${HOSTNAME_CMD} OUTPUT_VARIABLE HOSTNAME OUTPUT_STRIP_TRAILING_WHITESPACE) set (CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}") find_program (UNAME NAMES uname) macro (getuname name flag) - exec_program ("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}") + execute_process (COMMAND "${UNAME}" "${flag}" OUTPUT_VARIABLE "${name}" OUTPUT_STRIP_TRAILING_WHITESPACE) endmacro () getuname (osname -s) + string(STRIP ${osname} osname) getuname (osrel -r) + string(STRIP ${osrel} osrel) getuname (cpu -m) + string(STRIP ${cpu} cpu) message (STATUS "Dashboard script uname output: ${osname}-${osrel}-${cpu}\n") set (CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}") @@ -62,7 +64,7 @@ else () endif () #----------------------------------------------------------------------------- -# MAC machines need special option +# MacOS machines need special options #----------------------------------------------------------------------------- if (APPLE) # Compiler choice @@ -78,7 +80,6 @@ endif () set (NEED_REPOSITORY_CHECKOUT 0) set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") if (CTEST_USE_TAR_SOURCE) - ## Uncompress source if tar file provided ## -------------------------- if (WIN32 AND NOT MINGW) message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]") diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 6ec34815e9f..3461422f0e1 100644 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -178,7 +178,9 @@ if (NOT DEFINED HPC) message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2022, VS202264, VS2019, VS201964") endif () ## Set the following to unique id your computer ## - set (CTEST_SITE "WIN10${BUILD_GENERATOR}.XXXX") + if(NOT DEFINED CTEST_SITE) + set (CTEST_SITE "WIN10${BUILD_GENERATOR}-${CTEST_SITE_EXT}") + endif() else () if (MINGW) set (CTEST_CMAKE_GENERATOR "MinGW Makefiles") @@ -187,9 +189,13 @@ if (NOT DEFINED HPC) endif () ## Set the following to unique id your computer ## if (APPLE) - set (CTEST_SITE "MAC.XXXX") + if(NOT DEFINED CTEST_SITE) + set (CTEST_SITE "MAC-${CTEST_SITE_EXT}") + endif() else () - set (CTEST_SITE "LINUX.XXXX") + if(NOT DEFINED CTEST_SITE) + set (CTEST_SITE "LINUX-${CTEST_SITE_EXT}") + endif() endif () if (APPLE) execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE)