From f96d31d5525a42637bdf0a04ebfdc09b5d32fa62 Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Thu, 21 Sep 2017 23:28:55 +0800 Subject: [PATCH] only link iomp when with MKLDNN and MKLML --- cmake/util.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/util.cmake b/cmake/util.cmake index e814cad36f..3aaa055c3b 100644 --- a/cmake/util.cmake +++ b/cmake/util.cmake @@ -97,6 +97,10 @@ function(link_paddle_exe TARGET_NAME) target_link_libraries(${TARGET_NAME} log) endif(ANDROID) + if(WITH_MKLDNN AND WITH_MKLML AND MKLDNN_IOMP_DIR) + target_link_libraries(${TARGET_NAME} "-L${MKLDNN_IOMP_DIR} -liomp5 -Wl,--as-needed") + endif() + add_dependencies(${TARGET_NAME} ${external_project_dependencies}) endfunction() -- GitLab