zoukankan      html  css  js  c++  java
  • 解决一个Ubuntu中编译NEON优化的OpenCV的错误

    在Ubuntu 16中编译开启NEON优化的Opencv时,遇到libpng编译是使用汇编代码的错误,完整错误见文章末尾。通过查询发现解决方案是安装跨平台编译器,安装代码如下:

    sudo apt-get install gcc-arm-linux-gnueabi
    sudo apt-get install gcc-arm-linux-gnueabihf
    sudo apt-get install g++-arm-linux-gnueabihf

    在参考1中说的是用OCV源码中的toolchain_file,但是我用这个编译出来的会导致各种undefin reference,还是要用NDK中的toolchai_file才行
    参考1
    参考2

    [ 17%] Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/arm/arm_init.c.o
    [ 17%] Building ASM object 3rdparty/libpng/CMakeFiles/libpng.dir/arm/filter_neon.S.o
    <instantiation>:18:9: error: unknown directive
            .func png_read_filter_row_sub4_neon
            ^
    /home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:65:1: note: while in macro instantiation
    func png_read_filter_row_sub4_neon, export=1
    ^
    <instantiation>:2:9: error: unknown directive
            .endfunc
            ^
    /home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:79:1: note: while in macro instantiation
    endfunc
    ^
    <instantiation>:18:9: error: unknown directive
            .func png_read_filter_row_sub3_neon
            ^
    /home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:81:1: note: while in macro instantiation
    func png_read_filter_row_sub3_neon, export=1
    ^
    <instantiation>:2:9: error: unknown directive
            .endfunc
            ^
    /home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:105:1: note: while in macro instantiation
    endfunc
    ^
    <instantiation>:18:9: error: unknown directive
            .func png_read_filter_row_up_neon
            ^
    /home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:107:1: note: while in macro instantiation
    func png_read_filter_row_up_neon, export=1
    ^
    <instantiation>:2:9: error: unknown directive
            .endfunc
            ^
    /home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:118:1: note: while in macro instantiation
    endfunc
    ^
    <instantiation>:18:9: error: unknown directive
            .func png_read_filter_row_avg4_neon
            ^
    /home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:120:1: note: while in macro instantiation
    func png_read_filter_row_avg4_neon, export=1
    ^
    <instantiation>:2:9: error: unknown directive
            .endfunc
            ^
    /home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:139:1: note: while in macro instantiation
    endfunc
    ^
    <instantiation>:18:9: error: unknown directive
            .func png_read_filter_row_avg3_neon
            ^
    /home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:141:1: note: while in macro instantiation
    func png_read_filter_row_avg3_neon, export=1
    ^
    <instantiation>:2:9: error: unknown directive
            .endfunc
            ^
    /home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:174:1: note: while in macro instantiation
    endfunc
    ^
    <instantiation>:18:9: error: unknown directive
            .func png_read_filter_row_paeth4_neon
            ^
    /home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:192:1: note: while in macro instantiation
    func png_read_filter_row_paeth4_neon, export=1
    ^
    <instantiation>:2:9: error: unknown directive
            .endfunc
            ^
    /home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:213:1: note: while in macro instantiation
    endfunc
    ^
    <instantiation>:18:9: error: unknown directive
            .func png_read_filter_row_paeth3_neon
            ^
    /home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:215:1: note: while in macro instantiation
    func png_read_filter_row_paeth3_neon, export=1
    ^
    <instantiation>:2:9: error: unknown directive
            .endfunc
            ^
    /home/willhua/opencv/opencv-3.4.1/3rdparty/libpng/arm/filter_neon.S:250:1: note: while in macro instantiation
    endfunc
    ^
    3rdparty/libpng/CMakeFiles/libpng.dir/build.make:446: recipe for target '3rdparty/libpng/CMakeFiles/libpng.dir/arm/filter_neon.S.o' failed
    make[2]: *** [3rdparty/libpng/CMakeFiles/libpng.dir/arm/filter_neon.S.o] Error 1
    CMakeFiles/Makefile2:655: recipe for target '3rdparty/libpng/CMakeFiles/libpng.dir/all' failed
    make[1]: *** [3rdparty/libpng/CMakeFiles/libpng.dir/all] Error 2
    Makefile:162: recipe for target 'all' failed
    make: *** [all] Error 2
    
    
  • 相关阅读:
    jquery获取tr并更改tr内容
    jquery获取元素索引值index()
    禁止apache显示目录索引 apache禁止列目录
    mysql启动错误之mysql启动报1067错误如何解决
    Expo大作战(四)--快速用expo构建一个app,expo中的关键术语
    Expo大作战(三)--针对已经开发过react native项目开发人员有针对性的介绍了expo,expo的局限性,开发时项目选型注意点等
    Expo大作战(二)--expo的生命周期,expo社区交流方式,expo学习必备资源,开发使用expo时关注的一些问题
    Expo大作战(一)--什么是expo,如何安装expo clinet和xde,xde如何使用
    Linux(CentOS)之-性能监控
    [转]winform程序textbox滚动条保持在最下面 内容不闪烁
  • 原文地址:https://www.cnblogs.com/willhua/p/9675905.html
Copyright © 2011-2022 走看看