在嵌入式平台上编译OpenCV 4.0.1 - 后续篇

本文讲述了在ROCKPro64嵌入式平台上,遇到的编译OpenCV 4.0.1时的依赖问题,包括libgtk-3-dev的安装困难,以及解决系统时钟、libwayland-dev和libwayland-egl1的冲突。最终通过降级部分包和重新安装解决依赖问题。
摘要由CSDN通过智能技术生成

推到重来— WHY

stretch-minimal 真的是minimal。没有xserver,MIPI module 好像也没有enable。需要重新编译kernel。

硬件平台和软件环境

ROCKPro64 4GB Single Board Computer
bionic-lxde-rockpro64-0.7.9-1067-arm64.img.xz
Ubuntu 安装没问题。启动后自动进入桌面环境?

2019-05-08 更新

01/03/2019 解决了所有的dependency problems (gtk-3, weyland etc etc.),没有build OpenCV 4。
今天继续,各种问题。怀疑USB stick坏了。。。换了个新的,重新flash bionic-lxde-rockpro64-0.7.9-1067-arm64.img.xz (用Etcher 很快搞定)。再重启一切正常,安装dependencies完全没有问题?!! libgtk-3-dev 一次通过。。

系统启动后system clock 不对,会影响apt-get update&upgrade。其他的安装也会影响。
sudo date -s “09 MAY 2019 11:38:00”

安装Python Virtual Environment后,

Python3 -m venv py36cv41
从pip 安装numpy 各种错误(印象中以前碰到过但找不到任何记录)
pip3 install numpy

结果和BLAS, Atlas, OpenBLAS没有任何关系。

fatal error: Python.h: No such file or directory
sudo apt-get install python3-dev 就好了!

出错信息放在最后面。

Install Library Dependencies

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install build-essential cmake pkg-config
sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libxvidcore-dev libx264-dev
sudo apt-get install python3-dev
  • sudo apt-get install libgtk2.0-dev libgtk-3-dev

libgtk-3-dev : Depends: libwayland-dev (>= 1.9.91) but it is not going to be installed

  • sudo apt-get install libwayland-dev

Errors were encountered while processing: /var/cache/apt/archives/libwayland-dev_1.16.0-1ubuntu1.1~18.04.1_arm64.de
trying to overwrite ‘/usr/lib/aarch64-linux-gnu/pkgconfig/wayland-egl.pc’, which is also in package libmali-rk-dev:arm64 1.6-1ayufan10
libwayland-dev:arm64 depends on libwayland-egl1 (= 1.16.0-1ubuntu1.1~18.04.1); however:Package libwayland-egl1:arm64 is not configured yet.

Installing libgtk-3-dev, unmet dependencies

You have to downgrade some packages in order to meet the dependency requirements.

sudo apt-get install libglib2.0-0=2.40.0-2
sudo apt-get install libpango-1.0-0=1.36.3-1ubuntu1 libpangocairo-1.0-0=1.36.3-1ubuntu1 libpangoft2-1.0-0=1.36.3-1ubuntu1 libpangoxft-1.0-0=1.36.3-1ubuntu1 gir1.2-pango-1.0=1.36.3-1ubuntu1

“unmet dependencies” while installing gtk +3 [duplicate]

  • apt-get install -f
  • apt-mark showhold
  • sudo apt-cache policy libgtk-3-dev
  • apt-cache policy libpango1.0-dev
  • etc.
    This isn’t a case of existing broken dependencies (which apt-get install -f would attempt to fix), it’s that it can’t get the packages it needs to install the new package.

How to resolve “dpkg: error processing /var/cache/apt/archives/python-apport_2.0.1-0ubuntu9_all.deb”?

You need to force overwriting of the files causing the errors:

sudo dpkg -i --force-overwrite <filename>
In your case it's going to be:

sudo dpkg -i --force-overwrite /var/cache/apt/archives/python-problem-report_2.0.1-0ubuntu9_all.deb
Then run:

sudo apt-get -f install
You can try the following command:

sudo apt-get clean
sudo apt-get update && sudo apt-get upgrade
If you still end up with the same error, try:

sudo dpkg --configure -a
sudo apt-get -f install
Final Solution

How to fix dpkg: error processing package libwayland-server0:amd64 in Ubuntu 16.04 [duplicate]

  • sudo apt install --reinstall libwayland-server0
