# uname -r
3.10.0-229.4.2.el7.x86_64
安装步骤如下:
1 依赖包的安装
yum install gcc gcc-c++ libtool mysql-devel libxml2-devel expat-devel
2、下载软件包
wget http://www.coreseek.cn/uploads/csft/3.2/coreseek-3.2.14.tar.gz
wget http://www.coreseek.cn/uploads/csft/4.0/coreseek-4.1-beta.tar.gz
3、安装过程(不同版本安装过程基本相同,以3.2.4为例)
tar zxvf coreseek-3.2.14.tar.gz
cd coreseek-3.2.14
cd mmseg-3.2.14/
./bootstrap
./configure --prefix=/usr/local/mmseg3
make && make install
cd ../csft-3.2.14/
sh buildconf.sh
./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 --with-python
根据自己的环境需求,添加相关选项
make && make install
安装过程错误如下:
错误1
centOS7上安装4.1版本,执行 sh buildconf.sh 未生成configure
automake: warnings are treated as errors
/usr/share/automake-1.13/am/library.am: warning: ‘libstemmer.a‘: linking libraries using a non-POSIX
/usr/share/automake-1.13/am/library.am: archiver requires ‘AM_PROG_AR‘ in ‘configure.ac‘
libstemmer_c/Makefile.am:2: while processing library ‘libstemmer.a‘
/usr/share/automake-1.13/am/library.am: warning: ‘libsphinx.a‘: linking libraries using a non-POSIX
/usr/share/automake-1.13/am/library.am: archiver requires ‘AM_PROG_AR‘ in ‘configure.ac‘
src/Makefile.am:14: while processing library ‘libsphinx.a‘
总体意思是: archiver requires ‘AM_PROG_AR‘ in ‘configure.ac‘
解决办法:在 csft-4.1/configure.ac 文件中,查找:
AC_PROG_RANLIB
后面加上
AM_PROG_AR
最终格式为:AC_PROG_RANLIB AM_PROG_AR
再次执行 sh buildconf.sh
错误2
‘automake --add-missing‘ can install ‘ar-lib‘
在命令行执行
#automake --add-missing
再次执行 sh buildconf.sh
错误3
编译的时候出现
sphinxexpr.cpp:1823:43: error: ‘ExprEval’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
T val = ExprEval ( this->m_pArg, tMatch ); // ‘this‘ fixes gcc braindamage
处理办法:
#vim /usr/local/src/coreseek-4.1-beta/csft-4.1/src/sphinxexpr.cpp
1746 T val = ExprEval ( this->m_pArg, tMatch );
形式修改为 T val = this->ExprEval ( this->m_pArg, tMatch );
1777 T val = ExprEval ( this->m_pArg, tMatch );
形式修改为 T val = this->ExprEval ( this->m_pArg, tMatch );
1823 T val = ExprEval ( this->m_pArg, tMatch );
形式修改为 T val = this->ExprEval ( this->m_pArg, tMatch );
错误4
In file included from sphinxstd.cpp:24:0:
py_layer.h:16:27: fatal error: Python.h: No such file or directory
#include <Python.h>
这是由于缺少了python环境的devel支持包
解决办法:yum install python-devel
启动服务及测试
cd ../testpack/
##如要启动搜索服务,请使用
/usr/local/coreseek/bin/searchd -c etc/csft.conf(注意-c后面是相对路径)
##如要停止搜索服务,请使用
/usr/local/coreseek/bin/searchd -c etc/csft.conf --stop
/usr/local/src/coreseek-3.2.14/testpack/etc/pysource
支持python选项,会有一个
本文出自 “linux_zhao” 博客,请务必保留此出处http://zhaoxiaolong.blog.51cto.com/9134845/1769075
原文地址:http://zhaoxiaolong.blog.51cto.com/9134845/1769075