If you are trying to install Sphinx on Mac OS X, it will most likely fail. The current version of MySQL bundled with Mac OS X is not supported and therefore, it will spit out the error message because it can’t find the correct libraries.
ld: library not found for -lmysqlclient
There is a quick solution to the problem -upgrade mysql! You’ll need Mac Ports installed, available at
http://macports.org/
Run the command
sudo port install mysql5
This will not destroy any existing data from your previous MySQL installation. The mac port installation will take a while, and it will appear as if it is just hanging. It’s not. It just takes a while. I clocked it at 15 minutes on a relatively fast network connection. Drink a cappuccino!
After you have the upgrade you’ll need to download Sphinx available at:
http://sphinxsearch.com/downloads.html (latest stable) and build the Sphinx engine from source like so:
wget http://sphinxsearch.com/downloads/sphinx-0.9.8.1.tar.gz tar xzvf sphinx-0.9.8.1.tar.gz cd sphinx-0.9.8.1/ ./configure --with-mysql-libs=/opt/local/lib/mysql5/mysql/ --with-mysql-includes=/opt/local/include/mysql5/mysql/ make sudo make install
Much thanks to this post b/c I spent forever trying to get the bundled version of MySQL linked properly:
http://www.fozworks.com/2008/9/5/rake-installation-of-sphinx-in-mac-osx
Related posts:
One Comment
Hi. Is there a quick fix to this issue im having…
it appears when i go to make install.
xwgstealth:~ blackjinxed$ sudo make install
Password:
Making install in src
if test -d ../.svn; then svn info .. –xml | perl svnxrev.pl; fi;
make install-am
test -z “/usr/local/bin” || /sphinx-0.9.9/config/install-sh -c -d “/usr/local/bin”
/usr/bin/install -c ‘indexer’ ‘/usr/local/bin/indexer’
/usr/bin/install -c ’searchd’ ‘/usr/local/bin/searchd’
/usr/bin/install -c ’search’ ‘/usr/local/bin/search’
/usr/bin/install -c ’spelldump’ ‘/usr/local/bin/spelldump’
/usr/bin/install -c ‘indextool’ ‘/usr/local/bin/indextool’
make[3]: Nothing to be done for `install-data-am’.
Making install in test
/bin/sh: line 0: cd: test: No such file or directory
make: *** [install-recursive] Error 1