From 11ed2f2f93edd955cbb1d253d1c7fbeda3048191 Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Fri, 5 Jan 2018 23:04:57 +0800 Subject: [PATCH] package right mkldnn and mklml libs if enabled in capi --- cmake/external/mkldnn.cmake | 5 +++++ cmake/external/mklml.cmake | 4 ++++ paddle/scripts/docker/build.sh | 9 --------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmake/external/mkldnn.cmake b/cmake/external/mkldnn.cmake index b67c559fdf7..471de3858a5 100644 --- a/cmake/external/mkldnn.cmake +++ b/cmake/external/mkldnn.cmake @@ -77,3 +77,8 @@ FILE(WRITE ${dummyfile} "const char * dummy = \"${dummyfile}\";") ADD_LIBRARY(mkldnn STATIC ${dummyfile}) TARGET_LINK_LIBRARIES(mkldnn ${MKLDNN_LIB} ${MKLML_LIB} ${MKLML_IOMP_LIB}) ADD_DEPENDENCIES(mkldnn ${MKLDNN_PROJECT}) + +IF(WITH_C_API) + INSTALL(FILES ${MKLDNN_LIB} DESTINATION lib) +ENDIF() + diff --git a/cmake/external/mklml.cmake b/cmake/external/mklml.cmake index 20dbc32a738..15a07ea3daf 100644 --- a/cmake/external/mklml.cmake +++ b/cmake/external/mklml.cmake @@ -66,3 +66,7 @@ ADD_LIBRARY(mklml SHARED IMPORTED GLOBAL) SET_PROPERTY(TARGET mklml PROPERTY IMPORTED_LOCATION ${MKLML_LIB}) ADD_DEPENDENCIES(mklml ${MKLML_PROJECT}) LIST(APPEND external_project_dependencies mklml) + +IF(WITH_C_API) + INSTALL(FILES ${MKLML_LIB} ${MKLML_IOMP_LIB} DESTINATION lib) +ENDIF() diff --git a/paddle/scripts/docker/build.sh b/paddle/scripts/docker/build.sh index 12fd7b1bdaf..e70d04d9017 100644 --- a/paddle/scripts/docker/build.sh +++ b/paddle/scripts/docker/build.sh @@ -197,16 +197,7 @@ function gen_capi_package() { if [[ ${WITH_C_API} == "ON" ]]; then install_prefix="/paddle/build/capi_output" rm -rf $install_prefix - make DESTDIR="$install_prefix" install - - if [[ ${WITH_MKL:-OFF} == "ON" ]]; then - find ./third_party/install -name 'libmklml_gnu.so' -exec cp {} $install_prefix/usr/local/lib \; - find ./third_party/install -name 'libmklml_intel.so' -exec cp {} $install_prefix/usr/local/lib \; - cp -P ./third_party/install/mkldnn/lib/* $install_prefix/usr/local/lib/ - fi - - find ./third_party/install -name 'libiomp5.so' -exec cp {} $install_prefix/usr/local/lib \; cd $install_prefix/usr/local ls | egrep -v "^Found.*item$" | xargs tar -cf /paddle/build/paddle.tgz fi -- GitLab