Rate This Document
Findability
Accuracy
Completeness
Readability

Performing Compilation

  1. Obtain the Hyperscan source package.
    wget https://codeload.github.com/kunpengcompute/hyperscan/zip/aarch64
  2. Decompress the source package.
    unzip hyperscan-aarch64.zip
  3. Go to the Hyperscan source code directory.
    cd hyperscan-aarch64
  4. 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.

  5. Add the PCRE dependency library.

    The compilation of the source code hscollider tool depends on the PCRE tool.

    1. 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
    2. Open pcre/CMakeLists.txt.
      vim hyperscan-aarch64/pcre/CMakeLists.txt
    3. 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.
    4. Press Esc, type :wq!, and press Enter to save the file and exit.
  6. Compile the static library of the source code.

    By default, the static library is compiled in release mode.

    1. Go to the Hyperscan source code directory.
      cd Hyperscan-aarch64
    2. Create a build directory.
      mkdir -p build
    3. Go to the build directory.
      cd build
    4. 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:

  7. 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: