Skip to content
Open
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
16 changes: 13 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,19 @@ if(WITH_OPENBLAS)
set(SuiteSparse_LINKER_LAPACK_BLAS_LIBS BLAS::BLAS)
endif()
elseif(WITH_MKL)
hunter_add_package(mkl)
set(BLA_VENDOR "Intel10_64lp")
find_package(BLAS REQUIRED)
if(HUNTER_ENABLED)
hunter_add_package(mkl)
set(BLA_VENDOR "Intel10_64lp")
find_package(BLAS REQUIRED)
else()
find_package(MKL CONFIG HINTS $ENV{MKLROOT})
if(MKL_FOUND)
get_property(BLAS_INCLUDE_DIRS TARGET MKL::MKL PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
get_property(BLAS_LIBRARIES TARGET MKL::MKL PROPERTY INTERFACE_LINK_LIBRARIES)
else()
find_package(BLAS REQUIRED)
endif()
endif()
find_package(LAPACK REQUIRED)
set(SuiteSparse_LINKER_LAPACK_BLAS_LIBS ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})

Expand Down
19 changes: 16 additions & 3 deletions cmake/SuiteSparse-config-install.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,22 @@ else()
# use config file which provides LAPACK (and BLAS) for us
find_dependency(LAPACK CONFIG)
else()
# try to find BLAS and LAPACK with modules
find_dependency(BLAS)
find_dependency(LAPACK)
set(_SuiteSparse_WITH_MKL @WITH_MKL@)
set(_SuiteSparse_HUNTER_ENABLED @HUNTER_ENABLED@)
if (_SuiteSparse_WITH_MKL)
if (_SuiteSparse_HUNTER_ENABLED)
# try to find BLAS and LAPACK with modules
find_dependency(BLAS)
find_dependency(LAPACK)
else()
find_package(MKL CONFIG HINTS $ENV{MKLROOT})
endif()
else()
# try to find BLAS and LAPACK with modules
find_dependency(BLAS)
find_dependency(LAPACK)
endif()

endif()
endif()

Expand Down