Mac OS X 10.9.4 安裝全文索引 Coreseek-3.2.14穩定版 問題及解決

根據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
相關文章
相關標籤/搜索