diff --git a/CMakeLists.txt b/CMakeLists.txt index 73843f988d00598b715ee455bb69a553455ee6dd..9c7e02382a54478fdd8047eaee7a289fb220b539 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,41 +70,41 @@ if (NOT DEFINED WITH_MKLDNN) endif() if (SERVER) -include(external/jsoncpp) -#include(external/rocksdb) + include(external/jsoncpp) + #include(external/rocksdb) endif() if (SERVER OR CLIENT) -include(external/snappy) -include(external/leveldb) -include(external/zlib) -include(external/boost) -include(external/protobuf) -include(external/brpc) -include(external/gflags) -include(external/glog) -if (WITH_PYTHON) -include(external/pybind11) -include(external/python) -endif() -include(generic) -include(flags) + include(external/snappy) + include(external/leveldb) + include(external/zlib) + include(external/boost) + include(external/protobuf) + include(external/brpc) + include(external/gflags) + include(external/glog) + if (WITH_PYTHON) + include(external/pybind11) + include(external/python) + endif() + include(generic) + include(flags) endif() if (APP) -include(external/zlib) -include(external/boost) -include(external/protobuf) -include(external/gflags) -include(external/glog) -include(external/pybind11) -include(external/python) -include(generic) + include(external/zlib) + include(external/boost) + include(external/protobuf) + include(external/gflags) + include(external/glog) + include(external/pybind11) + include(external/python) + include(generic) endif() if (SERVER) -include(external/cudnn) -include(paddlepaddle) + include(external/cudnn) + include(paddlepaddle) endif() message("paddle serving source dir: " ${PADDLE_SERVING_SOURCE_DIR}) @@ -130,16 +130,16 @@ set(EXTERNAL_LIBS ) if(SERVER) -if(WITH_MKLML) - list(APPEND EXTERNAL_LIBS ${MKLML_IOMP_LIB}) -endif() + if(WITH_MKLML) + list(APPEND EXTERNAL_LIBS ${MKLML_IOMP_LIB}) + endif() endif() if(SERVER) -if(WITH_MKLDNN) - list(APPEND EXTERNAL_LIBS ${MKLDNN_LIB}) -endif() + if(WITH_MKLDNN) + list(APPEND EXTERNAL_LIBS ${MKLDNN_LIB}) + endif() endif() if (SERVER) @@ -149,9 +149,9 @@ endif() add_subdirectory(core) if(SERVER) -add_subdirectory(paddle_inference) + add_subdirectory(paddle_inference) endif() if (WITH_PYTHON) -add_subdirectory(python) + add_subdirectory(python) endif() diff --git a/cmake/paddlepaddle.cmake b/cmake/paddlepaddle.cmake index 83e89c9b56318f8f8ed6e9de80b268b751e00553..ca40c7b5598f2cf986a52b815939702f792f24f9 100644 --- a/cmake/paddlepaddle.cmake +++ b/cmake/paddlepaddle.cmake @@ -122,24 +122,24 @@ ADD_LIBRARY(paddle_fluid SHARED IMPORTED GLOBAL) SET_PROPERTY(TARGET paddle_fluid PROPERTY IMPORTED_LOCATION ${PADDLE_INSTALL_DIR}/lib/libpaddle_fluid.so) if (WITH_TRT) -ADD_LIBRARY(nvinfer SHARED IMPORTED GLOBAL) -SET_PROPERTY(TARGET nvinfer PROPERTY IMPORTED_LOCATION ${TENSORRT_ROOT}/lib/libnvinfer.so) - -ADD_LIBRARY(nvinfer_plugin SHARED IMPORTED GLOBAL) -SET_PROPERTY(TARGET nvinfer_plugin PROPERTY IMPORTED_LOCATION ${TENSORRT_ROOT}/lib/libnvinfer_plugin.so) + ADD_LIBRARY(nvinfer SHARED IMPORTED GLOBAL) + SET_PROPERTY(TARGET nvinfer PROPERTY IMPORTED_LOCATION ${TENSORRT_ROOT}/lib/libnvinfer.so) + + ADD_LIBRARY(nvinfer_plugin SHARED IMPORTED GLOBAL) + SET_PROPERTY(TARGET nvinfer_plugin PROPERTY IMPORTED_LOCATION ${TENSORRT_ROOT}/lib/libnvinfer_plugin.so) endif() if (WITH_LITE) -ADD_LIBRARY(paddle_api_full_bundled STATIC IMPORTED GLOBAL) -SET_PROPERTY(TARGET paddle_api_full_bundled PROPERTY IMPORTED_LOCATION ${PADDLE_INSTALL_DIR}/third_party/install/lite/cxx/lib/libpaddle_api_full_bundled.a) - -if (WITH_XPU) - ADD_LIBRARY(xpuapi SHARED IMPORTED GLOBAL) - SET_PROPERTY(TARGET xpuapi PROPERTY IMPORTED_LOCATION ${PADDLE_INSTALL_DIR}/third_party/install/xpu/lib/libxpuapi.so) - - ADD_LIBRARY(xpurt SHARED IMPORTED GLOBAL) - SET_PROPERTY(TARGET xpurt PROPERTY IMPORTED_LOCATION ${PADDLE_INSTALL_DIR}/third_party/install/xpu/lib/libxpurt.so) -endif() + ADD_LIBRARY(paddle_api_full_bundled STATIC IMPORTED GLOBAL) + SET_PROPERTY(TARGET paddle_api_full_bundled PROPERTY IMPORTED_LOCATION ${PADDLE_INSTALL_DIR}/third_party/install/lite/cxx/lib/libpaddle_api_full_bundled.a) + + if (WITH_XPU) + ADD_LIBRARY(xpuapi SHARED IMPORTED GLOBAL) + SET_PROPERTY(TARGET xpuapi PROPERTY IMPORTED_LOCATION ${PADDLE_INSTALL_DIR}/third_party/install/xpu/lib/libxpuapi.so) + + ADD_LIBRARY(xpurt SHARED IMPORTED GLOBAL) + SET_PROPERTY(TARGET xpurt PROPERTY IMPORTED_LOCATION ${PADDLE_INSTALL_DIR}/third_party/install/xpu/lib/libxpurt.so) + endif() endif() ADD_LIBRARY(xxhash STATIC IMPORTED GLOBAL) @@ -151,13 +151,13 @@ LIST(APPEND paddle_depend_libs xxhash) if(WITH_LITE) -LIST(APPEND paddle_depend_libs paddle_api_full_bundled) -if(WITH_XPU) - LIST(APPEND paddle_depend_libs xpuapi xpurt) -endif() + LIST(APPEND paddle_depend_libs paddle_api_full_bundled) + if(WITH_XPU) + LIST(APPEND paddle_depend_libs xpuapi xpurt) + endif() endif() if(WITH_TRT) -LIST(APPEND paddle_depend_libs - nvinfer nvinfer_plugin) + LIST(APPEND paddle_depend_libs + nvinfer nvinfer_plugin) endif()