diff --git a/cmake/inference_lib.cmake b/cmake/inference_lib.cmake index 4c92d0ba4ff1dbdb46649f998c88c7170479d6a3..4d0e777af8cf9980282b7b88f34d35b3a1f2fff4 100644 --- a/cmake/inference_lib.cmake +++ b/cmake/inference_lib.cmake @@ -104,6 +104,11 @@ function(copy_part_of_thrid_party TARGET DST) copy(${TARGET} SRCS ${GLOG_INCLUDE_DIR} ${GLOG_LIBRARIES} DSTS ${dst_dir} ${dst_dir}/lib) + + set(dst_dir "${DST}/third_party/install/xxhash") + copy(${TARGET} + SRCS ${XXHASH_INCLUDE_DIR} ${XXHASH_LIBRARIES} + DSTS ${dst_dir} ${dst_dir}/lib) if (NOT PROTOBUF_FOUND OR WIN32) set(dst_dir "${DST}/third_party/install/protobuf") @@ -138,31 +143,6 @@ endfunction() set(inference_lib_deps third_party paddle_fluid paddle_fluid_c paddle_fluid_shared paddle_fluid_c_shared) add_custom_target(inference_lib_dist DEPENDS ${inference_lib_deps}) -set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/eigen3") -copy(inference_lib_dist - SRCS ${EIGEN_INCLUDE_DIR}/Eigen/Core ${EIGEN_INCLUDE_DIR}/Eigen/src ${EIGEN_INCLUDE_DIR}/unsupported/Eigen - DSTS ${dst_dir}/Eigen ${dst_dir}/Eigen ${dst_dir}/unsupported) - -set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/boost") -copy(inference_lib_dist - SRCS ${BOOST_INCLUDE_DIR}/boost - DSTS ${dst_dir}) - -set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/dlpack") -copy(inference_lib_dist - SRCS ${DLPACK_INCLUDE_DIR}/dlpack - DSTS ${dst_dir}) - -set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/xxhash") -copy(inference_lib_dist - SRCS ${XXHASH_INCLUDE_DIR} ${XXHASH_LIBRARIES} - DSTS ${dst_dir} ${dst_dir}/lib) - -set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/zlib") -copy(inference_lib_dist - SRCS ${ZLIB_INCLUDE_DIR} ${ZLIB_LIBRARIES} - DSTS ${dst_dir} ${dst_dir}/lib) - copy(inference_lib_dist SRCS ${CMAKE_CURRENT_BINARY_DIR}/CMakeCache.txt DSTS ${FLUID_INFERENCE_INSTALL_DIR}) @@ -253,6 +233,26 @@ copy(fluid_lib_dist DSTS ${dst_dir}/${module} ) +set(dst_dir "${FLUID_INSTALL_DIR}/third_party/eigen3") +copy(inference_lib_dist + SRCS ${EIGEN_INCLUDE_DIR}/Eigen/Core ${EIGEN_INCLUDE_DIR}/Eigen/src ${EIGEN_INCLUDE_DIR}/unsupported/Eigen + DSTS ${dst_dir}/Eigen ${dst_dir}/Eigen ${dst_dir}/unsupported) + +set(dst_dir "${FLUID_INSTALL_DIR}/third_party/boost") +copy(inference_lib_dist + SRCS ${BOOST_INCLUDE_DIR}/boost + DSTS ${dst_dir}) + +set(dst_dir "${FLUID_INSTALL_DIR}/third_party/dlpack") +copy(inference_lib_dist + SRCS ${DLPACK_INCLUDE_DIR}/dlpack + DSTS ${dst_dir}) + +set(dst_dir "${FLUID_INSTALL_DIR}/third_party/install/zlib") +copy(inference_lib_dist + SRCS ${ZLIB_INCLUDE_DIR} ${ZLIB_LIBRARIES} + DSTS ${dst_dir} ${dst_dir}/lib) + # CMakeCache Info copy(fluid_lib_dist SRCS ${FLUID_INFERENCE_INSTALL_DIR}/third_party ${CMAKE_CURRENT_BINARY_DIR}/CMakeCache.txt diff --git a/paddle/fluid/inference/api/demo_ci/CMakeLists.txt b/paddle/fluid/inference/api/demo_ci/CMakeLists.txt index f6c4bed79f2be3a66e15af85acc465d72ecdb17f..255a1bf33e2fa1608b28e6923b0de463f440e4be 100644 --- a/paddle/fluid/inference/api/demo_ci/CMakeLists.txt +++ b/paddle/fluid/inference/api/demo_ci/CMakeLists.txt @@ -32,11 +32,7 @@ include_directories("${PADDLE_LIB_THIRD_PARTY_PATH}protobuf/include") include_directories("${PADDLE_LIB_THIRD_PARTY_PATH}glog/include") include_directories("${PADDLE_LIB_THIRD_PARTY_PATH}gflags/include") include_directories("${PADDLE_LIB_THIRD_PARTY_PATH}xxhash/include") -include_directories("${PADDLE_LIB_THIRD_PARTY_PATH}zlib/include") -include_directories("${PADDLE_LIB}/third_party/boost") -include_directories("${PADDLE_LIB}/third_party/eigen3") -link_directories("${PADDLE_LIB_THIRD_PARTY_PATH}zlib/lib") link_directories("${PADDLE_LIB_THIRD_PARTY_PATH}protobuf/lib") link_directories("${PADDLE_LIB_THIRD_PARTY_PATH}glog/lib") link_directories("${PADDLE_LIB_THIRD_PARTY_PATH}gflags/lib") @@ -137,12 +133,12 @@ if (NOT WIN32) set(EXTERNAL_LIB "-lrt -ldl -lpthread") set(DEPS ${DEPS} ${MATH_LIB} ${MKLDNN_LIB} ${NGRAPH_LIB} - glog gflags protobuf z xxhash + glog gflags protobuf xxhash ${EXTERNAL_LIB}) else() set(DEPS ${DEPS} ${MATH_LIB} ${MKLDNN_LIB} - glog gflags_static libprotobuf zlibstatic xxhash ${EXTERNAL_LIB}) + glog gflags_static libprotobuf xxhash ${EXTERNAL_LIB}) set(DEPS ${DEPS} libcmt shlwapi.lib) endif(NOT WIN32)