Thursday, February 10, 2011

Thrift installation on ubuntu (for usage with ruby)

(This tutorial is tested on thrift 0.5.0)

I was working on thrift (http://thrift.apache.org/), found a couple of issues during the installation and had to look at a couple of links to figure out the correct method.. so i thought to sum it up here.
  1. Download thrift (http://thrift.apache.org/)
  2. Extract the downloaded archive and go to the folder through terminal
  3. In order to install thrift, you'd need following dependencies: (as mentioned on the thrift wiki page)
    1.  g++ 3.3.5+
    2. boost 1.33.1+ (1.34.0 for building all tests)
    3. Runtime libraries for lex and yacc might be needed for the compiler
    4. The dependencies for each language are different which you can see at the link => http://wiki.apache.org/thrift/ThriftRequirements
    5. GNU build tools: autoconf 2.59+ (2.60+ recommended), automake 1.9+, libtool
    6. For C, you'll also might need to install "libglib2.0-dev"
  4. In order to install above dependencies, you can use the following command
    sudo apt-get install g++ libboost-dev libevent-dev automake pkg-config libtool flex bison
  5. You might need to bootstrap first, for that run ./bootstrap.sh (assuming you are in the directory of extracted thrift)
  6. Now, run the following commands (in sequence) to configure and install thrift
    1. ./configure
    2. make
    3. sudo make install
  7. Now, you are good to go with thrift. The final piece missing is the thrift gem. You can install that using command => sudo gem install thrift

Hope you find the post helpful. I will try to post example of thrift using ruby soon :)

No comments:

Post a Comment