Compiling Sphinx on Mac OS X

December 27th, 2011 by Eric Cope

We are looking into using Sphinx on a project and needed to get it installed on our local machines, Macbook Pros, for exploration. Sphinx does not ship Mac binaries, so we had to compile it. We had XCode previously installed. If you want the MySQL to connect, you need to download the source files to the version of MySQL you are running.

The first step is to run Cmake from within the MySQL source directory. Specifically, it generates a mysql_version.h file from mysql_version.h.in.  You probably have to download Cmake.

 cmake -DBUILD_CONFIG=mysql_release

You only need to make the MySQL client libraries, so cd into libmysql directory

cd libmysql
make

This will compile and link the necessary files into a libary for Sphinx to use.

Once these complete successfully, now you can follow sphinx’s compilation directions.

./configure --prefix=/Applications/sphinx/2.0.3/sphinx-2.0.3 --with-mysql-includes=/Applications/sphinx/2.0.3/mysql-5.5.9/include --with-mysql-libs=/Applications/sphinx/2.0.3/mysql-5.5.9/libmysql
make

You can see I downloaded the Sphinx and MySQL 5.5.9 sources to a directory buried in the Applications directory. I specified the includes directory as well as the client directory. Change these to your paths as needed. When its complete, you should have a bunch of new directories and files in the –prefix path. searchd is the search daemon in the bin directory.

Now, its off to try and leverage Sphinx!

UPDATE: I want to point out that you should typically compile the thread safe versions if the MySQL client. The Cmake script configures to compile both, thread safe and thread unsafe. I assume sphinx uses the thread-safe libraries, or at least knows its using unsafe versions on purpose. Hit tip to Chris Sebastian.

 

Mac OS X Upgrade: Snow Leopard

December 10th, 2009 by Eric Cope

I recently upgraded my Macbook Pro’s operating system. The upgrade cost was an incredible $29, an order of magnitude cheaper than Microsoft’s latest upgrade. And, it is not just an upgrade, its a full install too. I popped in the DVD, and an hour later, my laptop was running OS X 10.6. I ran the software upgrade tool and everything is fantastic.

One of the reasons I upgraded was the rumors surrounding the necessary disk space needed for the OS was reduced. I gained an additional 10GB by installing the update. Additionally, Mail seems to run much faster.

All in all, it was an easy enjoyable experience to upgrade my Mac. It was very easy and anyone could probably pull it off. Just remember to backup using Time Machine before you run the upgrade.