diff --git a/app/meson.build b/app/meson.build index 75f4a88c..33d0a592 100644 --- a/app/meson.build +++ b/app/meson.build @@ -18,4 +18,5 @@ multicharge_exe = executable( sources: files('main.f90'), dependencies: multicharge_dep, install: install, + link_language: 'fortran', ) diff --git a/config/meson.build b/config/meson.build index 64cc3b4e..09a5abb7 100644 --- a/config/meson.build +++ b/config/meson.build @@ -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' diff --git a/meson.build b/meson.build index b16bb487..6de70142 100644 --- a/meson.build +++ b/meson.build @@ -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', diff --git a/test/meson.build b/test/meson.build index 6a1e8859..740e5080 100644 --- a/test/meson.build +++ b/test/meson.build @@ -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', @@ -46,6 +46,7 @@ tester = executable( 'tester', sources: test_srcs, dependencies: [multicharge_dep, mstore_dep], + link_language: 'fortran', ) foreach t : tests