From dac938391dbe7c03444a6a49a737b257aab520de Mon Sep 17 00:00:00 2001 From: Greener Date: Mon, 1 Jul 2024 16:55:52 +0800 Subject: [PATCH] Fix MKL build issue by correctly finding and linking MKL libraries --- src/CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 84c5d291c..f567629f8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -28,6 +28,12 @@ if (WHISPER_OPENVINO) find_package(OpenVINO REQUIRED COMPONENTS Runtime) endif() +if (WHISPER_MKL) + find_package(MKL REQUIRED) + set(MKL_INCLUDE_DIRS "${MKLROOT}/include") + set(MKL_LIBRARIES "${MKLROOT}/lib/intel64") +endif() + # # libraries # @@ -134,7 +140,9 @@ if (WHISPER_OPENVINO) endif() if (WHISPER_MKL) - target_link_libraries(whisper PRIVATE MKL::MKL) + include_directories(${MKL_INCLUDE_DIRS}) + link_directories(${MKL_LIBRARIES}) + target_link_libraries(whisper PRIVATE mkl_rt) endif() if (BUILD_SHARED_LIBS)