Installing spead2
Preparation
There is optional support for ibverbs for higher performance, and pcap for reading from previously captured packet dumps. If the libraries (including development headers) are installed, they will be detected automatically and support for them will be included.
High-performance usage requires larger buffer sizes than Linux allows by default. The following commands will increase the permitted buffer sizes on Linux:
sysctl net.core.wmem_max=16777216
sysctl net.core.rmem_max=16777216
Note that these commands are not persistent across reboots, and the settings
need to be stored in /etc/sysctl.conf
or /etc/sysctl.d
.
Installing spead2 for Python
The only Python dependency is numpy.
The test suite has additional dependencies; refer to Getting started with development if you are developing spead2.
There are two ways to install spead2 for Python: compiling from source and installing a binary wheel.
Installing a binary wheel
As from version 1.12, binary wheels are provided on PyPI for x86-64 Linux systems. These support all the optional features, and it is the recommended installation method as it does not depend on a compiler, development libraries etc. The wheels use the “manylinux2014” tag, which requires at least pip 19.3 to install.
Since version 4.0 there are also aarch64 Linux wheels, which use the “manylinux_2_28” tag and require at least pip 20.3; and wheels for MacOS (both Intel and Apple Silicon).
Provided your system meets these requirements, just run:
pip install spead2
Python install from source
Installing from source requires a modern C++ compiler supporting C++17 (GCC 7+ or Clang 4+, although GCC 9.4 and Clang 10 are the oldest tested versions and support for older compilers may be dropped) as well as Boost 1.70+ (only headers are required), libdivide, and the Python development headers. At the moment only GNU/Linux and OS X get tested but other POSIX-like systems should work too. There are no plans to support Windows.
Installation works with standard Python installation methods.
Installing spead2 for C++
Installing spead2 requires
a modern C++ compiler supporting C++17 (see above for supported compilers)
Boost 1.69+, including the compiled boost_program_options library
libdivide
Python 3.x, with the packaging, jinja2, and pycparser packages
Meson 1.2 or later (note that this might be newer than the Meson package in your operating system’s package manager).
At the moment only GNU/Linux and OS X get tested but other POSIX-like systems should work too. There are no plans to support Windows.
Compilation uses the standard Meson flow (refer to the Meson manual for further help):
meson setup [options] build
cd build
meson compile
meson install
Optional features are autodetected by default, but can be disabled using
Meson options. To see the available options, run meson configure in
the build directory.
One option that may squeeze out a very small amount of extra performance is
link-time optimization, enabled with -Db_lto=true
.
The installation will install some benchmark tools, a static library, and the header files.