CMakeLists.txt 2.1 KB
Newer Older
W
wangguibao 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14
if (NOT EXISTS
                ${CMAKE_CURRENT_LIST_DIR}/data/model/paddle/fluid/text_classification_lstm)
        execute_process(COMMAND wget
                --no-check-certificate https://paddle-serving.bj.bcebos.com/data/text_classification/text_classification_lstm.tar.gz
                --output-document
                ${CMAKE_CURRENT_LIST_DIR}/data/model/paddle/fluid/text_classification_lstm.tar.gz)

            execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf
                "${CMAKE_CURRENT_LIST_DIR}/data/model/paddle/fluid/text_classification_lstm.tar.gz"
                WORKING_DIRECTORY
                ${CMAKE_CURRENT_LIST_DIR}/data/model/paddle/fluid
                )
endif()

W
serving  
wangguibao 已提交
15 16 17
find_library(MKLML_LIBS NAMES libmklml_intel.so libiomp5.so)
include(op/CMakeLists.txt)
include(proto/CMakeLists.txt)
W
wangguibao 已提交
18 19
add_executable(serving ${serving_srcs})
add_dependencies(serving pdcodegen fluid_cpu_engine pdserving paddle_fluid
W
sdk-cpp  
wangguibao 已提交
20
        opencv_imgcodecs)
W
wangguibao 已提交
21
target_include_directories(serving PUBLIC
W
wangguibao 已提交
22
        ${CMAKE_CURRENT_BINARY_DIR}/../predictor
W
sdk-cpp  
wangguibao 已提交
23
        )
W
wangguibao 已提交
24
target_link_libraries(serving opencv_imgcodecs
W
sdk-cpp  
wangguibao 已提交
25
        ${opencv_depend_libs} -Wl,--whole-archive fluid_cpu_engine
W
serving  
wangguibao 已提交
26
        -Wl,--no-whole-archive pdserving paddle_fluid ${paddle_depend_libs}
W
sdk-cpp  
wangguibao 已提交
27
        ${MKLML_LIB} ${MKLML_IOMP_LIB} -lpthread -lcrypto -lm -lrt -lssl -ldl -lz)
28

W
wangguibao 已提交
29 30 31
install(TARGETS serving
        RUNTIME DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/serving/bin)
32 33 34 35
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/conf DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/serving/)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/data DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/serving/)
W
wangguibao 已提交
36 37 38 39 40

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

W
wangguibao 已提交
41 42 43 44 45 46
if (${WITH_MKL})
        install(FILES ${THIRD_PARTY_PATH}/install/mklml/lib/libmklml_intel.so
                ${THIRD_PARTY_PATH}/install/mklml/lib/libmklml_gnu.so
                ${THIRD_PARTY_PATH}/install/mklml/lib/libiomp5.so DESTINATION
                ${PADDLE_SERVING_INSTALL_DIR}/demo/serving/bin)
endif()