遇到问题:

在安装OPENCV3.2.0 make过程中报错:

/usr/bin/ld: ../../lib/libopencv_core.so.3.2.0: undefined reference to `cblas_zgemm(CBLAS_ORDER, CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, int, int, int, void const*, void const*, int, void const*, int, void const*, void*, int)' /usr/bin/ld: ../../lib/libopencv_core.so.3.2.0: undefined reference to `cblas_dgemm(CBLAS_ORDER, CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, int, int, int, double, double const*, int, double const*, int, double, double*, int)' /usr/bin/ld: ../../lib/libopencv_core.so.3.2.0: undefined reference to `cblas_sgemm(CBLAS_ORDER, CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, int, int, int, float, float const*, int, float const*, int, float, float*, int)' /usr/bin/ld: ../../lib/libopencv_core.so.3.2.0: undefined reference to `cblas_cgemm(CBLAS_ORDER, CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, int, int, int, void const*, void const*, int, void const*, int, void const*, void*, int)' collect2: error: ld returned 1 exit status make[2]: *** [modules/core/CMakeFiles/opencv_test_core.dir/build.make:571:bin/opencv_test_core] 错误 1 make[1]: *** [CMakeFiles/Makefile2:1734:modules/core/CMakeFiles/opencv_test_core.dir/all] 错误 2 make: *** [Makefile:166:all] 错误 2

原因:

使用国内的大陆源在安装BLAS 和 CBLAS 库时会有一些依赖(libfaac-dev)无法下载安装

解决办法:

更换台湾源https://ftp.tc.edu.tw/Linux/ubuntu(中国的第一个)

卸载BLAS 和 CBLAS 库

sudo apt remove libblas-dev libatlas-base-dev libopenblas-base libopenblas-dev libatlas3-base liblapack-dev liblapack3 liblapacke-dev liblapacke
 

这时会有报错

下列软件包有未满足的依赖关系: libopencv-imgcodecs4.2 : 依赖: libgdal26 (>= 2.0.1) 但是它将不会被安装 E: 错误,pkgProblemResolver::Resolve 发生故障,这可能是有软件包被要求保持现状的缘故。

可以选择不管,继续安装

sudo apt install libblas-dev libatlas-base-dev libopenblas-base libopenblas-dev libatlas3-base

接着重新

cmake .. 

make

更多推荐