Compiling Hyperscan
In the Hyperscan source code directory, add the Boost header file and PCRE dependency library, and compile the source code in static library, dynamic library, or debug mode.
- Go to the Hyperscan source code directory.
1cd hyperscan
- Add the Boost header file.
1ln -s {boost_path}/boost include/boost
The compilation depends on the Boost header file. {boost_path} indicates the full path after boost_1_87_0.tar.gz is decompressed. It is recommended that boost_path be set to an absolute path.
- Add the PCRE dependency library.
The compilation of the hscollider tool source code depends on the PCRE tool.
- Go to the PCRE 8.43 download directory, extract and copy the pcre-8.43 folder to the Hyperscan source code directory, and rename the folder pcre.
1cp -rf ./pcre-8.43 hyperscan/pcre
- Open pcre/CMakeLists.txt.
1vim hyperscan/pcre/CMakeLists.txt - Press i to enter the insert mode and comment out line 77 in the copied pcre/CMakeLists.txt file as follows:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) #CMAKE_POLICY(SET CMP0026 OLD)
In the CMakeLists.txt file, the command in line 77 cannot be identified in CMake versions earlier than 2.8.1 and does not affect functionality. The command needs to be commented out. You can also upgrade CMake to 3.0 or later to solve the problem that the CMAKE_POLICY command cannot be identified.
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Go to the PCRE 8.43 download directory, extract and copy the pcre-8.43 folder to the Hyperscan source code directory, and rename the folder pcre.
- Compile the source code.
- Go to the Hyperscan source code directory.
1cd hyperscan
- Create a build directory.
1mkdir -p build
- Go to the build directory.
1cd build
- Perform the compilation.The compilation mode can be release or debug, and the compilation results can be static or dynamic libraries. By default, the release mode is used and static libraries are generated. If dynamic libraries are required, add the corresponding compilation option.
- Compile static libraries from the source code. By default, static libraries are generated in release mode.
1 2
cmake .. make -j
After the compilation, the following static libraries and test programs of Hyperscan are generated by default:

Generated test programs:

Generated static libraries:

- Compile dynamic libraries from the source code. Add the -DBUILD_SHARED_LIBS=ON option to the compile command.
1cmake .. -DBUILD_SHARED_LIBS=ON
Generated dynamic libraries:

- Compile the source code in debug mode. Add the -DCMAKE_BUILD_TYPE=DEBUG option to the compile command.
1cmake .. -DCMAKE_BUILD_TYPE=DEBUG
- Compile static libraries from the source code. By default, static libraries are generated in release mode.
- Go to the Hyperscan source code directory.