Skip to content

Commit

Permalink
Add a link option for -lgomp or -lomp
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Feb 8, 2025
1 parent a95d1d7 commit 6e7e2b6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ elif cxx.get_id() == 'intel-cl' or cxx.get_id() == 'intel-llvm-cl'
add_global_arguments('/Qopenmp', language : 'cpp')
endif

# Link flag for C++
# Link flags for C++
lstdcpp = '-lstdc++'
if host_machine.system() != 'linux'
if cxx.get_id() == 'clang' or cxx.get_id() == 'clang-cl'
Expand All @@ -138,6 +138,13 @@ if host_machine.system() != 'linux'
endif
endif

libomp = '-lgomp'
if host_machine.system() == 'darwin' or host_machine.system() == 'freebsd'
if cxx.get_id() == 'clang'
libomp = '-lomp'
endif
endif

binspral_src = []
libspral_src = []
libspral_cpp_src = []
Expand Down Expand Up @@ -170,7 +177,7 @@ libspral = library('spral',
sources : libspral_src + libspral_cpp_src + libspral_nvcc_src,
dependencies : libspral_deps,
link_language : 'fortran',
link_args : lstdcpp,
link_args : [lstdcpp, libomp],
include_directories: libspral_include,
install : true)

Expand Down

0 comments on commit 6e7e2b6

Please sign in to comment.