1. 概述
Thrift是Facebook为了跨编程语言工作而开发的软件库和代码生成工具的一个项目。其高效性十分吸引软件开发工作者。
2. 下载Thrift
首先从thrift的官方网站(http://thrift.apache.org/download)下载最新的安装包thrift-0.7.0.tar.gz
3. 安装Thrift
首先解压缩:
tar -zxvf thrift-0.6.1.tar.gz
./configurethrift 会按照系统中所能支持的语言,提供相应的支持。有如下提示:
thrift 0.7.0
Building code generators ..... : cpp c_glib java as3 csharp py rb perl php erl cocoa st ocaml h
s xsd html js javame go
Building C++ Library ......... : yes
Building C (GLib) Library .... : no
Building Java Library ........ : no
Building C# Library .......... : no
Building Python Library ...... : yes
Building Ruby Library ........ : yes
Building Haskell Library ..... : no
Building Perl Library ........ : no
Building PHP Library ......... : yes
Building Erlang Library ...... : yes
Building Go Library .......... : no
Building TZlibTransport ...... : yes
Building TNonblockingServer .. : yes
Using Python ................. : /usr/bin/python
Using php-config ............. : /usr/local/bin/php-config
Using Ruby ................... : /usr/bin/ruby
Using rspec .................. :
Using erlc ................... : /usr/bin/erlc
libevent-dev automake libtool flex bison pkg-config g++ libssl-dev
语言环境需求:
- C++
- Boost 1.33.1+
- libevent (optional, to build the nonblocking server)
- zlib (optional)
- Java
- Java 1.5+
- Apache Ant
- Apache Ivy (recommended)
- Apache Commons Lang (recommended)
- SLF4J
- C#: Mono 1.2.4+ (and pkg-config to detect it) or Visual Studio 2005+
- Python 2.4+ (including header files for extension modules)
- PHP 5.0+ (optionally including header files for extension modules)
- Ruby 1.8+ (including header files for extension modules)
- Erlang R12 (R11 works but not recommended)
- Perl 5
- Bit::Vector
- Class::Accessor
-
For ruby, install ruby-full
ruby-dev librspec-ruby rake rubygems libdaemons-ruby libgemplugin-ruby mongrel. -
For python, install python-dev
python-twisted. -
For perl, install libbit-vector-perl.
-
For php, install php5-dev
php5-cli. -
For c_glib, install libglib2.0-dev (Debian Lenny Users => sudo
apt-get -t lenny-backports install libglib2.0-dev) -
For erlang, install erlang-base
erlang-eunit erlang-dev -
For csharp, install mono-gmcs
libmono-dev libmono-system-web2.0-cil -
For haskell, install ghc6
cabal-install libghc6-binary-dev libghc6-network-dev libghc6-http-dev
make
make install
本文介绍了Thrift软件库及代码生成工具的安装步骤,并详细列出了不同编程语言环境的需求和必要的包安装指令。

被折叠的 条评论
为什么被折叠?



