Ubuntu 14.04 安装coreseek-3.2.14的那些坑
coreseek 官网上有很详细的安装过程,我这里就不多说了。我来说说遇到的一些坑和解决方式
坑1:
./configure --prefix=/usr/local/mmseg3
执行后会报错 error: cannot find input file: src/Makefile.in
这个是需要安装 automake
然后执行
aclocal libtoolize --force automake --add-missing autoconf autoheader make clean
以上代码如果执行报错,一般是没有安装相应软件,根据提示安装即可
坑2:
./configure --prefix=/usr/local/coreseek --without-unixodbc --with-mmseg --with-mmseg-includes=/usr/local/mmseg3/include/mmseg/ --with-mmseg-libs=/usr/local/mmseg3/lib/ --with-mysql
执行以上代码会报错 “ERROR: cannot find MySQL include files.......To disable MySQL support, use --without-mysql option."
解决方式:
##请找到头文件mysql.h所在的目录,一般是/usr/local/mysql/include,请替换为实际的 ##请找到库文件libmysqlclient.a所在的目录,一般是/usr/local/mysql/lib,请替换为实际 ##configure参数加上:--with-mysql-includes=/usr/local/mysql/include --with-mysql-libs=/usr/local/mysql/lib,执行后,重新编译安装
坑3:
make csft的时候报错 原因是Ubuntu下的csft需要打补丁
--- src/sphinxexpr.cpp.org 2011-10-07 20:08:58.000000000 +0800 +++ src/sphinxexpr.cpp 2012-09-07 19:58:01.000000000 +0800 @@ -1743,7 +1743,7 @@ /// evaluate arg, return interval id virtual int IntEval ( const CSphMatch & tMatch ) const { - T val = ExprEval ( this->m_pArg, tMatch ); // 'this' fixes gcc braindamage + T val = this->ExprEval ( this->m_pArg, tMatch ); // 'this' fixes gcc braindamage ARRAY_FOREACH ( i, this->m_dValues ) // FIXME! OPTIMIZE! perform binary search here if ( val<this->m_dValues[i] ) return i; @@ -1774,7 +1774,7 @@ /// evaluate arg, return interval id virtual int IntEval ( const CSphMatch & tMatch ) const { - T val = ExprEval ( this->m_pArg, tMatch ); // 'this' fixes gcc braindamage + T val = this->ExprEval ( this->m_pArg, tMatch ); // 'this' fixes gcc braindamage ARRAY_FOREACH ( i, m_dTurnPoints ) if ( val < Expr_ArgVsSet_c<T>::ExprEval ( m_dTurnPoints[i], tMatch ) ) return i; @@ -1820,7 +1820,7 @@ /// evaluate arg, check if the value is within set virtual int IntEval ( const CSphMatch & tMatch ) const { - T val = ExprEval ( this->m_pArg, tMatch ); // 'this' fixes gcc braindamage + T val = this->ExprEval ( this->m_pArg, tMatch ); // 'this' fixes gcc braindamage return this->m_dValues.BinarySearch ( val )!=NULL; }
将以上代码保存为 sphinxexpr.cpp-csft-4.1-beta.patch
然后执行:
patch -p1 < sphinxexpr.cpp-csft-4.1-beta.patch