CentOS7编译安装thrift工具

1、在https://archive.apache.org/dist/thrift/位置选择相应的版本下载,如下图所示:

2、然后选择thrift-0.13.0.tar.gz下载,如下图所示:

3、通过wget https://archive.apache.org/dist/thrift/0.13.0/thrift-0.13.0.tar.gz命令下载,如下图所示:

4、下载好之后通过:tar -xzvf thrift-0.13.0.tar.gz解压,如下图所示:

5、在编译之前要先安装:

yum install libtool flex bison pkgconfig boost-devel libevent-devel zlib-devel python-devel ruby-devel openssl-devel ant

如下图所示:

6、然后进入到thrift目录,执行./bootstrap.sh,如下图所示:

7、然后执行./configure,这是默认的,也可以支持选择,如下命令:

./configure --with-cpp --with-boost=/usr/local/ --with-python --without-csharp --with-java --without-erlang --without-perl --without-php --without-php_extension --without-ruby --without-haskell --without-go

凡是--with选项的都让其编译,--without不编译

如下图所示:

发现不管是单独的configure还是加参数的执行结果都相同,如果想支持java,必要安装ant:

yum install ant

如果是想安装支持C++,则必须手动编译boost,编译方法是:

 ./bootstrap.sh

./b2 --without-python stage debug

cp -rf boost /usr/local/
cp -rf stage/lib/* /usr/local/lib64/

然后在执行:

./configure --with-cpp --with-boost=/usr/local/ --with-python --without-csharp --with-java --without-erlang --without-perl --without-php --without-php_extension --without-ruby --without-haskell --without-go

如下图所示:

8、然后执行make,此时会出现如下错误:

libtool: Version mismatch error.  This is libtool 2.4.2, but the
libtool: definition of this LT_INIT comes from libtool 2.4.6.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4.2
libtool: and run autoconf again.
make[3]: *** [thrift] 错误 63
make[3]: 离开目录“/usr/local/src/thrift-0.13.0/compiler/cpp”
make[2]: *** [all-recursive] 错误 1
make[2]: 离开目录“/usr/local/src/thrift-0.13.0/compiler/cpp”
make[1]: *** [all-recursive] 错误 1
make[1]: 离开目录“/usr/local/src/thrift-0.13.0”
make: *** [all] 错误 2

如下图所示:

9、然后执行autoreconf -ivf,再次执行make,如下图所示:

10、然后通过make install进行安装,如下图所示:

11、此时通过thrift --version来查看版本号,如下图所示:

12、到此完成编译。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值