Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix finding of MKL for Intel 2021 and newer #20

Merged
merged 2 commits into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ multicharge_exe = executable(
sources: files('main.f90'),
dependencies: multicharge_dep,
install: install,
link_language: 'fortran',
)
16 changes: 10 additions & 6 deletions config/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,27 @@ endif

if lapack_vendor == 'mkl'
mkl_dep = []
cc = fc
if add_languages('c', required: false, native: false)
cc = meson.get_compiler('c')
endif
if fc_id == 'intel'
mkl_dep += fc.find_library('mkl_intel_lp64')
mkl_dep += cc.find_library('mkl_intel_lp64')
if get_option('openmp')
mkl_dep += fc.find_library('mkl_intel_thread')
mkl_dep += cc.find_library('mkl_intel_thread')
endif
elif fc_id == 'gcc'
mkl_dep += fc.find_library('mkl_gf_lp64')
mkl_dep += cc.find_library('mkl_gf_lp64')
if get_option('openmp')
mkl_dep += fc.find_library('mkl_gnu_thread')
mkl_dep += cc.find_library('mkl_gnu_thread')
endif
else
error('MKL not supported for this compiler')
endif
if not get_option('openmp')
mkl_dep += fc.find_library('mkl_tbb_thread')
mkl_dep += cc.find_library('mkl_tbb_thread')
endif
mkl_dep += fc.find_library('mkl_core')
mkl_dep += cc.find_library('mkl_core')
lib_deps += mkl_dep

elif lapack_vendor == 'mkl-rt'
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ project(
'fortran',
version: '0.2.0',
license: 'Apache-2.0',
meson_version: '>=0.53',
meson_version: '>=0.55',
default_options: [
'buildtype=debugoptimized',
'default_library=both',
Expand Down
9 changes: 5 additions & 4 deletions test/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Create mstore as subproject for testing
mstore_prj = subproject(
# Find mstore dependency for testing
mstore_dep = dependency(
'mstore',
version: '>=0.1',
fallback: ['mstore', 'mstore_dep'],
required: not meson.is_subproject(),
default_options: [
'default_library=static',
],
)
# If we do not find mstore and are a subproject, we just skip testing
if not mstore_prj.found()
if not mstore_dep.found()
subdir_done()
endif
mstore_dep = mstore_prj.get_variable('mstore_dep')

tests = [
'model',
Expand All @@ -46,6 +46,7 @@ tester = executable(
'tester',
sources: test_srcs,
dependencies: [multicharge_dep, mstore_dep],
link_language: 'fortran',
)

foreach t : tests
Expand Down