From e71976f2219b0ada9851ce8d7ebb50c96c9491e9 Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Fri, 4 Aug 2017 17:24:57 +0800 Subject: [PATCH 1/2] remove global linker and exe from mkldnn iomp --- cmake/configure.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmake/configure.cmake b/cmake/configure.cmake index 69220e03fe8e3..2ac098954647d 100644 --- a/cmake/configure.cmake +++ b/cmake/configure.cmake @@ -74,8 +74,6 @@ if(WITH_MKLDNN) set(OPENMP_FLAGS "-fopenmp") set(CMAKE_C_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS ${OPENMP_FLAGS}) set(CMAKE_CXX_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS ${OPENMP_FLAGS}) - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${MKLDNN_IOMP_DIR} -liomp5 -Wl,--as-needed") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${MKLDNN_IOMP_DIR} -liomp5 -Wl,--as-needed") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OPENMP_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPENMP_FLAGS}") else() From 2334a17203db192eca6da03827f3d90500630778 Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Fri, 4 Aug 2017 20:06:33 +0800 Subject: [PATCH 2/2] enable MKLDNN and MKLML for unit test --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7d743e193e7d..b174831109372 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,8 +36,8 @@ include(simd) ################################ Configurations ####################################### option(WITH_GPU "Compile PaddlePaddle with NVIDIA GPU" ${CUDA_FOUND}) option(WITH_AVX "Compile PaddlePaddle with AVX intrinsics" ${AVX_FOUND}) -option(WITH_MKLDNN "Compile PaddlePaddle with mkl-dnn support." OFF) -option(WITH_MKLML "Compile PaddlePaddle with mklml package." OFF) +option(WITH_MKLDNN "Compile PaddlePaddle with mkl-dnn support." ${AVX_FOUND}) +option(WITH_MKLML "Compile PaddlePaddle with mklml package." ${AVX_FOUND}) option(WITH_DSO "Compile PaddlePaddle with dynamic linked CUDA" ON) option(WITH_TESTING "Compile PaddlePaddle with unit testing" ON) option(WITH_SWIG_PY "Compile PaddlePaddle with inference api" ON)