cmake: Use standard try_run
instead of execute_process
#81
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CMake CI | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
paths-ignore: | |
- '.github/workflows/make.yml' | |
- '.gitignore' | |
- 'README' | |
- '**README' | |
- 'LICENSE' | |
- '**Makefile' | |
- 'SLmake.inc.example' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
CFLAGS: "-Wall -pedantic" | |
FFLAGS: "-fcheck=all,no-bounds" | |
CMAKE_BUILD_TYPE: Release | |
MPIEXEC_PREFLAGS: "--oversubscribe" | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build-all: | |
name: > | |
CMake ${{ matrix.cmake }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# CMake versions to test: | |
# - minimum and maximum in the `cmake_minimum_required` | |
# (if needed expand this to add all intermediate values | |
# for *temporary* CI testing) | |
# - latest version | |
cmake: ["3.26", "4.0", latest] | |
fail-fast: false | |
steps: | |
- name: Checkout ScaLAPACK | |
uses: actions/checkout@v4 | |
- name: Setup MPI | |
# uses: mpi4py/setup-mpi@v1 | |
run: | | |
sudo apt -y update | |
sudo apt -y install openmpi-bin libopenmpi-dev | |
- name: Install BLAS and LAPACK | |
run: sudo apt -y install libblas-dev liblapack-dev | |
- name: Setup CMake | |
uses: jwlawson/actions-setup-cmake@v2 | |
with: | |
cmake-version: ${{ matrix.cmake }} | |
- name: CMake configuration | |
# TODO: Use cmake presets for newer versions | |
# TODO: Simplify the defaults to not require configuration | |
run: > | |
cmake -B build \ | |
-G Ninja \ | |
-DCMAKE_BUILD_TYPE=${{env.CMAKE_BUILD_TYPE}} \ | |
-DBUILD_SHARED_LIBS=ON \ | |
-DSCALAPACK_BUILD_TESTS=ON \ | |
-DMPIEXEC_PREFLAGS=${{env.MPIEXEC_PREFLAGS}} | |
- name: Build | |
run: > | |
cmake --build build | |
- name: Test | |
# CMake<3.20 does not have -B option | |
working-directory: ${{github.workspace}}/build | |
run: > | |
ctest --output-on-failure | |
- name: Install | |
run: cmake --install build --prefix scalapack_install |