Skip to content

Commit 78ca4c3

Browse files
committed
CI: split and optimize the BLAS CI process
1 parent 0ce2372 commit 78ca4c3

File tree

4 files changed

+138
-134
lines changed

4 files changed

+138
-134
lines changed

.github/workflows/CI.yml

-66
Original file line numberDiff line numberDiff line change
@@ -92,69 +92,3 @@ jobs:
9292
- name: Install project
9393
if: ${{ contains(matrix.build, 'cmake') }}
9494
run: cmake --install ${{ env.BUILD_DIR }}
95-
96-
Build-with-MKL:
97-
runs-on: ubuntu-latest
98-
strategy:
99-
fail-fast: false
100-
matrix:
101-
toolchain:
102-
- {compiler: intel, version: '2024.1'}
103-
build: [cmake]
104-
env:
105-
BUILD_DIR: ${{ matrix.build == 'cmake' && 'build' || '.' }}
106-
APT_PACKAGES: >-
107-
intel-oneapi-mkl
108-
intel-oneapi-mkl-devel
109-
steps:
110-
- name: Checkout code
111-
uses: actions/checkout@v4
112-
113-
- name: Set up Python 3.x
114-
uses: actions/setup-python@v5 # Use pip to install latest CMake, & FORD/Jin2For, etc.
115-
with:
116-
python-version: 3.x
117-
118-
- name: Install fypp
119-
run: pip install --upgrade fypp ninja
120-
121-
- name: Setup Fortran compiler
122-
uses: fortran-lang/[email protected]
123-
id: setup-fortran
124-
with:
125-
compiler: ${{ matrix.toolchain.compiler }}
126-
version: ${{ matrix.toolchain.version }}
127-
128-
- name: Install Intel oneAPI MKL
129-
run: |
130-
sudo apt-get install ${APT_PACKAGES}
131-
source /opt/intel/oneapi/mkl/latest/env/vars.sh
132-
printenv >> $GITHUB_ENV
133-
134-
# Build and test with external BLAS and LAPACK (MKL on Ubuntu with Intel compilers)
135-
- name: Configure with CMake and MKL
136-
run: >-
137-
cmake -Wdev -G Ninja
138-
-DCMAKE_BUILD_TYPE=Release
139-
-DCMAKE_MAXIMUM_RANK:String=4
140-
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
141-
-DFIND_BLAS:STRING=TRUE
142-
-S . -B ${{ env.BUILD_DIR }}
143-
144-
- name: Build and compile with MKL
145-
run: cmake --build ${{ env.BUILD_DIR }} --parallel
146-
147-
- name: catch build fail with MKL
148-
if: failure()
149-
run: cmake --build ${{ env.BUILD_DIR }} --verbose --parallel 1
150-
151-
- name: test with MKL
152-
run: >-
153-
ctest
154-
--test-dir ${{ env.BUILD_DIR }}
155-
--parallel
156-
--output-on-failure
157-
--no-tests=error
158-
159-
- name: Install project with MKL
160-
run: cmake --install ${{ env.BUILD_DIR }}

.github/workflows/ci_BLAS.yml

+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
name: CI_BLAS
2+
3+
on: [push, pull_request]
4+
5+
env:
6+
CTEST_TIME_TIMEOUT: "5" # some failures hang forever
7+
CMAKE_GENERATOR: Ninja
8+
9+
jobs:
10+
msys2-build:
11+
runs-on: windows-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include: [{ msystem: UCRT64, arch: x86_64 }]
16+
defaults:
17+
run:
18+
shell: msys2 {0}
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Setup MinGW native environment
23+
uses: msys2/setup-msys2@v2
24+
with:
25+
msystem: ${{ matrix.msystem }}
26+
update: false
27+
install: >-
28+
git
29+
mingw-w64-ucrt64-${{ matrix.arch }}-gcc
30+
mingw-w64-ucrt64-${{ matrix.arch }}-gcc-fortran
31+
mingw-w64-ucrt64-${{ matrix.arch }}-python
32+
mingw-w64-ucrt64-${{ matrix.arch }}-python-fypp
33+
mingw-w64-ucrt64-${{ matrix.arch }}-cmake
34+
mingw-w64-ucrt64-${{ matrix.arch }}-ninja
35+
mingw-w64-ucrt64-${{ matrix.arch }}-openblas
36+
37+
# Build and test with external BLAS and LAPACK (OpenBLAS on UCRT64)
38+
- name: Configure with CMake and OpenBLAS
39+
run: >-
40+
PATH=$PATH:/ucrt64/bin/ cmake
41+
-Wdev
42+
-B build
43+
-DCMAKE_BUILD_TYPE=Debug
44+
-DCMAKE_Fortran_FLAGS_DEBUG="-Wall -Wextra -Wimplicit-interface -fPIC -g -fcheck=all -fbacktrace"
45+
-DCMAKE_MAXIMUM_RANK:String=4
46+
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
47+
-DFIND_BLAS:STRING=TRUE
48+
env:
49+
FC: gfortran
50+
CC: gcc
51+
CXX: g++
52+
53+
- name: CMake build with OpenBLAS
54+
run: PATH=$PATH:/ucrt64/bin/ cmake --build build --parallel
55+
56+
- name: catch build fail
57+
if: failure()
58+
run: PATH=$PATH:/ucrt64/bin/ cmake --build build --verbose --parallel 1
59+
60+
- name: CTest with OpenBLAS
61+
run: PATH=$PATH:/ucrt64/bin/ ctest --test-dir build --output-on-failure --parallel -V -LE quadruple_precision
62+
63+
- uses: actions/upload-artifact@v4
64+
if: failure()
65+
with:
66+
name: WindowsCMakeTestlog_openblas
67+
path: build/Testing/Temporary/LastTest.log
68+
69+
- name: Install project with OpenBLAS
70+
run: PATH=$PATH:/ucrt64/bin/ cmake --install build
71+
72+
Build:
73+
runs-on: ubuntu-latest
74+
strategy:
75+
fail-fast: false
76+
matrix:
77+
toolchain:
78+
- { compiler: intel, version: "2024.1" }
79+
build: [cmake]
80+
env:
81+
BUILD_DIR: ${{ matrix.build == 'cmake' && 'build' || '.' }}
82+
APT_PACKAGES: >-
83+
intel-oneapi-mkl
84+
intel-oneapi-mkl-devel
85+
steps:
86+
- name: Checkout code
87+
uses: actions/checkout@v4
88+
89+
- name: Set up Python 3.x
90+
uses: actions/setup-python@v5 # Use pip to install latest CMake, & FORD/Jin2For, etc.
91+
with:
92+
python-version: 3.x
93+
94+
- name: Install fypp
95+
run: pip install --upgrade fypp ninja
96+
97+
- name: Setup Fortran compiler
98+
uses: fortran-lang/[email protected]
99+
id: setup-fortran
100+
with:
101+
compiler: ${{ matrix.toolchain.compiler }}
102+
version: ${{ matrix.toolchain.version }}
103+
104+
- name: Install Intel oneAPI MKL
105+
run: |
106+
sudo apt-get install ${APT_PACKAGES}
107+
source /opt/intel/oneapi/mkl/latest/env/vars.sh
108+
printenv >> $GITHUB_ENV
109+
110+
# Build and test with external BLAS and LAPACK (MKL on Ubuntu with Intel compilers)
111+
- name: Configure with CMake and MKL
112+
run: >-
113+
cmake -Wdev -G Ninja
114+
-DCMAKE_BUILD_TYPE=Release
115+
-DCMAKE_MAXIMUM_RANK:String=4
116+
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
117+
-DFIND_BLAS:STRING=TRUE
118+
-S . -B ${{ env.BUILD_DIR }}
119+
120+
- name: Build and compile with MKL
121+
run: cmake --build ${{ env.BUILD_DIR }} --parallel
122+
123+
- name: catch build fail with MKL
124+
if: failure()
125+
run: cmake --build ${{ env.BUILD_DIR }} --verbose --parallel 1
126+
127+
- name: test with MKL
128+
run: >-
129+
ctest
130+
--test-dir ${{ env.BUILD_DIR }}
131+
--parallel
132+
--output-on-failure
133+
--no-tests=error
134+
135+
- name: Install project with MKL
136+
run: cmake --install ${{ env.BUILD_DIR }}

