提交 a7e23a4c 编写于 作者: T tensor-tang

fix link error static to shared

上级 f6dd8ae1
...@@ -145,7 +145,7 @@ if(WITH_GPU) ...@@ -145,7 +145,7 @@ if(WITH_GPU)
endif(WITH_GPU) endif(WITH_GPU)
if(WITH_MKLDNN) if(WITH_MKLDNN)
list(APPEND EXTERNAL_LIBS ${MKLDNN_LIBRARY} ${MKLML_LIB_IOMP}) list(APPEND EXTERNAL_LIBS ${MKLDNN_LIBRARY} ${MKLDNN_IOMP_LIB})
endif() endif()
if(USE_NNPACK) if(USE_NNPACK)
......
...@@ -41,6 +41,7 @@ INCLUDE_DIRECTORIES(${MKLDNN_INCLUDE_DIR}) ...@@ -41,6 +41,7 @@ INCLUDE_DIRECTORIES(${MKLDNN_INCLUDE_DIR})
IF(${CBLAS_PROVIDER} STREQUAL "MKLML") IF(${CBLAS_PROVIDER} STREQUAL "MKLML")
SET(MKLDNN_DEPENDS ${MKLML_PROJECT}) SET(MKLDNN_DEPENDS ${MKLML_PROJECT})
SET(MKLDNN_MKLROOT ${MKLML_ROOT}) SET(MKLDNN_MKLROOT ${MKLML_ROOT})
SET(MKLDNN_IOMP_LIB ${MKLML_IOMP_LIB})
SET(MKLDNN_IOMP_DIR ${MKLML_LIB_DIR}) SET(MKLDNN_IOMP_DIR ${MKLML_LIB_DIR})
ENDIF() ENDIF()
...@@ -59,7 +60,7 @@ ExternalProject_Add( ...@@ -59,7 +60,7 @@ ExternalProject_Add(
UPDATE_COMMAND "" UPDATE_COMMAND ""
) )
ADD_LIBRARY(mkldnn STATIC IMPORTED GLOBAL) ADD_LIBRARY(mkldnn SHARED IMPORTED GLOBAL)
SET_PROPERTY(TARGET mkldnn PROPERTY IMPORTED_LOCATION ${MKLDNN_LIBRARY}) SET_PROPERTY(TARGET mkldnn PROPERTY IMPORTED_LOCATION ${MKLDNN_LIBRARY})
ADD_DEPENDENCIES(mkldnn ${MKLDNN_PROJECT}) ADD_DEPENDENCIES(mkldnn ${MKLDNN_PROJECT})
MESSAGE(STATUS "Mkldnn library: ${MKLDNN_LIBRARY}") MESSAGE(STATUS "Mkldnn library: ${MKLDNN_LIBRARY}")
......
...@@ -48,14 +48,7 @@ ExternalProject_Add( ...@@ -48,14 +48,7 @@ ExternalProject_Add(
TEST_COMMAND "" TEST_COMMAND ""
) )
IF (${CMAKE_VERSION} VERSION_LESS "3.3.0") ADD_LIBRARY(mklml SHARED IMPORTED GLOBAL)
SET(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/mklml_dummy.c) SET_PROPERTY(TARGET mklml PROPERTY IMPORTED_LOCATION ${MKLML_LIB})
FILE(WRITE ${dummyfile} "const char * dummy_mklml = \"${dummyfile}\";")
ADD_LIBRARY(mklml STATIC ${dummyfile})
ELSE()
ADD_LIBRARY(mklml INTERFACE)
ENDIF()
ADD_DEPENDENCIES(mklml ${MKLML_PROJECT}) ADD_DEPENDENCIES(mklml ${MKLML_PROJECT})
LIST(APPEND external_project_dependencies mklml) LIST(APPEND external_project_dependencies mklml)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册