根据coreseek官方文档安装:
http://www.coreseek.cn/products-install/install_on_macosx/
(1)在安装mmseg过程当中,进行make操做的时候,忽然报了如下错误信息:
css
n file included from css/ThesaurusDict.cpp:6: ../src/css/ThesaurusDict.h:12:17: error: expected namespace name using namespace __gnu_cxx; ^ css/ThesaurusDict.cpp:79:15: warning: result of comparison against a string literal is unspecified (use strncmp instead) [-Wstring-compare] if (filename == "-") { ^ ~~~ css/ThesaurusDict.cpp:116:15: warning: result of comparison against a string literal is unspecified (use strncmp instead) [-Wstring-compare] if (filename != "-") { ^ ~~~ 2 warnings and 1 error generated. make[2] : *** [ThesaurusDict.lo] Error 1 make[1]: *** [install-recursive] Error 1
通过搜寻资料,最后得知是由于编译器版本过高致使的,那我也不想去下降编译器的版本,经过修改源代码,解决了该问题:
进入到源代码包目录:即coreseek-3.2.14所在目录,cd mmseg-3.2.14/src/css,找到文件:ThesaurusDict.h
在头部找到:#include <string>
再其下加入一行代码:#include <ext/hash_map>
再回到mmseg-3.2.14目录,执行make编译操做,顺利完成,最后就能够接着执行安装操做了。
(2)OK,mmseg中文分词是安装完成了,此时接着安装sphinx,编译的过程当中,又遇到了问题:
mysql
phinxexpr.cpp:1047:11: error: use of undeclared identifier 'ExprEval' T val = ExprEval ( this->m_pArg, tMatch ); // 'this' fixes gcc ...
编译过程当中,出现了无数个关于此函数:ExprEval(this->m_pArg, tMatch)的错误,进入:cd csft-3.2.14/src目录,找到源代码:sphinxexpr.cpp文件,
搜索:ExprEval ( this->m_pArg, tMatch )此函数,将该文件的全部关于此函数ExprEval ( this->m_pArg, tMatch )的调用,在其前面加上this->对象,即替换为:
sql
this->ExprEval ( this->m_pArg, tMatch );
再执行make编译操做,此时顺利完成编译,接着就能执行make install 安装操做了。
这个问题也是因为gcc编译器版本的问题致使了。
接着再结合coreseek官方文档,完成测试操做。
(3)测试时,shell
$ /usr/local/coreseek/bin/indexer -c etc/csft.conf --all
报错:
macos
dyld: Library not loaded: libmysqlclient.18.dylib Referenced from: /usr/local/coreseek/bin/indexer Reason: image not found Trace/BPT trap: 5
解决办法是:
ide
$ sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib