本文在 Debian8 中安裝 hyperscan 5.0.0
內(nèi)存至少 2 G,不然編譯慢而且失敗
hyperscan使用C++開發(fā),且需要C99和C++11支持,目前支持的編譯器有
依賴項 版本 說明
-------------------------------------------------
CMake >=2.8.11
Ragel 6.9
Python 2.7
Boost >=1.57 僅需要頭文件,無需編譯
Pcap >=0.8 Optional: 僅用于示例程序
注1: Ragel 最好用 6.9 版本,7.0 版本可能會報錯
wget -c http://www.colm.net/files/ragel/ragel-6.9.tar.gz
注2:boost不需要編譯安裝,如果通過系統(tǒng)包管理工具(yum/apt-get)安裝的版本無法滿足版本需要,只需要解壓源碼包
wget -c https://sourceforge.net/projects/boost/files/boost/1.68.0/boost_1_68_0.tar.gz/download
注3:pcap庫會依賴flex和bison
ln -s /soft/boost_1_68_0/boost /soft/hyperscan-5.0.0/include/boost
cd /soft/hyperscan-5.0.0
mkdir build
cd build
cmake ../
cmake --build . (別忘了最后有個點,編譯時間較長)
make install
安裝過程中,提示如下錯誤:
hyperscan-5.0.0/src/nfa/limex_compile.cpp:983:54: error: call of overloaded ‘distance(std::vector<boost::dynamic_bitset<> >::iterator, __gnu_cxx::__normal_iterator<boost::dynamic_bitset<>, std::vector<boost::dynamic_bitset<> > >&)’ is ambiguous
return verify_u32(distance(squash.begin(), it));
^
可在 github 的 issues 中找到解決方案 https://github.com/intel/hyperscan/issues/104
作者給出的解釋和解決方案如下:
只需將這兩行的,distance 改為 std::distance 即可
更多建議: