Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
6f3d881d
Commit
6f3d881d
authored
Jun 21, 2017
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8950 from alalek:cmake_mkl_detection
parents
8b664d61
9496fe40
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
40 deletions
+18
-40
OpenCVFindLibsPerf.cmake
cmake/OpenCVFindLibsPerf.cmake
+0
-25
OpenCVFindMKL.cmake
cmake/OpenCVFindMKL.cmake
+18
-15
No files found.
cmake/OpenCVFindLibsPerf.cmake
View file @
6f3d881d
...
...
@@ -2,31 +2,6 @@
# Detect other 3rd-party performance and math libraries
# ----------------------------------------------------------------------------
# --- Lapack ---
# if(WITH_LAPACK)
# if(WIN32)
# set(BLA_STATIC 1)
# endif()
# find_package(LAPACK)
# if(LAPACK_FOUND)
# find_path(LAPACKE_INCLUDE_DIR "lapacke.h")
# find_path(MKL_LAPACKE_INCLUDE_DIR "mkl_lapack.h")
# if(LAPACKE_INCLUDE_DIR)
# ocv_include_directories(${LAPACKE_INCLUDE_DIR})
# set(HAVE_LAPACK 1)
# set(HAVE_LAPACK_GENERIC 1)
# elseif(MKL_LAPACKE_INCLUDE_DIR)
# ocv_include_directories(${MKL_LAPACKE_INCLUDE_DIR})
# set(HAVE_LAPACK 1)
# set(HAVE_LAPACK_MKL 1)
# elseif(APPLE)
# set(HAVE_LAPACK 1)
# set(HAVE_LAPACK_APPLE 1)
# endif()
# list(APPEND OPENCV_LINKER_LIBS ${LAPACK_LIBRARIES})
# endif()
# endif()
# --- TBB ---
if
(
WITH_TBB
)
include
(
"
${
OpenCV_SOURCE_DIR
}
/cmake/OpenCVDetectTBB.cmake"
)
...
...
cmake/OpenCVFindMKL.cmake
View file @
6f3d881d
...
...
@@ -7,10 +7,10 @@
#
# On return this will define:
#
# HAVE_MKL - True if Intel
IPP
found
# MKL_ROOT_DIR - root of
IPP
installation
# MKL_INCLUDE_DIRS -
IPP
include folder
# MKL_LIBRARIES -
IPP
libraries that are used by OpenCV
# HAVE_MKL - True if Intel
MKL
found
# MKL_ROOT_DIR - root of
MKL
installation
# MKL_INCLUDE_DIRS -
MKL
include folder
# MKL_LIBRARIES -
MKL
libraries that are used by OpenCV
#
macro
(
mkl_find_lib VAR NAME DIRS
)
...
...
@@ -21,7 +21,7 @@ endmacro()
macro
(
mkl_fail
)
set
(
HAVE_MKL OFF
)
set
(
MKL_ROOT_DIR
${
MKL_ROOT_DIR
}
CACHE PATH
"Path to MKL directory"
)
set
(
MKL_ROOT_DIR
"
${
MKL_ROOT_DIR
}
"
CACHE PATH
"Path to MKL directory"
)
return
()
endmacro
()
...
...
@@ -46,23 +46,26 @@ if(NOT DEFINED MKL_USE_MULTITHREAD)
endif
()
#check current MKL_ROOT_DIR
if
(
NOT MKL_ROOT_DIR OR NOT EXISTS
${
MKL_ROOT_DIR
}
/include/mkl.h
)
set
(
mkl_root_paths
${
MKL_ROOT_DIR
}
)
if
(
NOT MKL_ROOT_DIR OR NOT EXISTS
"
${
MKL_ROOT_DIR
}
/include/mkl.h"
)
set
(
mkl_root_paths
"
${
MKL_ROOT_DIR
}
"
)
if
(
DEFINED ENV{MKLROOT}
)
list
(
APPEND mkl_root_paths
$ENV{MKLROOT}
)
list
(
APPEND mkl_root_paths
"$ENV{MKLROOT}"
)
endif
()
if
(
WIN32
)
if
(
WITH_MKL AND NOT mkl_root_paths
)
if
(
WIN32
)
set
(
ProgramFilesx86
"ProgramFiles(x86)"
)
list
(
APPEND mkl_root_paths $ENV{
${
ProgramFilesx86
}
}/IntelSWTools/compilers_and_libraries/windows/mkl
)
endif
()
if
(
UNIX
)
endif
()
if
(
UNIX
)
list
(
APPEND mkl_root_paths
"/opt/intel/mkl"
)
endif
()
endif
()
find_path
(
MKL_ROOT_DIR include/mkl.h PATHS
${
mkl_root_paths
}
)
endif
()
set
(
MKL_INCLUDE_DIRS
${
MKL_ROOT_DIR
}
/include
CACHE PATH
"Path to MKL include directory"
)
set
(
MKL_INCLUDE_DIRS
"
${
MKL_ROOT_DIR
}
/include"
CACHE PATH
"Path to MKL include directory"
)
if
(
NOT MKL_ROOT_DIR
OR NOT EXISTS
"
${
MKL_ROOT_DIR
}
"
...
...
@@ -128,9 +131,9 @@ endforeach()
message
(
STATUS
"Found MKL
${
MKL_VERSION_STR
}
at:
${
MKL_ROOT_DIR
}
"
)
set
(
HAVE_MKL ON
)
set
(
MKL_ROOT_DIR
${
MKL_ROOT_DIR
}
CACHE PATH
"Path to MKL directory"
)
set
(
MKL_INCLUDE_DIRS
${
MKL_INCLUDE_DIRS
}
CACHE PATH
"Path to MKL include directory"
)
set
(
MKL_LIBRARIES
${
MKL_LIBRARIES
}
CACHE STRING
"MKL libarries"
)
set
(
MKL_ROOT_DIR
"
${
MKL_ROOT_DIR
}
"
CACHE PATH
"Path to MKL directory"
)
set
(
MKL_INCLUDE_DIRS
"
${
MKL_INCLUDE_DIRS
}
"
CACHE PATH
"Path to MKL include directory"
)
set
(
MKL_LIBRARIES
"
${
MKL_LIBRARIES
}
"
CACHE STRING
"MKL libarries"
)
if
(
UNIX AND NOT MKL_LIBRARIES_DONT_HACK
)
#it's ugly but helps to avoid cyclic lib problem
set
(
MKL_LIBRARIES
${
MKL_LIBRARIES
}
${
MKL_LIBRARIES
}
${
MKL_LIBRARIES
}
"-lpthread"
"-lm"
"-ldl"
)
...
...
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