Skip to content

Commit 377e03a

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

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

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

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ set(
1414
"test_linalg_svd.fypp"
1515
"test_linalg_matrix_property_checks.fypp"
1616
"test_linalg_sparse.fypp"
17+
"test_blas_lapack.fypp"
1718
)
1819

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

0 commit comments

Comments
 (0)