Apr 5 2008

Configuring Sphinx on Leopard
2

I ran into a few small errors when installing Sphinx on my Mac Book Pro. I’ll share my install instructions along with a couple troubleshooting tips for others that may have the same problems.

Let’s start with the instructions for installing the latest version to /usr/local. If you’re not familiar with what this means, check out Dan’s article on Using /usr/local.

curl -O http://www.sphinxsearch.com/downloads/sphinx-0.9.8-rc2.tar.gz
tar -xzf sphinx-0.9.8-rc2.tar.gz
cd sphinx-0.9.8-rc2
./configure --prefix=/usr/local
make
sudo make install
cd ../
rm -fr sphinx-0.9.8-rc2*

Troubleshooting

If you’re installing Sphinx on Leopard on the 64 bit architecture you need to run

LDFLAGS="-arch x86_64" ./configure

If make is throwing you an error that looks like this:

...
make[2]: *** [sphinx.o] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1

You may need to specify the path to mysql using the –with-mysql option to ./configure.

./configure --with-mysql=/usr/local/mysql

If make is throwing you an error that looks like this:

sphinx.cpp:17343: error: ‘XML_STATUS_ERROR’ was not declared in this scope
sphinx.cpp:17367: error: ‘XML_STATUS_OK’ was not declared in this scope
sphinx.cpp: In member function ‘bool CSphSource_XMLPipe2::ParseNextChunk(int, CSphString&)’:
sphinx.cpp:17775: error: ‘XML_STATUS_OK’ was not declared in this scope
make[2]: *** [sphinx.o] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1

This is from having an incompatible version of expat installed. Here are instructions for installing the latest version of expat.

curl -O -L http://downloads.sourceforge.net/expat/expat-2.0.1.tar.gz
tar -xzf expat-2.0.1.tar.gz 
cd expat-2.0.1
./configure --prefix=/usr/local
make 
sudo make install
cd ../
rm -fr expat-2.0.1*

2 comments

  • comment by Charly 1 Aug 08

    Hi Derek,

    we’ve had similar problems – and tried to provide an instruction on how it worked for us. We’ve used MacPorts. Just thought it might be of relevance for you/some guys reading your blog.

    Thanks for sharing your thoughts!

    Bests,
    Charly

  • comment by Jack 18 Oct 08

    Excellent, excellent info. I even was able to get Sphinx setup as part of the great (but sadly neglected) MAMP package. Very appreciative!

Sorry, the comment form is closed at this time.