Skip to content

Publish DAQIRI public include and pkg-config metadata#81

Merged
cliffburdick merged 1 commit into
mainfrom
cburdick/public-include-pkgconfig
May 13, 2026
Merged

Publish DAQIRI public include and pkg-config metadata#81
cliffburdick merged 1 commit into
mainfrom
cburdick/public-include-pkgconfig

Conversation

@cliffburdick
Copy link
Copy Markdown
Collaborator

Install the public C++ headers under include/daqiri with daqiri/daqiri.h as the canonical consumer include.

Update examples, bindings, and docs to use <daqiri/daqiri.h>, and generate a daqiri.pc file that works from the installed tree.

Install the public C++ headers under include/daqiri with daqiri/daqiri.h as the canonical consumer include.

Update examples, bindings, and docs to use <daqiri/daqiri.h>, and generate a daqiri.pc file that works from the installed tree.

Signed-off-by: Cliff Burdick <cburdick@nvidia.com>
@cliffburdick cliffburdick merged commit 3eb08b8 into main May 13, 2026
1 check passed
@cliffburdick cliffburdick deleted the cburdick/public-include-pkgconfig branch May 13, 2026 21:08
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 13, 2026

Greptile Summary

This PR migrates the public C++ headers from src/ into an installed include/daqiri/ tree, adds a new daqiri.h umbrella entry point, and generates a daqiri.pc pkg-config file so consumers can build against an installed copy of the library using either CMake or pkg-config.

  • Header reorganization: src/common.h, src/logging.hpp, and src/types.h are renamed/moved under include/daqiri/; all internal and example source files are updated to use the canonical <daqiri/daqiri.h> angle-bracket form.
  • Build system: The src/.. include path is demoted from PUBLIC to PRIVATE on the daqiri_common CMake target, and a full pkg-config template (cmake/daqiri.pc.in) is added with relocatable ${pcfiledir}-based prefix computation and conditional RDMA dependency detection.
  • Docs and examples: All documentation snippets, HTML API reference, and benchmark examples are updated from the old \"src/common.h\" quoted include to <daqiri/daqiri.h>.

Confidence Score: 4/5

The core header migration and CMake install rules are correct; the pkg-config file is functional for standard layouts but has a few rough edges around empty fields and spdlog install destination consistency.

The include-path migration is mechanical and consistent across all 36 changed files, and the relocatable prefix math in the .pc generator handles common lib/lib64/lib/arch-linux-gnu layouts correctly. The main concerns are: the generated .pc file always emits a blank Requires: key; vendored spdlog headers are installed to hardcoded include/ rather than ${CMAKE_INSTALL_INCLUDEDIR}, which would cause consumers to fail to find spdlog/fmt/fmt.h if the install prefix include directory is customized; and DPDK include dirs remain PUBLIC on the exported CMake target, leaking an unnecessary sysroot requirement onto all downstream CMake consumers.

CMakeLists.txt (pkg-config generation logic) and src/CMakeLists.txt (spdlog install destination and DPDK include visibility) warrant a second look.

Important Files Changed

