Wednesday 16 January 2013

Thrift installation

Apache Thrift Installation Tutorial:
The official documentation for installing/using Apache Thrift is currently somewhat lacking. The following are step-by-step instructions on installing Apache Thrift and getting the sample project code running on either a fresh Ubuntu 10.10 installation
1. Install the necessary dependencies.
# sudo apt-get install libssl-dev libboost-dev flex bison g++
2. Download Apache Thrift 0.7 at:
# wget http://archive.apache.org/dist/thrift/0.7.0/thrift-0.7.0.tar.gz
3. Untar the tarball to your project directory:
# cd ~/project
# tar –xzvf ~/thrift-0.7.0.tar.gz
4. Run configure (turning off support for other unused languages)
# cd thrift-0.7.0
# chmod u+x configure install-sh
# ./configure --prefix=${HOME}/project --exec-prefix=${HOME}/project --with-python=no --with-erlang=no --with-java=no --with-php=no --with-csharp=no --with-ruby=no
# make
# make install
5. Download the sample code from the course website:
# cd
# wget http://www.cs.uwaterloo.ca/~bernard/courses/cs454/sample-0.1.1.tar.gz
# cd project
# tar –xzvf ~/sample-0.1.1.tar.gz
6. Compile the WatDHT.thrift file:
# cd sample
# ~/project/bin/thrift --strict --gen cpp WatDHT.thrift
7. Replace the first 4 lines of the Makefile in the sample code with the following:
CXX = g++
CPPFLAGS = -g -fpermissive -Wall -I. -I${HOME}/project/include -I${HOME}/project/include/thrift -Igen-cpp
LDFLAGS = -L${HOME}/project/lib -lthrift -lpthread -lcrypto
LD = g++
8. Compile the sample code:
# make
9. Add to LD_LIBRARY_PATH (assuming you are using bash as your shell):
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${HOME}/project/lib

4 comments:

  1. http://thrift.apache.org/tutorial/csharp/

    ReplyDelete
  2. http://blog.wakatta.jp/blog/2011/12/12/seven-databases-in-seven-weeks-hbase-day-2/

    ReplyDelete
  3. http://nbonvin.wordpress.com/2009/03/08/simple-thrift-tutorial/

    http://diwakergupta.github.com/thrift-missing-guide/thrift.pdf

    http://www.thecloudavenue.com/2012/02/getting-started-with-hbase.html

    ReplyDelete
  4. http://talkminer.com/viewtalk.jsp?videoid=xHvJhuGGOKc&q=#.UPfXL_JCHkU

    ReplyDelete