Skip to content

Commit 49547e0

Browse files
committed
Add custom BLAS selector to support MKL/OpenBLAS
1 parent a75641f commit 49547e0

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

config/meson.build

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,19 @@ if get_option('openmp')
5454
lib_deps += omp_dep
5555
endif
5656

57+
if get_option('blas') != 'none'
58+
add_project_arguments('-DWITH_BLAS', language: 'fortran')
59+
endif
5760
if get_option('blas') == 'netlib'
5861
blas_dep = dependency('blas', required: false)
5962
if not blas_dep.found()
6063
blas_dep = fc.find_library('blas', required: true)
6164
endif
6265
lib_deps += blas_dep
63-
add_project_arguments('-DWITH_BLAS', language: 'fortran')
66+
elif get_option('blas') == 'custom'
67+
foreach lib: get_option('blas_libs')
68+
lib_deps += fc.find_library(lib)
69+
endforeach
6470
endif
6571

6672
# Create the tool chain library as subproject

meson_options.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,15 @@ option(
1818
'blas',
1919
type: 'combo',
2020
value: 'none',
21-
choices: ['none', 'netlib'],
21+
choices: ['none', 'netlib', 'custom'],
2222
description: 'Use basic linear algebra subprograms',
2323
)
24+
option(
25+
'blas_libs',
26+
type: 'array',
27+
value: [],
28+
description: 'Libraries to link against as custom BLAS backend',
29+
)
2430
option(
2531
'openmp',
2632
type: 'boolean',

0 commit comments

Comments
 (0)