blob: adf8af47350238a8901e1e802ce8e2f8ae909b91 [file] [log] [blame]
Gavin McDonald0b75e1a2010-10-28 02:12:01 +00001Apache Thrift (an Apache Incubator project)
2
3Last Modified: 2009-Jan-30
4
5License
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.
24
25Introduction
26============
27
28Thrift is a lightweight, language-independent software stack with an
29associated 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
35Thrift is specifically designed to support non-atomic version changes
36across client and server code.
37
38For more details on Thrift's design and implementation, take a gander at
39the Thrift whitepaper included in this distribution or at the README files
40in your particular subdirectory of interest.
41
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/
58 rb/
59
60 test/
61
62 Contains sample Thrift files and test code across the target programming
63 languages.
64
65 tutorial/
66
67 Contains a basic tutorial that will teach you how to develop software
68 using Thrift.
69
70Requirements
71============
72
73See http://wiki.apache.org/thrift/ThriftRequirements for
74an up-to-date list of build requirements.
75
76Resources
77=========
78
79More information about Thrift can be obtained on the Thrift webpage at:
80
81 http://incubator.apache.org/thrift
82
83Acknowledgments
84===============
85
86Thrift was inspired by pillar, a lightweight RPC tool written by Adam D'Angelo,
87and also by Google's protocol buffers.
88
89Installation
90============
91
92If you are building from the first time out of the source repository, you will
93need to generate the configure scripts. (This is not necessary if you
94downloaded a tarball.) From the top directory, do:
95
96 ./bootstrap.sh
97
98Once the configure scripts are generated, thrift can be configured.
99From the top directory, do:
100
101 ./configure
102
103You may need to specify the location of the boost files explicitly.
104If you installed boost in /usr/local, you would run configure as follows:
105
106 ./configure --with-boost=/usr/local
107
108Note 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:
111
112 ./configure CXXFLAGS='-g -O2'
113 ./configure CFLAGS='-g -O2'
114 ./configure CPPFLAGS='-DDEBUG_MY_FEATURE'
115
116Run ./configure --help to see other configuration options
117
118Please be aware that the Python library will ignore the --prefix option
119and just install wherever Python's distutils puts it (usually along
120the 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++.)
123
124Make thrift:
125
126 make
127
128From the top directory, become superuser and do:
129
130 make install
131
132Note 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
136Look for the README file in the lib/<language>/ folder for more details on the
137installation of each language library package.