Skip to content

Commit 2cbbf39

Browse files
authored
OpenBLAS: starting with 0.3.21 build with LAPACK support per default (#639)
Starting with OpenBLAS 0.3.21 a f2c-converted copy of LAPACK 3.9.0 is available as fallback when "no fortran compiler" is specified. This means we get full BLAS/LAPACK support with just a normal C++ compiler. From the release notes: https://github.com/xianyi/OpenBLAS/releases/tag/v0.3.21 > - when no Fortran compiler is available, OpenBLAS builds will now automatically > build LAPACK from an f2c-converted copy of LAPACK 3.9.0 unless the NO_LAPACK option > is specified (more recent releases make too heavy use of Fortran90+ features to be easily convertible to C) Also disable the building of tests when building for Hunter to save time
1 parent 56f99df commit 2cbbf39

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

cmake/projects/OpenBLAS/hunter.cmake

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,20 @@ if(HUNTER_OpenBLAS_VERSION VERSION_LESS 0.3.1)
9696
"lib/cmake/openblas/OpenBLASConfig.cmake"
9797
)
9898
else()
99+
if(HUNTER_OpenBLAS_VERSION VERSION_LESS 0.3.21)
100+
set(_openblas_BUILD_WITHOUT_LAPACK "ON")
101+
else()
102+
# starting with 0.3.21 LAPACK support as a fallback with an
103+
# f2c-converted copy of LAPACK 3.9.0 was introduced
104+
# https://github.com/xianyi/OpenBLAS/releases/tag/v0.3.21
105+
set(_openblas_BUILD_WITHOUT_LAPACK "OFF")
106+
endif()
99107
hunter_cmake_args(
100108
OpenBLAS
101109
CMAKE_ARGS
110+
BUILD_TESTING=OFF
102111
NOFORTRAN=1
103-
BUILD_WITHOUT_LAPACK=ON
112+
BUILD_WITHOUT_LAPACK=${_openblas_BUILD_WITHOUT_LAPACK}
104113
)
105114
hunter_pick_scheme(DEFAULT url_sha1_cmake)
106115
set(_openblas_unrelocatable_text_files "")

docs/packages/pkg/OpenBLAS.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
.. spelling::
22

33
OpenBLAS
4+
Fortran
5+
LAPACK
46

57
.. index:: math ; OpenBLAS
68

@@ -23,3 +25,6 @@ OpenBLAS
2325
hunter_add_package(OpenBLAS)
2426
find_package(OpenBLAS CONFIG REQUIRED)
2527
target_link_libraries(... OpenBLAS::OpenBLAS)
28+
29+
Starting with OpenBLAS v0.3.21 LAPACK support is enabled by default in Hunter.
30+
This is due to upstream adding a f2c-converted copy of LAPACK 3.9.0 as fallback if no Fortran compiler is available.

0 commit comments

Comments
 (0)