Skip to content

Commit d198042

Browse files
committed
MKL compiler flag for Intel
1 parent 5573dca commit d198042

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

src/metapackage/fpm_meta_blas.f90

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,34 @@ subroutine init_blas(this, compiler, error)
2323
integer :: i
2424
character(len=:), allocatable :: include_flag, libdir
2525
character(*), parameter :: candidates(*) = &
26-
[character(20) :: 'mkl-dynamic-lp64-tbb', 'openblas', 'blas']
26+
[character(20) :: 'mkl-dynamic-lp64-tbb', 'openblas', 'blas']
2727

2828
include_flag = get_include_flag(compiler, "")
2929

3030
!> Cleanup
3131
call destroy(this)
32-
allocate (this % link_libs(0), this % incl_dirs(0), this % external_modules(0))
33-
this % link_flags = string_t("")
34-
this % flags = string_t("")
35-
this % has_external_modules = .false.
32+
allocate (this%link_libs(0), this%incl_dirs(0), this%external_modules(0))
33+
this%link_flags = string_t("")
34+
this%flags = string_t("")
35+
this%has_external_modules = .false.
36+
37+
if (compiler%is_intel()) then
38+
this%flags = string_t("-qmkl")
39+
this%has_build_flags = .true.
40+
this%link_flags = string_t("-qmkl")
41+
this%has_link_flags = .true.
42+
return
43+
end if
3644

3745
!> Assert pkg-config is installed
3846
if (.not. assert_pkg_config()) then
39-
call fatal_error(error, 'blas metapackage requires pkg-config')
47+
call fatal_error(error, 'blas metapackage requires pkg-config to continue lookup')
4048
return
4149
end if
4250

43-
do i=1,size(candidates)
51+
do i = 1, size(candidates)
4452
if (pkgcfg_has_package(trim(candidates(i)))) then
45-
call add_pkg_config_compile_options(&
53+
call add_pkg_config_compile_options( &
4654
this, trim(candidates(i)), include_flag, libdir, error)
4755
print *, 'found blas package: ', trim(candidates(i))
4856
return

0 commit comments

Comments
 (0)