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

Unify mkl-dnn patch. (#2418)

parent 66b05785
......@@ -95,11 +95,7 @@ target_link_libraries(libmkl INTERFACE ${MKL_LIBS})
set(MKLDNN_GIT_REPO_URL https://github.com/intel/mkl-dnn)
set(MKLDNN_GIT_TAG "b9ce57a")
if(NGRAPH_LIB_VERSIONING_ENABLE)
set(MKLDNN_PATCH_FILE mkldnn.patch)
else()
set(MKLDNN_PATCH_FILE mkldnn_no_so_link.patch)
endif()
set(MKLDNN_PATCH_FILE mkldnn.patch)
set(MKLDNN_LIBS ${EXTERNAL_PROJECTS_ROOT}/mkldnn/lib/libmkldnn${CMAKE_SHARED_LIBRARY_SUFFIX})
if (WIN32)
......@@ -128,6 +124,7 @@ if (WIN32)
-DCMAKE_INSTALL_PREFIX=${EXTERNAL_PROJECTS_ROOT}/mkldnn
-DMKLDNN_ENABLE_CONCURRENT_EXEC=ON
-DMKLROOT=${MKL_ROOT}
-DMKLDNN_LIB_VERSIONING_ENABLE=${NGRAPH_LIB_VERSIONING_ENABLE}
TMP_DIR "${EXTERNAL_PROJECTS_ROOT}/mkldnn/tmp"
STAMP_DIR "${EXTERNAL_PROJECTS_ROOT}/mkldnn/stamp"
DOWNLOAD_DIR "${EXTERNAL_PROJECTS_ROOT}/mkldnn/download"
......@@ -162,6 +159,7 @@ else()
-DCMAKE_INSTALL_PREFIX=${EXTERNAL_PROJECTS_ROOT}/mkldnn
-DMKLDNN_ENABLE_CONCURRENT_EXEC=ON
-DMKLROOT=${MKL_ROOT}
-DMKLDNN_LIB_VERSIONING_ENABLE=${NGRAPH_LIB_VERSIONING_ENABLE}
"-DARCH_OPT_FLAGS=-march=${NGRAPH_TARGET_ARCH} -mtune=${NGRAPH_TARGET_ARCH}"
TMP_DIR "${EXTERNAL_PROJECTS_ROOT}/mkldnn/tmp"
STAMP_DIR "${EXTERNAL_PROJECTS_ROOT}/mkldnn/stamp"
......
diff --git a/cmake/OpenMP.cmake b/cmake/OpenMP.cmake
index f9c3620e..ed1ad6c2 100644
index f9c3620e..ccfefe4f 100644
--- a/cmake/OpenMP.cmake
+++ b/cmake/OpenMP.cmake
@@ -30,14 +30,19 @@ if (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
@@ -30,14 +30,18 @@ if (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# But we still want to build the library.
set(_omp_severity "WARNING")
else()
......@@ -21,15 +21,14 @@ index f9c3620e..ed1ad6c2 100644
+ if (OpenMP_CXX_FOUND)
+ set(CMAKE_CXX_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS ${OpenMP_CXX_FLAGS})
+ endif()
+
if (NOT APPLE)
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed")
endif()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 83ed499a..3dc4fcf4 100644
index 83ed499a..05721370 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -98,6 +98,10 @@ else()
@@ -98,10 +98,16 @@ else()
set(CTESTCONFIG_PATH "${CTESTCONFIG_PATH}\;${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE)
endif()
target_link_libraries(${TARGET_NAME} ${${TARGET_NAME}_LINKER_LIBS} ${EXTRA_LIBS})
......@@ -39,4 +38,12 @@ index 83ed499a..3dc4fcf4 100644
+endif()
set_property(TARGET ${TARGET_NAME} PROPERTY CXX_STANDARD 11)
set_property(TARGET ${TARGET_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
set_property(TARGET ${TARGET_NAME} PROPERTY VERSION "${PROJECT_VERSION}.0")
-set_property(TARGET ${TARGET_NAME} PROPERTY VERSION "${PROJECT_VERSION}.0")
-set_property(TARGET ${TARGET_NAME} PROPERTY SOVERSION "0")
+if(MKLDNN_LIB_VERSIONING_ENABLE)
+ set_property(TARGET ${TARGET_NAME} PROPERTY VERSION "${PROJECT_VERSION}.0")
+ set_property(TARGET ${TARGET_NAME} PROPERTY SOVERSION "0")
+endif()
if(MINGW)
# We need to install *.dll into bin/ and *.a into lib/.
diff --git a/cmake/OpenMP.cmake b/cmake/OpenMP.cmake
index f9c3620e..ed1ad6c2 100644
--- a/cmake/OpenMP.cmake
+++ b/cmake/OpenMP.cmake
@@ -30,14 +30,19 @@ if (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# But we still want to build the library.
set(_omp_severity "WARNING")
else()
- set(_omp_severity "FATAL_ERROR")
+ set(_omp_severity "WARNING")
endif()
macro(forbid_link_compiler_omp_rt)
if (NOT WIN32)
- set_if(OpenMP_C_FOUND CMAKE_C_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS ${OpenMP_C_FLAGS})
- set_if(OpenMP_CXX_FOUND CMAKE_CXX_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS ${OpenMP_CXX_FLAGS})
+ if (OpenMP_C_FOUND)
+ set(CMAKE_C_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS ${OpenMP_C_FLAGS})
+ endif()
+ if (OpenMP_CXX_FOUND)
+ set(CMAKE_CXX_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS ${OpenMP_CXX_FLAGS})
+ endif()
+
if (NOT APPLE)
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed")
endif()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 83ed499..d7f4ea0 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -98,10 +98,12 @@ else()
set(CTESTCONFIG_PATH "${CTESTCONFIG_PATH}\;${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE)
endif()
target_link_libraries(${TARGET_NAME} ${${TARGET_NAME}_LINKER_LIBS} ${EXTRA_LIBS})
+if(NOT APPLE)
+ set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--rpath,$ORIGIN")
+ set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN")
+endif()
set_property(TARGET ${TARGET_NAME} PROPERTY CXX_STANDARD 11)
set_property(TARGET ${TARGET_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
-set_property(TARGET ${TARGET_NAME} PROPERTY VERSION "${PROJECT_VERSION}.0")
-set_property(TARGET ${TARGET_NAME} PROPERTY SOVERSION "0")
if(MINGW)
# We need to install *.dll into bin/ and *.a into lib/.
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