From 7208f440941f22afed889363a5d81ab630273604 Mon Sep 17 00:00:00 2001 From: wangguibao Date: Thu, 19 Sep 2019 15:44:31 +0800 Subject: [PATCH] Fix mklml lib --- cmake/paddlepaddle.cmake | 8 ++++++++ cube/cube-builder/CMakeLists.txt | 1 + demo-serving/CMakeLists.txt | 7 +------ inferencer-fluid-cpu/CMakeLists.txt | 2 +- inferencer-fluid-gpu/CMakeLists.txt | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cmake/paddlepaddle.cmake b/cmake/paddlepaddle.cmake index 6f2ead23..46f172dd 100644 --- a/cmake/paddlepaddle.cmake +++ b/cmake/paddlepaddle.cmake @@ -76,7 +76,15 @@ SET_PROPERTY(TARGET snappystream PROPERTY IMPORTED_LOCATION ${BINARY_DIR}/fluid_ ADD_LIBRARY(xxhash STATIC IMPORTED GLOBAL) SET_PROPERTY(TARGET xxhash PROPERTY IMPORTED_LOCATION ${BINARY_DIR}/fluid_install_dir/third_party/install/xxhash/lib/libxxhash.a) +ADD_LIBRARY(iomp5 SHARED IMPORTED GLOBAL) +SET_PROPERTY(TARGET iomp5 PROPERTY IMPORTED_LOCATION ${BINARY_DIR}/fluid_install_dir/third_party/install/mklml/lib/libiomp5.so) + +ADD_LIBRARY(mklml_intel SHARED IMPORTED GLOBAL) +SET_PROPERTY(TARGET mklml_intel PROPERTY IMPORTED_LOCATION ${BINARY_DIR}/fluid_install_dir/third_party/install/mklml/lib/libmklml_intel.so) + LIST(APPEND paddle_depend_libs snappystream snappy + iomp5 + mklml_intel xxhash) diff --git a/cube/cube-builder/CMakeLists.txt b/cube/cube-builder/CMakeLists.txt index 31d40949..2048e24f 100755 --- a/cube/cube-builder/CMakeLists.txt +++ b/cube/cube-builder/CMakeLists.txt @@ -32,6 +32,7 @@ add_dependencies(cube-builder jsoncpp) set(DYNAMIC_LIB gflags jsoncpp + brpc -lssl -lcrypto ${CURL_LIB} diff --git a/demo-serving/CMakeLists.txt b/demo-serving/CMakeLists.txt index 64918279..7db1ce01 100644 --- a/demo-serving/CMakeLists.txt +++ b/demo-serving/CMakeLists.txt @@ -26,11 +26,6 @@ endif() include_directories(SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../kvdb/include) -find_library(MKLML_LIB NAMES libmklml_intel.so PATHS - ${CMAKE_BINARY_DIR}/Paddle/third_party/install/mklml/lib/) -find_library(MKLML_IOMP_LIB NAMES libiomp5.so PATHS - ${CMAKE_BINARY_DIR}/Paddle/third_party/install/mklml/lib) - include(op/CMakeLists.txt) include(proto/CMakeLists.txt) add_executable(serving ${serving_srcs}) @@ -64,7 +59,7 @@ target_link_libraries(serving kvdb rocksdb) if(WITH_GPU) target_link_libraries(serving ${CUDA_LIBRARIES}) endif() -target_link_libraries(serving ${MKLML_LIB} ${MKLML_IOMP_LIB} -lpthread +target_link_libraries(serving iomp5 mklml_intel -lpthread -lcrypto -lm -lrt -lssl -ldl -lz -lbz2) install(TARGETS serving diff --git a/inferencer-fluid-cpu/CMakeLists.txt b/inferencer-fluid-cpu/CMakeLists.txt index f52f59f6..9f892988 100644 --- a/inferencer-fluid-cpu/CMakeLists.txt +++ b/inferencer-fluid-cpu/CMakeLists.txt @@ -3,7 +3,7 @@ add_library(fluid_cpu_engine ${fluid_cpu_engine_srcs}) target_include_directories(fluid_cpu_engine PUBLIC ${CMAKE_BINARY_DIR}/Paddle/fluid_install_dir/) add_dependencies(fluid_cpu_engine pdserving extern_paddle configure) -target_link_libraries(fluid_cpu_engine pdserving paddle_fluid -liomp5 -lmklml_intel -lpthread -lcrypto -lm -lrt -lssl -ldl -lz) +target_link_libraries(fluid_cpu_engine pdserving paddle_fluid iomp5 mklml_intel -lpthread -lcrypto -lm -lrt -lssl -ldl -lz) install(TARGETS fluid_cpu_engine ARCHIVE DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/lib diff --git a/inferencer-fluid-gpu/CMakeLists.txt b/inferencer-fluid-gpu/CMakeLists.txt index 0cd16298..725da85b 100644 --- a/inferencer-fluid-gpu/CMakeLists.txt +++ b/inferencer-fluid-gpu/CMakeLists.txt @@ -3,7 +3,7 @@ add_library(fluid_gpu_engine ${fluid_gpu_engine_srcs}) target_include_directories(fluid_gpu_engine PUBLIC ${CMAKE_BINARY_DIR}/Paddle/fluid_install_dir/) add_dependencies(fluid_gpu_engine pdserving extern_paddle configure) -target_link_libraries(fluid_gpu_engine pdserving paddle_fluid -liomp5 -lmklml_intel -lpthread -lcrypto -lm -lrt -lssl -ldl -lz) +target_link_libraries(fluid_gpu_engine pdserving paddle_fluid iomp5 mklml_intel -lpthread -lcrypto -lm -lrt -lssl -ldl -lz) install(TARGETS fluid_gpu_engine ARCHIVE DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/lib -- GitLab