安装coreseek全过程记录

2017-08-24 11:04:32

    因为sphinx基本上可以看作是不支持中文的,所以如果要使用,还必须要装一个为coreseek的扩展包。

    但是可惜的是,coreseek已经不在维护了,目前官网都打不开了。

    没有办法,我们只能新瓶装老酒,使用目前能找到的最新版本为:4.1,下载地址:coreseek

    现在开始安装。

    解压过后,来到mmseg-3.2.14目录,执行

./configure --prefix=/usr/local/mmseg
make
make install

    期间出现如下错误:

    config.status: error: cannot find input file:src/Makefile.in

    依次执行以下命令,解决

aclocal
libtoolize --force
automake --add-missing
autoconf
autoheader
make clean
然后在执行
./configure --prefix=/usr/local/mmseg


    

    则可以安装成功

    接着来到csft-4.1目录,执行

sh buildconf.sh
./configure --prefix=/usr/local/coreseek  --with-mmseg=/usr/local/mmseg --with-mmseg-includes=/usr/local/mmseg/include/mmseg --with-mmseg-libs=/usr/local/mmseg/lib/
make && make install

    其中执行buildconf.sh发现configure文件没有生成,解决:

     1. 在 csft-4.1/buildconf.sh 文件中,修改&& automake --foreign \ 为&& automake --add-missing --foreign \

     2. 在 csft-4.1/configure.ac 文件中,查找:AM_INIT_AUTOMAKE([-Wall -Werror foreign])  改为AM_INIT_AUTOMAKE([-Wall foreign])  ,查找:AC_PROG_RANLIB   后面加上:AM_PROG_AR  


    3. 最后,在 csft-4.1/src/sphinxexpr.cpp 文件中, 替换所有:T val = ExprEval ( this->m_pArg, tMatch );  为T val = this->ExprEval ( this->m_pArg, tMatch );  

    最后尝试

sh buildconf.sh

    成功生成configure文件

    make的时候报错:

    

    libsphinx.a(sphinx.o): In function `xmlUnknownEncoding(void*, char const*, XML_Encoding*)':
    /opt/coreseek/csft-4.1/src/sphinx.cpp:22292: undefined reference to `libiconv_open'
    /opt/coreseek/csft-4.1/src/sphinx.cpp:22310: undefined reference to `libiconv'
    /opt/coreseek/csft-4.1/src/sphinx.cpp:22316: undefined reference to `libiconv_close'
    collect2: error: ld returned 1 exit status
    Makefile:452: recipe for target 'indexer' failed
    make[2]: *** [indexer] Error 1
    make[2]: Leaving directory '/opt/coreseek/csft-4.1/src'
    Makefile:364: recipe for target 'all' failed
    make[1]: *** [all] Error 2
    make[1]: Leaving directory '/opt/coreseek/csft-4.1/src'
    Makefile:440: recipe for target 'all-recursive' failed
    make: *** [all-recursive] Error 1

    

    解决:编辑src/Makefile文件内容,修改

    LIBS = -ldl -lm -lz -lexpat  -L/usr/local/lib -lrt  -lpthread为:

    LIBS = -ldl -lm -lz -lexpat -liconv  -L/usr/local/lib -lrt  -lpthread

    

    测试编辑安装成功。至此我们就完成了整个软件的安装过程。