Commit 73b5ef48 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #8042 from alalek:fix_8037

parents a46adbfc f9828cd0
...@@ -133,6 +133,7 @@ if(WITH_LAPACK) ...@@ -133,6 +133,7 @@ if(WITH_LAPACK)
set(LAPACK_IMPL "LAPACK/Apple") set(LAPACK_IMPL "LAPACK/Apple")
ocv_lapack_check() ocv_lapack_check()
else() else()
unset(LAPACK_LIBRARIES)
unset(LAPACK_LIBRARIES CACHE) unset(LAPACK_LIBRARIES CACHE)
endif() endif()
endif() endif()
...@@ -147,7 +148,7 @@ if(WITH_LAPACK) ...@@ -147,7 +148,7 @@ if(WITH_LAPACK)
ocv_lapack_check() ocv_lapack_check()
endif() endif()
if(NOT HAVE_LAPACK AND LAPACK_LIBRARIES) if(NOT HAVE_LAPACK AND LAPACK_LIBRARIES AND LAPACK_CBLAS_H AND LAPACK_LAPACKE_H)
ocv_lapack_check() ocv_lapack_check()
endif() endif()
......
...@@ -20,10 +20,8 @@ macro (mkl_find_lib VAR NAME DIRS) ...@@ -20,10 +20,8 @@ macro (mkl_find_lib VAR NAME DIRS)
endmacro() endmacro()
macro(mkl_fail) macro(mkl_fail)
set(HAVE_MKL OFF CACHE BOOL "True if MKL found") 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")
unset(MKL_INCLUDE_DIRS CACHE)
unset(MKL_LIBRARIES CACHE)
return() return()
endmacro() endmacro()
...@@ -64,11 +62,16 @@ if(NOT MKL_ROOT_DIR OR NOT EXISTS ${MKL_ROOT_DIR}/include/mkl.h) ...@@ -64,11 +62,16 @@ if(NOT MKL_ROOT_DIR OR NOT EXISTS ${MKL_ROOT_DIR}/include/mkl.h)
find_path(MKL_ROOT_DIR include/mkl.h PATHS ${mkl_root_paths}) find_path(MKL_ROOT_DIR include/mkl.h PATHS ${mkl_root_paths})
endif() endif()
if(NOT MKL_ROOT_DIR) 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}"
OR NOT EXISTS "${MKL_INCLUDE_DIRS}"
OR NOT EXISTS "${MKL_INCLUDE_DIRS}/mkl_version.h"
)
mkl_fail() mkl_fail()
endif() endif()
set(MKL_INCLUDE_DIRS ${MKL_ROOT_DIR}/include)
get_mkl_version(${MKL_INCLUDE_DIRS}/mkl_version.h) get_mkl_version(${MKL_INCLUDE_DIRS}/mkl_version.h)
#determine arch #determine arch
...@@ -124,13 +127,11 @@ foreach(lib ${mkl_lib_list}) ...@@ -124,13 +127,11 @@ foreach(lib ${mkl_lib_list})
endforeach() endforeach()
message(STATUS "Found MKL ${MKL_VERSION_STR} at: ${MKL_ROOT_DIR}") message(STATUS "Found MKL ${MKL_VERSION_STR} at: ${MKL_ROOT_DIR}")
set(HAVE_MKL ON CACHE BOOL "True if MKL found") set(HAVE_MKL ON)
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")
set(MKL_INCLUDE_DIRS ${MKL_INCLUDE_DIRS} CACHE PATH "Path to MKL include directory") set(MKL_INCLUDE_DIRS ${MKL_INCLUDE_DIRS} CACHE PATH "Path to MKL include directory")
if(NOT UNIX) set(MKL_LIBRARIES ${MKL_LIBRARIES} CACHE STRING "MKL libarries")
set(MKL_LIBRARIES ${MKL_LIBRARIES} CACHE FILEPATH "MKL libarries") if(UNIX AND NOT MKL_LIBRARIES_DONT_HACK)
else()
#it's ugly but helps to avoid cyclic lib problem #it's ugly but helps to avoid cyclic lib problem
set(MKL_LIBRARIES ${MKL_LIBRARIES} ${MKL_LIBRARIES} ${MKL_LIBRARIES} "-lpthread" "-lm" "-ldl") set(MKL_LIBRARIES ${MKL_LIBRARIES} ${MKL_LIBRARIES} ${MKL_LIBRARIES} "-lpthread" "-lm" "-ldl")
set(MKL_LIBRARIES ${MKL_LIBRARIES} CACHE STRING "MKL libarries")
endif() endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment