Skip to content

Commit 08c3bcf

Browse files
authored
Fix finding of MKL for Intel 2021 and newer (#162)
1 parent d1d4ac6 commit 08c3bcf

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

app/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ dftd4_exe = executable(
2323
),
2424
dependencies: dftd4_dep,
2525
install: install,
26+
link_language: 'fortran',
2627
)
2728

2829
test('app-version', dftd4_exe, args: '--version')

config/meson.build

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616

1717
os = host_machine.system()
1818
fc = meson.get_compiler('fortran')
19+
cc = fc
20+
if has_cc
21+
cc = meson.get_compiler('c')
22+
endif
1923
fc_id = fc.get_id()
2024

2125
if fc_id == 'gcc'
@@ -53,22 +57,22 @@ endif
5357
if lapack_vendor == 'mkl'
5458
mkl_dep = []
5559
if fc_id == 'intel'
56-
mkl_dep += fc.find_library('mkl_intel_lp64')
60+
mkl_dep += cc.find_library('mkl_intel_lp64')
5761
if get_option('openmp')
58-
mkl_dep += fc.find_library('mkl_intel_thread')
62+
mkl_dep += cc.find_library('mkl_intel_thread')
5963
endif
6064
elif fc_id == 'gcc'
61-
mkl_dep += fc.find_library('mkl_gf_lp64')
65+
mkl_dep += cc.find_library('mkl_gf_lp64')
6266
if get_option('openmp')
63-
mkl_dep += fc.find_library('mkl_gnu_thread')
67+
mkl_dep += cc.find_library('mkl_gnu_thread')
6468
endif
6569
else
6670
error('MKL not supported for this compiler')
6771
endif
6872
if not get_option('openmp')
69-
mkl_dep += fc.find_library('mkl_tbb_thread')
73+
mkl_dep += cc.find_library('mkl_tbb_thread')
7074
endif
71-
mkl_dep += fc.find_library('mkl_core')
75+
mkl_dep += cc.find_library('mkl_core')
7276
lib_deps += mkl_dep
7377

7478
elif lapack_vendor == 'mkl-rt'

test/unit/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ tester = executable(
4646
'tester',
4747
sources: test_srcs,
4848
dependencies: [dftd4_dep, mstore_dep],
49+
link_language: 'fortran',
4950
)
5051

5152
foreach t : tests

0 commit comments

Comments
 (0)