r1192@dev030 (orig r59869): dweatherford | 2007-09-15 01:49:48 -0700
[amiethrift.git] / README
blob5dc232e72473649b6bb46278da4470893119cb24
1 Thrift (Thrift IDL and RPC tool)
3 Mark Slee (mcslee@facebook.com)
4 Marc Kwiatkowski (marc@facebook.com)
5 Aditya Agarwal (aditya@facebook.com)
7 Last Modified: 2007-Mar-06
9 Thrift is distributed under the Thrift open source software license.
10 Please see the included LICENSE file.
12 Introduction
13 ============
15 Thrift is a lightweight, language-independent software stack with an
16 associated code generation mechanism for RPC. Thrift provides clean
17 abstractions for data transport, data serialization, and application
18 level processing. The code generation system takes a simple definition
19 language as its input and generates code across programming languages that
20 uses the abstracted stack to build interoperable RPC clients and servers.
22 Thrift is specifically designed to support non-atomic version changes
23 across client and server code.
25 For more details on Thrift's design and implementation, take a gander at
26 the Thrift whitepaper included in this distribution or at the README files
27 in your particular subdirectory of interest.
29 Heirarchy
30 =========
32 thrift/
34   compiler/
35     Contains the Thrift compiler, implemented in C++.
37   lib/
38     Contains the Thrift software library implementation, subdivided by
39     language of implementation.
41     cpp/
42     java/
43     php/
44     py/
45     rb/
47   test/
49     Contains sample Thrift files and test code across the target programming
50     languages.
52   tutorial/
54     Contains a basic tutorial that will teach you how to develop software
55     using Thrift.
57 Requirements
58 ============
60 Thrift requires boost shared pointers from boost-1.33.1 or greater, see:
61 http://www.boost.org/libs/smart_ptr/smart_ptr.htm
63 Some portions of Thrift also depend upon libevent, see:
64 http://monkey.org/~provos/libevent/
66 These libraries are open source and may be freely obtained, but they are not
67 provided as a part of this distribution.
69 Resources
70 =========
72 More information about Thrift can be obtained on the Thrift webpage at:
74      http://developers.facebook.com/thrift
76 Acknowledgments
77 ===============
79 Thrift was inspired by pillar, a lightweight RPC tool written by Adam D'Angelo.
81 Installation
82 ============
84 If you are building from the first time out of the source repository, you will
85 need to generate the configure scripts.  From the top directory, do:
87         ./bootstrap.sh
89 Once the configure scripts are generated, thrift can be configured.
90 From the top directory, do:
92         ./configure
94 You may need to specify the location of the boost files explicitly.
95 If you installed boost in /usr/local, you would run configure as follows:
97         ./configure --with-boost=/usr/local
99 Note that by default the thrift C++ library is typically built with debugging
100 symbols included. If you want to customize these options you should use the
101 CXXFLAGS option in configure, as such:
103         ./configure CXXFLAGS='-g -O2'
104         ./configure CFLAGS='-g -O2'
105         ./configure CPPFLAGS='-DDEBUG_MY_FEATURE'
107 Run ./configure --help to see other configuration options
109 Please be aware that the Python library will ignore the --prefix option
110 and just install wherever Python's distutils puts it (usually along
111 the lines of /usr/lib/pythonX.Y/site-packages/).  If you need to control
112 where the Python modules are installed, set the PY_PREFIX variable.
113 (DESTDIR is respected for Python and C++.)
115 Make thrift:
117         make
119 From the top directory, become superuser and do:
121         make install
123 Note that some language packages must be installed manually using build tools
124 better suited to those languages (at the time of this writing, this applies
125 to Java, Ruby, PHP).
127 Look for the README file in the lib/<language>/ folder for more details on the
128 installation of each language library package.