CMakeLists.txt 7.4 KB
Newer Older
W
wangguibao 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
if (NOT EXISTS
                ${CMAKE_CURRENT_LIST_DIR}/data/text_classification/test_set.txt)
        execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory
                ${CMAKE_CURRENT_LIST_DIR}/data/text_classification)
        execute_process(COMMAND wget
                --no-check-certificate
                https://paddle-serving.bj.bcebos.com/data/text_classification/test_set.tar.gz
                --output-document
                ${CMAKE_CURRENT_LIST_DIR}/data/text_classification/test_set.tar.gz)

            execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf
                "${CMAKE_CURRENT_LIST_DIR}/data/text_classification/test_set.tar.gz"
                WORKING_DIRECTORY
                ${CMAKE_CURRENT_LIST_DIR}/data/text_classification
                )
endif()

add_executable(ximage ${CMAKE_CURRENT_LIST_DIR}/src/ximage.cpp)
target_link_libraries(ximage -Wl,--whole-archive sdk-cpp
               -Wl,--no-whole-archive -lpthread -lcrypto -lm -lrt -lssl -ldl
        -lz)

W
wangguibao 已提交
23 24 25 26 27
add_executable(ximage_press ${CMAKE_CURRENT_LIST_DIR}/src/ximage_press.cpp)
target_link_libraries(ximage_press -Wl,--whole-archive sdk-cpp
               -Wl,--no-whole-archive -lpthread -lcrypto -lm -lrt -lssl -ldl
        -lz)

G
guru4elephant 已提交
28 29 30 31 32
add_executable(load_general_model ${CMAKE_CURRENT_LIST_DIR}/src/load_general_model.cpp)
target_link_libraries(load_general_model -Wl,--whole-archive sdk-cpp -Wl,--no-whole-archive
        -lpthread -lcrypto -lm -lrt -lssl -ldl
        -lz)

G
guru4elephant 已提交
33
add_library(paddle_serving_client SHARED src/general_model.cpp src/pybind_general_model.cpp)
G
guru4elephant 已提交
34
target_link_libraries(paddle_serving_client brpc configure protobuf leveldb pybind python -lcrypto
G
guru4elephant 已提交
35 36
        -lssl -lz -lrt)

G
guru4elephant 已提交
37 38 39 40 41
add_executable(general_model_main ${CMAKE_CURRENT_LIST_DIR}/src/general_model_main.cpp)
target_link_libraries(general_model_main -Wl,--whole-archive sdk-cpp paddle_serving_client -Wl,--no-whole-archive
        -lpthread -lcrypto -lm -lrt -lssl -ldl
	-lz)

W
wangguibao 已提交
42 43 44 45 46
add_executable(echo ${CMAKE_CURRENT_LIST_DIR}/src/echo.cpp)
target_link_libraries(echo -Wl,--whole-archive sdk-cpp -Wl,--no-whole-archive
        -lpthread -lcrypto -lm -lrt -lssl -ldl
        -lz)

47 48 49 50 51
add_executable(echo_kvdb ${CMAKE_CURRENT_LIST_DIR}/src/echo_kvdb.cpp)
target_link_libraries(echo_kvdb -Wl,--whole-archive sdk-cpp -Wl,--no-whole-archive
        -lpthread -lcrypto -lm -lrt -lssl -ldl
         -lz)

W
wangguibao 已提交
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
add_executable(dense_format ${CMAKE_CURRENT_LIST_DIR}/src/dense_format.cpp)
target_link_libraries(dense_format -Wl,--whole-archive sdk-cpp -Wl,--no-whole-archive -lpthread -lcrypto -lm -lrt -lssl -ldl
        -lz)

add_executable(sparse_format ${CMAKE_CURRENT_LIST_DIR}/src/sparse_format.cpp)
target_link_libraries(sparse_format -Wl,--whole-archive sdk-cpp -Wl,--no-whole-archive -lpthread -lcrypto -lm -lrt -lssl -ldl
        -lz)

add_executable(int64tensor_format ${CMAKE_CURRENT_LIST_DIR}/src/int64tensor_format.cpp)
target_link_libraries(int64tensor_format -Wl,--whole-archive sdk-cpp -Wl,--no-whole-archive -lpthread -lcrypto -lm -lrt -lssl -ldl
        -lz)

