Skip to content

Commit

Permalink
Merge pull request #122 from jlblancoc/openblas_generic_linkage
Browse files Browse the repository at this point in the history
cmake: allow more generic OpenBLAS linkage
  • Loading branch information
jlblancoc authored Jan 22, 2024
2 parents 13071ec + 5be0063 commit 58152e5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
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

0 comments on commit 58152e5

Please sign in to comment.