Commit f21eeb8d authored by Sang Ik Lee's avatar Sang Ik Lee Committed by Robert Kimball

Allow external mklml outside of prebuilt mkldnn install directory. (#2291)

* Allow external mklml outside of prebuilt mkldnn install directory.

* Limit prebuilt mkl-dnn support to Linux.
parent 5ecab1ad
...@@ -21,6 +21,12 @@ include(ExternalProject) ...@@ -21,6 +21,12 @@ include(ExternalProject)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
if(MKLDNN_INCLUDE_DIR AND MKLDNN_LIB_DIR) if(MKLDNN_INCLUDE_DIR AND MKLDNN_LIB_DIR)
if(NOT LINUX)
message(FATAL_ERROR "Unsupported platform for prebuilt mkl-dnn!")
endif()
if(NOT MKLML_LIB_DIR)
set(MKLML_LIB_DIR ${MKLDNN_LIB_DIR})
endif()
ExternalProject_Add( ExternalProject_Add(
ext_mkldnn ext_mkldnn
DOWNLOAD_COMMAND "" DOWNLOAD_COMMAND ""
...@@ -33,11 +39,11 @@ if(MKLDNN_INCLUDE_DIR AND MKLDNN_LIB_DIR) ...@@ -33,11 +39,11 @@ if(MKLDNN_INCLUDE_DIR AND MKLDNN_LIB_DIR)
target_include_directories(libmkldnn SYSTEM INTERFACE ${MKLDNN_INCLUDE_DIR}) target_include_directories(libmkldnn SYSTEM INTERFACE ${MKLDNN_INCLUDE_DIR})
target_link_libraries(libmkldnn INTERFACE target_link_libraries(libmkldnn INTERFACE
${MKLDNN_LIB_DIR}/libmkldnn.so ${MKLDNN_LIB_DIR}/libmkldnn.so
${MKLDNN_LIB_DIR}/libmklml_intel.so ${MKLML_LIB_DIR}/libmklml_intel.so
${MKLDNN_LIB_DIR}/libiomp5.so ${MKLML_LIB_DIR}/libiomp5.so
) )
install(DIRECTORY ${MKLDNN_LIB_DIR}/ DESTINATION ${NGRAPH_INSTALL_LIB}) install(FILES ${MKLDNN_LIB_DIR}/libmkldnn.so ${MKLML_LIB_DIR}/libmklml_intel.so ${MKLML_LIB_DIR}/libiomp5.so DESTINATION ${NGRAPH_INSTALL_LIB})
return() return()
endif() endif()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment