Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find BLAS and LAPACK if not using MKL #39

Merged
merged 2 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cmake/recipes/blas.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm64" OR "${CMAKE_OSX_ARCHITECTURES}" M
# Use Accelerate on macOS M1
set(BLA_VENDOR Apple)
find_package(BLAS REQUIRED)
else()
# Use MKL on other platforms
elseif(POLYSOLVE_WITH_MKL)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would you ever want the system version over the MKL BLAS if available? MKL BLAS should be faster...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When POLYSOLVE_WITH_MKL=OFF, I would expect MKL to not be used entirely.

# Use MKL if enabled
include(mkl)
add_library(BLAS::BLAS ALIAS mkl::mkl)
else()
# otherwise find system version
find_package(BLAS REQUIRED)
endif()
7 changes: 5 additions & 2 deletions cmake/recipes/lapack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm64" OR "${CMAKE_OSX_ARCHITECTURES}" M
# Use Accelerate on macOS M1
set(BLA_VENDOR Apple)
find_package(LAPACK REQUIRED)
else()
# Use MKL on other platforms
elseif(POLYSOLVE_WITH_MKL)
# Use MKL if enabled
include(mkl)
add_library(LAPACK::LAPACK ALIAS mkl::mkl)
else()
# otherwise find system version
find_package(LAPACK REQUIRED)
endif()
Loading