Sphinx Config Problem on OS X Leopard 10.5.8

I bumped into a very strange bug trying to compile Sphinx on OS X Leopard today.

After running ./configure for Sphinx 0.9.8-rc2, things looked good until:

configure: error: cannot run C compiled programs. .

Then nothing.

Now, I’m positive that my computer is advanced enough to run C compile programs. So I peaked into the resulting config.log and noticed:

...Bad CPU type in executable...

Turns out Sphinx defaults to compiling for 64bit machines and, well, my MacBook Pro isn’t.

Changing the configure flags to 32bit mode fixed it:

./configure CFLAGS="-O -arch i386" CXXFLAGS="-O -arch i386" LDFLAGS="-arch i386" --disable-dependency-tracking

Thanks to schmeeve over at d27n for the tip.

After running: make; sudo make install, remember to create a sphinx.conf file:

cd cd /usr/local/etc
sudo cp sphinx.conf.dist sphinx.conf

Then run sudo searchd to run Sphinx or for ThinkingSphinx:

ts:config
ts:index
ts:start