From c8b11ff1d783f53fa971a62e92b882dd547d934a Mon Sep 17 00:00:00 2001 From: joejiong Date: Mon, 10 May 2021 10:54:46 +0800 Subject: [PATCH] fix mklml.so relative path (#377) --- cmake/external/mklml.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/external/mklml.cmake b/cmake/external/mklml.cmake index 06bc991d93c469..80f6e0766eabf3 100644 --- a/cmake/external/mklml.cmake +++ b/cmake/external/mklml.cmake @@ -70,8 +70,14 @@ ExternalProject_Add( ${CMAKE_COMMAND} -E copy_directory ${MKLML_DOWNLOAD_DIR}/lib ${MKLML_LIB_DIR} ) + INCLUDE_DIRECTORIES(${MKLML_INC_DIR}) -ADD_LIBRARY(mklml SHARED IMPORTED GLOBAL) -SET_PROPERTY(TARGET mklml PROPERTY IMPORTED_LOCATION ${MKLML_LIB}) +SET(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/mklml_dummy.c) + +FILE(WRITE ${dummyfile} "const char * dummy = \"${dummyfile}\";") +ADD_LIBRARY(mklml STATIC ${dummyfile}) + +TARGET_LINK_LIBRARIES(mklml ${MKLML_LIB} ${MKLML_IOMP_LIB}) ADD_DEPENDENCIES(mklml ${MKLML_PROJECT}) +