在centos7上编译安装thrift

1. 说明

本文以0.9.3版本为例,理论上适用于0.9.3 - 0.15.0版本

2. 更新yum源

[root@bigdata001 thrift]#
[root@bigdata001 thrift]# yum -y update
[root@bigdata001 thrift]#

3. 安装centos7的Development Tools

[root@bigdata001 thrift]#
[root@bigdata001 thrift]# yum -y groupinstall "Development Tools"
[root@bigdata001 thrift]#

4. 安装autoconf

[root@bigdata001 thrift]#
[root@bigdata001 thrift]# wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
[root@bigdata001 thrift]#
[root@bigdata001 thrift]# tar xvf autoconf-2.69.tar.gz
[root@bigdata001 thrift]#
[root@bigdata001 thrift]# mkdir autoconf-2.69-install
[root@bigdata001 thrift]#
[root@bigdata001 thrift]# cd autoconf-2.69
[root@bigdata001 autoconf-2.69]#
[root@bigdata001 autoconf-2.69]# ./configure --prefix=/root/thrift/autoconf-2.69-install
[root@bigdata001 autoconf-2.69]#
[root@bigdata001 autoconf-2.69]# make && make install 
[root@bigdata001 autoconf-2.69]#

5. 安装automake

[root@bigdata001 thrift]#
[root@bigdata001 thrift]# wget http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz
[root@bigdata001 thrift]#
[root@bigdata001 thrift]# tar xvf automake-1.14.tar.gz
[root@bigdata001 thrift]#
[root@bigdata001 thrift]# mkdir automake-1.14-install
[root@bigdata001 thrift]#
[root@bigdata001 thrift]# cd automake-1.14
[root@bigdata001 automake-1.14]#
[root@bigdata001 automake-1.14]# ./configure --prefix=/root/thrift/automake-1.14-install
[root@bigdata001 automake-1.14]#
[root@bigdata001 automake-1.14]# make && make install
[root@bigdata001 automake-1.14]#

6. 安装bison

[root@bigdata001 thrift]#
[root@bigdata001 thrift]# wget http://ftp.gnu.org/gnu/bison/bison-2.5.1.tar.gz
[root@bigdata001 thrift]#
[root@bigdata001 thrift]# tar xvf bison-2.5.1.tar.gz
[root@bigdata001 thrift]#
[root@bigdata001 thrift]# mkdir bison-2.5.1-install
[root@bigdata001 thrift]#
[root@bigdata001 thrift]# cd bison-2.5.1
[root@bigdata001 bison-2.5.1]#
[root@bigdata001 bison-2.5.1]# ./configure --prefix=/root/thrift/bison-2.5.1-install/
[root@bigdata001 bison-2.5.1]#
[root@bigdata001 bison-2.5.1]# make && make install
[root@bigdata001 bison-2.5.1]#

7. 安装C++ lib依赖

[root@bigdata001 thrift]#
[root@bigdata001 thrift]# yum -y install libevent-devel zlib-devel openssl-devel
[root@bigdata001 thrift]#

8. 安装Boost

[root@bigdata001 thrift]#
[root@bigdata001 thrift]# wget --no-check-certificate http://sourceforge.net/projects/boost/files/boost/1.56.0/boost_1_56_0.tar.gz
[root@bigdata001 thrift]#
[root@bigdata001 thrift]# tar xvf boost_1_56_0.tar.gz
[root@bigdata001 thrift]#
[root@bigdata001 thrift]# cd boost_1_56_0
[root@bigdata001 boost_1_56_0]#
[root@bigdata001 boost_1_56_0]# ./bootstrap.sh
[root@bigdata001 boost_1_56_0]#
[root@bigdata001 boost_1_56_0]# ./b2 install
[root@bigdata001 boost_1_56_0]#

9. 安装Thrift IDL Compiler

[root@bigdata001 thrift]#
[root@bigdata001 thrift]# wget http://archive.apache.org/dist/thrift/0.9.3/thrift-0.9.3.tar.gz
[root@bigdata001 thrift]#
[root@bigdata001 thrift]# tar -zxvf thrift-0.9.3.tar.gz 
[root@bigdata001 thrift]#
[root@bigdata001 thrift]# mkdir thrift-0.9.3-install
[root@bigdata001 thrift]#
[root@bigdata001 thrift]# cd thrift-0.9.3
[root@bigdata001 thrift-0.9.3]#
[root@bigdata001 thrift-0.9.3]# ./configure --with-lua=no --prefix=/root/thrift/thrift-0.9.3-install/
[root@bigdata001 thrift-0.9.3]#
[root@bigdata001 thrift-0.9.3]# make && make install 
[root@bigdata001 thrift-0.9.3]#

10. 创建软链接

[root@bigdata001 thrift]#
[root@bigdata001 thrift]# ln -s /root/thrift/thrift-0.9.3-install/bin/thrift /usr/bin/thrift
[root@bigdata001 thrift]#

11. 测试

[root@bigdata001 thrift]# 
[root@bigdata001 thrift]# thrift -version
Thrift version 0.9.3
[root@bigdata001 thrift]# 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值