@@ -20,8 +20,10 @@ subroutine init_blas(this, compiler, error)
20
20
type (compiler_t), intent (in ) :: compiler
21
21
type (error_t), allocatable , intent (out ) :: error
22
22
23
- logical :: s
23
+ integer :: i
24
24
character (len= :), allocatable :: include_flag, libdir
25
+ character (* ), parameter :: candidates(* ) = &
26
+ [character (20 ) :: ' mkl-dynamic-lp64-tbb' , ' openblas' , ' blas' ]
25
27
26
28
include_flag = get_include_flag(compiler, " " )
27
29
@@ -38,9 +40,15 @@ subroutine init_blas(this, compiler, error)
38
40
return
39
41
end if
40
42
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.' )
45
53
end subroutine init_blas
46
54
end module fpm_meta_blas
0 commit comments