Fix standalone build and add examples to GitHub Actions CI - #10
Merged
Conversation
The top-level fetch builds fmt with FMT_INSTALL off, leaving fmt and fmt-header-only out of any export set. Because lwtr (and the scp reporting target) are static libraries, exporting them wraps their fmt dependency in $<LINK_ONLY:>, which requires fmt to be in an export set. install(EXPORT) then fails: install(EXPORT ...) includes target "lwtr" which requires target "fmt-header-only" that is not in any export set. This configures cleanly in environments where fmt is already installed system-wide: find_package() yields an imported target, which is excluded from the export-set check. Where fmt is absent it is fetched and built from source as a normal (non-exported) target, triggering the error. Force FMT_INSTALL ON so a from-source fmt is exportable, and add FIND_PACKAGE_ARGS to prefer an installed fmt when present.
The binary FTR backend (lwtr_ftr.cpp, lz4_streambuf.cpp) and thus tx_ftr_init are only compiled when a lz4::lz4 target exists. Relying on a system lz4 is unreliable across environments: Ubuntu's liblz4-dev ships no CMake config, and upstream/other distributions export the target as LZ4::lz4 (capital), so the project's find_package(lz4)/lz4::lz4 check fails and the examples fail to link with undefined reference to tx_ftr_init. Fetch lz4 (v1.10.0) from source like the other dependencies so the FTR backend builds everywhere with nothing preinstalled. lz4 builds a static library as a subproject, so force PIC for linking into the shared lwtr library, disable its CLI, and alias the unified target to lz4::lz4.
The bundled SystemC (3.0.2) defines no _ns user-defined literal, so 10_ns fails with 'unable to find numeric literal operator'. Use an explicit sc_core::sc_time(10, SC_NS) instead.
- replace unavailable 10_ns literal with sc_time(10, SC_NS) - declare issue_time from sc_time_stamp() after wait() - use record_event_at_time for timestamped events - use end_tx_delayed for delayed memory tx end - enable events on tx_generators (with_events=true)
- add enable_testing() so the existing add_test() entries in example/CMakeLists.txt are registered with CTest - add ci-examples.yml workflow (C++17/20 matrix) that builds the three example targets and runs ctest scoped to build/example (unscoped ctest would also run failing tests from the fetched SystemC-CCI dependency)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Examples did not work out-of-the box of freshly installed Ubuntu 26.
Add examples build & run to CI.
Since this repo sees only occasional activity, the extra compute is unlikely to meaningfully accelerate climate change.