最近源碼編譯 opencv,出現下面的錯誤python
[ 60%] Built target opencv_dnn Makefile:160: recipe for target 'all' failed make: *** [all] Error 2
google 一下,才知道原來是安裝了 Anaconda 後,python 和 gcc 都用的是 anaconda 的版本,anaconda 的 gcc 版本,比 system defalut 的版本低linux
解決方案:ubuntu
1. 在 shell 中先註釋 Anaconda 的環境變量ui
# export PATH=~/anaconda3/bin:$PATH
2. cmake 添加選項google
-D WITH_OPENMP=ON