Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
4fec20c4
"git@developer.sourcefind.cn:OpenDAS/torch-harmonics.git" did not exist on "20563f6ee5bbd5690e42ff931aa7d256a2285cdc"
Commit
4fec20c4
authored
Jun 02, 2018
by
Alexis Tsogias
Committed by
Davis E. King
Jun 02, 2018
Browse files
Added option to link against mkl_sequential (#1302)
parent
996a4bbb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
32 deletions
+53
-32
dlib/CMakeLists.txt
dlib/CMakeLists.txt
+3
-0
dlib/cmake_utils/find_blas.cmake
dlib/cmake_utils/find_blas.cmake
+50
-32
No files found.
dlib/CMakeLists.txt
View file @
4fec20c4
...
@@ -140,6 +140,8 @@ if (NOT TARGET dlib)
...
@@ -140,6 +140,8 @@ if (NOT TARGET dlib)
"Disable this if you don't want to use a LAPACK library"
)
"Disable this if you don't want to use a LAPACK library"
)
set
(
DLIB_USE_CUDA_STR
set
(
DLIB_USE_CUDA_STR
"Disable this if you don't want to use NVIDIA CUDA"
)
"Disable this if you don't want to use NVIDIA CUDA"
)
set
(
DLIB_USE_MKL_SEQUENTIAL_STR
"Enable this if you have MKL installed and want to use the sequential version"
)
set
(
DLIB_PNG_SUPPORT_STR
set
(
DLIB_PNG_SUPPORT_STR
"Disable this if you don't want to link against libpng"
)
"Disable this if you don't want to link against libpng"
)
set
(
DLIB_GIF_SUPPORT_STR
set
(
DLIB_GIF_SUPPORT_STR
...
@@ -162,6 +164,7 @@ if (NOT TARGET dlib)
...
@@ -162,6 +164,7 @@ if (NOT TARGET dlib)
toggle_preprocessor_switch
(
DLIB_NO_GUI_SUPPORT
)
toggle_preprocessor_switch
(
DLIB_NO_GUI_SUPPORT
)
option
(
DLIB_ENABLE_STACK_TRACE
${
DLIB_ENABLE_STACK_TRACE_STR
}
OFF
)
option
(
DLIB_ENABLE_STACK_TRACE
${
DLIB_ENABLE_STACK_TRACE_STR
}
OFF
)
toggle_preprocessor_switch
(
DLIB_ENABLE_STACK_TRACE
)
toggle_preprocessor_switch
(
DLIB_ENABLE_STACK_TRACE
)
option
(
DLIB_USE_MKL_SEQUENTIAL
${
DLIB_USE_MKL_SEQUENTIAL_STR
}
OFF
)
if
(
DLIB_ENABLE_ASSERTS
)
if
(
DLIB_ENABLE_ASSERTS
)
# Set these variables so they are set in the config.h.in file when dlib
# Set these variables so they are set in the config.h.in file when dlib
...
...
dlib/cmake_utils/find_blas.cmake
View file @
4fec20c4
...
@@ -110,36 +110,48 @@ if (UNIX OR MINGW)
...
@@ -110,36 +110,48 @@ if (UNIX OR MINGW)
find_path
(
mkl_include_dir mkl_version.h
${
mkl_include_search_path
}
)
find_path
(
mkl_include_dir mkl_version.h
${
mkl_include_search_path
}
)
mark_as_advanced
(
mkl_include_dir
)
mark_as_advanced
(
mkl_include_dir
)
# Search for the needed libraries from the MKL. We will try to link against the mkl_rt
if
(
NOT DLIB_USE_MKL_SEQUENTIAL
)
# file first since this way avoids linking bugs in some cases.
# Search for the needed libraries from the MKL. We will try to link against the mkl_rt
find_library
(
mkl_rt mkl_rt
${
mkl_search_path
}
)
# file first since this way avoids linking bugs in some cases.
find_library
(
openmp_libraries iomp5
${
mkl_search_path
}
)
find_library
(
mkl_rt mkl_rt
${
mkl_search_path
}
)
mark_as_advanced
(
mkl_rt openmp_libraries
)
find_library
(
openmp_libraries iomp5
${
mkl_search_path
}
)
# if we found the MKL
mark_as_advanced
(
mkl_rt openmp_libraries
)
if
(
mkl_rt
)
# if we found the MKL
set
(
mkl_libraries
${
mkl_rt
}
)
if
(
mkl_rt
)
set
(
blas_libraries
${
mkl_rt
}
)
set
(
mkl_libraries
${
mkl_rt
}
)
set
(
lapack_libraries
${
mkl_rt
}
)
set
(
blas_libraries
${
mkl_rt
}
)
set
(
blas_found 1
)
set
(
lapack_libraries
${
mkl_rt
}
)
set
(
lapack_found 1
)
set
(
blas_found 1
)
set
(
found_intel_mkl 1
)
set
(
lapack_found 1
)
message
(
STATUS
"Found Intel MKL BLAS/LAPACK library"
)
set
(
found_intel_mkl 1
)
message
(
STATUS
"Found Intel MKL BLAS/LAPACK library"
)
endif
()
endif
()
endif
()
if
(
NOT found_intel_mkl
)
if
(
NOT found_intel_mkl
)
# Search for the needed libraries from the MKL. This time try looking for a different
# Search for the needed libraries from the MKL. This time try looking for a different
# set of MKL files and try to link against those.
# set of MKL files and try to link against those.
find_library
(
mkl_core mkl_core
${
mkl_search_path
}
)
find_library
(
mkl_core mkl_core
${
mkl_search_path
}
)
find_library
(
mkl_thread mkl_intel_thread
${
mkl_search_path
}
)
set
(
mkl_libs
${
mkl_intel
}
${
mkl_core
}
)
find_library
(
mkl_iomp iomp5
${
mkl_search_path
}
)
mark_as_advanced
(
mkl_libs mkl_intel mkl_core
)
find_library
(
mkl_pthread pthread
${
mkl_search_path
}
)
if
(
DLIB_USE_MKL_SEQUENTIAL
)
find_library
(
mkl_sequential mkl_sequential
${
mkl_search_path
}
)
mark_as_advanced
(
mkl_intel mkl_core mkl_thread mkl_iomp mkl_pthread
)
mark_as_advanced
(
mkl_sequential
)
list
(
APPEND mkl_libs
${
mkl_sequential
}
)
else
()
find_library
(
mkl_thread mkl_intel_thread
${
mkl_search_path
}
)
find_library
(
mkl_iomp iomp5
${
mkl_search_path
}
)
find_library
(
mkl_pthread pthread
${
mkl_search_path
}
)
mark_as_advanced
(
mkl_thread mkl_iomp mkl_pthread
)
list
(
APPEND mkl_libs
${
mkl_thread
}
${
mkl_iomp
}
${
mkl_pthread
}
)
endif
()
# If we found the MKL
# If we found the MKL
if
(
mkl_intel AND mkl_core AND mkl_thread AND mkl_iomp AND mkl_pthread
)
if
(
mkl_intel AND mkl_core
AND
((
mkl_thread AND mkl_iomp AND mkl_pthread
)
OR mkl_sequential
))
set
(
mkl_libraries
${
mkl_
intel
}
${
mkl_core
}
${
mkl_thread
}
${
mkl_iomp
}
${
mkl_pthread
}
)
set
(
mkl_libraries
${
mkl_
libs
}
)
set
(
blas_libraries
${
mkl_
intel
}
${
mkl_core
}
${
mkl_thread
}
${
mkl_iomp
}
${
mkl_pthread
}
)
set
(
blas_libraries
${
mkl_
libs
}
)
set
(
lapack_libraries
${
mkl_
intel
}
${
mkl_core
}
${
mkl_thread
}
${
mkl_iomp
}
${
mkl_pthread
}
)
set
(
lapack_libraries
${
mkl_
libs
}
)
set
(
blas_found 1
)
set
(
blas_found 1
)
set
(
lapack_found 1
)
set
(
lapack_found 1
)
set
(
found_intel_mkl 1
)
set
(
found_intel_mkl 1
)
...
@@ -302,14 +314,23 @@ elseif(WIN32 AND NOT MINGW)
...
@@ -302,14 +314,23 @@ elseif(WIN32 AND NOT MINGW)
# Search for the needed libraries from the MKL.
# Search for the needed libraries from the MKL.
find_library
(
mkl_core mkl_core
${
mkl_search_path
}
)
find_library
(
mkl_core mkl_core
${
mkl_search_path
}
)
find_library
(
mkl_thread mkl_intel_thread
${
mkl_search_path
}
)
set
(
mkl_libs
${
mkl_intel
}
${
mkl_core
}
)
find_library
(
mkl_iomp libiomp5md
${
mkl_search_path
}
)
mark_as_advanced
(
mkl_libs mkl_intel mkl_core
)
if
(
DLIB_USE_MKL_SEQUENTIAL
)
find_library
(
mkl_sequential mkl_sequential
${
mkl_search_path
}
)
mark_as_advanced
(
mkl_sequential
)
list
(
APPEND mkl_libs
${
mkl_sequential
}
)
else
()
find_library
(
mkl_thread mkl_intel_thread
${
mkl_search_path
}
)
find_library
(
mkl_iomp libiomp5md
${
mkl_search_path
}
)
mark_as_advanced
(
mkl_thread mkl_iomp
)
list
(
APPEND mkl_libs
${
mkl_thread
}
${
mkl_iomp
}
)
endif
()
mark_as_advanced
(
mkl_intel mkl_core mkl_thread mkl_iomp
)
# If we found the MKL
# If we found the MKL
if
(
mkl_intel AND mkl_core AND mkl_thread AND mkl_iomp
)
if
(
mkl_intel AND mkl_core
AND
((
mkl_thread AND mkl_iomp
)
OR mkl_sequential
)
)
set
(
blas_libraries
${
mkl_
intel
}
${
mkl_core
}
${
mkl_thread
}
${
mkl_iomp
}
)
set
(
blas_libraries
${
mkl_
libs
}
)
set
(
lapack_libraries
${
mkl_
intel
}
${
mkl_core
}
${
mkl_thread
}
${
mkl_iomp
}
)
set
(
lapack_libraries
${
mkl_
libs
}
)
set
(
blas_found 1
)
set
(
blas_found 1
)
set
(
lapack_found 1
)
set
(
lapack_found 1
)
message
(
STATUS
"Found Intel MKL BLAS/LAPACK library"
)
message
(
STATUS
"Found Intel MKL BLAS/LAPACK library"
)
...
@@ -324,10 +345,7 @@ elseif(WIN32 AND NOT MINGW)
...
@@ -324,10 +345,7 @@ elseif(WIN32 AND NOT MINGW)
set
(
blas_found 0
)
set
(
blas_found 0
)
set
(
lapack_found 0
)
set
(
lapack_found 0
)
endif
()
endif
()
endif
()
endif
()
endif
()
endif
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment