CMakeLists: install rules + pkg-config for daedalus_core #1

Merged
marfrit merged 1 commits from noether/installable-pkgconfig into main 2026-05-21 15:53:37 +00:00
Owner

First small step toward letting the daedalus-v4l2 daemon depend on daedalus-fourier (per the H.264 daemon-rewrite plan in reauktion/daedalus-v4l2#11 + the hybrid-substrate philosophy: V3D where it pays + NEON elsewhere, electrons saved).

Adds install() rules + a generated daedalus-fourier.pc so a sibling consumer can pkg_check_modules(DAEDALUS REQUIRED daedalus-fourier) and link against a system-installed copy.

What gets installed

  • lib/libdaedalus_core.a
  • include/daedalus.h
  • lib/pkgconfig/daedalus-fourier.pc
  • share/daedalus-fourier/shaders/*.spv (only when DAEDALUS_BUILD_VULKAN=ON; consumers using daedalus_ctx_create_no_qpu() don't need them)

pkg-config output

$ pkg-config --cflags --libs daedalus-fourier
-I${prefix}/include -L${prefix}/lib -ldaedalus_core

$ pkg-config --static --libs daedalus-fourier
-L${prefix}/lib -ldaedalus_core -lpthread -ldl -lm -lvulkan

Static-archive transitive deps surface via Libs.private (pthread, dl, m for the C runtime helpers + the vendored asm glue) and Requires.private (vulkan). Non-static consumers using only the no-QPU path get just -ldaedalus_core; static consumers needing V3D get the full transitive line via --static.

Verified

Clean build + install on hertz (Pi 5 dev host). All 7 SPIR-V shaders + the static lib + the header + the .pc file land in the install prefix. No behaviour change to existing tests / benches.

Next steps

This PR is purely enabling — no consumer is wired up yet. Follow-ups, in order:

  1. daedalus-v4l2 daemon: pkg_check_modules + daedalus_ctx_create_no_qpu() at startup, log result, commit (separate PR).
  2. daedalus-v4l2 daemon: instrument the existing libavcodec-driven H.264 decode to count per-frame how many 4×4 IDCT blocks / deblock edges / MC tiles a typical YouTube workload would dispatch. Pure measurement, no behaviour change.
  3. Then start substituting daedalus-fourier kernels for libavcodec's per-MB primitives, one cycle at a time, measuring CPU saved per substitution.

Deliberate small steps so each one is reviewable + reversible. See reauktion/daedalus-v4l2#11 for the full design.

First small step toward letting the daedalus-v4l2 daemon depend on daedalus-fourier (per the H.264 daemon-rewrite plan in reauktion/daedalus-v4l2#11 + the hybrid-substrate philosophy: V3D where it pays + NEON elsewhere, electrons saved). Adds `install()` rules + a generated `daedalus-fourier.pc` so a sibling consumer can `pkg_check_modules(DAEDALUS REQUIRED daedalus-fourier)` and link against a system-installed copy. ## What gets installed - `lib/libdaedalus_core.a` - `include/daedalus.h` - `lib/pkgconfig/daedalus-fourier.pc` - `share/daedalus-fourier/shaders/*.spv` (only when `DAEDALUS_BUILD_VULKAN=ON`; consumers using `daedalus_ctx_create_no_qpu()` don't need them) ## pkg-config output ``` $ pkg-config --cflags --libs daedalus-fourier -I${prefix}/include -L${prefix}/lib -ldaedalus_core $ pkg-config --static --libs daedalus-fourier -L${prefix}/lib -ldaedalus_core -lpthread -ldl -lm -lvulkan ``` Static-archive transitive deps surface via `Libs.private` (pthread, dl, m for the C runtime helpers + the vendored asm glue) and `Requires.private` (vulkan). Non-static consumers using only the no-QPU path get just `-ldaedalus_core`; static consumers needing V3D get the full transitive line via `--static`. ## Verified Clean build + install on hertz (Pi 5 dev host). All 7 SPIR-V shaders + the static lib + the header + the `.pc` file land in the install prefix. No behaviour change to existing tests / benches. ## Next steps This PR is purely enabling — no consumer is wired up yet. Follow-ups, in order: 1. **daedalus-v4l2 daemon**: `pkg_check_modules` + `daedalus_ctx_create_no_qpu()` at startup, log result, commit (separate PR). 2. **daedalus-v4l2 daemon**: instrument the existing libavcodec-driven H.264 decode to count per-frame how many 4×4 IDCT blocks / deblock edges / MC tiles a typical YouTube workload would dispatch. Pure measurement, no behaviour change. 3. Then start substituting daedalus-fourier kernels for libavcodec's per-MB primitives, one cycle at a time, measuring CPU saved per substitution. Deliberate small steps so each one is reviewable + reversible. See reauktion/daedalus-v4l2#11 for the full design.
marfrit added 1 commit 2026-05-21 15:50:20 +00:00
Make daedalus_core installable so sibling consumers (Phase 8 V4L2
daemon, future libva-v4l2-request-fourier integration tests, etc.)
can `pkg_check_modules(DAEDALUS REQUIRED daedalus-fourier)` against
a system-installed copy.

Installs:
  - lib/libdaedalus_core.a
  - include/daedalus.h
  - lib/pkgconfig/daedalus-fourier.pc
  - share/daedalus-fourier/shaders/*.spv  (only when
    DAEDALUS_BUILD_VULKAN is ON; consumers using
    daedalus_ctx_create_no_qpu() don't need them)

pkg-config surfaces the static-archive transitive deps via
Libs.private (-lpthread -ldl -lm) and Requires.private (vulkan),
so a consumer doing `pkg-config --static --libs daedalus-fourier`
gets the full link line.  Non-static consumers (using the
no_qpu path) get just `-ldaedalus_core`.

No behaviour change to existing tests / benches.

Verified on hertz (Pi 5, dev host): clean build, all 7 SPIR-V
shaders + the static lib + the header + the .pc file land in
the install prefix.
marfrit merged commit d87239d817 into main 2026-05-21 15:53:37 +00:00
marfrit deleted branch noether/installable-pkgconfig 2026-05-21 15:53:37 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: marfrit/daedalus-fourier#1