Skip to content

Commit 0078cb4

Browse files
author
me
committed
make sure DLIB_USE_BLAS and DLIB_USE_LAPACK are enabled by default when MKL is enabled.
1 parent 9416cde commit 0078cb4

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

dlib/CMakeLists.txt

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -610,21 +610,30 @@ if (NOT TARGET dlib)
610610
enable_preprocessor_switch(DLIB_USE_MKL_THREAD)
611611
list (APPEND dlib_needed_public_libraries ${mkl_libraries_thread})
612612
endif()
613-
else()
614-
if(DLIB_USE_BLAS)
613+
endif()
614+
615+
if(DLIB_USE_BLAS)
616+
enable_preprocessor_switch(DLIB_USE_BLAS)
617+
if (NOT DLIB_USE_MKL_SEQUENTIAL AND NOT DLIB_USE_MKL_WITH_TBB AND NOT DLIB_USE_MKL_THREAD)
615618
message(STATUS "Using BLAS ${blas_libraries}")
616-
enable_preprocessor_switch(DLIB_USE_BLAS)
617619
list (APPEND dlib_needed_public_libraries ${blas_libraries})
620+
else()
621+
message(STATUS "Using MKL BLAS")
618622
endif()
619-
if(DLIB_USE_LAPACK)
623+
endif()
624+
625+
if(DLIB_USE_LAPACK)
626+
enable_preprocessor_switch(DLIB_USE_LAPACK)
627+
if (NOT DLIB_USE_MKL_SEQUENTIAL AND NOT DLIB_USE_MKL_WITH_TBB AND NOT DLIB_USE_MKL_THREAD)
620628
message(STATUS "Using LAPACK ${lapack_libraries}")
621-
enable_preprocessor_switch(DLIB_USE_LAPACK)
622629
list (APPEND dlib_needed_public_libraries ${lapack_libraries})
623630
if (lapack_with_underscore)
624631
enable_preprocessor_switch(LAPACK_FORCE_UNDERSCORE)
625632
elseif (lapack_without_underscore)
626633
enable_preprocessor_switch(LAPACK_FORCE_NOUNDERSCORE)
627634
endif ()
635+
else()
636+
message(STATUS "Using MKL LAPACK")
628637
endif()
629638
endif()
630639

dlib/cmake_utils/find_blas.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ endif()
184184

185185
if (mkl_seq_found OR mkl_tbb_found OR mkl_thread_found)
186186
set(mkl_found 1)
187+
return()
187188
endif()
188189

189190
# Search for BLAS - pkgconfig

0 commit comments

Comments
 (0)