安装opencv无数次,每次都还有新发现,今天记下来吧。
1、安装依赖
yum install cmake gcc gcc-c++ gtk2-devel gimp-develgimp-devel-tools gimp-help-browser zlib-devel libtiff-devel libjpeg-devellibpng-devel gstreamer-devel libavc1394-devel libraw1394-devel libdc1394-develjasper-devel jasper-utils swig python libtool nasm
2、下载文件包
http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip/download
3、安装
unzip opencv-2.4.9.zip
cd opencv-2.4.9
cmake CMakeLists.txt
make
make install
4、配置环境变量
vim ~/.bashrc
export OpenCV_DIR=$OpenCV_DIR:/root/opencv-2.4.9/include/opencv
export LD_LIBRARY_PATH="/root/opencv-2.4.9/3rdparty/lib:$LD_LIBRARY_PATH"
source ~/.bashrc
5、测试
cd samples
cd c
./build_all.sh
6、安装结束
会出现的问题:
1、nvcc fatal : Unsupported gpu architecture 'compute_11'
解决办法:
打开 sources\cmake 目录,使用文本编辑器编辑OpenCVDetectCUDA.cmake
找到下面一段
把第二个1.1 1.2 1.3 2.0 2.1 去掉,修改为