Error Message when pip install numpy
(py36cv41) rock64@rockpro64:~/Developer$ pip install numpy
Collecting numpy
  Using cached https://files.pythonhosted.org/packages/93/48/956b9dcdddfcedb1705839280e02cbfeb2861ed5d7f59241210530867d5b/numpy-1.16.3.zip
Installing collected packages: numpy
  Running setup.py install for numpy ... error
    ERROR: Complete output from command /home/rock64/Developer/py36cv41/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-mcyddpaj/numpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-isoz3b8p/install-record.txt --single-version-externally-managed --compile --install-headers /home/rock64/Developer/py36cv41/include/site/python3.6/numpy:
    ERROR: Running from numpy source directory.
    
    Note: if you need reliable uninstall behavior, then install
    with pip instead of using `setup.py install`:
    
      - `pip install .`       (from a git repo or downloaded source
                               release)
      - `pip install numpy`   (last NumPy release on PyPi)
    
    
    blas_opt_info:
    blas_mkl_info:
    customize UnixCCompiler
      libraries mkl_rt not found in ['/home/rock64/Developer/py36cv41/lib', '/usr/local/lib', '/usr/lib', '/usr/lib/aarch64-linux-gnu']
      NOT AVAILABLE
    
    blis_info:
    customize UnixCCompiler
      libraries blis not found in ['/home/rock64/Developer/py36cv41/lib', '/usr/local/lib', '/usr/lib', '/usr/lib/aarch64-linux-gnu']
      NOT AVAILABLE
    
    openblas_info:
    customize UnixCCompiler
    customize UnixCCompiler
      libraries openblas not found in ['/home/rock64/Developer/py36cv41/lib', '/usr/local/lib', '/usr/lib', '/usr/lib/aarch64-linux-gnu']
      NOT AVAILABLE
    
    atlas_3_10_blas_threads_info:
    Setting PTATLAS=ATLAS
    customize UnixCCompiler
      libraries tatlas not found in ['/home/rock64/Developer/py36cv41/lib', '/usr/local/lib', '/usr/lib', '/usr/lib/aarch64-linux-gnu/atlas', '/usr/lib/aarch64-linux-gnu']
      NOT AVAILABLE
    
    atlas_3_10_blas_info:
    customize UnixCCompiler
      libraries satlas not found in ['/home/rock64/Developer/py36cv41/lib', '/usr/local/lib', '/usr/lib', '/usr/lib/aarch64-linux-gnu/atlas', '/usr/lib/aarch64-linux-gnu']
      NOT AVAILABLE
    
    atlas_blas_threads_info:
    Setting PTATLAS=ATLAS
    customize UnixCCompiler
      libraries ptf77blas,ptcblas,atlas not found in ['/home/rock64/Developer/py36cv41/lib', '/usr/local/lib', '/usr/lib', '/usr/lib/aarch64-linux-gnu/atlas', '/usr/lib/aarch64-linux-gnu']
      NOT AVAILABLE
    
    atlas_blas_info:
    customize UnixCCompiler
    get_default_fcompiler: matching types: '['gnu95', 'intel', 'lahey', 'pg', 'absoft', 'nag', 'vast', 'compaq', 'intele', 'intelem', 'gnu', 'g95', 'pathf95', 'nagfor']'
    customize Gnu95FCompiler
    Found executable /usr/bin/gfortran
    customize Gnu95FCompiler
    customize Gnu95FCompiler using config
    compiling '_configtest.c':
    
    /* This file is generated from numpy/distutils/system_info.py */
    void ATL_buildinfo(void);
    int main(void) {
      ATL_buildinfo();
      return 0;
    }
    
    C compiler: aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC
    
    compile options: '-c'
    aarch64-linux-gnu-gcc: _configtest.c
    aarch64-linux-gnu-gcc -pthread _configtest.o -lf77blas -lcblas -latlas -o _configtest
    customize UnixCCompiler
    customize UnixCCompiler
      FOUND:
        language = c
        define_macros = [('HAVE_CBLAS', None), ('NO_ATLAS_INFO', -1)]
        libraries = ['f77blas', 'cblas', 'atlas', 'f77blas', 'cblas']
        library_dirs = ['/usr/lib/aarch64-linux-gnu']
    
    accelerate_info:
      NOT AVAILABLE
    
      FOUND:
        language = c
        define_macros = [('HAVE_CBLAS', None), ('NO_ATLAS_INFO', -1)]
        libraries = ['f77blas', 'cblas', 'atlas', 'f77blas', 'cblas']
        library_dirs = ['/usr/lib/aarch64-linux-gnu']
    
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值