天天看点

centos6.3 thrift0.13.0 安装流程

thrift安装流程

参考: http://thrift.apache.org/docs/install/centos

1 更新yum源

sudo yum -y update

2 安装开发工具

sudo yum -y groupinstall "Development Tools"

需要安装 autoconf/automake/bison/boost/lievent, 查看thrift的configure文件,确定相关依赖软件的版本【节省时间,少坑】

3 安装wget 

sudo yum install -y wget

4 安装 autoconf

wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz

tar xvf autoconf-2.69.tar.gz

cd autoconf-2.69

./configure --prefix=/usr

make

sudo make install

5 安装 automake

wget http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz

tar xvf automake-1.14.tar.gz

cd automake-1.14

./configure --prefix=/usr

make

sudo make install

cd ..

6 安装 bison

wget http://ftp.gnu.org/gnu/bison/bison-2.5.1.tar.gz

tar xvf bison-2.5.1.tar.gz

cd bison-2.5.1

./configure --prefix=/usr

make

sudo make install

7 安装boost

【新版本要求5.6以上版本】

wget http://sourceforge.net/projects/boost/files/boost/1.70.0/boost_1_70_0.tar.gz

tar xvf boost_1_70_0.tar.gz

cd boost_1_70_0

./bootstrap.sh

sudo ./b2 install

8 安装libevent2

【新版本要求libevent 2 版本】

卸载旧版 

yum remove libevent

下载libevent2 

wget -c https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz

tar -zxvf libevent-2.0.22-stable.tar.gz

cd libevent-2.0.22-stable

./configure

make

make install

9 安装thrift

【新版使用C++11 查看gcc 版本看是否支持,不支持请升级】

git clone https://github.com/apache/thrift.git

cd thrift

./bootstrap.sh

./configure --with-lua=no

make

sudo make install

10 测试

测试例子请参考源码中的例子或者网络上给出的

继续阅读