fix cmake not finding openblas

This commit is contained in:
Davis King 2020-10-08 22:33:35 -04:00
parent c45d166a25
commit f4f8bff95e
1 changed files with 6 additions and 6 deletions

View File

@ -70,8 +70,8 @@ if (UNIX OR MINGW)
pkg_check_modules(LAPACK_REFERENCE lapack)
# Make sure the cblas found by pkgconfig actually has cblas symbols.
SET(CMAKE_REQUIRED_LIBRARIES "${BLAS_REFERENCE_LDFLAGS}")
CHECK_FUNCTION_EXISTS(cblas_ddot HAVE_CBLAS)
if (BLAS_REFERENCE_FOUND AND LAPACK_REFERENCE_FOUND AND HAVE_CBLAS)
CHECK_FUNCTION_EXISTS(cblas_ddot PKGCFG_HAVE_CBLAS)
if (BLAS_REFERENCE_FOUND AND LAPACK_REFERENCE_FOUND AND PKGCFG_HAVE_CBLAS)
set(blas_libraries "${BLAS_REFERENCE_LDFLAGS}")
set(lapack_libraries "${LAPACK_REFERENCE_LDFLAGS}")
set(blas_found 1)
@ -283,8 +283,8 @@ if (UNIX OR MINGW)
# with it. But it's fine since the MKL should always have cblas.
if (blas_found AND NOT found_intel_mkl)
set(CMAKE_REQUIRED_LIBRARIES ${blas_libraries})
CHECK_FUNCTION_EXISTS(cblas_ddot HAVE_CBLAS)
if (NOT HAVE_CBLAS)
CHECK_FUNCTION_EXISTS(cblas_ddot FOUND_BLAS_HAS_CBLAS)
if (NOT FOUND_BLAS_HAS_CBLAS)
message(STATUS "BLAS library does not have cblas symbols, so dlib will not use BLAS or LAPACK")
set(blas_found 0)
set(lapack_found 0)
@ -400,8 +400,8 @@ elseif(WIN32 AND NOT MINGW)
# the compiler we are using. One way to do this check is to see if we can
# link to it right now.
set(CMAKE_REQUIRED_LIBRARIES ${blas_libraries})
CHECK_FUNCTION_EXISTS(cblas_ddot HAVE_CBLAS)
if (NOT HAVE_CBLAS)
CHECK_FUNCTION_EXISTS(cblas_ddot MKL_HAS_CBLAS)
if (NOT MKL_HAS_CBLAS)
message("BLAS library does not have cblas symbols, so dlib will not use BLAS or LAPACK")
set(blas_found 0)
set(lapack_found 0)