PcapPlusPlus
PcapPlusPlus copied to clipboard
[CMake] [DPDK] building with out-of tree DPDK
PCPP_VER = 25.05
DPDK_VER = 24.11.3
Build pcpp from source code does not see custom DPDK build:
PCPP_CFG += -DBUILD_SHARED_LIBS=OFF
PCPP_CFG += -DPCAPPP_BUILD_PCAPPP=ON
PCPP_CFG += -DPCAPPP_USE_DPDK=ON
PCPP_CFG += -DPCAPPP_USE_DPDK_KNI=OFF
DPDK_ROOT = /opt/dpdk/dpdk-stable-$(DPDK_VER)/mydpdk
PCPP_CFG += -DDPDK_ROOT=$(DPDK_ROOT) -DDPDK_DEBUG=YES
PCPP_CFG += -DDPDK_INCLUDE_DIRS=$(DPDK_ROOT)/include
cmake \
-DBUILD_SHARED_LIBS=OFF -DPCAPPP_BUILD_PCAPPP=ON -DPCAPPP_USE_DPDK=ON \
-DPCAPPP_USE_DPDK_KNI=OFF -DDPDK_ROOT=/opt/dpdk/dpdk-stable-24.11.3/mydpdk \
-DDPDK_DEBUG=YES -DDPDK_INCLUDE_DIRS=/opt/dpdk/dpdk-stable-24.11.3/mydpdk/include \
-S ref/PcapPlusPlus/ -B tmp/pcpp --install-prefix=/home/dev01/veth/lib/pcpp
-- Found PCAP: /usr/lib/x86_64-linux-gnu/libpcap.so (found version "1.10.4 (with TPACKET_V3)")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
DPDK not found with pkg-config trying legacy mode
CMake Error at cmake/modules/FindDPDK.cmake:20 (file):
file failed to open for reading (No such file or directory):
/rte_build_config.h
Call Stack (most recent call first):
cmake/modules/FindDPDK.cmake:74 (dpdk_read_version)
CMakeLists.txt:231 (find_package)
WARNCan't parse DPDK version!
CMake Error at cmake/modules/FindDPDK.cmake:121 (find_library):
Could not find rte_kni using the following names: rte_kni, rte_kni_uio
Call Stack (most recent call first):
CMakeLists.txt:231 (find_package)
-- Configuring incomplete, errors occurred!
Looking into cmake/FindDPDK.cmake I don't see any references to variables:
-
DPDK_ROOT -
DPDK_INCLUDE_DIRS
At least it should contain something like extending pkg-config .pc's search path like:
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DPDK_ROOT}/lib/x86_64-linux-gnu/pkgconfig")
Thanks @ponyatov ! We'll look into it. If you have a fix in mind, you're more than welcome to open a PR! 🙏
@ponyatov I tried a similar configuration and it works for me. Maybe you should remove /include from -DDPDK_INCLUDE_DIRS?
> cmake -DBUILD_SHARED_LIBS=OFF -DPCAPPP_BUILD_PCAPPP=ON -DPCAPPP_USE_DPDK=ON -DDPDK_ROOT=/home/seladb/dpdk-stable-24.11.1 -DDPDK_DEBUG=YES -DDPDK_INCLUDE_DIRS=/home/seladb/dpdk-stable-24.11.1 -S . -B build
-- The CXX compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The C compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Ccache not found!
-- Found Git: /usr/bin/git (found version "2.34.1")
-- Building from commit:08d661c4 on branch:dev
-- Performing Test PCAP_LINKS_SOLO
-- Performing Test PCAP_LINKS_SOLO - Success
-- Looking for pcap_set_immediate_mode
-- Looking for pcap_set_immediate_mode - found
-- Looking for pcap_list_tstamp_types
-- Looking for pcap_list_tstamp_types - found
-- Looking for pcap_set_tstamp_precision
-- Looking for pcap_set_tstamp_precision - found
-- Found PCAP: /usr/lib/x86_64-linux-gnu/libpcap.so (found version "1.10.1 (with TPACKET_V3)")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
DPDK found with pkg-config
-----------
Libraries: rte_node;rte_graph;rte_pipeline;rte_table;rte_pdump;rte_port;rte_fib;rte_pdcp;rte_ipsec;rte_vhost;rte_stack;rte_security;rte_sched;rte_reorder;rte_rib;rte_mldev;rte_regexdev;rte_rawdev;rte_power;rte_pcapng;rte_member;rte_lpm;rte_latencystats;rte_jobstats;rte_ip_frag;rte_gso;rte_gro;rte_gpudev;rte_dispatcher;rte_eventdev;rte_efd;rte_dmadev;rte_distributor;rte_cryptodev;rte_compressdev;rte_cfgfile;rte_bpf;rte_bitratestats;rte_bbdev;rte_acl;rte_timer;rte_hash;rte_metrics;rte_cmdline;rte_pci;rte_ethdev;rte_meter;rte_net;rte_mbuf;rte_mempool;rte_rcu;rte_ring;rte_eal;rte_telemetry;rte_argparse;rte_kvargs;rte_log
Link Libraries: /usr/local/lib/x86_64-linux-gnu/librte_node.so;/usr/local/lib/x86_64-linux-gnu/librte_graph.so;/usr/local/lib/x86_64-linux-gnu/librte_pipeline.so;/usr/local/lib/x86_64-linux-gnu/librte_table.so;/usr/local/lib/x86_64-linux-gnu/librte_pdump.so;/usr/local/lib/x86_64-linux-gnu/librte_port.so;/usr/local/lib/x86_64-linux-gnu/librte_fib.so;/usr/local/lib/x86_64-linux-gnu/librte_pdcp.so;/usr/local/lib/x86_64-linux-gnu/librte_ipsec.so;/usr/local/lib/x86_64-linux-gnu/librte_vhost.so;/usr/local/lib/x86_64-linux-gnu/librte_stack.so;/usr/local/lib/x86_64-linux-gnu/librte_security.so;/usr/local/lib/x86_64-linux-gnu/librte_sched.so;/usr/local/lib/x86_64-linux-gnu/librte_reorder.so;/usr/local/lib/x86_64-linux-gnu/librte_rib.so;/usr/local/lib/x86_64-linux-gnu/librte_mldev.so;/usr/local/lib/x86_64-linux-gnu/librte_regexdev.so;/usr/local/lib/x86_64-linux-gnu/librte_rawdev.so;/usr/local/lib/x86_64-linux-gnu/librte_power.so;/usr/local/lib/x86_64-linux-gnu/librte_pcapng.so;/usr/local/lib/x86_64-linux-gnu/librte_member.so;/usr/local/lib/x86_64-linux-gnu/librte_lpm.so;/usr/local/lib/x86_64-linux-gnu/librte_latencystats.so;/usr/local/lib/x86_64-linux-gnu/librte_jobstats.so;/usr/local/lib/x86_64-linux-gnu/librte_ip_frag.so;/usr/local/lib/x86_64-linux-gnu/librte_gso.so;/usr/local/lib/x86_64-linux-gnu/librte_gro.so;/usr/local/lib/x86_64-linux-gnu/librte_gpudev.so;/usr/local/lib/x86_64-linux-gnu/librte_dispatcher.so;/usr/local/lib/x86_64-linux-gnu/librte_eventdev.so;/usr/local/lib/x86_64-linux-gnu/librte_efd.so;/usr/local/lib/x86_64-linux-gnu/librte_dmadev.so;/usr/local/lib/x86_64-linux-gnu/librte_distributor.so;/usr/local/lib/x86_64-linux-gnu/librte_cryptodev.so;/usr/local/lib/x86_64-linux-gnu/librte_compressdev.so;/usr/local/lib/x86_64-linux-gnu/librte_cfgfile.so;/usr/local/lib/x86_64-linux-gnu/librte_bpf.so;/usr/local/lib/x86_64-linux-gnu/librte_bitratestats.so;/usr/local/lib/x86_64-linux-gnu/librte_bbdev.so;/usr/local/lib/x86_64-linux-gnu/librte_acl.so;/usr/local/lib/x86_64-linux-gnu/librte_timer.so;/usr/local/lib/x86_64-linux-gnu/librte_hash.so;/usr/local/lib/x86_64-linux-gnu/librte_metrics.so;/usr/local/lib/x86_64-linux-gnu/librte_cmdline.so;/usr/local/lib/x86_64-linux-gnu/librte_pci.so;/usr/local/lib/x86_64-linux-gnu/librte_ethdev.so;/usr/local/lib/x86_64-linux-gnu/librte_meter.so;/usr/local/lib/x86_64-linux-gnu/librte_net.so;/usr/local/lib/x86_64-linux-gnu/librte_mbuf.so;/usr/local/lib/x86_64-linux-gnu/librte_mempool.so;/usr/local/lib/x86_64-linux-gnu/librte_rcu.so;/usr/local/lib/x86_64-linux-gnu/librte_ring.so;/usr/local/lib/x86_64-linux-gnu/librte_eal.so;/usr/local/lib/x86_64-linux-gnu/librte_telemetry.so;/usr/local/lib/x86_64-linux-gnu/librte_argparse.so;/usr/local/lib/x86_64-linux-gnu/librte_kvargs.so;/usr/local/lib/x86_64-linux-gnu/librte_log.so
Library DIr: /usr/local/lib/x86_64-linux-gnu
Ldflags: -L/usr/local/lib/x86_64-linux-gnu;-Wl,--as-needed;-lrte_node;-lrte_graph;-lrte_pipeline;-lrte_table;-lrte_pdump;-lrte_port;-lrte_fib;-lrte_pdcp;-lrte_ipsec;-lrte_vhost;-lrte_stack;-lrte_security;-lrte_sched;-lrte_reorder;-lrte_rib;-lrte_mldev;-lrte_regexdev;-lrte_rawdev;-lrte_power;-lrte_pcapng;-lrte_member;-lrte_lpm;-lrte_latencystats;-lrte_jobstats;-lrte_ip_frag;-lrte_gso;-lrte_gro;-lrte_gpudev;-lrte_dispatcher;-lrte_eventdev;-lrte_efd;-lrte_dmadev;-lrte_distributor;-lrte_cryptodev;-lrte_compressdev;-lrte_cfgfile;-lrte_bpf;-lrte_bitratestats;-lrte_bbdev;-lrte_acl;-lrte_timer;-lrte_hash;-lrte_metrics;-lrte_cmdline;-lrte_pci;-lrte_ethdev;-lrte_meter;-lrte_net;-lrte_mbuf;-lrte_mempool;-lrte_rcu;-lrte_ring;-lrte_eal;-lrte_telemetry;-lrte_argparse;-lrte_kvargs;-lrte_log
Include Dirs: /home/seladb/dpdk-stable-24.11.1
Cflags: -include;rte_config.h;-march=native;-mrtm;-I/usr/local/include;-I/usr/include
Cflags Other: -include;rte_config.h;-march=native;-mrtm
Version: 24.11.1
-----------
-- Found DPDK: /home/seladb/dpdk-stable-24.11.1 (found version "24.11.1")
-- Looking for include file rte_kni.h
-- Looking for include file rte_kni.h - not found
--
Properties for TARGET DPDK::DPDK:
DPDK::DPDK.INTERFACE_LINK_LIBRARIES = "rte_node;rte_graph;rte_pipeline;rte_table;rte_pdump;rte_port;rte_fib;rte_pdcp;rte_ipsec;rte_vhost;rte_stack;rte_security;rte_sched;rte_reorder;rte_rib;rte_mldev;rte_regexdev;rte_rawdev;rte_power;rte_pcapng;rte_member;rte_lpm;rte_latencystats;rte_jobstats;rte_ip_frag;rte_gso;rte_gro;rte_gpudev;rte_dispatcher;rte_eventdev;rte_efd;rte_dmadev;rte_distributor;rte_cryptodev;rte_compressdev;rte_cfgfile;rte_bpf;rte_bitratestats;rte_bbdev;rte_acl;rte_timer;rte_hash;rte_metrics;rte_cmdline;rte_pci;rte_ethdev;rte_meter;rte_net;rte_mbuf;rte_mempool;rte_rcu;rte_ring;rte_eal;rte_telemetry;rte_argparse;rte_kvargs;rte_log"
DPDK::DPDK.INTERFACE_COMPILE_OPTIONS = "-include;rte_config.h;-march=native;-mrtm"
DPDK::DPDK.INTERFACE_INCLUDE_DIRECTORIES = "/home/seladb/dpdk-stable-24.11.1"
-- Looking for backtrace
-- Looking for backtrace - found
-- backtrace facility detected in default set of libraries
-- Found Backtrace: /usr/include
-- Building Example from PcapPlusPlus project
-- Failed to find LLVM FileCheck
-- Google Benchmark version: v1.9.0, normalized to 1.9.0
-- Looking for shm_open in rt
-- Looking for shm_open in rt - found
-- Performing Test HAVE_CXX_FLAG_WALL
-- Performing Test HAVE_CXX_FLAG_WALL - Success
-- Performing Test HAVE_CXX_FLAG_WEXTRA
-- Performing Test HAVE_CXX_FLAG_WEXTRA - Success
-- Performing Test HAVE_CXX_FLAG_WSHADOW
-- Performing Test HAVE_CXX_FLAG_WSHADOW - Success
-- Performing Test HAVE_CXX_FLAG_WFLOAT_EQUAL
-- Performing Test HAVE_CXX_FLAG_WFLOAT_EQUAL - Success
-- Performing Test HAVE_CXX_FLAG_WOLD_STYLE_CAST
-- Performing Test HAVE_CXX_FLAG_WOLD_STYLE_CAST - Success
-- Performing Test HAVE_CXX_FLAG_WCONVERSION
-- Performing Test HAVE_CXX_FLAG_WCONVERSION - Success
-- Performing Test HAVE_CXX_FLAG_WERROR
-- Performing Test HAVE_CXX_FLAG_WERROR - Success
-- Performing Test HAVE_CXX_FLAG_WSUGGEST_OVERRIDE
-- Performing Test HAVE_CXX_FLAG_WSUGGEST_OVERRIDE - Success
-- Performing Test HAVE_CXX_FLAG_PEDANTIC
-- Performing Test HAVE_CXX_FLAG_PEDANTIC - Success
-- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS
-- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS - Success
-- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32
-- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32 - Failed
-- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING
-- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING - Success
-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED_DECLARATIONS
-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED_DECLARATIONS - Success
-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED
-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED - Success
-- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING
-- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING - Success
-- Performing Test HAVE_CXX_FLAG_WD654
-- Performing Test HAVE_CXX_FLAG_WD654 - Failed
-- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY
-- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY - Failed
-- Performing Test HAVE_CXX_FLAG_COVERAGE
-- Performing Test HAVE_CXX_FLAG_COVERAGE - Success
-- Compiling and running to test HAVE_STD_REGEX
-- Performing Test HAVE_STD_REGEX -- success
-- Compiling and running to test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Compiling and running to test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX -- success
-- Compiling and running to test HAVE_STEADY_CLOCK
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Compiling and running to test HAVE_PTHREAD_AFFINITY
-- Performing Test HAVE_PTHREAD_AFFINITY -- success
-- Configuring done (12.8s)
-- Generating done (0.2s)
-- Build files have been written to: /home/seladb/PcapPlusPlus/build