add_executable(text_classification
        ${CMAKE_CURRENT_LIST_DIR}/src/text_classification.cpp)
target_link_libraries(text_classification -Wl,--whole-archive sdk-cpp -Wl,--no-whole-archive -lpthread -lcrypto -lm -lrt -lssl -ldl
        -lz)

add_executable(text_classification_press
        ${CMAKE_CURRENT_LIST_DIR}/src/text_classification_press.cpp)
target_link_libraries(text_classification_press -Wl,--whole-archive sdk-cpp -Wl,--no-whole-archive -lpthread -lcrypto -lm -lrt -lssl -ldl
        -lz)

X
xulongteng 已提交
74 75 76 77
add_executable(ctr_prediction
        ${CMAKE_CURRENT_LIST_DIR}/src/ctr_prediction.cpp)
target_link_libraries(ctr_prediction -Wl,--whole-archive sdk-cpp
        -Wl,--no-whole-archive -lpthread -lcrypto -lm -lrt -lssl -ldl -lz)
M
MRXLT 已提交
78 79 80 81 82 83

add_executable(bert
    ${CMAKE_CURRENT_LIST_DIR}/src/bert_service.cpp)
target_link_libraries(bert -Wl,--whole-archive sdk-cpp 
    -Wl,--no-whole-archive -lpthread -lcrypto -lm -lrt -lssl -ldl -lz)
    
W
wangguibao 已提交
84 85 86 87
# install
install(TARGETS ximage
        RUNTIME DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/client/image_classification/bin)
W
wangguibao 已提交
88 89 90
install(TARGETS ximage_press
        RUNTIME DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/client/image_classification/bin)
W
wangguibao 已提交
91 92 93 94 95 96 97 98 99
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/conf DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/client/image_classification/)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/data/images DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/client/image_classification/data)

install(TARGETS echo
        RUNTIME DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/demo/client/echo/bin)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/conf DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/client/echo/)
100 101 102 103
install(FILES ${CMAKE_CURRENT_LIST_DIR}/python/echo.py
        DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/demo/client/echo/python)
install(FILES ${CMAKE_CURRENT_LIST_DIR}/php/echo.php
        DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/demo/client/echo/php)
W
wangguibao 已提交
104

105 106 107 108 109
install(TARGETS echo_kvdb
        RUNTIME DESTINATION ${PADDLE_SERVING_INSTALL_DIR}/demo/client/echo_kvdb/bin)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/conf DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/client/echo_kvdb/)

W
wangguibao 已提交
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
install(TARGETS dense_format
        RUNTIME DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/client/dense_format/bin)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/conf DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/client/dense_format/)

install(TARGETS sparse_format
        RUNTIME DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/client/sparse_format/bin)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/conf DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/client/sparse_format/)

install(TARGETS int64tensor_format
        RUNTIME DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/client/int64tensor_format/bin)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/conf DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/client/int64tensor_format/)

install(TARGETS text_classification text_classification_press
        RUNTIME DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/client/text_classification/bin)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/conf DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/client/text_classification/)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/data/text_classification DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/client/text_classification/data)
135 136 137 138 139 140 141 142
install(FILES ${CMAKE_CURRENT_LIST_DIR}/python/text_classification.py
        DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/client/text_classification/python)
install(FILES ${CMAKE_CURRENT_LIST_DIR}/php/text_classification.php
        DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/client/text_classification/php)


X
xulongteng 已提交
143 144 145 146 147 148 149 150

install(TARGETS ctr_prediction
        RUNTIME DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/client/ctr_prediction/bin)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/conf DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/client/ctr_prediction/)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/data/ctr_prediction DESTINATION
        ${PADDLE_SERVING_INSTALL_DIR}/demo/client/ctr_prediction/data)
M
MRXLT 已提交
151 152 153 154 155 156 157 158

install(TARGETS bert
    RUNTIME DESTINATION
    ${PADDLE_SERVING_INSTALL_DIR}/demo/client/bert/bin)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/conf DESTINATION
    ${PADDLE_SERVING_INSTALL_DIR}/demo/client/bert/)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/data/bert DESTINATION
    ${PADDLE_SERVING_INSTALL_DIR}/demo/client/bert/data)