1、centos 系统库更新
yum -y update
2、centos安装系统依赖库
yum install -y libxslt-devel.x86_64 libX11-devel pcre-devel zlib-devel.x86_64 libxml2 gettext.x86_64 freetype-devel vim ant libffi tcl leptonica curl-devel libxslt curl libffi-devel openjpeg openssl-devel.i686 pcre littlecms-devel gcc java uuid libcurl make tix-devel openssl-devel gdbm-devel subversion libxslt-devel openssl db4-devel libdbi-devel.i686 gcc-c++ readline-devel.x86_64 unixODBC-devel freetype glibtoolize gdbm-devel.i686 libfreetype6-devel unixODBC libxslt1 cmake rsync lrzsz ncurses-libs sqlite-devel.x86_64 libevent-devel.x86_64 bzip2-devel.i686 zlib-devel.i686 wxBase gmp-devel libxslt-devel bzip2-devel.x86_64 littlecms ncurses-devel readline-devel zlib-devel libxml2-devel.x86_64 wxGTK libevent.x86_64 libfreetype6 openjpeg-devel ibtoolize libjpeg-devel libjpeg libtiff-devel libxml2-devel zlib expat-devel openssl libxsltl-devel sqlite-devel tk-devel libGL-devel tcl-devel wxGTK-gl SDL mysql-devel.x86_64 libpng-devel
3、安装Python 2.x
修改Python安装包中的文件,vim Modules/Setup , 去掉 zlib zlibmodule.c -I(exec_prefix)/lib -lz 前面的注释#
安装Python ./configure –with-wide-unicode –enable-optimizations –enable-unicode=ucs2 –prefix=/home/kratos/local/python
4、安装pip,然后安装Python依赖库
enum==0.4.6
enum34==1.1.6
funcsigs==1.0.2
jieba==0.39
mock==2.0.0
nltk==3.3
numpy==1.14.3
pbr==4.0.3
six==1.11.0
5、安装0.12.0版本的bazel
6、源码安装TensorFlow
7、全局变量设置
export PATH=/home/kratos/local/sbin:/home/kratos/local/python/bin:/home/kratos/local/bazel/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-8.0/lib64
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda-8.0/lib64