Skip to content

[CMake] [DPDK] building with out-of tree DPDK #1991

@ponyatov

Description

@ponyatov
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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions