Sphinx installation problem w/mysql
I'm having issues installing Sphinx. I run configure as it says in the instructions (./configure --prefix=/usr/local/sphinx) and get this result:
checking build environment
--------------------------
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for compiler programs
------------------------------
checking whether to compile debug version... no
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
rm: conftest.dSYM: is a directory
checking dependency style of g++... gcc3
checking for ranlib... ranlib
checking for header files
-------------------------
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking expat.h usability... yes
checking expat.h presence... yes
checking for expat.h... yes
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for types
------------------
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for off_t... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for library functions
------------------------------
checking for pid_t... yes
checking for unistd.h... (cached) yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for sys/socket.h... (cached) yes
checking types of arguments for select... int,fd_set *,struct timeval *
rm: conftest.dSYM: is a directory
checking return type of signal handlers... void
checking whether lstat dereferences a symlink specified with a trailing slash... no
checking whether stat accepts an empty string... no
checking for vprintf... yes
checking for _doprnt... no
checking for library containing setsockopt... none required
checking for library containing gethostbyname... none required
checking for library containing XML_Parse... -lexpat
checking for library containing iconv... -liconv
checking for library containing logf... none required
checking for dup2... yes
checking for gethostbyname... yes
checking for gettimeofday... yes
checking for memmove... yes
checking for memset... yes
checking for select... yes
checking for socket... yes
checking for strcasecmp... yes
checking for strchr... yes
checking for strerror... yes
checking for strncasecmp... yes
checking for strstr... yes
checking for strtol... yes
checking for logf... yes
checking for LOCK_EX in sys/file.h... rm: conftest.dSYM: is a directory
yes
checking for F_SETLKW in fcntl.h... rm: conftest.dSYM: is a directory
yes
configuring Sphinx
------------------
checking whether to compile with MySQL support... yes
checking for mysql_config... mysql_config
checking MySQL include files... -I/usr/include -fno-omit-frame-pointer -pipe -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT
checking MySQL libraries... -pipe -L/usr/lib -lmysqlclient -lz -lm
checking whether to compile with PostgreSQL support... no
checking whether to use 64-bit document/word IDs... no
checking whether to compile with libstemmer support... no
checking for libexpat... found
checking for libiconv... found
checking for iconv() arg types... char **
checking for unaligned RAM access... yes
generating configuration files
------------------------------
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating libstemmer_c/Makefile
config.status: creating sphinx.conf.dist
config.status: creating sphinx-min.conf.dist
config.status: creating config/config.h
config.status: config/config.h is unchanged
config.status: executing depfiles commands
configuration done
------------------
You can now run 'make' to build Sphinx binaries,
and then run 'make install' to install them.
All fine, as far as I can tell. But when I run make, I get this:
Making all in src
if test -d ../.svn; then svn info .. --xml | perl svnxrev.pl; fi;
make all-am
if g++ -DHAVE_CONFIG_H -I. -I. -I../config -DSYSCONFDIR="\"/usr/local/sphinx/etc\"" -I/usr/local/include -I/usr/include -fno-omit-frame-pointer -pipe -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -Wall -g -D_FILE_OFFSET_BITS=64 -O3 -DNDEBUG -MT sphinx.o -MD -MP -MF ".deps/sphinx.Tpo" -c -o sphinx.o sphinx.cpp; \
then mv -f ".deps/sphinx.Tpo" ".deps/sphinx.Po"; else rm -f ".deps/sphinx.Tpo"; exit 1; fi
In file included from sphinx.cpp:14:
sphinx.h:54:19: error: mysql.h: No such file or directory
sphinx.h:1102: error: ISO C++ forbids declaration of 'MYSQL_RES' with no type
sphinx.h:1102: error: expected ';' before '*' token
sphinx.h:1103: error: ISO C++ forbids declaration of 'MYSQL_FIELD' with no type
sphinx.h:1103: error: expected ';' before '*' token
sphinx.h:1104: error: 'MYSQL_ROW' does not name a type
sphinx.h:1105: error: 'MYSQL' does not name a type
sphinx.cpp: In constructor 'CSphSource_MySQL::CSphSource_MySQL(const char*)':
sphinx.cpp:16697: error: class 'CSphSource_MySQL' does not have any field named 'm_pMysqlResult'
sphinx.cpp:16698: error: class 'CSphSource_MySQL' does not have any field named 'm_pMysqlFields'
sphinx.cpp:16699: error: class 'CSphSource_MySQL' does not have any field named 'm_tMysqlRow'
sphinx.cpp: In member function 'virtual void CSphSource_MySQL::SqlDismissResult()':
sphinx.cpp:16706: error: 'm_pMysqlResult' was not declared in this scope
sphinx.cpp:16709: error: 'm_pMysqlResult' was not declared in this scope
sphinx.cpp:16709: error: 'mysql_free_result' was not declared in this scope
sphinx.cpp:16711: error: 'm_pMysqlFields' was not declared in this scope
sphinx.cpp: In member function 'virtual bool CSphSource_MySQL::SqlQuery(const char*)':
sphinx.cpp:16717: error: 'm_tMysqlDriver' was not declared in this scope
sphinx.cpp:16717: error: 'mysql_query' was not declared in this scope
sphinx.cpp:16720: error: 'm_pMysqlResult' was not declared in this scope
sphinx.cpp:16720: error: 'm_tMysqlDriver' was not declared in this scope
sphinx.cpp:16720: error: 'mysql_use_result' was not declared in this scope
sphinx.cpp:16721: error: 'm_pMysqlFields' was not declared in this scope
sphinx.cpp: In member function 'virtual bool CSphSource_MySQL::SqlIsError()':
sphinx.cpp:16728: error: 'm_tMysqlDriver' was not declared in this scope
sphinx.cpp:16728: error: 'mysql_errno' was not declared in this scope
sphinx.cpp: In member function 'virtual const char* CSphSource_MySQL::SqlError()':
sphinx.cpp:16734: error: 'm_tMysqlDriver' was not declared in this scope
sphinx.cpp:16734: error: 'mysql_error' was not declared in this scope
sphinx.cpp: In member function 'virtual bool CSphSource_MySQL::SqlConnect()':
sphinx.cpp:16740: error: 'm_tMysqlDriver' was not declared in this scope
sphinx.cpp:16740: error: 'mysql_init' was not declared in this scope
sphinx.cpp:16743: error: 'mysql_real_connect' was not declared in this scope
sphinx.cpp: In member function 'virtual void CSphSource_MySQL::SqlDisconnect()':
sphinx.cpp:16749: error: 'm_tMysqlDriver' was not declared in this scope
sphinx.cpp:16749: error: 'mysql_close' was not declared in this scope
sphinx.cpp: In member function 'virtual int CSphSource_MySQL::SqlNumFields()':
sphinx.cpp:16755: error: 'm_pMysqlResult' was not declared in this scope
sphinx.cpp:16758: error: 'm_pMysqlResult' was not declared in this scope
sphinx.cpp:16758: error: 'mysql_num_fields' was not declared in this scope
sphinx.cpp: In member function 'virtual bool CSphSource_MySQL::SqlFetchRow()':
sphinx.cpp:16764: error: 'm_pMysqlResult' was not declared in this scope
sphinx.cpp:16767: error: 'm_tMysqlRow' was not declared in this scope
sphinx.cpp:16767: error: 'm_pMysqlResult' was not declared in this scope
sphinx.cpp:16767: error: 'mysql_fetch_row' was not declared in this scope
sphinx.cpp: In member function 'virtual const char* CSphSource_MySQL::SqlColumn(int)':
sphinx.cpp:16774: error: 'm_pMysqlResult' was not declared in this scope
sphinx.cpp:16777: error: 'm_tMysqlRow' was not declared in this scope
sphinx.cpp: In member function 'virtual const char* CSphSource_MySQL::SqlFieldName(int)':
sphinx.cpp:16783: error: 'm_pMysqlResult' was not declared in this scope
sphinx.cpp:16786: error: 'm_pMysqlFields' was not declared in this scope
sphinx.cpp:16787: error: 'm_pMysqlResult' was not declared in this scope
sphinx.cpp:16787: error: 'mysql_fetch_fields' was not declared in this scope
sphinx.cpp:16789: error: 'm_pMysqlFields' was not declared in this scope
make[2]: *** [sphinx.o] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
I'm running Mac OSX Server
MySQL Ver 14.12 Distrib 5.0.82, for apple-darwin9.0 (i386) using EditLine wrapper
Any ideas?



I've never compiled Sphinx on a Mac, but it looks like you're missing the mysql header files:
mysql.h: No such file or directory
I would check http://dev.mysql.com/downloads/mysql/5.1.html#macosx and look for the 5.0 header files, or upgrade to mysql 5.1 and use these.