Skip to content

Commit

Permalink
Merge branch 'mkl-link-fix' into 'master'
Browse files Browse the repository at this point in the history
[cmake] Added --no-as-needed link flag for MKL.

See merge request ogs/ogs!4813
  • Loading branch information
bilke committed Nov 21, 2023
2 parents 06cef6f + ea180cd commit 28918aa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions MathLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ target_link_libraries(
Eigen3::Eigen
$<$<TARGET_EXISTS:OpenMP::OpenMP_CXX>:OpenMP::OpenMP_CXX>
)
if(OGS_USE_MKL AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# Otherwise required MKL libs get stripped out (don't show up in ldd):
target_link_options(MathLib PUBLIC "LINKER:--no-as-needed")
endif()

if(OGS_USE_LIS)
target_include_directories(MathLib PUBLIC ${LIS_INCLUDE_DIR})
Expand Down

0 comments on commit 28918aa

Please sign in to comment.