diff --git a/cmake/external/mkldnn.cmake b/cmake/external/mkldnn.cmake index b67c559fdf7a2b1695589a041cfa8fb8a9580516..471de3858a51508ec871436eed3af7941e24dd06 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 20dbc32a738d982df2d3f035206279c82c8de264..15a07ea3daf5aa606235f20288a8306966334a1a 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 12fd7b1bdaf7606f5a5e4a5087c05e45929ff2d7..e70d04d9017e9e36bbd55d6a28889d9ba7fb2a13 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