From 26ea29d34364aa75ce0963a9e7a380d27888f42b Mon Sep 17 00:00:00 2001 From: Florent Pruvost <florent.pruvost@inria.fr> Date: Fri, 13 Apr 2018 10:42:33 +0200 Subject: [PATCH] set BLAS_VENDOR_FOUND also whit pkg-config --- modules/find/FindBLAS.cmake | 33 ++++++++++++++++++++++++++++++--- modules/find/FindLAPACK.cmake | 33 ++++++++++++++++++++++++++++++--- 2 files changed, 60 insertions(+), 6 deletions(-) diff --git a/modules/find/FindBLAS.cmake b/modules/find/FindBLAS.cmake index c470e5a..c366b9b 100644 --- a/modules/find/FindBLAS.cmake +++ b/modules/find/FindBLAS.cmake @@ -366,16 +366,43 @@ if( PKG_CONFIG_EXECUTABLE AND NOT BLAS_GIVEN_BY_USER ) # try different blas if (BLA_VENDOR STREQUAL "Intel10_64lp") pkg_search_module(BLAS mkl-${MKL_STR_BLA_STATIC}-lp64-iomp) + if (BLAS_FOUND) + set (BLAS_VENDOR_FOUND "Intel MKL") + endif() elseif(BLA_VENDOR STREQUAL "Intel10_64lp_seq") pkg_search_module(BLAS mkl-${MKL_STR_BLA_STATIC}-lp64-seq) + if (BLAS_FOUND) + set (BLAS_VENDOR_FOUND "Intel MKL") + endif() elseif(BLA_VENDOR STREQUAL "Open") pkg_search_module(BLAS openblas) + if (BLAS_FOUND) + set (BLAS_VENDOR_FOUND "Openblas") + endif() elseif(BLA_VENDOR STREQUAL "Generic") pkg_search_module(BLAS blas) + if (BLAS_FOUND) + set (BLAS_VENDOR_FOUND "Netlib or other Generic libblas") + endif() else() - pkg_search_module(BLAS blas) - pkg_search_module(BLAS openblas) - pkg_search_module(BLAS mkl-${MKL_STR_BLA_STATIC}-lp64-seq) + if (NOT BLAS_FOUND) + pkg_search_module(BLAS mkl-${MKL_STR_BLA_STATIC}-lp64-seq) + if (BLAS_FOUND) + set (BLAS_VENDOR_FOUND "Intel MKL") + endif() + endif() + if (NOT BLAS_FOUND) + pkg_search_module(BLAS openblas) + if (BLAS_FOUND) + set (BLAS_VENDOR_FOUND "Openblas") + endif() + endif() + if (NOT BLAS_FOUND) + pkg_search_module(BLAS blas) + if (BLAS_FOUND) + set (BLAS_VENDOR_FOUND "Netlib or other Generic libblas") + endif() + endif() endif() if (NOT BLAS_FIND_QUIETLY) diff --git a/modules/find/FindLAPACK.cmake b/modules/find/FindLAPACK.cmake index 20cfada..73f57da 100644 --- a/modules/find/FindLAPACK.cmake +++ b/modules/find/FindLAPACK.cmake @@ -396,16 +396,43 @@ if(BLAS_FOUND) # try different blas if (BLA_VENDOR STREQUAL "Intel10_64lp") pkg_search_module(LAPACK mkl-${MKL_STR_BLA_STATIC}-lp64-iomp) + if (LAPACK_FOUND) + set (LAPACK_VENDOR_FOUND "Intel MKL") + endif() elseif(BLA_VENDOR STREQUAL "Intel10_64lp_seq") pkg_search_module(LAPACK mkl-${MKL_STR_BLA_STATIC}-lp64-seq) + if (LAPACK_FOUND) + set (LAPACK_VENDOR_FOUND "Intel MKL") + endif() elseif(BLA_VENDOR STREQUAL "Open") pkg_search_module(LAPACK openblas) + if (LAPACK_FOUND) + set (LAPACK_VENDOR_FOUND "Openblas") + endif() elseif(BLA_VENDOR STREQUAL "Generic") pkg_search_module(LAPACK lapack) + if (LAPACK_FOUND) + set (LAPACK_VENDOR_FOUND "Netlib or other Generic liblapack") + endif() else() - pkg_search_module(LAPACK lapack) - pkg_search_module(LAPACK openblas) - pkg_search_module(LAPACK mkl-${MKL_STR_BLA_STATIC}-lp64-seq) + if (NOT LAPACK_FOUND) + pkg_search_module(LAPACK mkl-${MKL_STR_BLA_STATIC}-lp64-seq) + if (LAPACK_FOUND) + set (LAPACK_VENDOR_FOUND "Intel MKL") + endif() + endif() + if (NOT LAPACK_FOUND) + pkg_search_module(LAPACK openblas) + if (LAPACK_FOUND) + set (LAPACK_VENDOR_FOUND "Openblas") + endif() + endif() + if (NOT LAPACK_FOUND) + pkg_search_module(LAPACK lapack) + if (LAPACK_FOUND) + set (LAPACK_VENDOR_FOUND "Netlib or other Generic liblapack") + endif() + endif() endif() if (NOT LAPACK_FIND_QUIETLY) -- GitLab