环境依赖和编译
本篇内容对应dpdk版本为22.11
依赖
所需工具和库:
提示:
不同系统上所需的设置命令和安装的软件包可能不同。有关Linux发行版和测试版本的详细信息,请参阅DPDK发行说明。
通用开发工具,包括支持C的编译器,如gcc(4.9+版本)或clang(3.4+版本),以及 pkg-config或者pkgconf
在针对DPDK构建最终用户二进制文件时使用pkgconf。
- For RHEL/Fedora systems these can be installed using
dnf groupinstall "Development Tools"
- For Ubuntu/Debian systems these can be installed using
apt install build-essential
- For Alpine Linux,
apk add alpine-sdk bsd-compat-headers
- For RHEL/Fedora systems these can be installed using
提示:
RHEL-7提供的pkg-config 0.27无法正确处理Libs.private部分,导致静态链接的应用程序无法正确链接。在构建应用程序时,请使用更新版本的pkg-config
或pkgconf
- Python 3.6 or later.
- Meson (version 0.53.2+) and ninja
meson
&ninja-build
packages in most Linux distributions- If the packaged version is below the minimum version, the latest versions can be installed from Python’s “pip” repository:
pip3 install meson ninja
- pyelftools (version 0.22+)
- For Fedora systems it can be installed using
dnf install python-pyelftools
- For RHEL/CentOS systems it can be installed using
pip3 install pyelftools
- For Ubuntu/Debian it can be installed using
apt install python3-pyelftools
- For Alpine Linux,
apk add py3-elftools
- For Fedora systems it can be installed using
- Library for handling NUMA (Non Uniform Memory Access).
numactl-devel
in RHEL/Fedora;libnuma-dev
in Debian/Ubuntu;numactl-dev
in Alpine Linux
系统最低需求
内核 >= 4.14
uname -r
glibc >= 2.7
ldd --version
编译
tar xJf dpdk-<version>.tar.xz
cd dpdk-<version>
meson
meson build -Dplatform=generic
ninja
cd build
ninja -j 8
编译demo
cd dpdk/<build_dir>
meson configure -Dexamples=helloworld
# 或者一次编译所有 = all