Compiling Sphinx on OSX Leopard

Here’s a quicky – I have recently moved my dev env from Ubuntu/Gnome on a Dell XPS m1330 laptop to a MacBook Pro laptop. My dev env requires the Sphinx search engine so here’s how to compile it on Leopard.

With a straight ./configure; make you will get the following error:


ld: warning in indexer.o, file is not of required architecture
ld: warning in libsphinx.a, file is not of required architecture
ld: warning in /usr/local/mysql/lib/libmysqlclient.dylib, file is not of required architecture
ld: warning in /usr/local/mysql/lib/libmygcc.a, file is not of required architecture
Undefined symbols:
"_main", referenced from:
start in crt1.10.5.o
ld: symbol(s) not found

Here’s what you need to do:


export LDFLAGS="-arch x86_64"; ./configure

Tags: , ,

3 Responses to “Compiling Sphinx on OSX Leopard”

  1. Martin Dufort says:

    Colin: You will encounter the same type of error if you compile the MySQL Native GEM so beware.
    Welcome to the Mac.

  2. Jason Bond Pratt says:

    Hey Colin – thanks, perfect fix. Martin, et al: I just dropped

    export LDFLAGS=”-arch x86_64″

    into .profile, it comes up fairly often and will help with open source compilation without having to re-figure it out every time.

  3. Thanks for the flags! It saved me hours and also kept me from having to raise a white flag and shift my eval work to Linux.

Leave a Reply