Skip to content

Commit 5573dca

Browse files
committed
BLAS candidates: mkl, openblas, blas
1 parent a2c2913 commit 5573dca

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/metapackage/fpm_meta_blas.f90

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ subroutine init_blas(this, compiler, error)
2020
type(compiler_t), intent(in) :: compiler
2121
type(error_t), allocatable, intent(out) :: error
2222

23-
logical :: s
23+
integer :: i
2424
character(len=:), allocatable :: include_flag, libdir
25+
character(*), parameter :: candidates(*) = &
26+
[character(20) :: 'mkl-dynamic-lp64-tbb', 'openblas', 'blas']
2527

2628
include_flag = get_include_flag(compiler, "")
2729

@@ -38,9 +40,15 @@ subroutine init_blas(this, compiler, error)
3840
return
3941
end if
4042

41-
if (pkgcfg_has_package('openblas')) then
42-
call add_pkg_config_compile_options(this, 'openblas', include_flag, libdir, error)
43-
return
44-
end if
43+
do i=1,size(candidates)
44+
if (pkgcfg_has_package(trim(candidates(i)))) then
45+
call add_pkg_config_compile_options(&
46+
this, trim(candidates(i)), include_flag, libdir, error)
47+
print *, 'found blas package: ', trim(candidates(i))
48+
return
49+
end if
50+
end do
51+
52+
call fatal_error(error, 'pkg-config could not find a suitable blas package.')
4553
end subroutine init_blas
4654
end module fpm_meta_blas

0 commit comments

Comments
 (0)