Filename Overview
CMakeLists.txt Adds CUDAToolkit discovery and a full pkg-config file generation block; the prefix/libdir relative-path math is correct for standard GNUInstallDirs layouts, but the empty Requires: line and yaml-cpp placement in Libs: rather than Requires: are worth cleaning up.
cmake/daqiri.pc.in New pkg-config template; structure is standard and correctly uses ${pcfiledir} for relocatability, but will emit a blank Requires: line when the variable is empty.
src/CMakeLists.txt Public include path moved from PUBLIC to PRIVATE for the src/.. directory; new install rules correctly publish include/daqiri/ and vendored yaml-cpp headers, but vendored spdlog is still installed to hardcoded DESTINATION include rather than ${CMAKE_INSTALL_INCLUDEDIR}.
include/daqiri/daqiri.h New canonical umbrella header; thin wrapper that includes daqiri/common.h. License header and #pragma once guard are correct.
include/daqiri/common.h Renamed from src/common.h; internal include paths updated to angle-bracket form. No functional changes.
include/daqiri/logging.hpp Renamed from src/logging.hpp; includes spdlog/fmt/fmt.h which becomes a public header dependency consumers must satisfy.
include/daqiri/types.h Renamed from src/types.h; no functional changes. Includes cuda_runtime.h as a public dependency, handled via CUDA include flags in the .pc file.
src/common.cpp Updated to use angle-bracket includes; src/manager.h correctly retains quoted include since it is an internal-only header.
python/daqiri_common_pybind.cpp Single-line change updating include from src/common.h to daqiri/daqiri.h.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph Source
        A[src/common.cpp / manager.cpp / logging.cpp / backend .cpp files]
    end
    subgraph PublicHeaders
        B[daqiri.h umbrella]
        C[common.h]
        D[logging.hpp - spdlog/fmt/fmt.h]
        E[types.h - cuda_runtime.h]
        B --> C
        C --> D
        C --> E
    end
    subgraph Install
        F[include/daqiri/]
        G[include/spdlog/ vendored]
        H[include/yaml-cpp/ vendored]
        I[lib/pkgconfig/daqiri.pc]
        J[lib/cmake/daqiri/daqiriConfig.cmake]
        K[lib/libdaqiri.so]
    end
    subgraph Consumers
        L[pkg-config --cflags --libs daqiri]
        M[find_package daqiri / daqiri::daqiri]
    end
    A -->|include daqiri/daqiri.h| PublicHeaders
    PublicHeaders --> Install
    I --> L
    J --> M
Loading

Reviews (1): Last reviewed commit: "Publish DAQIRI public include and pkg-co..." | Re-trigger Greptile

Comment thread CMakeLists.txt
Comment on lines +83 to +90
set(DAQIRI_PC_REQUIRES "")
set(DAQIRI_PC_REQUIRES_PRIVATE "libdpdk")
set(DAQIRI_PC_LIBS "-lyaml-cpp")
separate_arguments(DAQIRI_PC_MGR_LIST UNIX_COMMAND "${DAQIRI_MGR}")
list(FIND DAQIRI_PC_MGR_LIST "socket" DAQIRI_PC_HAS_SOCKET_IDX)
list(FIND DAQIRI_PC_MGR_LIST "rdma" DAQIRI_PC_HAS_RDMA_IDX)
if(NOT DAQIRI_PC_HAS_SOCKET_IDX EQUAL -1 OR NOT DAQIRI_PC_HAS_RDMA_IDX EQUAL -1)
string(APPEND DAQIRI_PC_REQUIRES_PRIVATE " libibverbs librdmacm")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Empty Requires: line emitted in the generated .pc file

DAQIRI_PC_REQUIRES is always an empty string, so the template substitution produces Requires: (a key with no value). While most pkg-config implementations accept this, some (particularly older versions or strict linters) will emit a warning or error on a blank Requires: field. Additionally, yaml-cpp is placed directly in Libs: -lyaml-cpp, but since yaml-cpp ships its own .pc file on most systems, listing it in Requires: yaml-cpp would allow pkg-config to deduplicate flags and pull in its own include paths automatically. If keeping the direct -l is intentional (e.g. to support systems without a yaml-cpp.pc), the Requires: key should still be omitted when empty — the .pc.in template line can be guarded with a CMake conditional.

Comment thread src/CMakeLists.txt
Comment on lines 156 to 162
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../third_party/spdlog/include/spdlog/spdlog.h")
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../third_party/spdlog/include/spdlog
DESTINATION include
COMPONENT daqiri-cpp
)
endif()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 spdlog headers installed to hardcoded include/ instead of ${CMAKE_INSTALL_INCLUDEDIR}

The public header include/daqiri/logging.hpp includes <spdlog/fmt/fmt.h>, making spdlog a compile-time dependency for any consumer of <daqiri/daqiri.h>. When the vendored spdlog is installed, it lands at ${CMAKE_INSTALL_PREFIX}/include/spdlog/ (hardcoded DESTINATION include) rather than ${CMAKE_INSTALL_INCLUDEDIR}/spdlog/. If a caller sets CMAKE_INSTALL_INCLUDEDIR to anything other than include (e.g., an absolute path), the .pc file's ${includedir} will point to the wrong place and <spdlog/fmt/fmt.h> won't be found. Use ${CMAKE_INSTALL_INCLUDEDIR} consistently here to match the rest of the install rules.

