From faf8676a49be8d1e833f6620075067a98551cc30 Mon Sep 17 00:00:00 2001 From: Davis King Date: Fri, 27 Oct 2017 05:58:34 -0400 Subject: [PATCH] Cleanup --- dlib/cmake_utils/cmake_find_blas.txt | 45 +++++++++++----------------- 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/dlib/cmake_utils/cmake_find_blas.txt b/dlib/cmake_utils/cmake_find_blas.txt index 8765535d8..1aa59ac20 100644 --- a/dlib/cmake_utils/cmake_find_blas.txt +++ b/dlib/cmake_utils/cmake_find_blas.txt @@ -27,6 +27,7 @@ SET(lapack_found 0) SET(found_intel_mkl 0) SET(found_intel_mkl_headers 0) +message(STATUS "Searching for BLAS and LAPACK") if (UNIX OR MINGW) message(STATUS "Searching for BLAS and LAPACK") @@ -324,36 +325,24 @@ elseif(WIN32 AND NOT MINGW) endif() - if (NOT blas_found) - find_package(blas) - if (${BLAS_FOUND}) - set(blas_libraries ${BLAS_LIBRARIES}) - set(blas_found 1) - set(CMAKE_REQUIRED_LIBRARIES ${blas_libraries}) - # If you compiled OpenBLAS with LAPACK in it then it should have the - # sgetrf_single function in it. So if we find that function in - # OpenBLAS then just use OpenBLAS's LAPACK. - CHECK_FUNCTION_EXISTS(sgetrf_single OPENBLAS_HAS_LAPACK) - if (OPENBLAS_HAS_LAPACK) - message(STATUS "Using OpenBLAS's built in LAPACK") - # set(lapack_libraries gfortran) - set(lapack_found 1) - endif() - endif() - endif() - - - if (NOT lapack_found) - find_package(lapack) - if (${LAPACK_FOUND}) - set(lapack_libraries ${LAPACK_LIBRARIES}) - set(lapack_found 1) - message(STATUS "Found LAPACK library") - endif() - endif() - endif() +# When all else fails use CMake's built in functions to find BLAS and LAPACK +if (NOT blas_found) + find_package(BLAS) + if (${BLAS_FOUND}) + set(blas_libraries ${BLAS_LIBRARIES}) + set(blas_found 1) + endif() +endif() + +if (NOT lapack_found) + find_package(LAPACK) + if (${LAPACK_FOUND}) + set(lapack_libraries ${LAPACK_LIBRARIES}) + set(lapack_found 1) + endif() +endif()