From 9a02511d0c78dafa304395ae62cfacce0a825167 Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Wed, 23 Oct 2024 11:20:33 -0500 Subject: [PATCH] Add remaining CMake workflow versions of autotools workflows (#4998) * Add warnings as errors workflow for cmake * Add spc par workflow * Add workflow call * Add parallel special --- .github/workflows/cmake-analysis.yml | 2 +- .github/workflows/cmake.yml | 12 ++ .github/workflows/hdfeos5.yml | 53 ++++++-- .github/workflows/main-cmake-par-spc.yml | 79 +++++++++++ .github/workflows/main-cmake-par.yml | 4 +- .github/workflows/main-cmake-spc.yml | 164 ++++++++++++++++------- .github/workflows/netcdf.yml | 39 +++++- 7 files changed, 281 insertions(+), 72 deletions(-) create mode 100644 .github/workflows/main-cmake-par-spc.yml diff --git a/.github/workflows/cmake-analysis.yml b/.github/workflows/cmake-analysis.yml index 28d0cbd54eb..36dea0dc39e 100644 --- a/.github/workflows/cmake-analysis.yml +++ b/.github/workflows/cmake-analysis.yml @@ -90,7 +90,7 @@ jobs: set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_STATIC_LIBS:BOOL=ON") set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=ON") - set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_COVERAGE:BOOL=ON") set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCODE_COVERAGE:BOOL=ON") set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON") diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index b15205f38ae..b1137c3b944 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -75,6 +75,18 @@ jobs: with: build_mode: "Debug" + call-release-special-par: + name: "CMake Parallel Release Special Workflows" + uses: ./.github/workflows/main-cmake-par-spc.yml + with: + build_mode: "Release" + + call-debug-special-par: + name: "CMake Parallel Debug Special Workflows" + uses: ./.github/workflows/main-cmake-par-spc.yml + with: + build_mode: "Debug" + call-release-cmake-intel: name: "CMake Intel Workflows" uses: ./.github/workflows/intel-cmake.yml diff --git a/.github/workflows/hdfeos5.yml b/.github/workflows/hdfeos5.yml index 2f766ce36bb..01dad32f529 100644 --- a/.github/workflows/hdfeos5.yml +++ b/.github/workflows/hdfeos5.yml @@ -15,31 +15,59 @@ on: - 'LICENSE**' - '**.md' +permissions: + contents: read + # Using concurrency to cancel any in-progress job or run concurrency: group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} cancel-in-progress: true -permissions: - contents: read - jobs: build: name: Build hdfeos5 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.1.7 + - name: Install System dependencies + run: | + sudo apt-get update + sudo apt-get install ninja-build + sudo apt install libssl3 libssl-dev libcurl4 + sudo apt install -y libaec-dev zlib1g-dev automake autoconf libcurl4-openssl-dev libjpeg-dev wget curl bzip2 m4 flex bison cmake libzip-dev doxygen openssl libtool libtool-bin - - name: Install Autotools Dependencies (Linux) + - name: Checkout HDF5 + uses: actions/checkout@v4.1.7 + + - name: CMake Configure run: | - sudo apt update - sudo apt install automake autoconf libtool libtool-bin + mkdir "${{ runner.workspace }}/build" + cd "${{ runner.workspace }}/build" + cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \ + -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DHDF5_ENABLE_PARALLEL:BOOL=OFF \ + -DHDF5_BUILD_CPP_LIB:BOOL=OFF \ + -DHDF5_BUILD_FORTRAN=OFF \ + -DHDF5_BUILD_JAVA=OFF \ + -DHDF5_BUILD_DOC=OFF \ + -DLIBAEC_USE_LOCALCONTENT=OFF \ + -DZLIB_USE_LOCALCONTENT=OFF \ + -DH5_NO_DEPRECATED_SYMBOLS:BOOL=OFF \ + -DBUILD_TESTING:BOOL=OFF \ + -DDEFAULT_API_VERSION:STRING=v16 \ + -DCMAKE_INSTALL_PREFIX:PATH=/usr/local \ + $GITHUB_WORKSPACE + shell: bash + + - name: CMake Build + run: cmake --build . --parallel 3 --config Release + working-directory: ${{ runner.workspace }}/build + - name: Install HDF5 run: | - ./autogen.sh - ./configure --prefix=/usr/local --disable-tests --with-default-api-version=v16 - make - sudo make install + sudo cmake --install . --config Release --prefix="/usr/local" + working-directory: ${{ runner.workspace }}/build + - name: Install HDF-EOS5 run: | wget -O HDF-EOS5.2.0.tar.gz "https://git.earthdata.nasa.gov/projects/DAS/repos/hdfeos5/raw/hdf-eos5-2.0-src.tar.gz?at=refs%2Fheads%2FHDFEOS5_2.0" @@ -47,5 +75,6 @@ jobs: cd hdf-eos5-2.0 ./configure CC=/usr/local/bin/h5cc --prefix=/usr/local/ --enable-install-include make - make check + LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH}" + LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make check sudo make install diff --git a/.github/workflows/main-cmake-par-spc.yml b/.github/workflows/main-cmake-par-spc.yml new file mode 100644 index 00000000000..72bc99bed11 --- /dev/null +++ b/.github/workflows/main-cmake-par-spc.yml @@ -0,0 +1,79 @@ +name: hdf5 dev parallel special CMake CI + +on: + workflow_call: + inputs: + build_mode: + description: "release vs. debug build" + required: true + type: string + +permissions: + contents: read + +jobs: + # + # The GitHub runners are inadequate for running parallel HDF5 tests, + # so we catch most issues in daily testing. What we have here is just + # a compile check to make sure nothing obvious is broken. + # A workflow that builds the library + # Parallel Linux (Ubuntu) w/ gcc + CMake + # + CMake_build_parallel_werror: + name: "Parallel GCC-${{ inputs.build_mode }}" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.7 + + - name: Install Linux Dependencies + run: | + sudo apt-get update + sudo apt-get install ninja-build doxygen graphviz + sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev + sudo apt install gcc-12 g++-12 gfortran-12 + sudo apt install libaec0 libaec-dev + sudo apt install openmpi-bin openmpi-common mpi-default-dev + echo "CC=mpicc" >> $GITHUB_ENV + echo "FC=mpif90" >> $GITHUB_ENV + + - name: CMake Configure + shell: bash + run: | + mkdir "${{ runner.workspace }}/build" + cd "${{ runner.workspace }}/build" + CC=mpicc cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \ + --log-level=VERBOSE \ + -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \ + -DBUILD_SHARED_LIBS=ON \ + -DHDF5_ENABLE_ALL_WARNINGS=ON \ + -DHDF5_ENABLE_WARNINGS_AS_ERRORS=ON \ + -DHDF5_ENABLE_PARALLEL:BOOL=ON \ + -DHDF5_ENABLE_SUBFILING_VFD:BOOL=ON \ + -DHDF5_BUILD_CPP_LIB:BOOL=OFF \ + -DHDF5_BUILD_FORTRAN=OFF \ + -DHDF5_BUILD_JAVA=OFF \ + -DLIBAEC_USE_LOCALCONTENT=OFF \ + -DZLIB_USE_LOCALCONTENT=OFF \ + -DHDF5_ENABLE_MIRROR_VFD:BOOL=OFF \ + -DHDF5_ENABLE_DIRECT_VFD:BOOL=ON \ + -DHDF5_ENABLE_ROS3_VFD:BOOL=OFF \ + -DHDF5_PACK_EXAMPLES:BOOL=OFF \ + $GITHUB_WORKSPACE + + # BUILD + - name: CMake Build + run: cmake --build . --parallel 3 --config ${{ inputs.build_mode }} + working-directory: ${{ runner.workspace }}/build + + # + # RUN TESTS + # + - name: CMake Run Tests + run: ctest . -E MPI_TEST --parallel 2 -C ${{ inputs.build_mode }} -V + working-directory: ${{ runner.workspace }}/build + if: ${{ matrix.run_tests && (inputs.thread_safety != 'TS') }} + + - name: CMake Run Parallel Tests + run: ctest . -R MPI_TEST -C ${{ inputs.build_mode }} -V + working-directory: ${{ runner.workspace }}/build + if: ${{ matrix.run_tests && (inputs.thread_safety != 'TS') }} diff --git a/.github/workflows/main-cmake-par.yml b/.github/workflows/main-cmake-par.yml index c00caa713c9..c3d9900e857 100644 --- a/.github/workflows/main-cmake-par.yml +++ b/.github/workflows/main-cmake-par.yml @@ -1,4 +1,4 @@ -name: hdf5 dev PAR CMake CI +name: hdf5 dev parallel CMake CI on: workflow_call: @@ -17,7 +17,7 @@ jobs: # so we catch most issues in daily testing. What we have here is just # a compile check to make sure nothing obvious is broken. # A workflow that builds the library - # Parallel Linux (Ubuntu) w/ gcc + Autotools + # Parallel Linux (Ubuntu) w/ gcc + CMake # CMake_build_parallel: name: "Parallel GCC-${{ inputs.build_mode }}" diff --git a/.github/workflows/main-cmake-spc.yml b/.github/workflows/main-cmake-spc.yml index 0cee38a1608..a814cf1a09d 100644 --- a/.github/workflows/main-cmake-spc.yml +++ b/.github/workflows/main-cmake-spc.yml @@ -38,9 +38,7 @@ jobs: - name: Get Sources uses: actions/checkout@v4.1.7 - # # CMAKE CONFIGURE - # - name: CMake Configure run: | mkdir "${{ runner.workspace }}/build" @@ -65,16 +63,12 @@ jobs: $GITHUB_WORKSPACE shell: bash - # # BUILD - # - name: CMake Build run: cmake --build . --parallel 3 --config Debug working-directory: ${{ runner.workspace }}/build - # # RUN TESTS - disable until some tests are fixed - # # - name: CMake Run Tests # run: ctest . --parallel 2 -C Debug -V # working-directory: ${{ runner.workspace }}/build @@ -98,9 +92,7 @@ jobs: - name: Get Sources uses: actions/checkout@v4.1.7 - # # CMAKE CONFIGURE - # - name: CMake Configure run: | mkdir "${{ runner.workspace }}/build" @@ -125,9 +117,7 @@ jobs: $GITHUB_WORKSPACE shell: bash - # # BUILD - # - name: CMake Build run: cmake --build . --parallel 3 --config Debug working-directory: ${{ runner.workspace }}/build @@ -158,9 +148,7 @@ jobs: - name: Get Sources uses: actions/checkout@v4.1.7 - # # CMAKE CONFIGURE - # - name: CMake Configure run: | mkdir "${{ runner.workspace }}/build" @@ -185,9 +173,7 @@ jobs: $GITHUB_WORKSPACE shell: bash - # # BUILD - # - name: CMake Build run: cmake --build . --parallel 3 --config Debug working-directory: ${{ runner.workspace }}/build @@ -218,9 +204,7 @@ jobs: - name: Get Sources uses: actions/checkout@v4.1.7 - # # CMAKE CONFIGURE - # - name: CMake Configure run: | mkdir "${{ runner.workspace }}/build" @@ -245,16 +229,12 @@ jobs: $GITHUB_WORKSPACE shell: bash - # # BUILD - # - name: CMake Build run: cmake --build . --parallel 3 --config Debug working-directory: ${{ runner.workspace }}/build - # # RUN TESTS - # - name: CMake Run Tests run: ctest . --parallel 2 -C Debug -V working-directory: ${{ runner.workspace }}/build @@ -278,9 +258,7 @@ jobs: - name: Get Sources uses: actions/checkout@v4.1.7 - # # CMAKE CONFIGURE - # - name: CMake Configure run: | mkdir "${{ runner.workspace }}/build" @@ -305,16 +283,12 @@ jobs: $GITHUB_WORKSPACE shell: bash - # # BUILD - # - name: CMake Build run: cmake --build . --parallel 3 --config Debug working-directory: ${{ runner.workspace }}/build - # # RUN TESTS - # - name: CMake Run Tests run: ctest . --parallel 2 -C Debug -V working-directory: ${{ runner.workspace }}/build @@ -326,21 +300,19 @@ jobs: # SETUP - name: Install Linux Dependencies run: | - sudo apt-get update - sudo apt-get install ninja-build doxygen graphviz - sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev - sudo apt install gcc-12 g++-12 gfortran-12 - echo "CC=gcc-12" >> $GITHUB_ENV - echo "CXX=g++-12" >> $GITHUB_ENV - echo "FC=gfortran-12" >> $GITHUB_ENV + sudo apt-get update + sudo apt-get install ninja-build doxygen graphviz + sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev + sudo apt install gcc-12 g++-12 gfortran-12 + echo "CC=gcc-12" >> $GITHUB_ENV + echo "CXX=g++-12" >> $GITHUB_ENV + echo "FC=gfortran-12" >> $GITHUB_ENV # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - name: Get Sources uses: actions/checkout@v4.1.7 - # # CMAKE CONFIGURE - # - name: CMake Configure run: | mkdir "${{ runner.workspace }}/build" @@ -365,16 +337,12 @@ jobs: $GITHUB_WORKSPACE shell: bash - # # BUILD - # - name: CMake Build run: cmake --build . --parallel 3 --config Debug working-directory: ${{ runner.workspace }}/build - # # RUN TESTS - # - name: CMake Run Tests run: ctest . --parallel 2 -C Debug -V working-directory: ${{ runner.workspace }}/build @@ -386,21 +354,19 @@ jobs: # SETUP - name: Install Linux Dependencies run: | - sudo apt-get update - sudo apt-get install ninja-build doxygen graphviz - sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev - sudo apt install gcc-12 g++-12 gfortran-12 - echo "CC=gcc-12" >> $GITHUB_ENV - echo "CXX=g++-12" >> $GITHUB_ENV - echo "FC=gfortran-12" >> $GITHUB_ENV + sudo apt-get update + sudo apt-get install ninja-build doxygen graphviz + sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev + sudo apt install gcc-12 g++-12 gfortran-12 + echo "CC=gcc-12" >> $GITHUB_ENV + echo "CXX=g++-12" >> $GITHUB_ENV + echo "FC=gfortran-12" >> $GITHUB_ENV # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - name: Get Sources uses: actions/checkout@v4.1.7 - # # CMAKE CONFIGURE - # - name: CMake Configure run: | mkdir "${{ runner.workspace }}/build" @@ -425,16 +391,110 @@ jobs: $GITHUB_WORKSPACE shell: bash - # # BUILD - # - name: CMake Build run: cmake --build . --parallel 3 --config Release working-directory: ${{ runner.workspace }}/build - # # RUN TESTS - # - name: CMake Run Tests run: ctest . --parallel 2 -C Release -V working-directory: ${{ runner.workspace }}/build + + build_debug_werror: + name: "gcc DBG -Werror (build only)" + runs-on: ubuntu-latest + steps: + # SETUP + - name: Install Linux Dependencies + run: | + sudo apt-get update + sudo apt-get install ninja-build doxygen graphviz + sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev + sudo apt install gcc-12 g++-12 gfortran-12 + echo "CC=gcc-12" >> $GITHUB_ENV + echo "CXX=g++-12" >> $GITHUB_ENV + echo "FC=gfortran-12" >> $GITHUB_ENV + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Get Sources + uses: actions/checkout@v4.1.7 + + # CMAKE CONFIGURE + - name: CMake Configure + run: | + mkdir "${{ runner.workspace }}/build" + cd "${{ runner.workspace }}/build" + cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \ + -G Ninja \ + --log-level=VERBOSE \ + -DCMAKE_BUILD_TYPE=Debug \ + -DBUILD_SHARED_LIBS=ON \ + -DHDF5_ENABLE_ALL_WARNINGS=ON \ + -DHDF5_ENABLE_WARNINGS_AS_ERRORS=ON \ + -DHDF5_ENABLE_PARALLEL:BOOL=OFF \ + -DHDF5_BUILD_CPP_LIB:BOOL=ON \ + -DHDF5_BUILD_FORTRAN=OFF \ + -DHDF5_BUILD_JAVA=ON \ + -DHDF5_BUILD_DOC=OFF \ + -DLIBAEC_USE_LOCALCONTENT=OFF \ + -DZLIB_USE_LOCALCONTENT=OFF \ + -DHDF5_ENABLE_MIRROR_VFD:BOOL=ON \ + -DHDF5_ENABLE_DIRECT_VFD:BOOL=ON \ + -DHDF5_ENABLE_ROS3_VFD:BOOL=ON \ + $GITHUB_WORKSPACE + shell: bash + + # BUILD + - name: CMake Build + run: cmake --build . --parallel 3 --config Release + working-directory: ${{ runner.workspace }}/build + + build_release_werror: + name: "gcc REL -Werror (build only)" + runs-on: ubuntu-latest + steps: + # SETUP + - name: Install Linux Dependencies + run: | + sudo apt-get update + sudo apt-get install ninja-build doxygen graphviz + sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev + sudo apt install gcc-12 g++-12 gfortran-12 + echo "CC=gcc-12" >> $GITHUB_ENV + echo "CXX=g++-12" >> $GITHUB_ENV + echo "FC=gfortran-12" >> $GITHUB_ENV + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Get Sources + uses: actions/checkout@v4.1.7 + + # CMAKE CONFIGURE + - name: CMake Configure + run: | + mkdir "${{ runner.workspace }}/build" + cd "${{ runner.workspace }}/build" + cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \ + -G Ninja \ + --log-level=VERBOSE \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS=ON \ + -DHDF5_ENABLE_ALL_WARNINGS=ON \ + -DHDF5_ENABLE_WARNINGS_AS_ERRORS=ON \ + -DHDF5_ENABLE_PARALLEL:BOOL=OFF \ + -DHDF5_BUILD_CPP_LIB:BOOL=ON \ + -DHDF5_BUILD_FORTRAN=ON \ + -DHDF5_BUILD_JAVA=ON \ + -DHDF5_BUILD_DOC=OFF \ + -DLIBAEC_USE_LOCALCONTENT=OFF \ + -DZLIB_USE_LOCALCONTENT=OFF \ + -DHDF5_ENABLE_MIRROR_VFD:BOOL=ON \ + -DHDF5_ENABLE_DIRECT_VFD:BOOL=ON \ + -DHDF5_ENABLE_ROS3_VFD:BOOL=ON \ + $GITHUB_WORKSPACE + shell: bash + + # BUILD + - name: CMake Build + run: cmake --build . --parallel 3 --config Release + working-directory: ${{ runner.workspace }}/build diff --git a/.github/workflows/netcdf.yml b/.github/workflows/netcdf.yml index 080160d086d..febc7b6fd8f 100644 --- a/.github/workflows/netcdf.yml +++ b/.github/workflows/netcdf.yml @@ -29,21 +29,50 @@ jobs: steps: - name: Install System dependencies run: | - sudo apt update + sudo apt-get update + sudo apt-get install ninja-build + sudo apt install libssl3 libssl-dev libcurl4 sudo apt install -y libaec-dev zlib1g-dev automake autoconf libcurl4-openssl-dev libjpeg-dev wget curl bzip2 m4 flex bison cmake libzip-dev doxygen openssl libtool libtool-bin + - name: Checkout HDF5 uses: actions/checkout@v4.1.7 + + - name: CMake Configure + run: | + mkdir "${{ runner.workspace }}/build" + cd "${{ runner.workspace }}/build" + cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \ + -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DONLY_SHARED_LIBS=ON \ + -DHDF5_ENABLE_PARALLEL:BOOL=OFF \ + -DHDF5_BUILD_CPP_LIB:BOOL=OFF \ + -DHDF5_BUILD_FORTRAN=OFF \ + -DHDF5_BUILD_JAVA=OFF \ + -DHDF5_BUILD_DOC=OFF \ + -DLIBAEC_USE_LOCALCONTENT=OFF \ + -DZLIB_USE_LOCALCONTENT=OFF \ + -DH5_NO_DEPRECATED_SYMBOLS:BOOL=OFF \ + -DBUILD_TESTING:BOOL=OFF \ + -DCMAKE_INSTALL_PREFIX:PATH=/usr/local \ + $GITHUB_WORKSPACE + shell: bash + + - name: CMake Build + run: cmake --build . --parallel 3 --config Release + working-directory: ${{ runner.workspace }}/build + - name: Install HDF5 run: | - ./autogen.sh - ./configure --prefix=/usr/local --disable-tests --disable-static --enable-shared --enable-hl --with-szlib - make -j - sudo make install -j + sudo cmake --install . --config Release --prefix="/usr/local" + working-directory: ${{ runner.workspace }}/build + - name: Checkout netCDF uses: actions/checkout@v4.1.7 with: repository: unidata/netcdf-c path: netcdf-c + - name: Test netCDF run: | cd netcdf-c