Sphinx 2.0.4与MAMP 2.0的安装错误:Can';找不到MySQL头

Sphinx 2.0.4与MAMP 2.0的安装错误:Can';找不到MySQL头,mysql,gcc,sphinx,mamp,Mysql,Gcc,Sphinx,Mamp,在MAMP中进行本地开发,需要Sphinx与MAMP的MySQL配合使用。基本上在$sudo make期间遇到了死胡同 MAMP安装时没有Sphinx集成所需的一些资源,主要是一个mysql lib目录和一个包含C头源文件的include目录。这些已成功下载并安装(使用CMake)到以下目录: /应用程序/MAMP/Library/include/mysql /Applications/MAMP/Library/lib/mysql 解压缩Sphinx并运行后: sudo ./configure

在MAMP中进行本地开发,需要Sphinx与MAMP的MySQL配合使用。基本上在
$sudo make
期间遇到了死胡同

MAMP安装时没有Sphinx集成所需的一些资源,主要是一个mysql lib目录和一个包含C头源文件的include目录。这些已成功下载并安装(使用CMake)到以下目录:

/应用程序/MAMP/Library/include/mysql
/Applications/MAMP/Library/lib/mysql

解压缩Sphinx并运行后:

sudo ./configure --prefix=/usr/local/sphinx --with-libstemmer --with-mysql=/Applications/MAMP/Library
我得到:

******************************************************************************
ERROR: cannot find MySQL include files.

Check that you do have MySQL include files installed.
The package name is typically 'mysql-devel'.

If include files are installed on your system, but you are still getting
this message, you should do one of the following:

1) either specify includes location explicitly, using --with-mysql-includes;
2) or specify MySQL installation root location explicitly, using --with-mysql;
3) or make sure that the path to 'mysql_config' program is listed in
将./configure命令更改为:

sudo ./configure --prefix=/usr/local/sphinx--with-libstemmer --with-mysql-includes /Applications/MAMP/Library/include --with-mysql-libs /Applications/MAMP/Library/lib
在开始时抛出以下内容,但不管结果如何,都会导致成功配置:

configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: /Applications/MAMP/Library/include
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: /Applications/MAMP/Library/lib
日志还包含以下行(我认为这在一秒钟内是相关的):

现在,继续,
$sudo make
抛出以下内容:

Making all in src
/bin/sh svnxrev.sh ..
make  all-am
g++ -DHAVE_CONFIG_H -I. -I../config  -DSYSCONFDIR="\"/usr/local/sphinx--with-libstemmer/etc\"" -DDATADIR="\"/usr/local/sphinx--with-libstemmer/var/data\"" -I/usr/local/include -Iyes   -Wall -g -D_FILE_OFFSET_BITS=64 -O3 -DNDEBUG -MT sphinx.o -MD -MP -MF .deps/sphinx.Tpo -c -o sphinx.o sphinx.cpp
In file included from sphinx.cpp:16:
sphinx.h:64:19: error: mysql.h: No such file or directory

... //whole bunch of errors follow, resulting from the above
所以,我知道mysql.h存在于我的include文件中,我想我也有所有必要的二进制文件,而且配置似乎看到了include文件,所以我有点扯头发。我希望这是一个简单的路径问题,或者是./configure属性的语法错误,因为这是我第一次从命令行编译和安装


谢谢。

Sphinx的
/configure
使用了一个未知的默认值,用于mysql,默认情况下是启用的,这可能会让您认为不需要调用它

要让Sphinx处理MAMP的各种分布式MySQL文件,请确保在
/configure
命令中使用以下每个属性,并为每个属性指定直接路径:

--with-mysql= // root mysql app
--with-includes= // path to mysql header includes
--with-mysql-libs= // path to libmysqlclient.dylib files
对我有效的最后一个命令是:

./configure --prefix=/usr/local/sphinx --with-libstemmer --with-mysql=/Applications/MAMP/Library --with-mysql-includes=/Applications/MAMP/Library/include/mysql --with-mysql-libs=/Applications/MAMP/Library/lib/mysql
--prefix
是您在usr/local中的首选安装目录,
--libstemmer
添加了Snowball的扩展词干分析功能(如果您下载了它)

如果运行时没有错误,只需
make
makeinstall
就可以了


还请注意,在未压缩的Sphinx目录中有一个很容易忽略的配置错误日志。在这种情况下没有帮助,但如果您遇到问题,可能对其他人非常有用。

Sphinx的
/configure
使用了一个未知的默认值,即mysql,默认情况下是启用的,这可能会使您认为不需要调用它

要让Sphinx处理MAMP的各种分布式MySQL文件,请确保在
/configure
命令中使用以下每个属性,并为每个属性指定直接路径:

--with-mysql= // root mysql app
--with-includes= // path to mysql header includes
--with-mysql-libs= // path to libmysqlclient.dylib files
对我有效的最后一个命令是:

./configure --prefix=/usr/local/sphinx --with-libstemmer --with-mysql=/Applications/MAMP/Library --with-mysql-includes=/Applications/MAMP/Library/include/mysql --with-mysql-libs=/Applications/MAMP/Library/lib/mysql
--prefix
是您在usr/local中的首选安装目录,
--libstemmer
添加了Snowball的扩展词干分析功能(如果您下载了它)

如果运行时没有错误,只需
make
makeinstall
就可以了


还请注意,在未压缩的Sphinx目录中有一个很容易忽略的配置错误日志。在这种情况下没有帮助,但如果您遇到问题,可能对其他人非常有用。

在哪里可以找到MySQL的根位置?在哪里可以找到MySQL的根位置?