【问题标题】:Standalone build of DPDK on Windows fails for examples application示例应用程序在 Windows 上独立构建 DPDK 失败
【发布时间】:2021-03-26 16:59:28
【问题描述】:

通过带有选项-Dexamples= 的DPDK 介子构建示例应用程序skeleton 或l2fwd 或l3fwd,创建二进制可执行文件而不会出现任何警告或错误。但是执行与独立构建相同的示例会导致 DPDK 构建错误

C:\dpdk\dpdk-21.02\examples\skeleton>gcc basicfwd.c -include rte_config.h -march=native -IC:/include  -Wl,--as-needed -LC:/lib -lrte_cfgfile -lrte_hash -lrte_cmdline -lrte_pci -lrte_ethdev -lrte_meter -lrte_net -lrte_mbuf -lrte_mempool -lrte_rcu -lrte_ring -lrte_eal -lrte_telemetry -lrte_kvargs
In file included from C:/include/rte_eal.h:21,
                 from basicfwd.c:7:
C:/include/rte_bus.h:22:10: fatal error: sys/queue.h: No such file or directory
 #include <sys/queue.h>
          ^~~~~~~~~~~~~
compilation terminated.

期望:

C:\dpdk\dpdk-21.02\examples\skeleton>dir
 Directory of C:\dpdk\dpdk-21.02\examples\skeleton

    <DIR>          .
    <DIR>          ..
           163,348 a.exe
             5,458 basicfwd.c
             1,511 Makefile

               322 meson.build

重现错误的步骤

  • 平台:x86_64,Intel E5 2680 Xeon
  • 操作系统:windows server 2019
  • DPDK 版本:21.02
  • 介子版本:0.57.1​​
  • 忍者版本:1.10.2
  • 包配置版本:0.26
  • 后续步骤:http://doc.dpdk.org/guides/windows_gsg/index.html
  • 编译器标志:执行pkg-config --cflags --libs libdpdk

【问题讨论】:

  • @stackinside 感谢您的建议,发现包含缺失。通过添加缺少的内容,我们能够创建二进制文件,正如问题中所解释的,“为什么使用 pkg-config --cflags --libs libdpdk 的独立二进制编译不会生成正确的标志为 meson -Dexamples=[application] build

标签: windows compilation dpdk


【解决方案1】:

当使用介子meson -Dexamples=l2fwd buildmeson build 时,CFLAGS 和 LDFLAGS 有所不同。在前一种情况下,直接从 DPDK 根文件夹中提取依赖项并直接链接到 lib/librte_eal/windows/include。但是当 DPDK pkg 安装后,lib/librte_eal/windows/include 下的文件没有被复制,导致构建失败。

检查lib/librte_eal/windows/ 中的meson.build 显示唯一安装的是“rte_os.h”、“rte_virt2phys.h”和“rte_windows.h”。文件夹“netinet”和“sys”被跳过。基于 DPDK 维护者的更新,由于 Windows 上的 DPDK 是实验性的,因此仅使用 meson -Dexamples=l2fwd build 进行验证。因此,临时解决方法是使用-I[DPDK folder]\lib\librte_eal\windows\include\

注意:

  1. 感谢@stackinside 的评论
  2. 正在开发 DPDK 补丁以填补丢失的文件。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-06
    • 1970-01-01
    • 2021-06-14
    • 1970-01-01
    相关资源
    最近更新 更多