Similar questions to Need help on compiling DPDK hello world. However my DPDK version is v20.05, I have to use meson and ninja to build my DPDK,so the solution doesn't work for me.
I built my DPDK following the link:https://doc.dpdk.org/guides/linux_gsg/build_dpdk.html.
Before building my DPDK, I pre-set:
export RTE_SDK=/home/cxx/dpdk-20.05
export RTE_TARGET=build
My building commands:
meson build --prefix=/home/cxx/dpdk-20.05
cd build
ninja
ninja install (I don't run the"ldconfig" command)
cd /home/cxx/dpdk-20.05/examples/helloworld
make
the error shows:
/home/cxx/dpdk-20.05/mk/internal/rte.extvars.mk:29: *** Cannot find .config in /home/cxx/dpdk-20.05/build. Stop.
So, I run the command below to see if the .config file really doesn't exist.
cd /home/cxx/dpdk-20.05/build
find . -name ".config"
The result shows that there is actually no ".config" file in /home/cxx/dpdk-20.05/build.
Why did I lose the .config file and how can I do to solve the problem?
[EDIT-1] the real issue is
libdpdk.pkg
Explanation: From DPDK version > 19.11 LTS onwards support for meson ninja
is fully integrated with the removal of Makefile. Hence one needs to use meson ninja
only. So the right steps to follow are
export RTE_SDK=/home/cxx/dpdk-20.05
export RTE_TARGET=build
built DPDK and install in default path
, then executeuntar dpdk.tar
cd dpdk-folder
meson [desired folder name]
cd [desired folder name]
ninja
ninja install
ldconfig
built and save the libraries and header files in different folder
thenuntar dpdk.tar
cd dpdk-folder
meson [desired folder name] --prefix=[folder to hold the built dpdk libraries and headers]
cd [desired folder name]
ninja
ninja install
ls [folder to hold the built dpdk libraries and headers]
In order to build helloworld with step-2, gcc helloworld.c $(pkg-config --libs --cflags libdpdk)
is sufficient.
But in order to make use of libraries and headers from the custom folder, one requires to point PKG_CONFIG_PATH to the custom folder which has libdpdk.pkg
. This will allow the libdpdk.pkg to be used from the custom folder, not /usr/lib/
.
steps to follow
export PKG_CONFIG_PATH=[dpdk master folder]/[custom folder path where libdpdk.pkg is located]
gcc helloworld.c $(pkg-config --libs --cflags libdpdk)