diff --git a/CMakeLists.txt b/CMakeLists.txt index 25bcdffeb3e7694e5d297461248c8c11ad2896d1..d84783484e62b81a94b3ba27bc2cf424a858604f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -154,6 +154,10 @@ else() ${OGS_EIGEN_DYNAMIC_SHAPE_MATRICES} ) endif() + +cmake_dependent_option( + OGS_EIGEN_USE_MKL "Defines EIGEN_USE_MKL_ALL." OFF "OGS_USE_MKL" OFF +) # Eigen End # Debug diff --git a/MathLib/CMakeLists.txt b/MathLib/CMakeLists.txt index 68c1dfb6e780952085683a8687dbd5c0ebf85851..84ca68493ff262ee0275c0acb7e7e0f54376615c 100644 --- a/MathLib/CMakeLists.txt +++ b/MathLib/CMakeLists.txt @@ -40,10 +40,10 @@ if(OGS_USE_LIS) target_include_directories(MathLib PUBLIC ${LIS_INCLUDE_DIR}) endif() if(OGS_USE_MKL) - target_include_directories(MathLib PRIVATE ${MKL_INCLUDE_DIR}) - target_link_libraries(MathLib PRIVATE ${MKL_LIBRARIES}) + target_include_directories(MathLib PUBLIC ${MKL_INCLUDE_DIR}) + target_link_libraries(MathLib PUBLIC ${MKL_LIBRARIES}) target_link_options(MathLib PUBLIC ${MKL_LINK_FLAGS}) - target_compile_definitions(MathLib PRIVATE ${MKL_DEFINITIONS}) + target_compile_definitions(MathLib PUBLIC ${MKL_DEFINITIONS}) endif() target_compile_definitions( @@ -57,5 +57,6 @@ target_compile_definitions( $<$<BOOL:${OGS_USE_EIGEN_UNSUPPORTED}>:USE_EIGEN_UNSUPPORTED> $<$<BOOL:${OGS_EIGEN_INITIALIZE_MATRICES_BY_NAN}>:EIGEN_INITIALIZE_MATRICES_BY_NAN> $<$<CONFIG:Debug>:EIGEN_INITIALIZE_MATRICES_BY_NAN> + $<$<AND:$<BOOL:${OGS_USE_MKL}>,$<BOOL:${OGS_EIGEN_USE_MKL}>>:EIGEN_USE_MKL_ALL> PRIVATE $<$<BOOL:${OGS_USE_MKL}>:USE_MKL> )