blob: adf8af47350238a8901e1e802ce8e2f8ae909b91 [file] [log] [blame]
Greg Steinf0d35d22009-01-30 19:10:27 +00001Apache Thrift (an Apache Incubator project)
Marc Slemko9de5a5c2006-08-23 22:34:00 +00002
Greg Steinf0d35d22009-01-30 19:10:27 +00003Last Modified: 2009-Jan-30
Marc Slemko9de5a5c2006-08-23 22:34:00 +00004
Bryan Duxburydef30a62009-04-08 00:19:37 +00005License
6=======
7
8Licensed to the Apache Software Foundation (ASF) under one
9or more contributor license agreements. See the NOTICE file
10distributed with this work for additional information
11regarding copyright ownership. The ASF licenses this file
12to you under the Apache License, Version 2.0 (the
13"License"); you may not use this file except in compliance
14with the License. You may obtain a copy of the License at
15
16 http://www.apache.org/licenses/LICENSE-2.0
17
18Unless required by applicable law or agreed to in writing,
19software distributed under the License is distributed on an
20"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21KIND, either express or implied. See the License for the
22specific language governing permissions and limitations
23under the License.
Marc Slemko9de5a5c2006-08-23 22:34:00 +000024
25Introduction
26============
27
Mark Slee57cc25e2007-02-28 21:43:54 +000028Thrift is a lightweight, language-independent software stack with an
Mark Slee3303f362007-03-05 20:09:37 +000029associated code generation mechanism for RPC. Thrift provides clean
30abstractions for data transport, data serialization, and application
31level processing. The code generation system takes a simple definition
32language as its input and generates code across programming languages that
33uses the abstracted stack to build interoperable RPC clients and servers.
34
Mark Slee227ac2c2007-03-07 05:46:50 +000035Thrift is specifically designed to support non-atomic version changes
36across client and server code.
37
Mark Slee3303f362007-03-05 20:09:37 +000038For more details on Thrift's design and implementation, take a gander at
39the Thrift whitepaper included in this distribution or at the README files
Mark Slee227ac2c2007-03-07 05:46:50 +000040in your particular subdirectory of interest.
Mark Slee3303f362007-03-05 20:09:37 +000041
42Heirarchy
43=========
44
45thrift/
46
47 compiler/
48 Contains the Thrift compiler, implemented in C++.
49
50 lib/
51 Contains the Thrift software library implementation, subdivided by
52 language of implementation.
53
54 cpp/
55 java/
56 php/
57 py/
Mark Slee227ac2c2007-03-07 05:46:50 +000058 rb/
Mark Slee3303f362007-03-05 20:09:37 +000059
60 test/
61
62 Contains sample Thrift files and test code across the target programming
63 languages.
64
Mark Slee227ac2c2007-03-07 05:46:50 +000065 tutorial/
66
67 Contains a basic tutorial that will teach you how to develop software
68 using Thrift.
Marc Slemko9de5a5c2006-08-23 22:34:00 +000069
70Requirements
71============
Mark Slee3303f362007-03-05 20:09:37 +000072
David Reissfc306672009-03-20 07:15:04 +000073See http://wiki.apache.org/thrift/ThriftRequirements for
74an up-to-date list of build requirements.
Marc Slemko9de5a5c2006-08-23 22:34:00 +000075
76Resources
77=========
78
79More information about Thrift can be obtained on the Thrift webpage at:
80
Greg Steinf0d35d22009-01-30 19:10:27 +000081 http://incubator.apache.org/thrift
Marc Slemko9de5a5c2006-08-23 22:34:00 +000082
83Acknowledgments
84===============
85
Greg Steinf0d35d22009-01-30 19:10:27 +000086Thrift was inspired by pillar, a lightweight RPC tool written by Adam D'Angelo,
87and also by Google's protocol buffers.
Marc Slemko9de5a5c2006-08-23 22:34:00 +000088
Mark Slee54b7ab92007-03-06 00:06:27 +000089Installation
Marc Slemko9de5a5c2006-08-23 22:34:00 +000090============
91
Mark Slee57cc25e2007-02-28 21:43:54 +000092If you are building from the first time out of the source repository, you will
David Reissb72d19f2007-09-18 19:46:00 +000093need to generate the configure scripts. (This is not necessary if you
94downloaded a tarball.) From the top directory, do:
Marc Slemko9de5a5c2006-08-23 22:34:00 +000095
96 ./bootstrap.sh
97
Mark Slee57cc25e2007-02-28 21:43:54 +000098Once the configure scripts are generated, thrift can be configured.
99From the top directory, do:
Marc Slemko9de5a5c2006-08-23 22:34:00 +0000100
101 ./configure
102
Mark Slee57cc25e2007-02-28 21:43:54 +0000103You may need to specify the location of the boost files explicitly.
Mark Slee3303f362007-03-05 20:09:37 +0000104If you installed boost in /usr/local, you would run configure as follows:
Marc Slemko9de5a5c2006-08-23 22:34:00 +0000105
106 ./configure --with-boost=/usr/local
107
Mark Slee3303f362007-03-05 20:09:37 +0000108Note that by default the thrift C++ library is typically built with debugging
109symbols included. If you want to customize these options you should use the
110CXXFLAGS option in configure, as such:
Mark Slee29050782006-09-29 00:12:30 +0000111
Mark Slee3303f362007-03-05 20:09:37 +0000112 ./configure CXXFLAGS='-g -O2'
Mark Slee57cc25e2007-02-28 21:43:54 +0000113 ./configure CFLAGS='-g -O2'
David Reissaea19c92007-08-29 23:17:32 +0000114 ./configure CPPFLAGS='-DDEBUG_MY_FEATURE'
Mark Slee29050782006-09-29 00:12:30 +0000115
Marc Slemko9de5a5c2006-08-23 22:34:00 +0000116Run ./configure --help to see other configuration options
117
David Reissaea19c92007-08-29 23:17:32 +0000118Please be aware that the Python library will ignore the --prefix option
119and just install wherever Python's distutils puts it (usually along
David Reissd6832192007-09-05 00:47:32 +0000120the lines of /usr/lib/pythonX.Y/site-packages/). If you need to control
121where the Python modules are installed, set the PY_PREFIX variable.
122(DESTDIR is respected for Python and C++.)
David Reissaea19c92007-08-29 23:17:32 +0000123
Mark Slee227ac2c2007-03-07 05:46:50 +0000124Make thrift:
Marc Slemko9de5a5c2006-08-23 22:34:00 +0000125
126 make
127
128From the top directory, become superuser and do:
129
130 make install
Mark Slee54b7ab92007-03-06 00:06:27 +0000131
Mark Slee227ac2c2007-03-07 05:46:50 +0000132Note that some language packages must be installed manually using build tools
133better suited to those languages (at the time of this writing, this applies
134to Java, Ruby, PHP).
135
Mark Slee54b7ab92007-03-06 00:06:27 +0000136Look for the README file in the lib/<language>/ folder for more details on the
137installation of each language library package.