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

cmake: allow more generic OpenBLAS linkage #122

Merged
merged 1 commit into from
Jan 22, 2024
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Unreleased

# unreleased
- More generic `OpenBLAS` linkage [#122](/~https://github.com/jlblancoc/suitesparse-metis-for-windows/pull/122)

# Release 1.8.0: October 25th, 2023
- Increase minimum required CMake version to v3.5 to prevent deprecation warnings [#117](/~https://github.com/jlblancoc/suitesparse-metis-for-windows/issues/117).
- Add option `METIS_IDXTYPEWIDTH` with default `64` to override the index type used for `metis.h` [#116](/~https://github.com/jlblancoc/suitesparse-metis-for-windows/issues/116).
Expand Down
18 changes: 15 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,22 @@ if (WITH_OPENBLAS)
# mabye with 'NOFORTAN=1' to get a pure C++ OpenBLAS library (with the
# benefits described above)
hunter_add_package(OpenBLAS)
find_package(OpenBLAS CONFIG REQUIRED)
message(STATUS "found OpenBLAS config file. Linking target OpenBLAS::OpenBLAS")
set(SuiteSparse_LINKER_LAPACK_BLAS_LIBS OpenBLAS::OpenBLAS)
set(BLA_VENDOR OpenBLAS)
find_package(OpenBLAS CONFIG)
if (OpenBLAS_FOUND)
message(STATUS "Found OpenBLAS ${OpenBLAS_VERSION}")
else()
message(STATUS "Looking for OpenBLAS")
find_package(BLAS REQUIRED)
message(STATUS "Found OpenBLAS in ${BLAS_LIBRARIES}")
endif()
if (TARGET OpenBLAS::OpenBLAS)
message(STATUS "found OpenBLAS config file, linking target OpenBLAS::OpenBLAS")
set(SuiteSparse_LINKER_LAPACK_BLAS_LIBS OpenBLAS::OpenBLAS)
else()
message(STATUS "found OpenBLAS, linking target BLAS::BLAS")
set(SuiteSparse_LINKER_LAPACK_BLAS_LIBS BLAS::BLAS)
endif()
elseif (WITH_MKL)
hunter_add_package(mkl)
set(BLA_VENDOR "Intel10_64lp")
Expand Down