Skip to content

Instantly share code, notes, and snippets.

@dajobe
Last active December 19, 2015 07:59
Show Gist options
  • Save dajobe/5922470 to your computer and use it in GitHub Desktop.
Save dajobe/5922470 to your computer and use it in GitHub Desktop.
Build thrift on Ubuntu 10.04

Set up the development environment

$ mkdir -p ~/dev/thrift
$ cd ~/dev/thrift

Install the dependencies

Get some core development tools that are not direct dependencies below

$ sudo apt-get install git-core make

The following pulls in openjdk-6-jre-headless to provide /usr/bin/java:

$ sudo apt-get install maven2

Pull in the main thrift dependencies (taken from http://thrift.apache.org/docs/install/ubuntu/ ):

$ sudo apt-get install libboost-dev libboost-test-dev libboost-program-options-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev 

Add curl since we'll need it shortly:

$ sudo apt-get install curl

Install the JDK to get /usr/bin/javac and the Java .h header files:

$ sudo apt-get install openjdk-6-jdk

Download and configure thrift

Get thrift 0.9.0 with curl and extract it:

$ curl -O ftp://apache.mirrors.pair.com/thrift/0.9.0/thrift-0.9.0.tar.gz
$ tar xfpz thrift-0.9.0.tar.gz

Python is enabled by default (although broken since there is no Python.h header). This line will build with C++ and Java:

$ cd thrift-0.9.0
$ ./configure --prefix=/usr --without-python JAVA_PREFIX=/usr/share/java

It should look something like this at the end, showing it is building C++ and Java only:

...

thrift 0.9.0

Building C++ Library ......... : yes
Building C (GLib) Library .... : no
Building Java Library ........ : yes
Building C# Library .......... : no
Building Python Library ...... : no
Building Ruby Library ........ : no
Building Haskell Library ..... : no
Building Perl Library ........ : no
Building PHP Library ......... : no
Building Erlang Library ...... : no
Building Go Library .......... : no
Building D Library ........... : no

C++ Library:
   Build TZlibTransport ...... : yes
   Build TNonblockingServer .. : yes
   Build TQTcpServer (Qt) .... : no

Java Library:
   Using javac ............... : javac
   Using java ................ : java
   Using ant ................. : /usr/bin/ant

Build:

$ make

and install:

$ sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment