• paddleocr的cpp_infer在Liunx下编译部署


    sh tools/build.sh

    CMake Error at CMakeLists.txt:47 (find_package):

    Could not find a package configuration file provided by "OpenCV" with any

    of the following names:

    OpenCVConfig.cmake

    opencv-config.cmake

    Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set

    "OpenCV_DIR" to a directory containing one of the above files. If "OpenCV"

    provides a separate development package or SDK, be sure it has been

    installed.

    修改:

    1. OPENCV_DIR=opencv3.4.7/opencv3 #不在编译的build下
    2. LIB_DIR=your_paddle_inference_dir

     

    报错

    1. cc1plus: error: too many filenames given; type ‘cc1plus --helpfor usage
    2. cc1plus: fatal error: CMakeFiles/ppocr.dir/src/main.cpp.d: No such file or directory
    3. compilation terminated.
    4. make[2]: *** [CMakeFiles/ppocr.dir/src/main.cpp.o] Error 1
    5. cc1plus: error: too many filenames given; type ‘cc1plus --helpfor usage
    6. cc1plus: fatal error: CMakeFiles/ppocr.dir/src/paddleocr.cpp.d: No such file or directory
    7. compilation terminated.
    8. cc1plus: error: too many filenames given; type ‘cc1plus --helpfor usage
    9. cc1plus: error: too many filenames given; type ‘cc1plus --helpfor usage
    10. cc1plus: fatal error: CMakeFiles/ppocr.dir/src/ocr_cls.cpp.d: No such file or directory
    11. cc1plus: error: too many filenames given; type ‘cc1plus --helpfor usage
    12. compilation terminated.
    13. cc1plus: fatal error: CMakeFiles/ppocr.dir/src/preprocess_op.cpp.d: No such file or directory
    14. compilation terminated.
    15. cc1plus: error: too many filenames given; type ‘cc1plus --helpfor usage
    16. cc1plus: fatal error: CMakeFiles/ppocr.dir/src/paddlestructure.cpp.d: No such file or directory
    17. compilation terminated.
    18. cc1plus: fatal error: CMakeFiles/ppocr.dir/src/args.cpp.d: No such file or directory
    19. compilation terminated.
    20. make[2]: *** [CMakeFiles/ppocr.dir/src/paddleocr.cpp.o] Error 1cc1plus: error: too many filenames given; type ‘cc1plus --helpfor usage
    21. cc1plus: error: too many filenames given; type ‘cc1plus --helpfor usage
    22. cc1plus: error: too many filenames given; type ‘cc1plus --helpfor usage
    23. cc1plus: fatal error: CMakeFiles/ppocr.dir/src/ocr_det.cpp.d: No such file or directory
    24. cc1plus: fatal error: CMakeFiles/ppocr.dir/src/ocr_rec.cpp.d: No such file or directory
    25. make[2]: *** [CMakeFiles/ppocr.dir/src/preprocess_op.cpp.o] Error 1compilation terminated.
    26. compilation terminated.
    27. make[2]: cc1plus: fatal error: CMakeFiles/ppocr.dir/src/postprocess_op.cpp.d: No such file or directory
    28. *** [CMakeFiles/ppocr.dir/src/ocr_cls.cpp.o] Error 1
    29. compilation terminated.
    30. make[2]: *** [CMakeFiles/ppocr.dir/src/args.cpp.o] Error 1
    31. make[2]: *** [CMakeFiles/ppocr.dir/src/paddlestructure.cpp.o] Error 1
    32. cc1plus: error: too many filenames given; type ‘cc1plus --helpfor usage
    33. cc1plus: error: too many filenames given; type ‘cc1plus --helpfor usage
    34. make[2]: cc1plus: fatal error: CMakeFiles/ppocr.dir/src/structure_layout.cpp.d: No such file or directory
    35. *** [CMakeFiles/ppocr.dir/src/postprocess_op.cpp.o] Error 1
    36. compilation terminated.
    37. cc1plus: error: too many filenames given; type ‘cc1plus --helpfor usage
    38. make[2]: *** [CMakeFiles/ppocr.dir/src/ocr_rec.cpp.o] Error 1cc1plus: fatal error: CMakeFiles/ppocr.dir/src/structure_table.cpp.d: No such file or directory
    39. make[2]: compilation terminated.
    40. *** [CMakeFiles/ppocr.dir/src/ocr_det.cpp.o] Error 1
    41. cc1plus: fatal error: CMakeFiles/ppocr.dir/src/utility.cpp.d: No such file or directory
    42. compilation terminated.
    43. cc1plus: error: too many filenames given; type ‘cc1plus --helpfor usage
    44. make[2]: *** [CMakeFiles/ppocr.dir/src/structure_layout.cpp.o] Error 1
    45. cc1plus: fatal error: CMakeFiles/ppocr.dir/src/clipper.cpp.d: No such file or directory
    46. compilation terminated.
    47. make[2]: *** [CMakeFiles/ppocr.dir/src/structure_table.cpp.o] Error 1
    48. make[2]: *** [CMakeFiles/ppocr.dir/src/utility.cpp.o] Error 1
    49. make[2]: *** [CMakeFiles/ppocr.dir/src/clipper.cpp.o] Error 1
    50. make[1]: *** [CMakeFiles/ppocr.dir/all] Error 2
    51. make: *** [all] Error 2

     

    cpp_infer/CMakeLists.txt 74行

    将 "-o3" 改成 "-O3" 就可以了,修改后的结果如下,

    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O3 ${FLAG_OPENMP} -std=c++11")

  • 相关阅读:
    slam14讲总结(一)
    P1743 矩阵 III
    从简历被拒到收割 8个大厂offer,我用2个月的时间破茧成蝶
    Python通过setup.py安装的模块怎么卸载
    HTTP/HTTPS详解
    Python解决图文验证码登录识别(1)
    终极Hadoop大数据教程
    k8s 部署nginx前端
    C++ vector模拟实现
    STM32——SPI通信实验
  • 原文地址:https://blog.csdn.net/mddCSDN/article/details/134553173