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.

check_requirements.cmake 1.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ## define customized find functions, print customized error messages
  2. function(find_required_package pkg_name)
  3. find_package(${pkg_name})
  4. if(NOT ${pkg_name}_FOUND)
  5. message(FATAL_ERROR "Required package ${pkg_name} not found, please install the package and try"
  6. " building mindspore_serving again.")
  7. endif()
  8. endfunction()
  9. ## find python, quit if the found python is static
  10. set(Python3_USE_STATIC_LIBS FALSE)
  11. find_package(Python3 COMPONENTS Interpreter Development)
  12. if(Python3_FOUND)
  13. message("Python3 found, version: ${Python3_VERSION}")
  14. message("Python3 library path: ${Python3_LIBRARY}")
  15. message("Python3 interpreter: ${Python3_EXECUTABLE}")
  16. elseif(Python3_LIBRARY AND Python3_EXECUTABLE AND
  17. ${Python3_VERSION} VERSION_GREATER_EQUAL "3.7.0" AND ${Python3_VERSION} VERSION_LESS "3.10.0")
  18. message(WARNING "Maybe python3 environment is broken.")
  19. message("Python3 library path: ${Python3_LIBRARY}")
  20. message("Python3 interpreter: ${Python3_EXECUTABLE}")
  21. else()
  22. message(FATAL_ERROR "Python3 not found, please install Python>=3.7.5, and set --enable-shared "
  23. "if you are building Python locally")
  24. endif()
  25. ## packages used both on windows and linux
  26. if(DEFINED ENV{MS_PATCH_PATH})
  27. find_program(Patch_EXECUTABLE patch PATHS $ENV{MS_PATCH_PATH})
  28. set(Patch_FOUND ${Patch_EXECUTABLE})
  29. else()
  30. find_package(Patch)
  31. endif()
  32. if(NOT Patch_FOUND)
  33. message(FATAL_ERROR "Patch not found, please set environment variable MS_PATCH_PATH to path where Patch is located,"
  34. " usually found in GIT_PATH/usr/bin on Windows")
  35. endif()
  36. message(PATCH_EXECUTABLE = ${Patch_EXECUTABLE})
  37. find_required_package(Threads)
  38. ## packages used on Linux
  39. if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
  40. find_required_package(OpenSSL)
  41. endif()

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