Skip to content

Commit c3d6b22

Browse files
authored
Merge pull request #123 from LecrisUT/ci/cmake
Adjust CI to test for CMake versions
2 parents db1221f + afbc20a commit c3d6b22

File tree

6 files changed

+49
-109
lines changed

6 files changed

+49
-109
lines changed

.github/workflows/cmake.yml

+41-34
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,9 @@ name: CMake CI
22

33
on:
44
push:
5-
paths-exclude:
6-
- '.github/workflows/make.yml'
7-
- '.gitignore'
8-
- 'README'
9-
- '**README'
10-
- 'LICENSE'
11-
- '**Makefile'
12-
- 'SLmake.inc.example'
5+
branches: [master]
136
pull_request:
14-
paths-exclude:
7+
paths-ignore:
158
- '.github/workflows/make.yml'
169
- '.gitignore'
1710
- 'README'
@@ -20,10 +13,14 @@ on:
2013
- '**Makefile'
2114
- 'SLmake.inc.example'
2215

16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
2320
env:
2421
CFLAGS: "-Wall -pedantic"
2522
FFLAGS: "-fcheck=all,no-bounds"
26-
BUILD_TYPE: Release
23+
CMAKE_BUILD_TYPE: Release
2724
MPIEXEC_PREFLAGS: "--oversubscribe"
2825

2926
defaults:
@@ -33,15 +30,22 @@ defaults:
3330
jobs:
3431

3532
build-all:
33+
name: >
34+
CMake ${{ matrix.cmake }}
3635
runs-on: ubuntu-latest
37-
36+
strategy:
37+
matrix:
38+
# CMake versions to test:
39+
# - minimum and maximum in the `cmake_minimum_required`
40+
# (if needed expand this to add all intermediate values
41+
# for *temporary* CI testing)
42+
# - latest version
43+
cmake: ["3.26", "4.0", latest]
44+
fail-fast: false
3845
steps:
3946

4047
- name: Checkout ScaLAPACK
41-
uses: actions/checkout@v2
42-
43-
- name: Install ninja-build tool
44-
uses: seanmiddleditch/gha-setup-ninja@v3
48+
uses: actions/checkout@v4
4549

4650
- name: Setup MPI
4751
# uses: mpi4py/setup-mpi@v1
@@ -51,29 +55,32 @@ jobs:
5155
5256
- name: Install BLAS and LAPACK
5357
run: sudo apt -y install libblas-dev liblapack-dev
54-
58+
59+
- name: Setup CMake
60+
uses: jwlawson/actions-setup-cmake@v2
61+
with:
62+
cmake-version: ${{ matrix.cmake }}
63+
5564
- name: CMake configuration
65+
# TODO: Use cmake presets for newer versions
66+
# TODO: Simplify the defaults to not require configuration
5667
run: >
57-
cmake -B build
58-
-G Ninja
59-
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
60-
-D CMAKE_INSTALL_PREFIX=${{github.workspace}}/scalapack_install
61-
-D BUILD_SHARED_LIBS=ON
62-
-D SCALAPACK_BUILD_TESTS=ON
63-
-D MPIEXEC_PREFLAGS=${{env.MPIEXEC_PREFLAGS}}
64-
68+
cmake -B build \
69+
-G Ninja \
70+
-DCMAKE_BUILD_TYPE=${{env.CMAKE_BUILD_TYPE}} \
71+
-DBUILD_SHARED_LIBS=ON \
72+
-DSCALAPACK_BUILD_TESTS=ON \
73+
-DMPIEXEC_PREFLAGS=${{env.MPIEXEC_PREFLAGS}}
74+
6575
- name: Build
66-
working-directory: ${{github.workspace}}/build
67-
run: |
68-
ctest -D ExperimentalStart
69-
ctest -D ExperimentalConfigure
70-
ctest -D ExperimentalBuild
76+
run: >
77+
cmake --build build
7178
7279
- name: Test
80+
# CMake<3.20 does not have -B option
7381
working-directory: ${{github.workspace}}/build
74-
run: |
75-
ctest -D ExperimentalTest --schedule-random --output-on-failure --timeout 180
76-
ctest -D ExperimentalSubmit
77-
82+
run: >
83+
ctest --output-on-failure
84+
7885
- name: Install
79-
run: cmake --build build --target install
86+
run: cmake --install build --prefix scalapack_install

.github/workflows/make.yml

+6-9
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,9 @@ name: Makefile CI
22

33
on:
44
push:
5-
paths-exclude:
6-
- '.github/workflows/cmake.yml'
7-
- '.gitignore'
8-
- 'README'
9-
- '**README'
10-
- 'LICENSE'
11-
- 'CMAKE**'
12-
- '**CMakeLists.txt'
5+
branches: [master]
136
pull_request:
14-
paths-exclude:
7+
paths-ignore:
158
- '.github/workflows/cmake.yml'
169
- '.gitignore'
1710
- 'README'
@@ -20,6 +13,10 @@ on:
2013
- 'CMAKE**'
2114
- '**CMakeLists.txt'
2215

16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
2320
defaults:
2421
run:
2522
shell: bash

BLACS/INSTALL/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 2.8)
1+
cmake_minimum_required(VERSION 3.26...4.0)
22
project(INSTALL C Fortran)
33

44
add_executable(xintface Fintface.f Cintface.c)

CMAKE/CTestCustom.cmake.in

-42
This file was deleted.

CMakeLists.txt

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
cmake_minimum_required(VERSION 3.9)
1+
cmake_minimum_required(VERSION 3.26...4.0)
22

33
project(SCALAPACK VERSION 2.2.2 LANGUAGES C Fortran)
44

5-
# Configure the warning and code coverage suppression file
6-
configure_file(
7-
"${SCALAPACK_SOURCE_DIR}/CMAKE/CTestCustom.cmake.in"
8-
"${SCALAPACK_BINARY_DIR}/CTestCustom.cmake"
9-
COPYONLY
10-
)
11-
125
# Add the CMake directory for custon CMake modules
136
set(CMAKE_MODULE_PATH "${SCALAPACK_SOURCE_DIR}/CMAKE" ${CMAKE_MODULE_PATH})
147

@@ -87,8 +80,6 @@ endmacro()
8780
# Testing
8881
SET(DART_TESTING_TIMEOUT 600)
8982

90-
enable_testing()
91-
include(CTest)
9283
enable_testing()
9384
# --------------------------------------------------
9485

CTestConfig.cmake

-13
This file was deleted.

0 commit comments

Comments
 (0)