Performing Compilation
- Obtain the Hyperscan source package.
wget https://codeload.github.com/kunpengcompute/hyperscan/zip/aarch64
- Decompress the source package.
unzip hyperscan-aarch64.zip
- Go to the Hyperscan source code directory.
cd hyperscan-aarch64
- Add the Boost header file.
ln -s {boost_path}/boost include/boost
The compilation depends on the Boost header file. {boost_path} indicates the full path after boost_1_69_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 source code hscollider tool depends on the PCRE tool.
- Copy the pcre-8.43 folder to the Hyperscan source code directory and rename the folder as pcre.
cp -rf ./pcre-8.43 hyperscan-aarch64/pcre
- Open pcre/CMakeLists.txt.
vim hyperscan-aarch64/pcre/CMakeLists.txt
- Comment out line 77 in the pcre/CMakeLists.txt file as follows:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) #CMAKE_POLICY(SET CMP0026 OLD)
- In the CMakeLists.txt file, the #CMAKE_POLICY(SETCMP0026 OLD) command in line 77 cannot be identified in CMake 2.8.1 and does not affect functions. Therefore, the command needs to be commented out.
- You can also upgrade the 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.
- Copy the pcre-8.43 folder to the Hyperscan source code directory and rename the folder as pcre.
- Compile the static library of the source code.
By default, the static library is compiled in release mode.
- Go to the Hyperscan source code directory.
cd Hyperscan-aarch64
- Create a build directory.
mkdir -p build
- Go to the build directory.
cd build
- Perform the compilation.
cmake ..
make -j32
After the compilation, the following static libraries and test programs of Hyperscan are generated by default:

Generated test programs:

Generated static libraries:

- Go to the Hyperscan source code directory.
- Compile the source code dynamic library.Add the -DBUILD_SHARED_LIBS=ON option to the compile command.
cmake .. -DBUILD_SHARED_LIBS=ON
Generated dynamic libraries:

Parent topic: Hyperscan Compilation Guide