Publish DAQIRI public include and pkg-config metadata#81
Conversation
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>
Greptile SummaryThis PR migrates the public C++ headers from
Confidence Score: 4/5The 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
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
Reviews (1): Last reviewed commit: "Publish DAQIRI public include and pkg-co..." | Re-trigger Greptile |
| 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") |
There was a problem hiding this comment.
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.
| 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() |
There was a problem hiding this comment.
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.
| 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() |
| 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() |
There was a problem hiding this comment.
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.
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>
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>
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>
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>
* #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>
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.