Skip to content

Commit

Permalink
fix mklml.so relative path (PaddlePaddle#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joejiong authored May 10, 2021
1 parent a743b27 commit c8b11ff
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmake/external/mklml.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})

0 comments on commit c8b11ff

Please sign in to comment.