From 7b3b21621c3a26d065b043aececb2324260aac77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Thu, 30 Jul 2026 09:34:24 +0200 Subject: [PATCH 1/3] Split CI into separate workflows per platform GitHub allows temporarily disabling workflows (e.g., in forks of the repository). It doesn't have built-in granularity to disable jobs inside the same workflow though. To do that currently, a user could, e.g., remove jobs manually and then rebase their actual changes on a branch where the jobs are still intact. Simplify that workflow by splitting the workflow files into three (one per platform). --- .github/workflows/build-macos.yml | 100 ++++++++ .github/workflows/build-mingw.yml | 102 ++++++++ .github/workflows/build-ubuntu.yml | 163 +++++++++++++ .github/workflows/jobs.yml | 359 ----------------------------- 4 files changed, 365 insertions(+), 359 deletions(-) create mode 100644 .github/workflows/build-macos.yml create mode 100644 .github/workflows/build-mingw.yml create mode 100644 .github/workflows/build-ubuntu.yml delete mode 100644 .github/workflows/jobs.yml diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml new file mode 100644 index 00000000..61962c57 --- /dev/null +++ b/.github/workflows/build-macos.yml @@ -0,0 +1,100 @@ +name: build-macos +on: [push, pull_request] +jobs: + macos_latest_cmake: + runs-on: macos-latest + steps: + - name: Clone and check out repository code + uses: actions/checkout@v7 + with: + fetch-depth: 0 + ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. + repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. + - name: Check commit + run: | + git log -1 + - name: Install brew dependencies + run: | + brew reinstall gcc # brings gfortran on path + brew install cmake open-mpi eigen veclibfort + - name: Run job + run: | + mkdir -p build + cd build + export FC=mpif90 # Uses gfortran. + export CC=mpicc # Uses clang. + export CFLAGS="-Qunused-arguments" + export CXX=mpic++ # Uses clang++. + export CXXFLAGS="-Qunused-arguments" + export VECLIBFORT_PREFIX=$(brew --prefix veclibfort) + cmake \ + -DBLAS_LIBRARIES="${VECLIBFORT_PREFIX}/lib/libvecLibFort.dylib" \ + -DLAPACK_LIBRARIES="${VECLIBFORT_PREFIX}/lib/libvecLibFort.dylib" \ + -DEXAMPLES=ON -DICB=ON -DEIGEN=ON -DMPI=ON .. + make all + CTEST_OUTPUT_ON_FAILURE=1 make test + macos_latest_cmake_python: + runs-on: macos-latest + steps: + - name: Clone and check out repository code + uses: actions/checkout@v7 + with: + fetch-depth: 0 + ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. + repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. + - name: Check commit + run: | + git log -1 + - name: Install brew dependencies + run: | + # Unlink and re-link to prevent errors when github mac runner images + # install python outside of brew, for example: + # https://github.com/orgs/Homebrew/discussions/3895 + # https://github.com/actions/setup-python/issues/577 + # https://github.com/actions/runner-images/issues/6459 + # https://github.com/actions/runner-images/issues/6507 + # https://github.com/actions/runner-images/issues/2322 + brew list -1 | grep python | while read formula; do brew unlink $formula; brew link --overwrite $formula; done + brew reinstall gcc # brings gfortran on path + brew install cmake eigen boost-python3 python3 numpy veclibfort + - name: Run job + run: | + mkdir -p build + cd build + export FC=gfortran + export CC=clang + export CFLAGS="-Qunused-arguments" + export CXX=clang++ + export CXXFLAGS="-Qunused-arguments" + export VECLIBFORT_PREFIX=$(brew --prefix veclibfort) + cmake \ + -DBLAS_LIBRARIES="${VECLIBFORT_PREFIX}/lib/libvecLibFort.dylib" \ + -DLAPACK_LIBRARIES="${VECLIBFORT_PREFIX}/lib/libvecLibFort.dylib" \ + -DEXAMPLES=ON -DICB=ON -DEIGEN=ON -DPYTHON3=ON .. + make all + CTEST_OUTPUT_ON_FAILURE=1 make test + macos_latest_autotools: + runs-on: macos-latest + steps: + - name: Clone and check out repository code + uses: actions/checkout@v7 + with: + fetch-depth: 0 + ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. + repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. + - name: Check commit + run: | + git log -1 + - name: Install brew dependencies + run: | + brew reinstall gcc # brings gfortran on path + brew install autoconf automake libtool pkgconfig open-mpi eigen veclibfort + - name: Run job + run: | + ./bootstrap + export VECLIBFORT_PREFIX=$(brew --prefix veclibfort) + BLAS_LIBS="-L${VECLIBFORT_PREFIX}/lib -lvecLibFort" \ + LAPACK_LIBS="-L${VECLIBFORT_PREFIX}/lib -lvecLibFort" \ + ./configure --enable-icb --enable-eigen --enable-mpi + make all + make check diff --git a/.github/workflows/build-mingw.yml b/.github/workflows/build-mingw.yml new file mode 100644 index 00000000..cd187a83 --- /dev/null +++ b/.github/workflows/build-mingw.yml @@ -0,0 +1,102 @@ +name: build-mingw +on: [push, pull_request] +jobs: + windows_latest_cmake: + runs-on: windows-latest + name: MinGW-w64 ${{ matrix.msystem }} INTERFACE64=${{ matrix.int64 }}/MPI=${{ matrix.mpi }} + strategy: + fail-fast: false + matrix: + msystem: [UCRT64, CLANG64] + int64: [ON, OFF] + mpi: [ON, OFF] + exclude: + - int64: ON + mpi: ON + defaults: + run: + # Use MSYS2 as default shell + shell: msys2 {0} + steps: + - name: Install MSYS2 build environment + uses: msys2/setup-msys2@v2 + with: + update: true + msystem: ${{ matrix.msystem }} + install: >- + base-devel + git + pacboy: >- + cmake:p + ninja:p + cc:p + fc:p + eigen3:p + - name: Install OpenBLAS and MS-MPI from MSYS2 + run: | + if [[ ${{ matrix.int64 }} != ON ]]; then + pacboy -S openblas:p --noconfirm + else + pacboy -S openblas64:p --noconfirm + fi + if [[ ${{ matrix.mpi }} = ON ]]; then + # This installs only the link library. + # The actual library will be installed in the next step. + pacboy -S msmpi:p --noconfirm + fi + - name: Install MS-MPI (for mpiexec) + uses: mpi4py/setup-mpi@v1 + - name: Clone and check out repository code + uses: actions/checkout@v7 + with: + fetch-depth: 0 + ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. + repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. + - name: Check commit + run: | + git log -1 + - name: Run job + run: | + mkdir -p build && cd build + echo "::group::Configure" + if [[ ${{ matrix.int64 }} == ON ]]; then + _blas_lib_flag="-DBLAS_LIBRARIES=openblas_64" + fi + cmake \ + -GNinja \ + -DICB=ON \ + -DEIGEN=ON \ + -DEXAMPLES=ON \ + -DMPI=${{ matrix.mpi }} \ + -DINTERFACE64=${{ matrix.int64 }} \ + ${_blas_lib_flag} \ + .. + echo "::endgroup::" + echo "::group::Build" + cmake --build . -v + echo "::endgroup::" + - name: Run tests + id: run-ctest + run: | + if [[ ${{ matrix.mpi }} == ON ]]; then + export PATH="/c/Program Files/Microsoft MPI/Bin":$PATH # add mpiexec to msys2 path + fi + cd build + ctest + - name: Re-run tests + if: always() && (steps.run-ctest.outcome == 'failure') + timeout-minutes: 60 + run: | + if [[ ${{ matrix.mpi }} == ON ]]; then + export PATH="/c/Program Files/Microsoft MPI/Bin":$PATH # add mpiexec to msys2 path + fi + cd build + echo "::group::Re-run ctest" + ctest --rerun-failed --output-on-failure || true + echo "::endgroup::" + echo "::group::Log from these tests" + [ ! -f Testing/Temporary/LastTest.log ] || cat Testing/Temporary/LastTest.log + echo "::endgroup::" + echo "::group::Content of arpackmm.run.log" + [ ! -f EXAMPLES/MATRIX_MARKET/arpackmm.run.log ] || cat EXAMPLES/MATRIX_MARKET/arpackmm.run.log + echo "::endgroup::" diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml new file mode 100644 index 00000000..f9ef7445 --- /dev/null +++ b/.github/workflows/build-ubuntu.yml @@ -0,0 +1,163 @@ +name: build-ubuntu +on: [push, pull_request] +jobs: + ubuntu_latest_cmake: + runs-on: ubuntu-latest + steps: + - name: Clone and check out repository code + uses: actions/checkout@v7 + with: + fetch-depth: 0 + ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. + repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. + - name: Check commit + run: | + git log -1 + - name: Update OS + run: sudo apt-get update + - name: Install apt-get dependencies + run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev libeigen3-dev cmake + - name: Run job + run: | + mkdir build + cd build + cmake -DEXAMPLES=ON -DMPI=ON -DICB=ON -DEIGEN=ON .. + make all + CTEST_OUTPUT_ON_FAILURE=1 make test + make package_source + ubuntu_latest_cmake_install: + runs-on: ubuntu-latest + steps: + - name: Clone and check out repository code + uses: actions/checkout@v7 + with: + fetch-depth: 0 + ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. + repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. + - name: Check commit + run: | + git log -1 + - name: Update OS + run: sudo apt-get update + - name: Install apt-get dependencies + run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev libeigen3-dev cmake + - name: Run job + run: | + mkdir build + cd build + cmake .. + bash ./tstCMakeInstall.sh + bash ./tstCMakeInstall.sh 64- + bash ./tstCMakeInstall.sh -ILP64 + bash ./tstCMakeInstall.sh 64-ILP64 + ubuntu_latest_autotools: + runs-on: ubuntu-latest + steps: + - name: Clone and check out repository code + uses: actions/checkout@v7 + with: + fetch-depth: 0 + ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. + repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. + - name: Check commit + run: | + git log -1 + - name: Update OS + run: sudo apt-get update + - name: Install apt-get dependencies + run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev libeigen3-dev automake autoconf pkg-config libtool + - name: Run job + run: | + ./bootstrap + ./configure --enable-mpi --enable-icb --enable-eigen + make all + make check + make distcheck + ubuntu_latest_autotools_install: + runs-on: ubuntu-latest + steps: + - name: Clone and check out repository code + uses: actions/checkout@v7 + with: + fetch-depth: 0 + ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. + repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. + - name: Check commit + run: | + git log -1 + - name: Update OS + run: sudo apt-get update + - name: Install apt-get dependencies + run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev libeigen3-dev automake autoconf pkg-config libtool + - name: Run job + run: | + ./bootstrap + ./configure + bash ./tstAutotoolsInstall.sh + bash ./tstAutotoolsInstall.sh 64- + bash ./tstAutotoolsInstall.sh -ILP64 + bash ./tstAutotoolsInstall.sh 64-ILP64 + ubuntu_latest_cmake_python: + runs-on: ubuntu-latest + steps: + - name: Clone and check out repository code + uses: actions/checkout@v7 + with: + fetch-depth: 0 + ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. + repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. + - name: Check commit + run: | + git log -1 + - name: Update OS + run: sudo apt-get update + - name: Install apt-get dependencies + run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev cmake libeigen3-dev + - name: Install python dependencies + run: sudo apt-get -y install python3-minimal python3-pip python3-numpy + - name: Build boost-python for python3 (not provided by apt-cache) + run : | + sudo apt-get -y install wget + wget https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.gz + tar -xf boost_1_79_0.tar.gz + cd boost_1_79_0 + ./bootstrap.sh --with-libraries=python --with-python=/usr/bin/python3 --with-toolset=gcc + sudo ./b2 toolset=gcc install + sudo apt-get install locate + sudo updatedb + - name: Run job + run: | + mkdir build + cd build + cmake -DEXAMPLES=ON -DMPI=ON -DICB=ON -DEIGEN=ON -DPYTHON3=ON .. + make all + CTEST_OUTPUT_ON_FAILURE=1 make test + ubuntu_latest_autotools_ilp64: + runs-on: ubuntu-latest + steps: + - name: Clone and check out repository code + uses: actions/checkout@v7 + with: + fetch-depth: 0 + ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. + repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. + - name: Check commit + run: | + git log -1 + - name: Update OS + run: sudo apt-get update + - name: Install apt-get dependencies + run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev automake autoconf pkg-config libtool libeigen3-dev + - name: Install Intel MKL (ILP64 blas/lapack) + run: echo yes | sudo apt-get -y install intel-mkl libmkl-dev + - name: Run job + run: | + ./bootstrap + ./configure --enable-icb --with-blas=mkl_gf_ilp64 --with-lapack=mkl_gf_ilp64 + make all + make check + env: + FFLAGS: "-DMKL_ILP64 -I/usr/include/mkl" + FCFLAGS: "-DMKL_ILP64 -I/usr/include/mkl" + LIBS: "-Wl,--no-as-needed -L/usr/lib/x86_64-linux-gnu -lmkl_sequential -lmkl_core -lpthread -lm -ldl" + INTERFACE64: "1" diff --git a/.github/workflows/jobs.yml b/.github/workflows/jobs.yml deleted file mode 100644 index 476e0d23..00000000 --- a/.github/workflows/jobs.yml +++ /dev/null @@ -1,359 +0,0 @@ -name: arpack-ng -on: [push, pull_request] -jobs: - ubuntu_latest_cmake: - runs-on: ubuntu-latest - steps: - - name: Clone and check out repository code - uses: actions/checkout@v7 - with: - fetch-depth: 0 - ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. - repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. - - name: Check commit - run: | - git log -1 - - name: Update OS - run: sudo apt-get update - - name: Install apt-get dependencies - run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev libeigen3-dev cmake - - name: Run job - run: | - mkdir build - cd build - cmake -DEXAMPLES=ON -DMPI=ON -DICB=ON -DEIGEN=ON .. - make all - CTEST_OUTPUT_ON_FAILURE=1 make test - make package_source - ubuntu_latest_cmake_install: - runs-on: ubuntu-latest - steps: - - name: Clone and check out repository code - uses: actions/checkout@v7 - with: - fetch-depth: 0 - ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. - repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. - - name: Check commit - run: | - git log -1 - - name: Update OS - run: sudo apt-get update - - name: Install apt-get dependencies - run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev libeigen3-dev cmake - - name: Run job - run: | - mkdir build - cd build - cmake .. - bash ./tstCMakeInstall.sh - bash ./tstCMakeInstall.sh 64- - bash ./tstCMakeInstall.sh -ILP64 - bash ./tstCMakeInstall.sh 64-ILP64 - ubuntu_latest_autotools: - runs-on: ubuntu-latest - steps: - - name: Clone and check out repository code - uses: actions/checkout@v7 - with: - fetch-depth: 0 - ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. - repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. - - name: Check commit - run: | - git log -1 - - name: Update OS - run: sudo apt-get update - - name: Install apt-get dependencies - run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev libeigen3-dev automake autoconf pkg-config libtool - - name: Run job - run: | - ./bootstrap - ./configure --enable-mpi --enable-icb --enable-eigen - make all - make check - make distcheck - ubuntu_latest_autotools_install: - runs-on: ubuntu-latest - steps: - - name: Clone and check out repository code - uses: actions/checkout@v7 - with: - fetch-depth: 0 - ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. - repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. - - name: Check commit - run: | - git log -1 - - name: Update OS - run: sudo apt-get update - - name: Install apt-get dependencies - run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev libeigen3-dev automake autoconf pkg-config libtool - - name: Run job - run: | - ./bootstrap - ./configure - bash ./tstAutotoolsInstall.sh - bash ./tstAutotoolsInstall.sh 64- - bash ./tstAutotoolsInstall.sh -ILP64 - bash ./tstAutotoolsInstall.sh 64-ILP64 - ubuntu_latest_cmake_python: - runs-on: ubuntu-latest - steps: - - name: Clone and check out repository code - uses: actions/checkout@v7 - with: - fetch-depth: 0 - ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. - repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. - - name: Check commit - run: | - git log -1 - - name: Update OS - run: sudo apt-get update - - name: Install apt-get dependencies - run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev cmake libeigen3-dev - - name: Install python dependencies - run: sudo apt-get -y install python3-minimal python3-pip python3-numpy - - name: Build boost-python for python3 (not provided by apt-cache) - run : | - sudo apt-get -y install wget - wget https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.gz - tar -xf boost_1_79_0.tar.gz - cd boost_1_79_0 - ./bootstrap.sh --with-libraries=python --with-python=/usr/bin/python3 --with-toolset=gcc - sudo ./b2 toolset=gcc install - sudo apt-get install locate - sudo updatedb - - name: Run job - run: | - mkdir build - cd build - cmake -DEXAMPLES=ON -DMPI=ON -DICB=ON -DEIGEN=ON -DPYTHON3=ON .. - make all - CTEST_OUTPUT_ON_FAILURE=1 make test - ubuntu_latest_autotools_ilp64: - runs-on: ubuntu-latest - steps: - - name: Clone and check out repository code - uses: actions/checkout@v7 - with: - fetch-depth: 0 - ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. - repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. - - name: Check commit - run: | - git log -1 - - name: Update OS - run: sudo apt-get update - - name: Install apt-get dependencies - run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev automake autoconf pkg-config libtool libeigen3-dev - - name: Install Intel MKL (ILP64 blas/lapack) - run: echo yes | sudo apt-get -y install intel-mkl libmkl-dev - - name: Run job - run: | - ./bootstrap - ./configure --enable-icb --with-blas=mkl_gf_ilp64 --with-lapack=mkl_gf_ilp64 - make all - make check - env: - FFLAGS: "-DMKL_ILP64 -I/usr/include/mkl" - FCFLAGS: "-DMKL_ILP64 -I/usr/include/mkl" - LIBS: "-Wl,--no-as-needed -L/usr/lib/x86_64-linux-gnu -lmkl_sequential -lmkl_core -lpthread -lm -ldl" - INTERFACE64: "1" - macos_latest_cmake: - runs-on: macos-latest - steps: - - name: Clone and check out repository code - uses: actions/checkout@v7 - with: - fetch-depth: 0 - ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. - repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. - - name: Check commit - run: | - git log -1 - - name: Install brew dependencies - run: | - brew reinstall gcc # brings gfortran on path - brew install cmake open-mpi eigen veclibfort - - name: Run job - run: | - mkdir -p build - cd build - export FC=mpif90 # Uses gfortran. - export CC=mpicc # Uses clang. - export CFLAGS="-Qunused-arguments" - export CXX=mpic++ # Uses clang++. - export CXXFLAGS="-Qunused-arguments" - export VECLIBFORT_PREFIX=$(brew --prefix veclibfort) - cmake \ - -DBLAS_LIBRARIES="${VECLIBFORT_PREFIX}/lib/libvecLibFort.dylib" \ - -DLAPACK_LIBRARIES="${VECLIBFORT_PREFIX}/lib/libvecLibFort.dylib" \ - -DEXAMPLES=ON -DICB=ON -DEIGEN=ON -DMPI=ON .. - make all - CTEST_OUTPUT_ON_FAILURE=1 make test - macos_latest_cmake_python: - runs-on: macos-latest - steps: - - name: Clone and check out repository code - uses: actions/checkout@v7 - with: - fetch-depth: 0 - ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. - repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. - - name: Check commit - run: | - git log -1 - - name: Install brew dependencies - run: | - # Unlink and re-link to prevent errors when github mac runner images - # install python outside of brew, for example: - # https://github.com/orgs/Homebrew/discussions/3895 - # https://github.com/actions/setup-python/issues/577 - # https://github.com/actions/runner-images/issues/6459 - # https://github.com/actions/runner-images/issues/6507 - # https://github.com/actions/runner-images/issues/2322 - brew list -1 | grep python | while read formula; do brew unlink $formula; brew link --overwrite $formula; done - brew reinstall gcc # brings gfortran on path - brew install cmake eigen boost-python3 python3 numpy veclibfort - - name: Run job - run: | - mkdir -p build - cd build - export FC=gfortran - export CC=clang - export CFLAGS="-Qunused-arguments" - export CXX=clang++ - export CXXFLAGS="-Qunused-arguments" - export VECLIBFORT_PREFIX=$(brew --prefix veclibfort) - cmake \ - -DBLAS_LIBRARIES="${VECLIBFORT_PREFIX}/lib/libvecLibFort.dylib" \ - -DLAPACK_LIBRARIES="${VECLIBFORT_PREFIX}/lib/libvecLibFort.dylib" \ - -DEXAMPLES=ON -DICB=ON -DEIGEN=ON -DPYTHON3=ON .. - make all - CTEST_OUTPUT_ON_FAILURE=1 make test - macos_latest_autotools: - runs-on: macos-latest - steps: - - name: Clone and check out repository code - uses: actions/checkout@v7 - with: - fetch-depth: 0 - ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. - repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. - - name: Check commit - run: | - git log -1 - - name: Install brew dependencies - run: | - brew reinstall gcc # brings gfortran on path - brew install autoconf automake libtool pkgconfig open-mpi eigen veclibfort - - name: Run job - run: | - ./bootstrap - export VECLIBFORT_PREFIX=$(brew --prefix veclibfort) - BLAS_LIBS="-L${VECLIBFORT_PREFIX}/lib -lvecLibFort" \ - LAPACK_LIBS="-L${VECLIBFORT_PREFIX}/lib -lvecLibFort" \ - ./configure --enable-icb --enable-eigen --enable-mpi - make all - make check - windows_latest_cmake: - runs-on: windows-latest - name: MinGW-w64 ${{ matrix.msystem }} INTERFACE64=${{ matrix.int64 }}/MPI=${{ matrix.mpi }} - strategy: - fail-fast: false - matrix: - msystem: [UCRT64, CLANG64] - int64: [ON, OFF] - mpi: [ON, OFF] - exclude: - - int64: ON - mpi: ON - defaults: - run: - # Use MSYS2 as default shell - shell: msys2 {0} - steps: - - name: Install MSYS2 build environment - uses: msys2/setup-msys2@v2 - with: - update: true - msystem: ${{ matrix.msystem }} - install: >- - base-devel - git - pacboy: >- - cmake:p - ninja:p - cc:p - fc:p - eigen3:p - - name: Install OpenBLAS and MS-MPI from MSYS2 - run: | - if [[ ${{ matrix.int64 }} != ON ]]; then - pacboy -S openblas:p --noconfirm - else - pacboy -S openblas64:p --noconfirm - fi - if [[ ${{ matrix.mpi }} = ON ]]; then - # This installs only the link library. - # The actual library will be installed in the next step. - pacboy -S msmpi:p --noconfirm - fi - - name: Install MS-MPI (for mpiexec) - uses: mpi4py/setup-mpi@v1 - - name: Clone and check out repository code - uses: actions/checkout@v7 - with: - fetch-depth: 0 - ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. - repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. - - name: Check commit - run: | - git log -1 - - name: Run job - run: | - mkdir -p build && cd build - echo "::group::Configure" - if [[ ${{ matrix.int64 }} == ON ]]; then - _blas_lib_flag="-DBLAS_LIBRARIES=openblas_64" - fi - cmake \ - -GNinja \ - -DICB=ON \ - -DEIGEN=ON \ - -DEXAMPLES=ON \ - -DMPI=${{ matrix.mpi }} \ - -DINTERFACE64=${{ matrix.int64 }} \ - ${_blas_lib_flag} \ - .. - echo "::endgroup::" - echo "::group::Build" - cmake --build . -v - echo "::endgroup::" - - name: Run tests - id: run-ctest - run: | - if [[ ${{ matrix.mpi }} == ON ]]; then - export PATH="/c/Program Files/Microsoft MPI/Bin":$PATH # add mpiexec to msys2 path - fi - cd build - ctest - - name: Re-run tests - if: always() && (steps.run-ctest.outcome == 'failure') - timeout-minutes: 60 - run: | - if [[ ${{ matrix.mpi }} == ON ]]; then - export PATH="/c/Program Files/Microsoft MPI/Bin":$PATH # add mpiexec to msys2 path - fi - cd build - echo "::group::Re-run ctest" - ctest --rerun-failed --output-on-failure || true - echo "::endgroup::" - echo "::group::Log from these tests" - [ ! -f Testing/Temporary/LastTest.log ] || cat Testing/Temporary/LastTest.log - echo "::endgroup::" - echo "::group::Content of arpackmm.run.log" - [ ! -f EXAMPLES/MATRIX_MARKET/arpackmm.run.log ] || cat EXAMPLES/MATRIX_MARKET/arpackmm.run.log - echo "::endgroup::" From 7d2d0f21fe9deb55392240bb7eca5285c5714be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Thu, 30 Jul 2026 11:58:28 +0200 Subject: [PATCH 2/3] CI (Ubuntu): Reduce duplication by using job matrices Additionally, use more granular steps to make it easier to catch where the runs potentially fail. That also might help with GitHub truncating the output for long steps. --- .github/workflows/build-ubuntu.yml | 226 +++++++++++++++-------------- 1 file changed, 118 insertions(+), 108 deletions(-) diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index f9ef7445..de02120e 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -1,8 +1,23 @@ name: build-ubuntu on: [push, pull_request] jobs: + ubuntu_latest_cmake: runs-on: ubuntu-latest + name: Ubuntu CMake ${{ matrix.tests }} tests ${{ matrix.install }} install ${{ matrix.python }} Python + strategy: + fail-fast: false + matrix: + include: + - tests: with + install: without + python: without + - tests: without + install: with + python: without + - tests: with + install: without + python: with steps: - name: Clone and check out repository code uses: actions/checkout@v7 @@ -17,41 +32,83 @@ jobs: run: sudo apt-get update - name: Install apt-get dependencies run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev libeigen3-dev cmake - - name: Run job + - name: Install python dependencies + if: matrix.python == 'with' + run: sudo apt-get -y install python3-minimal python3-pip python3-numpy + - name: Build boost-python for python3 (not provided by apt-cache) + if: matrix.python == 'with' + run : | + sudo apt-get -y install wget + wget https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.gz + tar -xf boost_1_79_0.tar.gz + cd boost_1_79_0 + ./bootstrap.sh --with-libraries=python --with-python=/usr/bin/python3 --with-toolset=gcc + sudo ./b2 toolset=gcc install + sudo apt-get install locate + sudo updatedb + - name: Configure run: | mkdir build cd build - cmake -DEXAMPLES=ON -DMPI=ON -DICB=ON -DEIGEN=ON .. - make all - CTEST_OUTPUT_ON_FAILURE=1 make test - make package_source - ubuntu_latest_cmake_install: - runs-on: ubuntu-latest - steps: - - name: Clone and check out repository code - uses: actions/checkout@v7 - with: - fetch-depth: 0 - ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. - repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. - - name: Check commit + cmake \ + $([ "${{ matrix.tests }}" == "with" ] && echo "-DEXAMPLES=ON -DMPI=ON -DICB=ON -DEIGEN=ON" || echo "") \ + $([ "${{ matrix.python }}" == "with" ] && echo "-DPYTHON3=ON" || echo "") \ + .. + - name: Build and install + if: matrix.install == 'with' run: | - git log -1 - - name: Update OS - run: sudo apt-get update - - name: Install apt-get dependencies - run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev libeigen3-dev cmake - - name: Run job - run: | - mkdir build cd build - cmake .. bash ./tstCMakeInstall.sh + - name: Build and install '64-' + if: matrix.install == 'with' + run: | + cd build bash ./tstCMakeInstall.sh 64- + - name: Build and install '-ILP64' + if: matrix.install == 'with' + run: | + cd build bash ./tstCMakeInstall.sh -ILP64 + - name: Build and install '64-ILP64' + if: matrix.install == 'with' + run: | + cd build bash ./tstCMakeInstall.sh 64-ILP64 + - name: Build + if: matrix.tests == 'with' + run: | + cd build + make all + - name: Run tests + if: matrix.tests == 'with' + run: | + cd build + CTEST_OUTPUT_ON_FAILURE=1 make test + - name: Create source package + if: matrix.tests == 'with' + run: | + cd build + make package_source + ubuntu_latest_autotools: runs-on: ubuntu-latest + name: Ubuntu autotools ${{ matrix.tests }} tests ${{ matrix.install }} install using ${{ matrix.blas }} + strategy: + fail-fast: false + matrix: + include: + - tests: with + install: without + blas: BLAS + configure-flags: --enable-mpi --enable-icb --enable-eigen + - tests: without + install: with + blas: BLAS + configure-flags: + - tests: with + install: without + blas: MKL + configure-flags: --enable-icb --with-blas=mkl_gf_ilp64 --with-lapack=mkl_gf_ilp64 steps: - name: Clone and check out repository code uses: actions/checkout@v7 @@ -65,99 +122,52 @@ jobs: - name: Update OS run: sudo apt-get update - name: Install apt-get dependencies - run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev libeigen3-dev automake autoconf pkg-config libtool - - name: Run job run: | - ./bootstrap - ./configure --enable-mpi --enable-icb --enable-eigen - make all - make check - make distcheck - ubuntu_latest_autotools_install: - runs-on: ubuntu-latest - steps: - - name: Clone and check out repository code - uses: actions/checkout@v7 - with: - fetch-depth: 0 - ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. - repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. - - name: Check commit + sudo apt-get install -y \ + gfortran gcc g++ openmpi-bin libopenmpi-dev \ + $([ "${{ matrix.blas }}" != "BLAS" ] || echo "libblas-dev liblapack-dev") \ + libeigen3-dev automake autoconf pkg-config libtool + if [ "${{ matrix.blas }}" == "MKL" ]; then + echo "::group::Install Intel MKL (ILP64 BLAS/LAPACK)" + echo yes | sudo apt-get -y install intel-mkl libmkl-dev + echo "::endgroup::" + fi + - name: Setup environment for MKL + if: matrix.blas == 'MKL' run: | - git log -1 - - name: Update OS - run: sudo apt-get update - - name: Install apt-get dependencies - run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev libeigen3-dev automake autoconf pkg-config libtool - - name: Run job + echo "FFLAGS=-DMKL_ILP64 -I/usr/include/mkl" >> $GITHUB_ENV + echo "FCFLAGS=-DMKL_ILP64 -I/usr/include/mkl" >> $GITHUB_ENV + echo "LIBS=-Wl,--no-as-needed -L/usr/lib/x86_64-linux-gnu -lmkl_sequential -lmkl_core -lpthread -lm -ldl" >> $GITHUB_ENV + echo "INTERFACE64=1" >> $GITHUB_ENV + - name: Configure run: | ./bootstrap - ./configure + ./configure ${{ matrix.configure-flags }} + - name: Build and install + if: matrix.install == 'with' + run: | bash ./tstAutotoolsInstall.sh + - name: Build and install '64-' + if: matrix.install == 'with' + run: | bash ./tstAutotoolsInstall.sh 64- + - name: Build and install '-ILP64' + if: matrix.install == 'with' + run: | bash ./tstAutotoolsInstall.sh -ILP64 - bash ./tstAutotoolsInstall.sh 64-ILP64 - ubuntu_latest_cmake_python: - runs-on: ubuntu-latest - steps: - - name: Clone and check out repository code - uses: actions/checkout@v7 - with: - fetch-depth: 0 - ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. - repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. - - name: Check commit + - name: Build and install '64-ILP64' + if: matrix.install == 'with' run: | - git log -1 - - name: Update OS - run: sudo apt-get update - - name: Install apt-get dependencies - run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev cmake libeigen3-dev - - name: Install python dependencies - run: sudo apt-get -y install python3-minimal python3-pip python3-numpy - - name: Build boost-python for python3 (not provided by apt-cache) - run : | - sudo apt-get -y install wget - wget https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.gz - tar -xf boost_1_79_0.tar.gz - cd boost_1_79_0 - ./bootstrap.sh --with-libraries=python --with-python=/usr/bin/python3 --with-toolset=gcc - sudo ./b2 toolset=gcc install - sudo apt-get install locate - sudo updatedb - - name: Run job + bash ./tstAutotoolsInstall.sh 64-ILP64 + - name: Build + if: matrix.tests == 'with' run: | - mkdir build - cd build - cmake -DEXAMPLES=ON -DMPI=ON -DICB=ON -DEIGEN=ON -DPYTHON3=ON .. make all - CTEST_OUTPUT_ON_FAILURE=1 make test - ubuntu_latest_autotools_ilp64: - runs-on: ubuntu-latest - steps: - - name: Clone and check out repository code - uses: actions/checkout@v7 - with: - fetch-depth: 0 - ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. - repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. - - name: Check commit - run: | - git log -1 - - name: Update OS - run: sudo apt-get update - - name: Install apt-get dependencies - run: sudo apt-get install -y gfortran gcc g++ openmpi-bin libopenmpi-dev libblas-dev liblapack-dev automake autoconf pkg-config libtool libeigen3-dev - - name: Install Intel MKL (ILP64 blas/lapack) - run: echo yes | sudo apt-get -y install intel-mkl libmkl-dev - - name: Run job + - name: Run checks + if: matrix.tests == 'with' run: | - ./bootstrap - ./configure --enable-icb --with-blas=mkl_gf_ilp64 --with-lapack=mkl_gf_ilp64 - make all make check - env: - FFLAGS: "-DMKL_ILP64 -I/usr/include/mkl" - FCFLAGS: "-DMKL_ILP64 -I/usr/include/mkl" - LIBS: "-Wl,--no-as-needed -L/usr/lib/x86_64-linux-gnu -lmkl_sequential -lmkl_core -lpthread -lm -ldl" - INTERFACE64: "1" + - name: Run distchecks + if: matrix.tests == 'with' && matrix.blas != 'MKL' + run: | + make distcheck From be2323ebfa4aef4d511d4c8ef73a393b9de84678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Thu, 30 Jul 2026 12:12:38 +0200 Subject: [PATCH 3/3] CI (macOS): Reduce duplication by using build matrix. Additionally, use more granular steps to make it easier to catch where the runs potentially fail. That also might help with GitHub truncating the output for long steps. --- .github/workflows/build-macos.yml | 92 ++++++++++++++++--------------- 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 61962c57..6f39b4c5 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -1,8 +1,16 @@ name: build-macos on: [push, pull_request] jobs: + macos_latest_cmake: runs-on: macos-latest + name: macOS CMake ${{ matrix.python }} Python + strategy: + fail-fast: false + matrix: + include: + - python: without + - python: with steps: - name: Clone and check out repository code uses: actions/checkout@v7 @@ -15,66 +23,56 @@ jobs: git log -1 - name: Install brew dependencies run: | + if [ "${{ matrix.python }}" == "with" ]; then + # Unlink and re-link to prevent errors when github mac runner images + # install python outside of brew, for example: + # https://github.com/orgs/Homebrew/discussions/3895 + # https://github.com/actions/setup-python/issues/577 + # https://github.com/actions/runner-images/issues/6459 + # https://github.com/actions/runner-images/issues/6507 + # https://github.com/actions/runner-images/issues/2322 + brew list -1 | grep python | while read formula; do brew unlink $formula; brew link --overwrite $formula; done + fi brew reinstall gcc # brings gfortran on path - brew install cmake open-mpi eigen veclibfort - - name: Run job + brew install cmake open-mpi eigen veclibfort $([ "${{ matrix.python }}" == "with" ] && echo "boost-python3 python3 numpy" || echo " ") + - name: Setup environment + run: | + if [ "${{ matrix.python }}" == "without" ]; then + # use MPI compiler wrappers + echo "FC=mpif90" >> $GITHUB_ENV + echo "CC=mpicc" >> $GITHUB_ENV + echo "CXX=mpic++" >> $GITHUB_ENV + else + # use compiler drivers directly + echo "FC=gfortran" >> $GITHUB_ENV + echo "CC=clang" >> $GITHUB_ENV + echo "CXX=clang++" >> $GITHUB_ENV + fi + - name: Configure run: | mkdir -p build cd build - export FC=mpif90 # Uses gfortran. - export CC=mpicc # Uses clang. export CFLAGS="-Qunused-arguments" - export CXX=mpic++ # Uses clang++. export CXXFLAGS="-Qunused-arguments" export VECLIBFORT_PREFIX=$(brew --prefix veclibfort) cmake \ -DBLAS_LIBRARIES="${VECLIBFORT_PREFIX}/lib/libvecLibFort.dylib" \ -DLAPACK_LIBRARIES="${VECLIBFORT_PREFIX}/lib/libvecLibFort.dylib" \ - -DEXAMPLES=ON -DICB=ON -DEIGEN=ON -DMPI=ON .. - make all - CTEST_OUTPUT_ON_FAILURE=1 make test - macos_latest_cmake_python: - runs-on: macos-latest - steps: - - name: Clone and check out repository code - uses: actions/checkout@v7 - with: - fetch-depth: 0 - ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented. - repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented. - - name: Check commit - run: | - git log -1 - - name: Install brew dependencies - run: | - # Unlink and re-link to prevent errors when github mac runner images - # install python outside of brew, for example: - # https://github.com/orgs/Homebrew/discussions/3895 - # https://github.com/actions/setup-python/issues/577 - # https://github.com/actions/runner-images/issues/6459 - # https://github.com/actions/runner-images/issues/6507 - # https://github.com/actions/runner-images/issues/2322 - brew list -1 | grep python | while read formula; do brew unlink $formula; brew link --overwrite $formula; done - brew reinstall gcc # brings gfortran on path - brew install cmake eigen boost-python3 python3 numpy veclibfort - - name: Run job + -DEXAMPLES=ON -DICB=ON -DEIGEN=ON -DMPI=ON \ + $([ "${{ matrix.python }}" == "with" ] && echo "-DPYTHON3=ON" || echo "") \ + .. + - name: Build run: | - mkdir -p build cd build - export FC=gfortran - export CC=clang - export CFLAGS="-Qunused-arguments" - export CXX=clang++ - export CXXFLAGS="-Qunused-arguments" - export VECLIBFORT_PREFIX=$(brew --prefix veclibfort) - cmake \ - -DBLAS_LIBRARIES="${VECLIBFORT_PREFIX}/lib/libvecLibFort.dylib" \ - -DLAPACK_LIBRARIES="${VECLIBFORT_PREFIX}/lib/libvecLibFort.dylib" \ - -DEXAMPLES=ON -DICB=ON -DEIGEN=ON -DPYTHON3=ON .. make all + - name: Run tests + run: | + cd build CTEST_OUTPUT_ON_FAILURE=1 make test + macos_latest_autotools: runs-on: macos-latest + name: macOS autotools steps: - name: Clone and check out repository code uses: actions/checkout@v7 @@ -89,12 +87,16 @@ jobs: run: | brew reinstall gcc # brings gfortran on path brew install autoconf automake libtool pkgconfig open-mpi eigen veclibfort - - name: Run job + - name: Configure run: | ./bootstrap export VECLIBFORT_PREFIX=$(brew --prefix veclibfort) BLAS_LIBS="-L${VECLIBFORT_PREFIX}/lib -lvecLibFort" \ LAPACK_LIBS="-L${VECLIBFORT_PREFIX}/lib -lvecLibFort" \ ./configure --enable-icb --enable-eigen --enable-mpi + - name: Build + run: | make all + - name: Run checks + run: | make check