Skip to content

Commit

Permalink
Fix MKL finding with Intel 2021 and newer (#640)
Browse files Browse the repository at this point in the history
  • Loading branch information
awvwgk authored May 26, 2022
1 parent 44d1cf5 commit 6bdb295
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/fortran-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ jobs:
printenv >> $GITHUB_ENV
- name: Configure meson build
run: meson setup ${{ env.BUILD_DIR }} --prefix=/ -Dfortran_args=-qopenmp
run: meson setup ${{ env.BUILD_DIR }} --prefix=/

- name: Build project
run: ninja -C ${{ env.BUILD_DIR }}
Expand Down
5 changes: 4 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ endif
# We rely on the existence of Python since meson will need a Python interpreter to run,
# this way we have a cross-platform way to obtain relevant data for our build.
pymod = import('python')
python = pymod.find_installation('python3')
python = pymod.find_installation('python3', required: false)
if not python.found()
python = find_program('python3', 'python')
endif

# build a configuration data containing all the important data to propagate
# it to the automatically generated files
Expand Down
18 changes: 9 additions & 9 deletions meson/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -108,29 +108,29 @@ if la_backend == 'mkl' or la_backend == 'mkl-static'
endif

if get_option('default_library') == 'dynamic'
mkl_rt_dep = fc.find_library('mkl_rt', required: true)
mkl_rt_dep = cc.find_library('mkl_rt', required: true)
lib_deps += libmkl_exe
else
if fc.get_id() == 'gcc'
libmkl_exe = [fc.find_library('mkl_gf_lp64')]
libmkl_exe = [cc.find_library('mkl_gf_lp64')]
if get_option('openmp')
libmkl_exe += fc.find_library('mkl_gnu_thread')
libmkl_exe += cc.find_library('mkl_gnu_thread')
endif
elif fc.get_id() == 'intel' or fc.get_id() == 'intel-cl'
libmkl_exe = [fc.find_library('mkl_intel_lp64')]
libmkl_exe = [cc.find_library('mkl_intel_lp64')]
if get_option('openmp')
libmkl_exe += fc.find_library('mkl_intel_thread')
libmkl_exe += cc.find_library('mkl_intel_thread')
endif
elif fc.get_id() == 'pgi' or fc.get_id() == 'nvidia_hpc'
libmkl_exe = [fc.find_library('mkl_intel_lp64')]
libmkl_exe = [cc.find_library('mkl_intel_lp64')]
if get_option('openmp')
libmkl_exe += fc.find_library('mkl_pgi_thread')
libmkl_exe += cc.find_library('mkl_pgi_thread')
endif
endif
if not get_option('openmp')
libmkl_exe += fc.find_library('mkl_sequential')
libmkl_exe += cc.find_library('mkl_sequential')
endif
libmkl_exe += fc.find_library('mkl_core')
libmkl_exe += cc.find_library('mkl_core')
lib_deps += libmkl_exe
endif

Expand Down

0 comments on commit 6bdb295

Please sign in to comment.