Skip to content

Commit

Permalink
Fix cmake MKL BLAS library finding
Browse files Browse the repository at this point in the history
Thanks to Daniel Arndt <[email protected]>
  • Loading branch information
jczhang07 committed Oct 20, 2023
1 parent 99dc492 commit 1a0b099
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmake/Modules/FindTPLMKL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ IF(TARGET MKL::MKL)
ADD_LIBRARY(KokkosKernels::MKL ALIAS MKL )
GET_TARGET_PROPERTY(LIB_TYPE ${TPL_IMPORTED_NAME} TYPE)
MESSAGE("LIB_TYPE: ${LIB_TYPE}")
SET(BLAS_LIBRARIES MKL::MKL)
# kokkoskernels_export_imported_tpl install MKL with target name MKL instead of
# MKL::MKL or KokkosKernels::MKL, so we need to install a specific ALIAS one
if(TARGET MKL)
Expand All @@ -33,6 +34,8 @@ ELSEIF (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
KOKKOSKERNELS_CREATE_IMPORTED_TPL(MKL INTERFACE COMPILE_OPTIONS -mkl LINK_OPTIONS -mkl)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TPLMKL DEFAULT_MSG KOKKOSKERNELS_HAS_MKL_ARG)
# TODO: @masterleinad: "That didn't work for me. We were missing a library search path."
SET(BLAS_LIBRARIES "mkl")
ELSEIF(WIN32)
SET(BLA_VENDOR Intel10_64lp)
FIND_PACKAGE(BLAS REQUIRED)
Expand Down Expand Up @@ -72,5 +75,6 @@ ELSE()
HEADER_PATHS
${MKL_ROOT}/include
)
SET(BLAS_LIBRARIES "mkl_intel_lp64;mkl_intel_thread;mkl_core;iomp5")
ENDIF()
ENDIF()

0 comments on commit 1a0b099

Please sign in to comment.