Debian Codegraph @

Documentation/build.rst

raw
1 .. SPDX-License-Identifier: BSD-2-Clause
2 ..
3 .. Copyright (C) 2022-2025 Linutronix GmbH
4 .. Author Kurt Kanzenbach <[email protected]>
5 ..
6 .. Testbench documentation build file.
7 ..
8
9 Build
10 =====
11
12 The buildsystem is cmake. The applications can be build and installed by:
13
14 .. code:: bash
15
16 mkdir build
17 cd build
18 cmake -DCMAKE_BUILD_TYPE=Release -DWITH_MQTT=TRUE ..
19 make -j`nproc`
20 sudo make install
21
22 Setting the build type is important, as it defines the used compiler
23 flags. ``Release`` builds the application with optimizations and without debug
24 symbols. Other build types include: ``Debug`` or ``RelWithDebInfo``.
25
26 The applications have the following dependencies:
27
28 - Run time: libbpf, libyaml, libxdp, libssl
29 - Build time: cmake, gcc, clang, llvm, pkg-config
30 - Utilities: linuxptp, ethtool, iproute2, rt-tests, iperf3
31
32 For Debian based systems do:
33
34 .. code:: bash
35
36 apt update
37 apt install -y build-essential clang llvm cmake pkg-config \
38 libbpf-dev libyaml-dev libc6-dev rt-tests ethtool iproute2 \
39 iperf3 linuxptp libxdp-dev libssl-dev libmosquitto-dev git bc
40
41 .. Note:: For Debian Bullseye ``libxdp`` is packaged in backports.
42
43 For RHEL based systems do:
44
45 .. code:: bash
46
47 dnf -y upgrade
48 dnf -y install libxdp-devel libyaml-devel clang mosquitto-devel \
49 python3-sphinx python3-sphinx_rtd_theme cmake openssl-devel llvm
50
51 .. Note:: For RHEL ``libxdp-devel`` is packaged in CodeReadyBuilder repos. More info at
52 https://developers.redhat.com/blog/2018/11/15/introducing-codeready-linux-builder. Usually
53 a matter of running ``crb enable`` on the subscription-manager registered system with the
54 ``EPEL`` repository enabled.
55
56 Furthermore, the Linux RealTime Communication ``Testbench`` requires Linux kernel version >= v5.12.
57 PREEMPT_RT is recommended. In addition, the following configuration options have to be set:
58
59 - CONFIG_PTP_1588_CLOCK
60 - CONFIG_BPF
61 - CONFIG_BPF_SYSCALL
62 - CONFIG_DEBUG_INFO
63 - CONFIG_DEBUG_INFO_BTF
64 - CONFIG_XDP_SOCKETS
65 - CONFIG_NET_SCH_MQPRIO
66 - CONFIG_NET_SCH_TAPRIO
67 - CONFIG_NET_SCH_ETF
68 - CONFIG_NET_SCH_INGRESS
69 - CONFIG_NET_CLS_*
70
71 Additional Options
72 ^^^^^^^^^^^^^^^^^^
73
74 Some features are added by using additional CMake opitions, the table bellow presents those features
75 and options.
76
77 .. list-table:: Features & CMake options
78 :widths: 50 50
79 :header-rows: 1
80
81 * - Feature
82 - Option
83
84 * - MQTT
85 - WITH_MQTT
86
87 * - Show Packet RX Latency
88 - RX_TIMESTAMP
89
90 * - Enable TX Hardware Timestamping
91 - TX_TIMESTAMP