提交 da02a581 编写于 作者: T Tao Luo 提交者: Yiqun Liu

refine inference_lib_dist after code move, and add it to docker/build.sh (#8379)

* refine inference_lib_dist after code move, and add it to docker/build.sh

* remove is_directory in inference_lib.cmake
上级 5046869e
...@@ -16,12 +16,10 @@ function(copy TARGET) ...@@ -16,12 +16,10 @@ function(copy TARGET)
foreach(index RANGE ${len}) foreach(index RANGE ${len})
list(GET copy_lib_SRCS ${index} src) list(GET copy_lib_SRCS ${index} src)
list(GET copy_lib_DSTS ${index} dst) list(GET copy_lib_DSTS ${index} dst)
add_custom_command(TARGET ${TARGET} PRE_BUILD COMMAND mkdir -p "${dst}") add_custom_command(TARGET ${TARGET} PRE_BUILD
if(IS_DIRECTORY ${src}) COMMAND mkdir -p "${dst}"
add_custom_command(TARGET ${TARGET} PRE_BUILD COMMAND cp -r "${src}" "${dst}") COMMAND cp -r "${src}" "${dst}"
else() COMMENT "copying ${src} -> ${dst}")
add_custom_command(TARGET ${TARGET} PRE_BUILD COMMAND cp "${src}" "${dst}")
endif()
endforeach() endforeach()
endfunction() endfunction()
...@@ -53,11 +51,11 @@ IF(NOT PROTOBUF_FOUND) ...@@ -53,11 +51,11 @@ IF(NOT PROTOBUF_FOUND)
ENDIF(NOT PROTOBUF_FOUND) ENDIF(NOT PROTOBUF_FOUND)
# paddle fluid module # paddle fluid module
set(src_dir "${PADDLE_SOURCE_DIR}/paddle") set(src_dir "${PADDLE_SOURCE_DIR}/paddle/fluid")
set(dst_dir "${CMAKE_INSTALL_PREFIX}/paddle") set(dst_dir "${CMAKE_INSTALL_PREFIX}/paddle/fluid")
set(module "framework") set(module "framework")
copy(framework_lib DEPS framework_py_proto copy(framework_lib DEPS framework_py_proto
SRCS ${src_dir}/${module}/*.h ${src_dir}/${module}/details/*.h ${PADDLE_BINARY_DIR}/paddle/framework/framework.pb.h SRCS ${src_dir}/${module}/*.h ${src_dir}/${module}/details/*.h ${PADDLE_BINARY_DIR}/paddle/fluid/framework/framework.pb.h
DSTS ${dst_dir}/${module} ${dst_dir}/${module}/details ${dst_dir}/${module} DSTS ${dst_dir}/${module} ${dst_dir}/${module}/details ${dst_dir}/${module}
) )
...@@ -69,7 +67,7 @@ copy(memory_lib ...@@ -69,7 +67,7 @@ copy(memory_lib
set(module "inference") set(module "inference")
copy(inference_lib DEPENDS paddle_fluid_shared copy(inference_lib DEPENDS paddle_fluid_shared
SRCS ${src_dir}/${module}/*.h ${PADDLE_BINARY_DIR}/paddle/inference/libpaddle_fluid.so SRCS ${src_dir}/${module}/*.h ${PADDLE_BINARY_DIR}/paddle/fluid/inference/libpaddle_fluid.so
DSTS ${dst_dir}/${module} ${dst_dir}/${module} DSTS ${dst_dir}/${module} ${dst_dir}/${module}
) )
......
...@@ -204,6 +204,17 @@ function gen_capi_package() { ...@@ -204,6 +204,17 @@ function gen_capi_package() {
fi fi
} }
function gen_fluid_inference_lib() {
if [ ${WITH_C_API:-OFF} == "OFF" ] ; then
cat <<EOF
========================================
Building fluid inference library ...
========================================
EOF
make inference_lib_dist
fi
}
set -xe set -xe
cmake_gen ${PYTHON_ABI:-""} cmake_gen ${PYTHON_ABI:-""}
...@@ -212,6 +223,7 @@ run_test ...@@ -212,6 +223,7 @@ run_test
gen_docs gen_docs
gen_dockerfile gen_dockerfile
gen_capi_package gen_capi_package
gen_fluid_inference_lib
if [[ ${WITH_C_API:-OFF} == "ON" ]]; then if [[ ${WITH_C_API:-OFF} == "ON" ]]; then
printf "PaddlePaddle C-API libraries was generated on build/paddle.tgz\n" printf "PaddlePaddle C-API libraries was generated on build/paddle.tgz\n"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册