HOW TO INSTALL APACHE THRIFT IN UBUNTU

Apache Thrift is a software framework used for scalable cross-language services development. It combines a software stack with a code generation engine to build services that work efficiently and seamlessly between various languages.

Open the terminal (Ctrl+Alt+T)

Before we start installing thrift server, we need to install java. You can refer my previous post on how to install java. default JRE and JDK or Oracle JDK.

Once java is installed in your system, we can start installing the dependency packages for thrift server.
sudo apt-get install libboost-dev libboost-test-dev libboost-program-options-dev libboost-system-dev libboost-filesystem-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev

Now move to the tmp directory,
cd /tmp

Download the thrift package from http://archive.apache.org/dist/thrift/0.9.3/thrift-0.9.3.tar.gz

Untar the downloaded file using the below command
sudo tar xvzf /home/greetz/Downloads/thrift-0.9.3.tar.gz

Note: Assuming that the downloaded file is stored in the Downloads folder by default.

Open the thrift directory and execute the following commands.
cd thrift-0.9.3/
sudo ./configure
sudo make
sudo make install

 

Check the location of thrift.pc
cd /usr/local/lib/pkgconfig/

Configure the thrift.pc file
sudo gedit /usr/local/lib/pkgconfig/thrift.pc

thrift_pc

Change the includedir as shown below,
includedir=${prefix}/include/thrift

check whether pkg-config path is correct.
pkg-config –cflags thrift 

thrift2

This will return the path as,
-I/usr/local/include/thrift

For more help about thrift,
thrift –help

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s