Find an installed Eigen 3.4 as well as Eigen 5 - #356
Merged
Merged
Conversation
find_package(Eigen3 3.4...99) was meant to accept any Eigen >= 3.4, but Eigen 3.4's ConfigVersion declares SameMajorVersion, under which a range is accepted only if both of its ends have major version 3. Every Eigen 3 was therefore rejected: on RHEL 10 with EPEL's eigen3-devel 3.4.0 the configure reported "Eigen3 >= 3.4 not found" and fetched 5.0.1 instead. Ask for a bare 3.4 first, which SameMajorVersion reads as any 3.x >= 3.4, and fall back to the range for Eigen 5, whose ConfigVersion reads a bare 3.4 as [3.4, 3.5). Checked against a SameMajorVersion 3.4.0 package and Fedora's Eigen 5.0.1: the old request rejects the first, the new one accepts both. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RyAriWLj2QhhGFs6GrWVC3
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.
find_package(Eigen3 3.4...99)was meant to accept any Eigen >= 3.4, but Eigen 3.4'sEigen3ConfigVersion.cmakedeclares SameMajorVersion, under which a version range is accepted only if both of its ends have major version 3. Every Eigen 3 was therefore rejected: on RHEL 10 with EPEL'seigen3-devel-3.4.0the configure reports "Eigen3 >= 3.4 not found" and fetches 5.0.1 over the installed package.This asks for a bare
3.4first — which SameMajorVersion reads as any 3.x >= 3.4 — and falls back to the range for Eigen 5, whose ConfigVersion reads a bare3.4as [3.4, 3.5). A version-rejectedfind_packageloads no targets, so the second request starts clean.Checked in a standalone project against a SameMajorVersion 3.4.0 package (generated with
write_basic_package_version_file) and Fedora 44's Eigen 5.0.1:3.4...99(before)3.4, then3.4...99(this PR)🤖 Generated with Claude Code
https://claude.ai/code/session_01RyAriWLj2QhhGFs6GrWVC3