Skip to content

buildsystem: fix the macOS build (Eigen 5 + Apple clang)#1801

Open
nicolassanchez02 wants to merge 2 commits into
SFTtech:masterfrom
nicolassanchez02:fix/eigen3-version-constraint
Open

buildsystem: fix the macOS build (Eigen 5 + Apple clang)#1801
nicolassanchez02 wants to merge 2 commits into
SFTtech:masterfrom
nicolassanchez02:fix/eigen3-version-constraint

Conversation

@nicolassanchez02
Copy link
Copy Markdown
Contributor

@nicolassanchez02 nicolassanchez02 commented May 29, 2026

Merge Checklist

The macOS build is broken two ways. find_package(Eigen3 3.3 REQUIRED NO_MODULE) at libopenage/CMakeLists.txt:59 won't take Eigen 5: the config is found, it's just refused on version (found 5.0.1, asked for 3.3), because Eigen's cmake config stopped treating a new major as satisfying an old request. Arch and Homebrew ship Eigen 5 now, so configure dies before it builds anything (that's the Arch failure in #1793). We only use the fixed-size Vector/Matrix/Affine types and none of that changed in Eigen 5, so I dropped the version bound. A range would read nicer but needs cmake 3.19 and we're on 3.16.

Past that, the build still fell over compiling: the macOS job forced Homebrew's llvm, and clang 22's libc++ couldn't find its own <math.h> before the SDK's, so nothing built. None of that was our code, it was just hidden behind the Eigen abort. building.md already says to build with --compiler=clang on macOS, so I pointed CI there and dropped the leftover llvm install.

Built and tested against Eigen 5.0.1 with the system Eigen removed so only 5.x was visible: reproduced the failure, then it builds and tests clean. macOS runner's green now.

Closes #1793.

find_package(Eigen3 3.3 REQUIRED NO_MODULE) rejects Eigen 5, because
Eigen's config-version file no longer treats a new major as compatible
with an older request. Eigen 5 now ships on Arch and Homebrew, so
configure aborts there before anything compiles. This is the cause of
issue SFTtech#1793 and of the long-failing macOS CI on master.

openage only uses the stable core and geometry API (Vector2/3/4f,
Matrix4f, Affine3f, AngleAxisf, dot, prescale, UnitZ), none of which
Eigen 5 drops, so dropping the version constraint is enough. A version
range would be tidier but needs cmake 3.19 and our floor is 3.16.

Verified by building openage and running the full test suite against a
local Eigen 5.0.1: configures, compiles, and all tests pass.

Closes SFTtech#1793.
@nicolassanchez02 nicolassanchez02 force-pushed the fix/eigen3-version-constraint branch from f5acda8 to 5f7169b Compare May 29, 2026 06:20
@nicolassanchez02
Copy link
Copy Markdown
Contributor Author

nicolassanchez02 commented May 29, 2026

Folded the macOS CI fix in here (it was #1802), so this goes green on its own instead of stopping at the Eigen change. Mac runner's passing now.

The macOS workflow forced Homebrew's LLVM (`brew --prefix llvm`/clang++),
which on the current runner is clang 22 whose libc++ can't find its own
<math.h>/<stddef.h> ahead of the SDK's C headers, so every C++ TU fails
to compile with "header search paths are not configured properly". None
of the errors are in openage code.

doc/building.md already recommends `--compiler=clang` (the Xcode clang)
as the hassle-free macOS toolchain, so point CI at it and drop the now
unused Homebrew LLVM install. Apple clang is built for the macOS SDK and
its libc++, so the header-ordering problem goes away.
@nicolassanchez02 nicolassanchez02 changed the title libopenage: accept Eigen 5 by relaxing version pin Fix the macOS build: accept Eigen 5, build CI with Apple clang May 29, 2026
@nicolassanchez02 nicolassanchez02 changed the title Fix the macOS build: accept Eigen 5, build CI with Apple clang buildsystem: fix the macOS build (Eigen 5 + Apple clang) May 29, 2026
@nicolassanchez02
Copy link
Copy Markdown
Contributor Author

This is ready for review. CI's green on macOS now, and it's the prerequisite for #1798/#1799/#1800, which stay red until this lands and they rebase. Happy to split the Eigen and CI commits into separate PRs if you'd rather review them apart.

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.

[BUG] Arch linux build fails

1 participant