I’ve recently started to look at and play around with DPDK and try to understand it all. Let’s just say that I’m far from understanding all of it yet, as most of my experience has been with the transport layer and up in the OSI stack. But one thing I do know is that getting some hands-on experience whilst learning new technologies is one of the best ways to get answers for all one’s questions and thesis on how the inner workings actually fit together. Of course looking at the source code of the technology being used will tell you it better, but with all the new terms being thrown at you, it’s good to just play around and get inspired instead of being overwhelmed and discouraged by the task of learning all the new concepts and namings.
So to start playing around I would like to use CMake as my build configuration tool and not Meson that DPDK is built with. Meson looks great, but I’m really comfortable with CMake as of now, and it also works great with CLion, which is my IDE of choice.
DPDK comes with support for pkg-config which I’ll be using to link my application with the DPDK SDK. This means that I’ve built and installed the DPDK libraries on my machine so that they are located in the usr/local
.
Next is a template for CMake to link your application with the SDK. There are two options, shared or static linking.
CMake DPDK Template
1 | cmake_minimum_required(VERSION 3.20) |
I hope this may become a handy simple template for you to start off your new DPDK projects.