Skip to content

Commit 0704d6a

Browse files
Smit-creatergommers
authored andcommitted
ENH: Add configure option for blas/lapack libraries
1 parent 7deaf3e commit 0704d6a

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

meson.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ project(
1616
'c_args=-Wno-unused-function -Wno-conversion -Wno-misleading-indentation -Wno-incompatible-pointer-types',
1717
'fortran_args=-Wno-conversion',
1818
'fortran_std=legacy',
19+
'blas=openblas',
20+
'lapack=openblas'
1921
],
2022
)
2123

meson_options.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
option('blas', type: 'string', value: 'openblas',
2+
description: 'option for BLAS library switching')
3+
option('lapack', type: 'string', value: 'openblas',
4+
description: 'option for LAPACK library switching')

scipy/meson.build

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,17 @@ numpy_nodepr_api = '-DNPY_NO_DEPRECATED_API=NPY_1_9_API_VERSION'
108108

109109

110110
# TODO: 64-bit BLAS and LAPACK
111-
blas = dependency('openblas')
112-
lapack = dependency('openblas')
113-
114-
# TODO: deal with case where we do need the g77 ABI wrappers (see
115-
# _build_utils/_fortran.py)
116-
g77_abi_wrappers = files('_build_utils' / 'src' / 'wrap_dummy_g77_abi.f')
111+
blas = dependency(get_option('blas'))
112+
lapack = dependency(get_option('lapack'))
113+
114+
if blas.name() == 'mkl' or lapack.name() == 'mkl'
115+
g77_abi_wrappers = files([
116+
'_build_utils/src/wrap_g77_abi_f.f',
117+
'_build_utils/src/wrap_g77_abi_c.c'
118+
])
119+
else
120+
g77_abi_wrappers = files('_build_utils/src/wrap_dummy_g77_abi.f')
121+
endif
117122

118123
generate_config = custom_target(
119124
'generate-config',

0 commit comments

Comments
 (0)