Skip to content

Commit d475595

Browse files
committed
add FIND_BLAS option
1 parent 095ee16 commit d475595

File tree

2 files changed

+47
-7
lines changed

2 files changed

+47
-7
lines changed

.github/workflows/ci_windows.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobs:
5858
- name: Install fypp
5959
run: pip install fypp
6060

61+
# Build and test with build-in BLAS and LAPACK
6162
- run: >-
6263
PATH=$PATH:/mingw64/bin/ cmake
6364
-Wdev
@@ -66,6 +67,7 @@ jobs:
6667
-DCMAKE_Fortran_FLAGS_DEBUG="-Wall -Wextra -Wimplicit-interface -fPIC -g -fcheck=all -fbacktrace"
6768
-DCMAKE_MAXIMUM_RANK:String=4
6869
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
70+
-DFIND_BLAS:STRING=FALSE
6971
env:
7072
FC: gfortran
7173
CC: gcc
@@ -89,3 +91,37 @@ jobs:
8991

9092
- name: Install project
9193
run: PATH=$PATH:/mingw64/bin/ cmake --install build
94+
95+
# Build and test with external BLAS and LAPACK (OpenBLAS)
96+
- run: >-
97+
PATH=$PATH:/mingw64/bin/ cmake
98+
-Wdev
99+
-B build_openblas
100+
-DCMAKE_BUILD_TYPE=Debug
101+
-DCMAKE_Fortran_FLAGS_DEBUG="-Wall -Wextra -Wimplicit-interface -fPIC -g -fcheck=all -fbacktrace"
102+
-DCMAKE_MAXIMUM_RANK:String=4
103+
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
104+
-DFIND_BLAS:STRING=TRUE
105+
env:
106+
FC: gfortran
107+
CC: gcc
108+
CXX: g++
109+
110+
- name: CMake build with OpenBLAS
111+
run: PATH=$PATH:/mingw64/bin/ cmake --build build_openblas --parallel
112+
113+
- name: catch build fail
114+
run: PATH=$PATH:/mingw64/bin/ cmake --build build_openblas --verbose --parallel 1
115+
if: failure()
116+
117+
- name: CTest with OpenBLAS
118+
run: PATH=$PATH:/mingw64/bin/ ctest --test-dir build_openblas --output-on-failure --parallel -V -LE quadruple_precision
119+
120+
- uses: actions/upload-artifact@v1
121+
if: failure()
122+
with:
123+
name: WindowsCMakeTestlog_openblas
124+
path: build_openblas/Testing/Temporary/LastTest.log
125+
126+
- name: Install project with OpenBLAS
127+
run: PATH=$PATH:/mingw64/bin/ cmake --install build_openblas

CMakeLists.txt

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,18 @@ if(NOT DEFINED CMAKE_MAXIMUM_RANK)
4242
set(CMAKE_MAXIMUM_RANK 4 CACHE STRING "Maximum array rank for generated procedures")
4343
endif()
4444

45+
option(FIND_BLAS "Find external BLAS and LAPACK" ON)
46+
4547
# --- find BLAS and LAPACK
46-
find_package(BLAS)
47-
if(BLAS_FOUND)
48-
add_compile_definitions(STDLIB_EXTERNAL_BLAS)
49-
endif()
50-
find_package(LAPACK)
51-
if(LAPACK_FOUND)
52-
add_compile_definitions(STDLIB_EXTERNAL_LAPACK)
48+
if(FIND_BLAS)
49+
find_package(BLAS)
50+
if(BLAS_FOUND)
51+
add_compile_definitions(STDLIB_EXTERNAL_BLAS)
52+
endif()
53+
find_package(LAPACK)
54+
if(LAPACK_FOUND)
55+
add_compile_definitions(STDLIB_EXTERNAL_LAPACK)
56+
endif()
5357
endif()
5458

5559
# --- find preprocessor

0 commit comments

Comments
 (0)