Skip to content

common: fix gcc 14 build — include <cmath> in speculative.cpp - #6

Open
lornecodes wants to merge 1 commit into
poolsideai:lagunafrom
dawnfield-institute:fix/cmath-gcc14-build
Open

common: fix gcc 14 build — include <cmath> in speculative.cpp#6
lornecodes wants to merge 1 commit into
poolsideai:lagunafrom
dawnfield-institute:fix/cmath-gcc14-build

Conversation

@lornecodes

Copy link
Copy Markdown

The laguna branch fails to compile on gcc 14 / recent libstdc++:

common/speculative.cpp: In function '...':
common/speculative.cpp:1091:35: error: 'isfinite' is not a member of 'std'

std::isfinite (used in the DFlash speculative path) was only reaching the
translation unit transitively through another header. gcc 14 tightened its
standard-library includes and no longer pulls <cmath> in that way, so the
build breaks on Debian trixie, Fedora 40+, Arch, etc.

This adds the explicit #include <cmath> to common/speculative.cpp. One
line, no behavior change — the file just declares the header it uses.

Verified by building the laguna branch on Debian trixie (gcc 14.2): fails
without this, builds clean with it (Laguna-S-2.1 Q4_K_M + DFlash then run).

std::isfinite is used in speculative.cpp (DFlash path) but <cmath> was only
reaching it transitively. gcc 14 / libstdc++ no longer pull it in, so the
laguna branch fails to compile:

  common/speculative.cpp: error: 'isfinite' is not a member of 'std'

Add the explicit include. One line; no behavior change.
@nzbrian

nzbrian commented Jul 28, 2026

Copy link
Copy Markdown

Can confirm this is required on Ubuntu Resolute gcc 15.2

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