Skip to content

Fix build with GCC 15, CMake 4.x, and Boost 1.89#217

Open
filliformes wants to merge 12 commits into
uliss:ceammcfrom
filliformes:gcc15-cmake4-compat
Open

Fix build with GCC 15, CMake 4.x, and Boost 1.89#217
filliformes wants to merge 12 commits into
uliss:ceammcfrom
filliformes:gcc15-cmake4-compat

Conversation

@filliformes

Copy link
Copy Markdown

Summary

This PR fixes compilation with modern toolchains (GCC 15.2, CMake 4.2, Boost 1.89) on rolling-release Linux distributions like Arch/CachyOS. The upstream code currently fails to build on these systems due to several compatibility issues.

Problems and Fixes

1. C++17 required for Boost 1.89 lockfree headers

Problem: boost/lockfree/spsc_queue.hpp uses std::conditional_t which is C++14+. GCC 15's new -Wtemplate-body diagnostic catches this at template parse time, causing hard errors even with C++11.
Fix: Upgrade CMAKE_CXX_STANDARD from 11 to 17.

2. Implicit function declarations in portmidi (GCC 15)

Problem: GCC 15 treats implicit function declarations as errors (-Wimplicit-function-declaration). pmlinux.c calls find_default_device() and finddefault.c calls pm_find_default_device() without declarations.
Fix: Add forward declarations and missing #include <ctype.h>.

3. Missing #include <cstdint> in 111+ Faust-generated headers

Problem: With C++17, intptr_t and uint32_t are no longer implicitly available through other standard headers. All Faust-generated DSP headers use these types in ScopedNoDenormals but only include <cmath>, <cstdio>, etc.
Fix: Add #include <cstdint> after the first #include <cmath> in each affected header.

4. Ambiguous boost::hash_value with Boost 1.89 + C++17

Problem: In base_clone.cpp, boost::hash_value<t_symbol*>() becomes ambiguous between std::complex<T> and std::optional<T> overloads (both available in C++17).
Fix: Use boost::hash<T>{}() functor instead.

5. MemoryPool typo exposed by GCC 15

Problem: MemoryPool.tcc references memoryPool.freeSlots but the member is named freeSlots_. GCC 15's -Wtemplate-body catches this latent bug.
Fix: Correct to freeSlots_.

6. Missing M_PI definition

Problem: ui_canvas_cairo.cpp uses M_PI which is not guaranteed by the C++ standard in strict mode.
Fix: Add #define _USE_MATH_DEFINES and #include <cmath>.

7. Missing #include <algorithm> in nonius

Problem: execution_plan.h++ uses std::generate_n without including <algorithm>. GCC 15's template body checking requires it at parse time.
Fix: Add the missing include.

8. CMake 4.x Makefile generator issues

Problem: set_property(TARGET ... PROPERTY SOVERSION 1 VERSION "1.0.0") produces Makefile targets with semicolons, which breaks GNU Make. RPi GPIO externals are unconditionally compiled but depend on hw_rust.
Fix: Split into separate set_property calls; guard RPi externals behind WITH_RUST_HW.

Build Configuration

Tested on CachyOS (Arch-based) x86_64 with:

  • GCC 15.2.1, CMake 4.2.3, Boost 1.89
  • Required CMake flags: -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DFAUST_INCLUDE_DIR=/usr/include -DFAUST_LIBRARY=/usr/lib/libfaust.so
  • Disabled features (incompatible Rust crate deps): -DWITH_VEROVIO=OFF -DWITH_RUST_HW=OFF -DWITH_GAMEPAD=OFF -DWITH_PRINTER=OFF

Test plan

  • Full build completes to 100%
  • pd binary runs
  • ceammc.pd_linux external built (124MB)
  • Installed via make install

🤖 Generated with Claude Code

filliformes and others added 12 commits March 10, 2026 15:21
GCC 15 with Boost 1.89 requires C++17 for std::conditional_t used in
boost/lockfree/spsc_queue.hpp. C++11 doesn't define std::conditional_t,
and GCC 15's -Wtemplate-body catches this at template parse time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GCC 15 treats implicit function declarations as errors by default.
- pmlinux.c: add forward declaration for find_default_device()
- finddefault.c: add forward declaration for pm_find_default_device()
  and missing #include <ctype.h> for isspace()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GCC 15 with C++17 no longer implicitly includes <cstdint> through
other standard headers. The Faust-generated DSP headers use intptr_t
and uint32_t in ScopedNoDenormals but don't include <cstdint>.
Added the include after the first #include <cmath> in each file.

Affects 111 auto-generated headers across an/, dyn/, env/, flt/, fx/,
lfo/, misc/, noise/, osc/, pieces/, spat/, and synth/ directories.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
With Boost 1.89 and C++17, boost::hash_value<T> becomes ambiguous
between std::complex<T> and std::optional<T> overloads when T is
a pointer type. Use boost::hash<T>{} functor instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GCC 15's -Wtemplate-body detects member name mismatch in move
constructor and assignment operator. The member is named freeSlots_
but was referenced as freeSlots (missing trailing underscore).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
M_PI is not guaranteed by the C++ standard. With C++17 strict mode,
it may not be available without _USE_MATH_DEFINES.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GCC 15's -Wtemplate-body requires std::generate_n to be declared
at template parse time, not just at instantiation time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- class-wrapper/CMakeLists.txt: split SOVERSION/VERSION into separate
  set_property calls to avoid Makefile generator producing invalid
  target names with semicolons
- hw/CMakeLists.txt: guard RPi GPIO externals behind WITH_RUST_HW
  since they depend on hw_rust.hpp from the Rust hw crate

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The RPi hardware setup functions were declared and called unconditionally
in mod_hw.cpp, causing undefined symbol errors when building without
the Rust hw module. Guard both declarations and calls behind
#ifdef WITH_RUST_HW, and propagate the compile definition from CMake.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
mod_net.cpp unconditionally included net_rust.hpp and called
ceammc_net_logger_init(), causing build failures when all Rust net
features (MQTT, Telegram, HTTP, Freesound, WebSocket) are disabled.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
mod_proto.cpp unconditionally included proto_rust.hpp and called
ceammc_proto_log_init() and setup_proto_obs_client(), causing build
failures when WITH_OBS is disabled (no proto_rust library available).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
base_bitmap depends on core_rust (uses ceammc_core_async_bitmap from
core_rust.hpp). When WITH_RUST_CORE is OFF, the core_rust library is
not built, causing link failures. Guard the bitmap sources, include
paths, and setup call behind WITH_RUST_CORE.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@uliss uliss self-requested a review March 16, 2026 11:16
@uliss uliss self-assigned this Mar 16, 2026
@uliss uliss self-requested a review March 18, 2026 22:35

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

this is auto generated file, so changes should be made not here, but in faust_arch_ceammc.cpp

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.

2 participants