Compile Thrift


download the newest boost version(eg.1.45.0), copy boost’s header files to /usr/include/boost or any other place as you like. There’s no need to compile boost, coz thrift only use it’s header files.


In order to use TNonBlockingServer, you need to download libevent, and then ./configure;make;make install


python 2.3.4 is not suitable, I have it upgrade to 2.7. If you don’t need python generator, just ignore this step.


./configure –with-php=no –enable-gen-php=no –with-php_extension=no –enable-gen-csharp=no –with-csharp=no –enable-gen-java=no  –enable-gen-js=no –enable-gen-javame=no –with-java=no –enable-gen-rb=no –with-ruby=no –enable-gen-cocoa=no –with-erlang=no –enable-gen-erl=no –with-perl=no –enable-gen-perl=no –with-boost=/usr/include/boost/ –disable-gen-java make make install

Replace ‘boost=/usr/lib/boost’ with your boost dir

Disable what you don’t really want, you can type ./configure –help to see all options.

And don’t forget to comment out 'namespace java xxxx’ in the test *.thrift files if you don’t need java, otherwise the tests will fail.

You may need more other libs to compile thrift, it depends on what language you want to support. For example if you what to use java code generator, then you will need install jdk.

if thrift complain about tr1::functional(when your compiler is too old to support tr1), you can change the include file from <tr1/functional> to <boost/tr1/functional.hpp>