Thrift(1)Installation on win7/CentOS/Ubuntu

Thrift(1)Installation on win7/CentOS/Ubuntu

1. win7
download the binary file from here http://thrift.apache.org/download/
http://www.fayea.com/apache-mirror/thrift/0.8.0/thrift-0.8.0.exe

copy that file to working directory:
D:\tool\thrift-0.8.0, and add this to path=D:\tool\thrift-0.8.0

>thrift.exe -version
Thrift version 0.8.0

2. CentOS
>sudo yum install automake
>sudo yum install libtool
>sudo yum install flex
>sudo yum install bison
>sudo yum install pkgconfig
>sudo yum install gcc-c++
>sudo yum install boost-devel libevent-devel zlib-devel python-devel ruby-devel

Then I will build the thrift from source
download the source
>wget http://mirror.bjtu.edu.cn/apache/thrift/0.8.0/thrift-0.8.0.tar.gz
>tar zxvf thrift-0.8.0.tar.gz
>cd thrift-0.8.0/
>sudo mkdir /opt/tool/thrift
>./configure --prefix=/opt/tool/thrift

error message
configure: error: "Error: libcrypto required."

solution
>sudo yum install openssl-devel
>./configure --prefix=/opt/tool/thrift
>sudo make
>sudo make install
>sudo ln -s /opt/tool/thrift/bin/thrift /usr/bin/thrift
>thrift -version
Thrift version 0.8.0

3. Ubuntu
>sudo apt-get install libboost-dev
>sudo apt-get install libboost-test-dev
>sudo apt-get install libboost-program-options-dev
>sudo apt-get install libevent-dev
>sudo apt-get install automake
>sudo apt-get install libtool
>sudo apt-get install flex
>sudo apt-get install bison
>sudo apt-get install pkg-config
>sudo apt-get install g++
>sudo apt-get install libssl-dev

Optional packages
Python
>sudo apt-get install python-dev python-twisted

Ruby
>sudo apt-get install ruby-full ruby-dev librspec-ruby rake rubygems libdaemons-ruby libgemplugin-ruby mongrel

Perl
>sudo apt-get install libbit-vector-perl

Erlang
>sudo apt-get install erlang-base erlang-eunit erlang-dev

Install from source
>wget http://mirror.bjtu.edu.cn/apache/thrift/0.8.0/thrift-0.8.0.tar.gz
>tar zxvf thrift-0.8.0.tar.gz
>cd thrift-0.8.0/
>sudo mkdir /opt/tool/thrift
>./configure --prefix=/home/karl/tools/thrift
>sudo make
>sudo make install
>sudo ln -s /home/karl/tools/thrift/bin/thrift /usr/bin/thrift
>thrift -version
Thrift version 0.8.0

references:
http://thrift.apache.org/
http://gemantic.iteye.com/blog/1199214
http://www.cnblogs.com/birdshover/archive/2010/03/16/1687301.html
http://www.javabloger.com/article/thrift-java-code-example.html
http://www.javabloger.com/article/apache-thrift-architecture.html
http://yangfanchao.iteye.com/blog/1271737

http://thrift.apache.org/docs/install/
http://thrift.apache.org/docs/idl/
http://thrift.apache.org/docs/types/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值