Getting Thrift & Scribe working with OSX
I googled out a whole slew of write-ups on getting thrift and scribe working on OSX and I finally cobbled together something that works. I’m sure of dependancies may/will change so YMMV following these steps.
First off, if you don’t already, install Macports.
In terminal type:
sudo port selfupdate sudo port install boost sudo port install pkgconfig sudo port install libevent
Note: I read somewhere that libevent needs to be compiled not, installed through Macports, so I did both but doubt compiliing it was necessary. Also the ‘install boost’ section took me nearly an hour to fully build.
Grab thrift. Before doing any installing, you need to do this one step within the thrift directory:
cp /opt/local/share/aclocal/pkg.m4 aclocal
In the thrift directory run:
./bootstrap.sh ./configure --with-libevent=/opt/local make sudo make install
Now it’s on to Scribe. Grab scribe.
./bootstrap.sh
./configure
make
sudo make install
Alright, if all goes well you’ll have scribe and thrift now running. To double check follow these steps from http://bzilla.org/running-scribe-on-osx (it was down when I found it, so I grabbed this portion of text from Google cache and pasted it here):
Testing
Now that you have successfully installed Scribe and its pre-reqs you can test it out. For testing purposes you can follow the steps outlined in <scribe dir>/examples/README.
You may encounter an error when running scribe_cat and/or scribe_ctrl that looks something like:
- ImportError: No module named scribe
- ImportError: No module named fb303_scripts
First, make sure you ran the make install target for Thrift, FB303 and Scribe. If you confirm installation of all the libraries and you still are having import errors you’ll want to create symlinks for Python (I’ve tried exporting PYTHONHOME as well as creating a .pth file in the examples folder with no luck). Execute the following from the /Library/Python/2.5/site-packages/ directory:
- ln -s /usr/lib/python2.5/site-packages/fb303 fb303
- /usr/lib/python2.5/site-packages/fb303_scripts/ fb303_scripts
- ln -s /usr/lib/python2.5/site-packages/thrift/ thrift
- ln -s /usr/lib/python2.5/site-packages/scribe scribe
You should now be able to run the examples.