Compiling Thrift on OSX

Compiling thrift on OSX can be a bit of a hassle because of some POSIX discrepancies.

sudo port install boost 

tar xfz thrift-*
cd thirft-*
curl http://blog.leetsoft.com/files/patches/thrift.patch | patch -p1
./configure --with-boost=/opt/local  --prefix=/opt/local
make
sudo make install 

Update: Installing from SVN is doesn’t require the patch above so I’m recommending to do that now:

svn co http://svn.facebook.com/svnroot/thrift/trunk/ thrift
cd thrift; sh bootstrap.sh
./configure --with-boost=/opt/local --with-libevent=/opt/local --prefix=/opt/local
sudo make install

To install the ruby libs for thrift simply do:

cd lib/rb
ruby setup.rb