| Mark Slee | 57cc25e | 2007-02-28 21:43:54 +0000 | [diff] [blame] | 1 | Thrift (Thrift IDL and RPC tool) | 
| Marc Slemko | 9de5a5c | 2006-08-23 22:34:00 +0000 | [diff] [blame] | 2 |  | 
|  | 3 | Mark Slee (mcslee@facebook.com) | 
|  | 4 | Marc Kwiatkowski (marc@facebook.com) | 
| Mark Slee | 3303f36 | 2007-03-05 20:09:37 +0000 | [diff] [blame] | 5 | Aditya Agarwal (aditya@facebook.com) | 
| Marc Slemko | 9de5a5c | 2006-08-23 22:34:00 +0000 | [diff] [blame] | 6 |  | 
| Mark Slee | 227ac2c | 2007-03-07 05:46:50 +0000 | [diff] [blame] | 7 | Last Modified: 2007-Mar-06 | 
|  | 8 |  | 
| Mark Slee | 57cc25e | 2007-02-28 21:43:54 +0000 | [diff] [blame] | 9 | Thrift is distributed under the Thrift open source software license. | 
|  | 10 | Please see the included LICENSE file. | 
| Marc Slemko | 9de5a5c | 2006-08-23 22:34:00 +0000 | [diff] [blame] | 11 |  | 
|  | 12 | Introduction | 
|  | 13 | ============ | 
|  | 14 |  | 
| Mark Slee | 57cc25e | 2007-02-28 21:43:54 +0000 | [diff] [blame] | 15 | Thrift is a lightweight, language-independent software stack with an | 
| Mark Slee | 3303f36 | 2007-03-05 20:09:37 +0000 | [diff] [blame] | 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. | 
|  | 21 |  | 
| Mark Slee | 227ac2c | 2007-03-07 05:46:50 +0000 | [diff] [blame] | 22 | Thrift is specifically designed to support non-atomic version changes | 
|  | 23 | across client and server code. | 
|  | 24 |  | 
| Mark Slee | 3303f36 | 2007-03-05 20:09:37 +0000 | [diff] [blame] | 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 | 
| Mark Slee | 227ac2c | 2007-03-07 05:46:50 +0000 | [diff] [blame] | 27 | in your particular subdirectory of interest. | 
| Mark Slee | 3303f36 | 2007-03-05 20:09:37 +0000 | [diff] [blame] | 28 |  | 
|  | 29 | Heirarchy | 
|  | 30 | ========= | 
|  | 31 |  | 
|  | 32 | thrift/ | 
|  | 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 Slee | 227ac2c | 2007-03-07 05:46:50 +0000 | [diff] [blame] | 45 | rb/ | 
| Mark Slee | 3303f36 | 2007-03-05 20:09:37 +0000 | [diff] [blame] | 46 |  | 
|  | 47 | test/ | 
|  | 48 |  | 
|  | 49 | Contains sample Thrift files and test code across the target programming | 
|  | 50 | languages. | 
|  | 51 |  | 
| Mark Slee | 227ac2c | 2007-03-07 05:46:50 +0000 | [diff] [blame] | 52 | tutorial/ | 
|  | 53 |  | 
|  | 54 | Contains a basic tutorial that will teach you how to develop software | 
|  | 55 | using Thrift. | 
| Marc Slemko | 9de5a5c | 2006-08-23 22:34:00 +0000 | [diff] [blame] | 56 |  | 
|  | 57 | Requirements | 
|  | 58 | ============ | 
| Mark Slee | 3303f36 | 2007-03-05 20:09:37 +0000 | [diff] [blame] | 59 |  | 
|  | 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 | 
|  | 62 |  | 
|  | 63 | Some portions of Thrift also depend upon libevent, see: | 
|  | 64 | http://monkey.org/~provos/libevent/ | 
|  | 65 |  | 
|  | 66 | These libraries are open source and may be freely obtained, but they are not | 
|  | 67 | provided as a part of this distribution. | 
| Marc Slemko | 9de5a5c | 2006-08-23 22:34:00 +0000 | [diff] [blame] | 68 |  | 
|  | 69 | Resources | 
|  | 70 | ========= | 
|  | 71 |  | 
|  | 72 | More information about Thrift can be obtained on the Thrift webpage at: | 
|  | 73 |  | 
|  | 74 | http://developers.facebook.com/thrift | 
|  | 75 |  | 
|  | 76 | Acknowledgments | 
|  | 77 | =============== | 
|  | 78 |  | 
| Mark Slee | 54b7ab9 | 2007-03-06 00:06:27 +0000 | [diff] [blame] | 79 | Thrift was inspired by pillar, a lightweight RPC tool written by Adam D'Angelo. | 
| Marc Slemko | 9de5a5c | 2006-08-23 22:34:00 +0000 | [diff] [blame] | 80 |  | 
| Mark Slee | 54b7ab9 | 2007-03-06 00:06:27 +0000 | [diff] [blame] | 81 | Installation | 
| Marc Slemko | 9de5a5c | 2006-08-23 22:34:00 +0000 | [diff] [blame] | 82 | ============ | 
|  | 83 |  | 
| Mark Slee | 57cc25e | 2007-02-28 21:43:54 +0000 | [diff] [blame] | 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: | 
| Marc Slemko | 9de5a5c | 2006-08-23 22:34:00 +0000 | [diff] [blame] | 86 |  | 
|  | 87 | ./bootstrap.sh | 
|  | 88 |  | 
| Mark Slee | 57cc25e | 2007-02-28 21:43:54 +0000 | [diff] [blame] | 89 | Once the configure scripts are generated, thrift can be configured. | 
|  | 90 | From the top directory, do: | 
| Marc Slemko | 9de5a5c | 2006-08-23 22:34:00 +0000 | [diff] [blame] | 91 |  | 
|  | 92 | ./configure | 
|  | 93 |  | 
| Mark Slee | 57cc25e | 2007-02-28 21:43:54 +0000 | [diff] [blame] | 94 | You may need to specify the location of the boost files explicitly. | 
| Mark Slee | 3303f36 | 2007-03-05 20:09:37 +0000 | [diff] [blame] | 95 | If you installed boost in /usr/local, you would run configure as follows: | 
| Marc Slemko | 9de5a5c | 2006-08-23 22:34:00 +0000 | [diff] [blame] | 96 |  | 
|  | 97 | ./configure --with-boost=/usr/local | 
|  | 98 |  | 
| Mark Slee | 3303f36 | 2007-03-05 20:09:37 +0000 | [diff] [blame] | 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: | 
| Mark Slee | 2905078 | 2006-09-29 00:12:30 +0000 | [diff] [blame] | 102 |  | 
| Mark Slee | 3303f36 | 2007-03-05 20:09:37 +0000 | [diff] [blame] | 103 | ./configure CXXFLAGS='-g -O2' | 
| Mark Slee | 57cc25e | 2007-02-28 21:43:54 +0000 | [diff] [blame] | 104 | ./configure CFLAGS='-g -O2' | 
| Mark Slee | 3303f36 | 2007-03-05 20:09:37 +0000 | [diff] [blame] | 105 | ./configure CPPFLAGS='-g -O2' | 
| Mark Slee | 2905078 | 2006-09-29 00:12:30 +0000 | [diff] [blame] | 106 |  | 
| Marc Slemko | 9de5a5c | 2006-08-23 22:34:00 +0000 | [diff] [blame] | 107 | Run ./configure --help to see other configuration options | 
|  | 108 |  | 
| Mark Slee | 227ac2c | 2007-03-07 05:46:50 +0000 | [diff] [blame] | 109 | Make thrift: | 
| Marc Slemko | 9de5a5c | 2006-08-23 22:34:00 +0000 | [diff] [blame] | 110 |  | 
|  | 111 | make | 
|  | 112 |  | 
|  | 113 | From the top directory, become superuser and do: | 
|  | 114 |  | 
|  | 115 | make install | 
| Mark Slee | 54b7ab9 | 2007-03-06 00:06:27 +0000 | [diff] [blame] | 116 |  | 
| Mark Slee | 227ac2c | 2007-03-07 05:46:50 +0000 | [diff] [blame] | 117 | Note that some language packages must be installed manually using build tools | 
|  | 118 | better suited to those languages (at the time of this writing, this applies | 
|  | 119 | to Java, Ruby, PHP). | 
|  | 120 |  | 
| Mark Slee | 54b7ab9 | 2007-03-06 00:06:27 +0000 | [diff] [blame] | 121 | Look for the README file in the lib/<language>/ folder for more details on the | 
|  | 122 | installation of each language library package. |