当前位置:   article > 正文

ubuntu20.04编译opencv3.4.0记录_could not find openblas include. turning openblas_

could not find openblas include. turning openblas_found off

更新源:

sudo apt update
  • 1

安装依赖:

sudo apt-get install build-essential cmake git
  • 1
sudo apt-get install pkg-config libavcodec-dev libavformat-dev libswscale-dev libatlas-base-dev gfortran zlib1g-dev ccache
  • 1
#这些可先不安装,后面看是否会报错
sudo apt-get install autoconf automake libtool checkinstall
  • 1
  • 2

添加新的源:

sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt update
  • 1
  • 2

安装libjasper(若不添加源会报错找不到libjasper):

sudo apt install libjasper1 libjasper-dev
  • 1

安装常用图像工具包:

 sudo apt-get install libjpeg-dev libjpeg8-dev libtiff5-dev libjasper-dev libpng-dev
  • 1

安装视频IO包:

sudo apt install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
  • 1

xfeatures2d模块缺失boostdesc_bgm.i文件,下载超时:

修改opencv_contrib下面的modules/xfeatures2d/cmake/download_boostdesc.cmake文件,将下载地址https://raw.githubusercontent.com/opencv/opencv_3rdparty/ 修改为:

https://ghproxy.com//https://raw.githubusercontent.com/opencv/opencv_3rdparty/
  • 1

vgg文件下载错误同理(即在原地址前加上https://ghproxy.com//)。

然后CMAKE的时候又会报一堆错,一个一个解决:

1、No package ‘libavresample’ found:

sudo apt-get -y install libavresample-dev
  • 1

2、error:No package ‘libgphoto2’ found:

sudo apt-get -y install libgphoto2-dev
  • 1

3、No package ‘gtk±3.0’ found,No package ‘gtk±2.0’ found:

sudo apt-get install libgtk-3-dev
  • 1
apt-get install libgtk2.0-dev
  • 1

4、-- Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
– Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
– Could NOT find Atlas (missing: Atlas_CBLAS_INCLUDE_DIR Atlas_CLAPACK_INCLUDE_DIR Atlas_CBLAS_LIBRARY Atlas_BLAS_LIBRARY Atlas_LAPACK_LIBRARY)
– Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
– Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
– Could NOT find Matlab (missing: MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN)
– VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file:

apt安装的openblas似乎不行,只能自己下载源码编译,很简单,只需要注意提前安装fortran编译器

sudo apt-get install gfortran
  • 1

然后去https://github.com/xianyi/OpenBLAS下载下来源码编译安装,但我操作完之后还是有版本问题。

sudo apt install doxygen openjdk-8-jdk libvtk7-dev
  • 1

5、Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version “2.7”):

cmake编译命令加上新参数不编译python包,不然编译阶段很可能会报错(也可以忽略这个警告,加上参数更保险):

cmake -DBUILD_opencv_python3=OFF DBUILD_opencv_python2=OFF -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ../opencv
  • 1

6、Looking for linux/videodev.h - not found:

忽略

7、Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS)

sudo apt install libhdf5-dev
  • 1

8、Failed to find gflags:

sudo apt-get install libgflags-dev
  • 1

9、Failed to find glog:

sudo apt-get install libgoogle-glog-dev
  • 1

10、The imported target “vtk” references the file “/usr/bin/vtk” but this file does not exist:

sudo ln -s /usr/bin/vtk7 /usr/bin/vtk
  • 1

11、No package ‘tesseract’ found:

cd ~
git clone https://ghproxy.com//https://github.com/tesseract-ocr/tesseract.git
cd tesseract
./autogen.sh
./configure
make -j4
sudo make install
sudo ldconfig
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

若报错:CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Tesseract_INCLUDE_DIR

则删除build文件夹下的所有东西重新编译

12、No package ‘gstreamer-base-1.0’ found:

sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
  • 1

13、No package ‘libdc1394-2’ found:

sudo apt-get install libdc1394-22-dev
  • 1

14、最后还是剩下了一些问题没有解决,忽略:
[外链图片转存中...(img-PoWTFWTT-1679023588034)]

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/119788
推荐阅读
相关标签
  

闽ICP备14008679号