一、基础套餐
yum update
yum groupinstall "Development Tools"
二、安装OpenCV
yum install cmake
yum install python-devel numpy
yum install gcc gcc-c++
yum install gtk2-devel
yum install libdc1394-devel
yum install libv4l-devel
yum install ffmpeg-devel
yum install gstreamer-plugins-base-devel
yum install libpng-devel
yum install libjpeg-turbo-devel
yum install jasper-devel
yum install openexr-devel
yum install libtiff-devel
yum install libwebp-devel
yum install opencv
yum install opencv-python
yum install opencv-devel
或
yum install cmake python-devel numpy gcc gcc-c++ gtk2-devel libdc1394-devel libv4l-devel ffmpeg-devel gstreamer-plugins-base-devel libpng-devel libjpeg-turbo-devel jasper-devel openexr-devel libtiff-devel libwebp-devel opencv opencv-python opencv-devel
查看gcc版本
g++ --version
ps: c++ 版本大等于 gcc4.8.2 可以跳过 三
三、安装C++11(gcc4.8.2),不升级gcc,lib装不上
wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
sudo yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++
软件会被安装在/opt/rh目录下
配置环境变量
export CC=/opt/rh/devtoolset-2/root/usr/bin/gcc
export CPP=/opt/rh/devtoolset-2/root/usr/bin/cpp
export CXX=/opt/rh/devtoolset-2/root/usr/bin/c++
别忘了. /etc/profile
查看gcc版本
g++ --version
将安装的目录软链接到local/bin
ln -s /opt/rh/devtoolset-2/root/usr/bin/* /usr/local/bin/
hash -r
四、安装boost
yum install boost
yum install boost-devel
yum install boost-doc
或
yum install boost boost-devel boost-doc
五、安装Dlib
pip install dlib
六、安装libXdmcp
这时候import dlib会报错,需要libXdmcp
yum install libXdmcp libXdmcp-devel