.github/workflows/ci_windows.yml

-68
Original file line numberDiff line numberDiff line change
@@ -67,71 +67,3 @@ jobs:
6767

6868
- name: Install project
6969
run: PATH=$PATH:/mingw64/bin/ cmake --install build
70-
71-
msys2-build-with-OpenBLAS:
72-
runs-on: windows-latest
73-
strategy:
74-
fail-fast: false
75-
matrix:
76-
include: [
77-
{ msystem: MINGW64, arch: x86_64 }
78-
]
79-
defaults:
80-
run:
81-
shell: msys2 {0}
82-
steps:
83-
- uses: actions/checkout@v2
84-
85-
- name: Setup MinGW native environment
86-
uses: msys2/setup-msys2@v2
87-
with:
88-
msystem: ${{ matrix.msystem }}
89-
update: false
90-
install: >-
91-
git
92-
mingw-w64-${{ matrix.arch }}-gcc
93-
mingw-w64-${{ matrix.arch }}-gcc-fortran
94-
mingw-w64-${{ matrix.arch }}-python
95-
mingw-w64-${{ matrix.arch }}-python-pip
96-
mingw-w64-${{ matrix.arch }}-python-setuptools
97-
mingw-w64-${{ matrix.arch }}-cmake
98-
mingw-w64-${{ matrix.arch }}-ninja
99-
mingw-w64-${{ matrix.arch }}-openblas
100-
101-
- name: Install fypp
102-
run: pip install fypp
103-
104-
# Build and test with external BLAS and LAPACK (OpenBLAS on MINGW64)
105-
- name: Configure with CMake and OpenBLAS
106-
run: >-
107-
PATH=$PATH:/mingw64/bin/ cmake
108-
-Wdev
109-
-B build
110-
-DCMAKE_BUILD_TYPE=Debug
111-
-DCMAKE_Fortran_FLAGS_DEBUG="-Wall -Wextra -Wimplicit-interface -fPIC -g -fcheck=all -fbacktrace"
112-
-DCMAKE_MAXIMUM_RANK:String=4
113-
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
114-
-DFIND_BLAS:STRING=TRUE
115-
env:
116-
FC: gfortran
117-
CC: gcc
118-
CXX: g++
119-
120-
- name: CMake build with OpenBLAS
121-
run: PATH=$PATH:/mingw64/bin/ cmake --build build --parallel
122-
123-
- name: catch build fail
124-
if: failure()
125-
run: PATH=$PATH:/mingw64/bin/ cmake --build build --verbose --parallel 1
126-
127-
- name: CTest with OpenBLAS
128-
run: PATH=$PATH:/mingw64/bin/ ctest --test-dir build --output-on-failure --parallel -V -LE quadruple_precision
129-
130-
- uses: actions/upload-artifact@v1
131-
if: failure()
132-
with:
133-
name: WindowsCMakeTestlog_openblas
134-
path: build/Testing/Temporary/LastTest.log
135-
136-
- name: Install project with OpenBLAS
137-
run: PATH=$PATH:/mingw64/bin/ cmake --install build

test/linalg/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ set(
1414
"test_linalg_svd.fypp"
1515
"test_linalg_matrix_property_checks.fypp"
1616
"test_linalg_sparse.fypp"
17+
"test_linalg_cholesky.fypp"
18+
"test_blas_lapack.fypp"
1719
)
1820

1921
# Preprocessed files to contain preprocessor directives -> .F90

0 commit comments

Comments
 (0)