ubuntu上编译Thrift

Thrift是Apache的一个开源项目,用来实现不同语言之间的通信,要使用编程语言操作cassandra,就需要Thrift。
可惜的是Ubuntu还不能使用apt-get安装Thrift,因此需要手工编译
编译环境:Ubuntu 8.10 (8.04的libtool包不能用)
首先安装必要的包
sudo apt-get install build-essential
sudo apt-get install bison flex
sudo apt-get install libboost-dev python-dev
sudo apt-get install autoconf automake libtool pkg-config
sudo apt-get install git
然后下载Thrift的源码包,并编译安装
wget http://labs.renren.com/apache-mirror/incubator/thrift/0.2.0-incubating/thrift-0.2.0-incubating.tar.gz
tar xf thrift-0.2.0-incubating.tar.gz
cd thrift-0.2.0
./configure
make
sudo make install
安装成功,

使用Python进行测试
cd tutorial
thrift --gen py thrift.thrift
thrift --gen py shared.thrift
cp py/* gen-py
cd gen-py
python PythonServer.py &
python PythonClient.py
原文地址:https://www.cnblogs.com/end/p/2021357.html