File tree Expand file tree Collapse file tree 1 file changed +19
-7
lines changed
Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -45,14 +45,26 @@ if(EIGEN_WITH_MKL)
4545 EIGEN_USE_LAPACKE_STRICT
4646 )
4747elseif (APPLE )
48- target_link_libraries (Eigen3_Eigen INTERFACE
49- "-framework Accelerate"
50- "/opt/homebrew/opt/lapack/lib/liblapacke.dylib"
51- )
52- target_compile_definitions (Eigen3_Eigen INTERFACE
53- EIGEN_USE_BLAS
54- EIGEN_USE_LAPACKE_STRICT
48+ find_package (BLAS REQUIRED)
49+ find_library (LAPACKE lapacke PATHS
50+ "/opt/local/lib/lapack"
51+ "/opt/homebrew/opt/lapack/lib"
5552 )
53+ if (NOT LAPACKE)
54+ # BLAS should be available on macOS, but LAPACKE might not be
55+ message (WARNING "LAPACKE library not found (required for EIGEN_USE_LAPACKE on macOS)! "
56+ "Perhaps you need to install it (e.g., brew install lapack). "
57+ "Eigen will be built without LAPACKE support." )
58+ else ()
59+ message (STATUS "Found BLAS and LAPACKE. Enabling Eigen LAPACKE support." )
60+ target_link_libraries (Eigen3_Eigen INTERFACE
61+ ${BLAS_LIBRARIES} ${LAPACKE}
62+ )
63+ target_compile_definitions (Eigen3_Eigen INTERFACE
64+ EIGEN_USE_BLAS
65+ EIGEN_USE_LAPACKE_STRICT
66+ )
67+ endif ()
5668endif ()
5769
5870# On Windows, enable natvis files to improve debugging experience
You can’t perform that action at this time.
0 commit comments