CMakeLists.txt 2.2 KB
Newer Older
W
wangjiawei04 已提交
1
include_directories(SYSTEM  ${CMAKE_CURRENT_LIST_DIR}/../../)
2 3 4
include(op/CMakeLists.txt)
include(proto/CMakeLists.txt)
add_executable(serving ${serving_srcs})
5
add_dependencies(serving pdcodegen fluid_cpu_engine pdserving paddle_fluid cube-api utils)
6 7 8
if (WITH_GPU)
    add_dependencies(serving fluid_gpu_engine)
endif()
Z
zhangjun 已提交
9 10 11 12 13

if (WITH_LITE)
    add_dependencies(serving fluid_arm_engine)
endif()

14 15 16
target_include_directories(serving PUBLIC
        ${CMAKE_CURRENT_BINARY_DIR}/../../core/predictor
        )
M
MRXLT 已提交
17
    include_directories(${CUDNN_ROOT}/include/)
18 19 20 21 22
if(WITH_GPU)
    target_link_libraries(serving -Wl,--whole-archive fluid_gpu_engine
            -Wl,--no-whole-archive)
endif()

Z
zhangjun 已提交
23 24 25 26 27
if(WITH_LITE)
    target_link_libraries(serving -Wl,--whole-archive fluid_arm_engine
            -Wl,--no-whole-archive)
endif()

28 29 30 31
target_link_libraries(serving -Wl,--whole-archive fluid_cpu_engine
        -Wl,--no-whole-archive)

target_link_libraries(serving paddle_fluid ${paddle_depend_libs})
W
wangjiawei04 已提交
32 33
target_link_libraries(serving brpc)
target_link_libraries(serving protobuf)
34 35
target_link_libraries(serving pdserving)
target_link_libraries(serving cube-api)
36
target_link_libraries(serving utils)
37 38 39 40 41

if(WITH_GPU)
    target_link_libraries(serving ${CUDA_LIBRARIES})
endif()

M
MRXLT 已提交
42
if(WITH_MKL OR WITH_GPU)
M
MRXLT 已提交
43 44 45
    if (WITH_TRT)
    target_link_libraries(serving -liomp5 -lmklml_intel -lpthread -lcrypto -lm -lrt -lssl -ldl -lz -lbz2)
    else()
46
    target_link_libraries(serving -liomp5 -lmklml_intel -lmkldnn -lpthread -lcrypto -lm -lrt -lssl -ldl -lz -lbz2)
M
MRXLT 已提交
47
endif()
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
else()
    target_link_libraries(serving openblas -lpthread -lcrypto -lm -lrt -lssl -ldl -lz -lbz2)
endif()

install(TARGETS serving
        RUNTIME DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/serving/bin)

FILE(GLOB inc ${CMAKE_CURRENT_BINARY_DIR}/*.pb.h)
install(FILES ${inc}
        DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/include/serving)

if (${WITH_MKL})
install(FILES
        ${CMAKE_BINARY_DIR}/third_party/install/Paddle/third_party/install/mklml/lib/libmklml_intel.so
        ${CMAKE_BINARY_DIR}/third_party/install/Paddle/third_party/install/mklml/lib/libiomp5.so
        ${CMAKE_BINARY_DIR}/third_party/install/Paddle/third_party/install/mkldnn/lib/libmkldnn.so.0
        DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/serving/bin)
endif()