blob: 647df05e3f478eb67f8419ea6f42104ff2e792a0 [file] [log] [blame]
Mark Slee57cc25e2007-02-28 21:43:54 +00001Thrift (Thrift IDL and RPC tool)
Marc Slemko9de5a5c2006-08-23 22:34:00 +00002
3Mark Slee (mcslee@facebook.com)
4Marc Kwiatkowski (marc@facebook.com)
Mark Slee3303f362007-03-05 20:09:37 +00005Aditya Agarwal (aditya@facebook.com)
Marc Slemko9de5a5c2006-08-23 22:34:00 +00006
Mark Slee227ac2c2007-03-07 05:46:50 +00007Last Modified: 2007-Mar-06
8
Mark Slee57cc25e2007-02-28 21:43:54 +00009Thrift is distributed under the Thrift open source software license.
10Please see the included LICENSE file.
Marc Slemko9de5a5c2006-08-23 22:34:00 +000011
12Introduction
13============
14
Mark Slee57cc25e2007-02-28 21:43:54 +000015Thrift is a lightweight, language-independent software stack with an
Mark Slee3303f362007-03-05 20:09:37 +000016associated code generation mechanism for RPC. Thrift provides clean
17abstractions for data transport, data serialization, and application
18level processing. The code generation system takes a simple definition
19language as its input and generates code across programming languages that
20uses the abstracted stack to build interoperable RPC clients and servers.
21
Mark Slee227ac2c2007-03-07 05:46:50 +000022Thrift is specifically designed to support non-atomic version changes
23across client and server code.
24
Mark Slee3303f362007-03-05 20:09:37 +000025For more details on Thrift's design and implementation, take a gander at
26the Thrift whitepaper included in this distribution or at the README files
Mark Slee227ac2c2007-03-07 05:46:50 +000027in your particular subdirectory of interest.
Mark Slee3303f362007-03-05 20:09:37 +000028
29Heirarchy
30=========
31
32thrift/
33
34 compiler/
35 Contains the Thrift compiler, implemented in C++.
36
37 lib/
38 Contains the Thrift software library implementation, subdivided by
39 language of implementation.
40
41 cpp/
42 java/
43 php/
44 py/
Mark Slee227ac2c2007-03-07 05:46:50 +000045 rb/
Mark Slee3303f362007-03-05 20:09:37 +000046
47 test/
48
49 Contains sample Thrift files and test code across the target programming
50 languages.
51
Mark Slee227ac2c2007-03-07 05:46:50 +000052 tutorial/
53
54 Contains a basic tutorial that will teach you how to develop software
55 using Thrift.
Marc Slemko9de5a5c2006-08-23 22:34:00 +000056
57Requirements
58============
Mark Slee3303f362007-03-05 20:09:37 +000059
60Thrift requires boost shared pointers from boost-1.33.1 or greater, see:
61http://www.boost.org/libs/smart_ptr/smart_ptr.htm
62
63Some portions of Thrift also depend upon libevent, see:
64http://monkey.org/~provos/libevent/
65
66These libraries are open source and may be freely obtained, but they are not
67provided as a part of this distribution.
Marc Slemko9de5a5c2006-08-23 22:34:00 +000068
69Resources
70=========
71
72More information about Thrift can be obtained on the Thrift webpage at:
73
74 http://developers.facebook.com/thrift
75
76Acknowledgments
77===============
78
Mark Slee54b7ab92007-03-06 00:06:27 +000079Thrift was inspired by pillar, a lightweight RPC tool written by Adam D'Angelo.
Marc Slemko9de5a5c2006-08-23 22:34:00 +000080
Mark Slee54b7ab92007-03-06 00:06:27 +000081Installation
Marc Slemko9de5a5c2006-08-23 22:34:00 +000082============
83
Mark Slee57cc25e2007-02-28 21:43:54 +000084If you are building from the first time out of the source repository, you will
85need to generate the configure scripts. From the top directory, do:
Marc Slemko9de5a5c2006-08-23 22:34:00 +000086
87 ./bootstrap.sh
88
Mark Slee57cc25e2007-02-28 21:43:54 +000089Once the configure scripts are generated, thrift can be configured.
90From the top directory, do:
Marc Slemko9de5a5c2006-08-23 22:34:00 +000091
92 ./configure
93
Mark Slee57cc25e2007-02-28 21:43:54 +000094You may need to specify the location of the boost files explicitly.
Mark Slee3303f362007-03-05 20:09:37 +000095If you installed boost in /usr/local, you would run configure as follows:
Marc Slemko9de5a5c2006-08-23 22:34:00 +000096
97 ./configure --with-boost=/usr/local
98
Mark Slee3303f362007-03-05 20:09:37 +000099Note that by default the thrift C++ library is typically built with debugging
100symbols included. If you want to customize these options you should use the
101CXXFLAGS option in configure, as such:
Mark Slee29050782006-09-29 00:12:30 +0000102
Mark Slee3303f362007-03-05 20:09:37 +0000103 ./configure CXXFLAGS='-g -O2'
Mark Slee57cc25e2007-02-28 21:43:54 +0000104 ./configure CFLAGS='-g -O2'
Mark Slee3303f362007-03-05 20:09:37 +0000105 ./configure CPPFLAGS='-g -O2'
Mark Slee29050782006-09-29 00:12:30 +0000106
Marc Slemko9de5a5c2006-08-23 22:34:00 +0000107Run ./configure --help to see other configuration options
108
Mark Slee227ac2c2007-03-07 05:46:50 +0000109Make thrift:
Marc Slemko9de5a5c2006-08-23 22:34:00 +0000110
111 make
112
113From the top directory, become superuser and do:
114
115 make install
Mark Slee54b7ab92007-03-06 00:06:27 +0000116
Mark Slee227ac2c2007-03-07 05:46:50 +0000117Note that some language packages must be installed manually using build tools
118better suited to those languages (at the time of this writing, this applies
119to Java, Ruby, PHP).
120
Mark Slee54b7ab92007-03-06 00:06:27 +0000121Look for the README file in the lib/<language>/ folder for more details on the
122installation of each language library package.