[dpdk-dev] Linking with -ldpdk

tom.barbette at uliege.be tom.barbette at uliege.be
Mon Feb 19 10:39:39 CET 2018


Hi list,

I found out that to staticly compile against DPDK using the combined lib, I needed all these options :

-I${RTE_SDK}/${RTE_TARGET}/include -L${RTE_SDK}/${RTE_TARGET}/lib -Wl,--whole-archive -ldpdk -Wl,--no-whole-archive -lnuma -ldl -lpthread -lm -lmlx4 -lmlx5 -libverbs

The whole-archive makes sense, as we need to embed drivers that wouldn't be found at linking time (failing to include it prevents port discovery).
However it leads to missing inclusion. That's why I added all the libs at the end of the line. The mlx4 libs particularly leads me to think that there must be a more programmatic way, portable accross versions of DPDK to find out which libraries referenced in DPDK I should include, right? Morveover if the DPDK user didn't include mlx4, it will fail to compile...

What should I use? (the whole rte.extapp.mk DPDK build process is not an option as the build system is rather complex in this project)

Or maybe some of these libraries should be included in the dpdk static lib?

I use the last git version (but it's the same problem with previous ones).

Thanks,

Tom


More information about the dev mailing list