您的位置:首页 > 其它

【hyperscan】编译hyperscan 4.0.0

2015-10-22 13:31 676 查看
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 编译为动态库,默认是静态库

等。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: