You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 1.4 kB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
1234567891011121314151617181920212223242526272829303132
  1. # This branch assumes that gRPC and all its dependencies are already installed
  2. # on this system, so they can be located by find_package().
  3. # Find Protobuf installation
  4. # Looks for protobuf-config.cmake file installed by Protobuf's cmake installation.
  5. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-rpath,$ORIGIN:$ORIGIN/lib")
  6. # python ut
  7. add_compile_definitions(ENABLE_PYTHON)
  8. file(GLOB_RECURSE PY_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "../../../mindspore_serving/ccsrc/python/*.cc")
  9. find_package(Python3 3.7 COMPONENTS Interpreter Development)
  10. if(Python3_FOUND)
  11. set(PYTHON_INCLUDE_DIRS "${Python3_INCLUDE_DIRS}")
  12. set(PYTHON_LIBRARIES "${Python3_LIBRARIES}")
  13. else()
  14. find_python_package(py_inc py_lib)
  15. set(PYTHON_INCLUDE_DIRS "${py_inc}")
  16. set(PYTHON_LIBRARIES "${py_lib}")
  17. endif()
  18. include_directories(${PYTHON_INCLUDE_DIRS})
  19. set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/mindspore_serving)
  20. pybind11_add_module(_mindspore_serving ${PY_SRC_LIST})
  21. target_link_libraries(_mindspore_serving PRIVATE serving_common)
  22. target_link_libraries(_mindspore_serving PRIVATE "${PYTHON_LIBRARIES}")
  23. target_include_directories(_mindspore_serving PRIVATE ${pybind11_INCLUDE_DIRS})
  24. target_link_options(_mindspore_serving PRIVATE -Wl,-init,mindspore_serving_log_init)
  25. # disable auto rpath
  26. set_target_properties(_mindspore_serving PROPERTIES SKIP_BUILD_RPATH TRUE)

A lightweight and high-performance service module that helps MindSpore developers efficiently deploy online inference services in the production environment.