Skip to content

Commit

Permalink
Use global link flags
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Feb 8, 2025
1 parent ef32cf1 commit 3ecde5b
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ if host_machine.system() == 'darwin' or host_machine.system() == 'freebsd'
lomp = '-lomp'
endif
endif
add_global_link_arguments(lomp, language : 'fortran')
add_global_link_arguments(lomp, language : 'c')
add_global_link_arguments(lomp, language : 'cpp')

# Link flag for C++
lstdcpp = '-lstdc++'
Expand Down Expand Up @@ -170,7 +173,7 @@ libspral = library('spral',
sources : libspral_src + libspral_cpp_src + libspral_nvcc_src,
dependencies : libspral_deps,
link_language : 'fortran',
link_args : [lstdcpp, lomp],
link_args : lstdcpp,
include_directories: libspral_include,
install : true)

Expand All @@ -179,7 +182,6 @@ executable('spral_ssids',
sources : binspral_src,
dependencies : libcuda,
link_with : libspral,
link_args : lomp,
link_language : 'fortran',
install : true)

Expand All @@ -203,8 +205,7 @@ if build_tests
file = test[1]
test(name,
executable(name, file, link_with : libspral, dependencies : libspral_deps,
link_language : 'fortran', include_directories: libspral_include,
link_args : lomp),
link_language : 'fortran', include_directories: libspral_include),
timeout : 300, is_parallel : false, env: omp_env)
endforeach

Expand All @@ -213,8 +214,7 @@ if build_tests
file = test[1]
test(name,
executable(name, file, link_with : libspral, dependencies : libspral_deps,
link_language : 'c', include_directories : libspral_include,
link_args : lomp),
link_language : 'c', include_directories : libspral_include),
timeout : 300, is_parallel : false, env: omp_env)
endforeach

Expand All @@ -223,8 +223,7 @@ if build_tests
file = test[1]
test(name,
executable(name, file, link_with : libspral, dependencies : libspral_deps,
link_language : 'cpp', include_directories : libspral_include,
link_args : lomp),
link_language : 'cpp', include_directories : libspral_include),
timeout : 300, is_parallel : false, env: omp_env)
endforeach
endif
Expand All @@ -240,7 +239,7 @@ if build_examples
test(name,
executable(name, file, link_with : libspral, dependencies : libspral_deps,
link_language : 'fortran', include_directories : libspral_include,
install : true, install_dir : fortran_examples_folder, link_args : lomp),
install : true, install_dir : fortran_examples_folder),
timeout : 300, is_parallel : false, env: omp_env)
endforeach

Expand All @@ -252,7 +251,7 @@ if build_examples
test(name,
executable(name, file, link_with : libspral, dependencies : libspral_deps,
link_language : 'c', include_directories : libspral_include,
install : true, install_dir : c_examples_folder, link_args : lomp),
install : true, install_dir : c_examples_folder),
timeout : 300, is_parallel : false, env: omp_env)
endforeach
endif

0 comments on commit 3ecde5b

Please sign in to comment.