check.cmake 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Check for 32bit system
  2. if(WIN32)
  3. if(NOT CMAKE_CL_64)
  4. message("***********************Compile on non 64-bit system now**********************")
  5. add_definitions(-DNON_64_PLATFORM)
  6. if(WITH_GPU)
  7. message(FATAL_ERROR "-DWITH_GPU=ON doesn't support on non 64-bit system now.")
  8. endif()
  9. if(ENABLE_PADDLE_BACKEND)
  10. message(FATAL_ERROR "-DENABLE_PADDLE_BACKEND=ON doesn't support on non 64-bit system now.")
  11. endif()
  12. if(ENABLE_POROS_BACKEND)
  13. message(FATAL_ERROR "-DENABLE_POROS_BACKEND=ON doesn't support on non 64-bit system now.")
  14. endif()
  15. endif()
  16. endif()
  17. if(IOS)
  18. if(ENABLE_ORT_BACKEND)
  19. message(FATAL_ERROR "Not support ONNXRuntime backend for IOS now. Please set ENABLE_ORT_BACKEND=OFF.")
  20. endif()
  21. if(ENABLE_PADDLE_BACKEND)
  22. message(FATAL_ERROR "Not support Paddle backend for IOS now. Please set ENABLE_PADDLE_BACKEND=OFF.")
  23. endif()
  24. if(ENABLE_OPENVINO_BACKEND)
  25. message(FATAL_ERROR "Not support OpenVINO backend for IOS now. Please set ENABLE_OPENVINO_BACKEND=OFF.")
  26. endif()
  27. if(ENABLE_TRT_BACKEND)
  28. message(FATAL_ERROR "Not support TensorRT backend for Andorid/IOS now. Please set ENABLE_TRT_BACKEND=OFF.")
  29. endif()
  30. endif()
  31. if(WITH_GPU)
  32. if(APPLE)
  33. message(FATAL_ERROR "Cannot enable GPU while compling in Mac OSX.")
  34. elseif(IOS)
  35. message(FATAL_ERROR "Cannot enable GPU while compling in IOS.")
  36. endif()
  37. endif()
  38. if(WITH_OPENCL)
  39. if(NOT ENABLE_LITE_BACKEND)
  40. message(FATAL_ERROR "Cannot enable OpenCL while compling unless in Paddle Lite backend is enbaled.")
  41. endif()
  42. endif()