diff --git a/cmake/ShogunFindLAPACK.cmake b/cmake/ShogunFindLAPACK.cmake index fe3d6db9c..e4bb9cb21 100644 --- a/cmake/ShogunFindLAPACK.cmake +++ b/cmake/ShogunFindLAPACK.cmake @@ -19,9 +19,20 @@ IF (LAPACK_FOUND) NAMES lapacke PATHS /usr/lib /usr/local/lib $ENV{LAPACKE_PATH}) if (LAPACKE_LIBRARY) - MESSAGE(STATUS "Enabling Accelerate.framework as LAPACK backend for Eigen.") - SET(EIGEN_USE_LAPACKE_STRICT 1) - LIST(APPEND LAPACK_LIBRARIES ${LAPACKE_LIBRARY}) + include(CheckCXXSourceCompiles) + CHECK_CXX_SOURCE_COMPILES( + "#include + int main(void){ + return 0; + }" VECLIB_INCLUDE_WORKS) + + if (VECLIB_INCLUDE_WORKS) + MESSAGE(STATUS "Enabling Accelerate.framework as LAPACK backend for Eigen.") + SET(EIGEN_USE_LAPACKE_STRICT 1) + LIST(APPEND LAPACK_LIBRARIES ${LAPACKE_LIBRARY}) + else() + MESSAGE(STATUS "Could not include hence not enabling LAPACK as an Eigen backend") + endif() endif() endif() ELSEIF("${LAPACK_LIBRARIES}" MATCHES ".*/.*mkl_.*")