Migrating to version 4
Unlike version 3, version 4 does not make substantial changes to the spead2 API, although it does drop deprecated functionality. It replaces the build system and increases the minimum version requirements, which may have implications for how you install, link to or use spead2.
Removed functionality
The following deprecated functionality has been removed:
C++
Functionality |
Replacement |
---|---|
|
|
|
|
|
|
|
|
|
constructor that takes a |
|
constructor that takes a |
|
pass a vector containing a single queue |
|
|
|
pass a vector containing a single endpoint |
Python
|
|
---|---|
|
|
|
|
|
|
|
|
|
Pass a |
|
Pass a |
|
Pass a list containing a single queue |
|
|
|
Pass a list containing a single |
Meson
The autotools build system has been replaced by Meson. This mainly affects C++ users, as for Python this is hidden behind the Python packaging interface. Refer to Installing spead2 for installation instructions.
The old build system had a number of options to adjust the build. The table below shows corresponding Meson options:
autotools |
meson |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Link-time optimization no longer requires intervention to select suitable versions of ar and ranlib; Meson takes care of it.
C++17
The codebase now uses C++17, whereas older versions used C++11. This might require a newer C++ compiler. See Installing spead2 for minimum compiler versions.
Additionally, when compiling against the C++ API, you may need to pass
compiler arguments to select at least C++17 (e.g. --std=c++17
). GCC
11+ and Clang 16+ support C++17 without a compiler flag, but keep in mind that
your users might use older compilers.
Boost
Boost 1.69+ is now required: from this release, boost_system is a header-only library. You no longer need to link against any Boost libraries when linking against spead2.
pcap
The detection logic for libpcap has changed. It used to first try pkg-config, then fall back to testing compilation. It now tries pkg-config first and falls back to pcap-config. If neither of those methods works, you may need to upgrade your pcap library.
Code generation
In older versions of spead2, some of the code was generated and included in
the release tarballs. If you used a release, you would be unaware of this, but
trying to build directly from git would require you to run a bootstrap.sh
script.
Meson doesn’t have good support for including generated code into releases, so
these generated files are no longer included in the releases, and they are
instead created as part of the build. This requires Python, with the
jinja2
, pycparser
and packaging
packaging installed.
An advantage of this approach is that it is now possible to directly build from a git checkout without any preparatory steps.
Python configuration
When building the Python bindings from source, it was previously only possible to adjust the build-time configuration by editing source files. With the new build system, it’s now possible to pass options on the command line.
Python editable installs
Meson-python doesn’t support editable installs with build
isolation. To make an editable install, use pip install --no-build-isolation -e .
.