opencv编译 Posted on 2020-08-22 opencv编译12345678910111213141516171819202122下载opencv:https://opencv.org/releases.htmlunzip opencv-3.4.0.zipcd opencv-3.4.0mkdir build && cd buildcmake -D CMAKE_BUILD_TYPE=RELEASE \-D CMAKE_INSTALL_PREFIX=/usr/local \-D WITH_CUDA=on -D ENABLE_FAST_MATH=1 \-D CUDA_FAST_MATH=1 -D WITH_CUBLAS=1 \-D WITH_NVCUVID=on -D CUDA_GENERATION=Auto \-D WITH_OPENCL=off -D WITH_OPENCL_SVM=off \-D WITH_OPENCLAMDFFT=off \-D WITH_OPENCLAMDBLAS=off ..make -j 24sudo make install卸载: cd build sudo make uninstall make clean如果要重新编译,记得删除掉build文件夹,否则不生效 第一次成功编译执行的时候报错找不到libgtk2.0, sudo apt-get install libgtk2.0-dev 报错nvcc fatal : Unsupported gpu architecture 'compute_75',将CUDA_GENERATION=Auto去掉,删除build文件夹重新编译