一、安装CentOS的扩展工具 1、yum -y upgrade(更新除CentOS核心包外的所有软件包) 2、yum -y install yum-utils

3、yum -y groupinstall development(安装一些开发工具,以便于后面使用源码的安装方式安装软件)

二、安装支持环境 1、安装python3 1)依赖环境:yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel 2)安装包:wget -P /tmp https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tar.xz 3)解压:tar -Jxf /tmp/Python-3.6.6.tar.xz 4)编译与安装:/tmp/Python-3.6.6/configure --enable-optimizations --prefix=/usr/local/python3 && make && make install  5)创建软链接 1、ln -s /usr/local/python3/bin/python3 /usr/bin/python3 2、ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

2、安装支持C++11的gcc(gcc-4.7开始支持C++11): 1)确保已经安装了旧版本的gcc:yum -y install gcc-c++

2)安装包:wget -P /tmp ftp://ftp.gnu.org/gnu/gcc/gcc-7.2.0/gcc-7.2.0.tar.gz

3)解压:tar -zxf /tmp/gcc-7.2.0.tar.gz

4)下载依赖包:source /tmp/gcc-7.2.0/contrib/download_prerequisites

5)编译与安装:/tmp/gcc-7.2.0/configure --prefix=/usr/local/software/gcc7.2.0 -enable-checking=release -enable-languages=c,c++ -disable-multilib && make -j4 && make install

6)配置环境变量

vim ~/.bashrc

 

#上面的操作为进入vim编辑器前的操作

export PATH=/usr/local/software/gcc-7.2.0/bin:$PATH export PATH=/usr/local/software/gcc-7.2.0/lib:$PATH export PATH=/usr/local/software/gcc-7.2.0/lib64:$PATH export LD_LIBRARY_PATH=/usr/local/software/gcc-7.2.0/lib:$LD_LIBRARY_PATH export LD_PRELOAD=/usr/local/software/gcc-7.2.0/lib64/libstdc++.so.6

 

#下面为退出vim编辑器后的操作

source ~/.bashrc

7)卸载就版本的gcc:yum -y remove gcc

8)创建软链接

    1、ln -s /usr/local/software/gcc-7.2.0/bin/gcc /usr/bin/cc

    2、ln -s /usr/local/software/gcc-7.2.0/bin/g++ /usr/bin/c++

3、安装CMake 1)安装包:wget -P /tmp https://cmake.org/files/v3.12/cmake-3.12.0-rc2.tar.gz

2)解压:tar -zxf /tmp/cmake-3.12.0-rc2.tar.gz

3)编译与安装:/tmp/cmake-3.12.0-rc2/bootstrap && make && make install

4、安装OpenBLAS 1)安装包:git clone https://github.com/xianyi/OpenBLAS.git

2)编译与安装:make NO_AVX2=1 && make install

5、安装face_recognition 1)pip3 install face_recognition(安装face_recognition的依赖包dlib时,需要耗费很长的时间,请耐心等待)

三、安装过程中参考的一些博客 1、gcc

    1)安装:https://blog.csdn.net/gaoqingwuma/article/details/78341940

    2)配置环境变量:https://blog.csdn.net/laopaifang/article/details/79425488

2、安装face_recognition前需要安装OpenBLAS:https://www.jianshu.com/p/1e6ac3d614e3