Suggested change
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../third_party/spdlog/include/spdlog/spdlog.h")
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../third_party/spdlog/include/spdlog
DESTINATION include
COMPONENT daqiri-cpp
)
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../third_party/spdlog/include/spdlog/spdlog.h")
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../third_party/spdlog/include/spdlog
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT daqiri-cpp
)
endif()

Comment thread CMakeLists.txt
Comment on lines +80 to +91
set(DAQIRI_PKGCONFIG_INCLUDEDIR "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
endif()

set(DAQIRI_PC_REQUIRES "")
set(DAQIRI_PC_REQUIRES_PRIVATE "libdpdk")
set(DAQIRI_PC_LIBS "-lyaml-cpp")
separate_arguments(DAQIRI_PC_MGR_LIST UNIX_COMMAND "${DAQIRI_MGR}")
list(FIND DAQIRI_PC_MGR_LIST "socket" DAQIRI_PC_HAS_SOCKET_IDX)
list(FIND DAQIRI_PC_MGR_LIST "rdma" DAQIRI_PC_HAS_RDMA_IDX)
if(NOT DAQIRI_PC_HAS_SOCKET_IDX EQUAL -1 OR NOT DAQIRI_PC_HAS_RDMA_IDX EQUAL -1)
string(APPEND DAQIRI_PC_REQUIRES_PRIVATE " libibverbs librdmacm")
endif()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 DPDK_INCLUDE_DIRS is still PUBLIC on the CMake exported target

DPDK_INCLUDE_DIRS is in the PUBLIC section of target_include_directories(daqiri_common ...) in src/CMakeLists.txt, so it propagates through find_package(daqiri) to every CMake consumer — even though the public headers do not directly include any DPDK header. Consumers silently gain a dependency on DPDK headers being present in their sysroot. Moving ${DPDK_INCLUDE_DIRS} to PRIVATE would avoid this leakage.

cliffburdick added a commit that referenced this pull request May 13, 2026
Omit empty pkg-config dependency fields, keep vendored spdlog under the configured install include directory, and stop exporting DPDK include directories from the public daqiri target.

Signed-off-by: Cliff Burdick <cburdick@nvidia.com>
cliffburdick added a commit that referenced this pull request May 13, 2026
Drop the simple_packet_reorder launcher and its documentation. Keep reordering on the configured rx.reorder_configs path and use a no-op CUDA launch in docs where a generic packet-processing example is useful.

Signed-off-by: Cliff Burdick <cburdick@nvidia.com>
cliffburdick added a commit that referenced this pull request May 13, 2026
Declare the user-facing simple_packet_reorder launcher from <daqiri/daqiri.h> so consumers do not include private src headers. Keep src/kernels.h private for internal reorder implementation details and make installed pkg-config links resolve sibling DAQIRI libraries.

Signed-off-by: Cliff Burdick <cburdick@nvidia.com>
cliffburdick added a commit that referenced this pull request May 13, 2026
Drop the simple_packet_reorder launcher and its documentation. Keep reordering on the configured rx.reorder_configs path and use a no-op CUDA launch in docs where a generic packet-processing example is useful.

Signed-off-by: Cliff Burdick <cburdick@nvidia.com>
cliffburdick added a commit that referenced this pull request May 13, 2026
* #81 - Expose reorder kernel through daqiri header

Declare the user-facing simple_packet_reorder launcher from <daqiri/daqiri.h> so consumers do not include private src headers. Keep src/kernels.h private for internal reorder implementation details and make installed pkg-config links resolve sibling DAQIRI libraries.

Signed-off-by: Cliff Burdick <cburdick@nvidia.com>

* #81 - Remove public simple reorder kernel

Drop the simple_packet_reorder launcher and its documentation. Keep reordering on the configured rx.reorder_configs path and use a no-op CUDA launch in docs where a generic packet-processing example is useful.

Signed-off-by: Cliff Burdick <cburdick@nvidia.com>

---------

Signed-off-by: Cliff Burdick <cburdick@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant