Skip to content

Installation from source

Konstantinos Margaritis edited this page Nov 19, 2023 · 6 revisions

Building from source

The build system has recently been refactored to be more modular and easier to extend. For that reason, some small but necessary changes were made that might break compatibility with how Hyperscan was built.

Install Common Dependencies

Debian/Ubuntu

In order to build on Debian/Ubuntu make sure you install the following build-dependencies

$ sudo apt build-essential cmake ragel pkg-config libsqlite3-dev libpcap-dev

Other distributions

TBD

MacOS X (M1/M2/M3 CPUs only)

Assuming an existing HomeBrew installation:

% brew install boost cmake gcc libpcap pkg-config ragel sqlite

Configure & build

In order to configure with cmake first create and cd into a build directory:

$ mkdir build
$ cd build

Then call cmake from inside the build directory:

$ cmake ../

Common options for Cmake are:

  • -DBUILD_STATIC_LIBS=[On|Off] Build static libraries
  • -DBUILD_SHARED_LIBS=[On|Off] Build shared libraries (if none are set static libraries are built by default)
  • -DCMAKE_BUILD_TYPE=[Release|Debug|RelWithDebInfo|MinSizeRel] Configure build type and determine optimizations and certain features.
  • -DUSE_CPU_NATIVE=[On|Off] Native CPU detection is off by default, however it is possible to build a performance-oriented non-fat library tuned to your CPU
  • -DFAT_RUNTIME=[On|Off] Fat Runtime is only available for X86 32-bit/64-bit and AArch64 architectures and only on Linux. It is incompatible with Debug type and USE_CPU_NATIVE.

Specific options for X86 32-bit/64-bit (Intel/AMD) CPUs

  • -DBUILD_AVX2=[On|Off] Enable code for AVX2.
  • -DBUILD_AVX512=[On|Off] Enable code for AVX512. Implies BUILD_AVX2.
  • -DBUILD_AVX512VBMI=[On|Off] Enable code for AVX512 with VBMI extension. Implies BUILD_AVX512.

Specific options for Arm 64-bit CPUs

  • -DBUILD_SVE=[On|Off] Enable code for SVE, like on AWS Graviton3 CPUs. Not much code is ported just for SVE , but enabling SVE code production, does improve code generation, see Benchmarks.
  • -DBUILD_SVE2=[On|Off] Enable code for SVE2, implies BUILD_SVE. Most non-Neon code is written for SVE2
  • -DBUILD_SVE2_BITPERM=[On|Off] Enable code for SVE2_BITPERM harwdare feature, implies BUILD_SVE2.

Build

If cmake has completed successfully you can run make in the same directory, if you have a multi-core system with N cores, running

$ make -j <N>

will speed up the process. If all goes well, you should have the vectorscan library compiled.