ref: http://01org.github.io/hyperscan/dev-reference/getting_started.html
1. 硬件需求
intel x86處理器 64-bit或32-bit模式
2. 軟件需求
2.1 操作系統
Linux:
Ubuntu 14.04 LTS or newer
RedHat/CentOS 7 or newer
FreeBSD:
10.0 or newer
Mac OS X:
10.8 or newer, using XCode/Clang
對Windows的支持正在試驗中...
2.2 C/C++編譯器
hyperscan使用C++開發,且需要C99和C++11支持,目前支持的編譯器有
- GCC, v4.8.1 or higher
- Clang, v3.4 or higher (with libstdc++ or libc++)
- Intel C++ Compiler v15 or higher
2.3 第三方依賴庫
依賴項 版本 說明 ------------------------------------------------- CMake >=2.8.11 Ragel 6.9 Python 2.7 Boost >=1.57 僅需要頭文件,無需編譯 Pcap >=0.8 Optional: 僅用於示例程序
注1:boost不需要編譯安裝,如果通過系統包管理工具(yum/apt-get)安裝的
版本無法滿足版本需要,則需要下載源碼包,解壓后執行類似
ln -s /home/zzq/boost_1_59_0/boost hyperscan-4.0.0/include/boost
的命令創建符號鏈接,注意boost路徑需要是絕對路徑,否則可能找不到。
注2:pcap庫會依賴flex和bison
3. 編譯過程
假設在用戶根目錄下的hs_build下面編譯hyperscan,源碼在~/hyperscan-4.0.0
cd ~ mkdir hs_build cd hs_build cmake ../hyperscan-4.0.0 cmake --build . (別忘了最后有個點)
之后開始編譯,成功后hs_build目錄將包含編譯好的hyperscan。
切換到root,運行make install可在/usr/local/下面安裝相關頭文件和庫。
hyperscan還通過cmake支持一些編譯選項,如debug/release, static/shared等,如
- -DCMAKE_BUILD_TYPE=Release 編譯為Release版本,不帶調試信息,默認是RelWithDebInfo
- -DBUILD_SHARED_LIBS=on 編譯為動態庫,默認是靜態庫
等。