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

블로그를 이전합니다

뭐, 이런 작은 변방의 블로그에 관심있으신 분들은 아무도 없으시리라 생각합니다만...... (웃음) 블로그 플랫폼을 블로거에서 dev.to로 옮겼습니다. 새 URL은 아래와 같습니다: https://dev.to/teminian 새로운 거처에서 뵙겠습니...

Popular in Code{nested}