Pages

Monday, September 23, 2019

Let's build DPDK in Windows with MinGW-w64

There's a library named DPDK(Data Plane Development Kit. https://www.dpdk.org). Previously led by Intel, now it's a project from the Linux Foundation. The aim of this project is to make a packet from NIC to bypass kernel and go to userspace right away. Though you need to make your hands quite dirty, it's worth it.

So what? DPDK started to support Windows from 19.05(ta-da!). Though it supports only the basics, the team plans to broaden supported features more and more.

Well, there's a problem, though - you need LLVM+MSVC+meson+ninja to build the library. Even the official documentation explains that way. But you know what? You can replace LLVM+MSVC to MinGW-w64. Yes, you can use MinGW-w64+meson+ninja as your toolchain to build DPDK in Windows.

First, let's see meson commmands.
  • set CC=gcc
  • meson -Dexample=helloworld -Dc_args="-D_WIN32_WINNT=0x0601" build
  • cd build
After this, when ninja.build file is created, replace /imp: to --out-implib, and remove -Wl containing /def.  After that, just run ninja to get your library ready to serve.

Quite easy, huh?

No comments:

Post a Comment