Skip to content

Commit 434b849

Browse files
committed
Tests with OpenBLAS on MINGW64 and MKL on Ubuntu
1 parent d475595 commit 434b849

File tree

3 files changed

+48
-5
lines changed

3 files changed

+48
-5
lines changed

.github/workflows/CI.yml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ jobs:
3333
build: cmake-inline
3434
toolchain:
3535
- {compiler: gcc, version: 10}
36+
APT_PACKAGES: >-
37+
intel-oneapi-mkl-2024.1.0
38+
intel-oneapi-mkl-devel-2024.1.0
3639
exclude:
3740
- os: macos-12
3841
toolchain: {compiler: intel, version: '2024.1'}
@@ -67,15 +70,16 @@ jobs:
6770
-DCMAKE_BUILD_TYPE=Release
6871
-DCMAKE_MAXIMUM_RANK:String=4
6972
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
73+
-DFIND_BLAS:STRING=FALSE
7074
-S . -B ${{ env.BUILD_DIR }}
7175
7276
- name: Build and compile
7377
if: ${{ contains(matrix.build, 'cmake') }}
7478
run: cmake --build ${{ env.BUILD_DIR }} --parallel
7579

7680
- name: catch build fail
77-
run: cmake --build ${{ env.BUILD_DIR }} --verbose --parallel 1
7881
if: ${{ failure() && contains(matrix.build, 'cmake') }}
82+
run: cmake --build ${{ env.BUILD_DIR }} --verbose --parallel 1
7983

8084
- name: test
8185
if: ${{ contains(matrix.build, 'cmake') }}
@@ -89,3 +93,36 @@ jobs:
8993
- name: Install project
9094
if: ${{ contains(matrix.build, 'cmake') }}
9195
run: cmake --install ${{ env.BUILD_DIR }}
96+
97+
# Build and test with external BLAS and LAPACK (MKL on Ubuntu with Intel compilers)
98+
- name: Configure with CMake and MKL
99+
if: ${{ contains(matrix.build, 'cmake') && matrix.os == 'ubuntu-latest' && matrix.toolchain.compiler == 'intel' }}
100+
run: >-
101+
cmake -Wdev -G Ninja
102+
-DCMAKE_BUILD_TYPE=Release
103+
-DCMAKE_MAXIMUM_RANK:String=4
104+
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
105+
-DFIND_BLAS:STRING=TRUE
106+
-DBLA_VENDOR=Intel10_64lp
107+
-S . -B build_mkl
108+
109+
- name: Build and compile with MKL
110+
if: ${{ contains(matrix.build, 'cmake') && matrix.os == 'ubuntu-latest' && matrix.toolchain.compiler == 'intel' }}
111+
run: cmake --build build_mkl --parallel
112+
113+
- name: catch build fail with MKL
114+
if: ${{ failure() && contains(matrix.build, 'cmake') && matrix.os == 'ubuntu-latest' && matrix.toolchain.compiler == 'intel' }}
115+
run: cmake --build build_mkl --verbose --parallel 1
116+
117+
- name: test with MKL
118+
if: ${{ contains(matrix.build, 'cmake') && matrix.os == 'ubuntu-latest' && matrix.toolchain.compiler == 'intel' }}
119+
run: >-
120+
ctest
121+
--test-dir build_mkl
122+
--parallel
123+
--output-on-failure
124+
--no-tests=error
125+
126+
- name: Install project with MKL
127+
if: ${{ contains(matrix.build, 'cmake') && matrix.os == 'ubuntu-latest' && matrix.toolchain.compiler == 'intel' }}
128+
run: cmake --install build_mkl

.github/workflows/ci_windows.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,10 @@ jobs:
9292
- name: Install project
9393
run: PATH=$PATH:/mingw64/bin/ cmake --install build
9494

95-
# Build and test with external BLAS and LAPACK (OpenBLAS)
96-
- run: >-
95+
# Build and test with external BLAS and LAPACK (OpenBLAS on MINGW64)
96+
- name: Configure with CMake and OpenBLAS
97+
if: contains(matrix.msystem, 'MINGW64')
98+
run: >-
9799
PATH=$PATH:/mingw64/bin/ cmake
98100
-Wdev
99101
-B build_openblas
@@ -108,20 +110,23 @@ jobs:
108110
CXX: g++
109111

110112
- name: CMake build with OpenBLAS
113+
if: contains(matrix.msystem, 'MINGW64')
111114
run: PATH=$PATH:/mingw64/bin/ cmake --build build_openblas --parallel
112115

113116
- name: catch build fail
117+
if: contains(matrix.msystem, 'MINGW64') && failure()
114118
run: PATH=$PATH:/mingw64/bin/ cmake --build build_openblas --verbose --parallel 1
115-
if: failure()
116119

117120
- name: CTest with OpenBLAS
121+
if: contains(matrix.msystem, 'MINGW64')
118122
run: PATH=$PATH:/mingw64/bin/ ctest --test-dir build_openblas --output-on-failure --parallel -V -LE quadruple_precision
119123

120124
- uses: actions/upload-artifact@v1
121-
if: failure()
125+
if: contains(matrix.msystem, 'MINGW64') && failure()
122126
with:
123127
name: WindowsCMakeTestlog_openblas
124128
path: build_openblas/Testing/Temporary/LastTest.log
125129

126130
- name: Install project with OpenBLAS
131+
if: contains(matrix.msystem, 'MINGW64')
127132
run: PATH=$PATH:/mingw64/bin/ cmake --install build_openblas

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ Important options are
135135
- `-DBUILD_TESTING` set to `off` in case you want to disable the stdlib tests (default: `on`).
136136
- `-DCMAKE_VERBOSE_MAKEFILE` is by default set to `Off`, but if set to `On` will show commands used to compile the code.
137137
- `-DCMAKE_BUILD_TYPE` is by default set to `RelWithDebInfo`, which uses compiler flags suitable for code development (but with only `-O2` optimization). Beware the compiler flags set this way will override any compiler flags specified via `FFLAGS`. To prevent this, use `-DCMAKE_BUILD_TYPE=NoConfig` in conjunction with `FFLAGS`.
138+
- `-DFIND_BLAS` set to `off` in case you want to disable finding the extlib BLAS/LAPACK dependency (default: `on`).
138139

139140
For example, to configure a build using the Ninja backend while specifying compiler optimization via `FFLAGS`, generating procedures up to rank 7, installing to your home directory, using the `NoConfig` compiler flags, and printing the compiler commands, use
140141

0 commit comments

Comments
 (0)