Skip to content

Commit

Permalink
Add custom BLAS selector to support MKL/OpenBLAS
Browse files Browse the repository at this point in the history
  • Loading branch information
awvwgk committed Jan 12, 2021
1 parent a75641f commit 49547e0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion config/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,19 @@ if get_option('openmp')
lib_deps += omp_dep
endif

if get_option('blas') != 'none'
add_project_arguments('-DWITH_BLAS', language: 'fortran')
endif
if get_option('blas') == 'netlib'
blas_dep = dependency('blas', required: false)
if not blas_dep.found()
blas_dep = fc.find_library('blas', required: true)
endif
lib_deps += blas_dep
add_project_arguments('-DWITH_BLAS', language: 'fortran')
elif get_option('blas') == 'custom'
foreach lib: get_option('blas_libs')
lib_deps += fc.find_library(lib)
endforeach
endif

# Create the tool chain library as subproject
Expand Down
8 changes: 7 additions & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ option(
'blas',
type: 'combo',
value: 'none',
choices: ['none', 'netlib'],
choices: ['none', 'netlib', 'custom'],
description: 'Use basic linear algebra subprograms',
)
option(
'blas_libs',
type: 'array',
value: [],
description: 'Libraries to link against as custom BLAS backend',
)
option(
'openmp',
type: 'boolean',
Expand Down

0 comments on commit 49547e0

Please sign in to comment.