ENH: Update vendored Eigen3 to 5.0.1+master; verify USE_SYSTEM 3.3/3.4/5.x#6176
Open
hjmjohnson wants to merge 8 commits intoInsightSoftwareConsortium:mainfrom
Open
ENH: Update vendored Eigen3 to 5.0.1+master; verify USE_SYSTEM 3.3/3.4/5.x#6176hjmjohnson wants to merge 8 commits intoInsightSoftwareConsortium:mainfrom
hjmjohnson wants to merge 8 commits intoInsightSoftwareConsortium:mainfrom
Conversation
Member
Author
|
@greptile review |
This comment was marked as resolved.
This comment was marked as resolved.
a3699e0 to
6fbd1d6
Compare
6fbd1d6 to
016f9ac
Compare
This comment was marked as resolved.
This comment was marked as resolved.
56a7240 to
eda5a20
Compare
Member
Author
|
/azp run ITK.Windows |
This comment was marked as resolved.
This comment was marked as resolved.
Member
Author
|
/azp run ITK.Windows |
Contributor
|
Too many files changed for review. ( |
Member
Author
|
/azp run ITK.Windows |
blowekamp
reviewed
May 1, 2026
Member
blowekamp
left a comment
There was a problem hiding this comment.
Looking good.
Thank you for updating the library. After I refactored from an off fetch_content in the root of the project to an itk standard third party library I ran out of steam to upgrade.
There were some rather odd usages of Eigen in external modules. The intention moving forward is just have it behave just like a normal ITK interface library without special cmake code.
e7a197c to
be77e85
Compare
Member
Author
|
/azp run ITK.Windows |
5 tasks
Phase 2 prep for Eigen 5.x update. Points UpdateFromUpstream.sh at the
refreshed InsightSoftwareConsortium/eigen tag derived from gitlab
libeigen/eigen master tip 879885e (2026-05-01), which adds the
"Modernize internal utilities for C++14" patch (libeigen/eigen!2490)
on top of the 5.0.1 release tip plus three small follow-on fixes
(RealQZ pushDownZero counting, small-determinant LU fastpath, and
IncompleteLUT static row matching).
Adds new top-level support headers introduced since the previous import:
AccelerateSupport, KLUSupport, ThreadPool, and Version. The Version
header is required because Eigen 5 moved EIGEN_{MAJOR,MINOR,PATCH}_VERSION
out of src/Core/util/Macros.h.
Code extracted from:
https://github.com/InsightSoftwareConsortium/eigen
at commit 505023a2a0fc8eeff5f92d07683ab5ff0c03ba0f (for/itk-20260501-879885e1).
* upstream-Eigen3: Eigen3 2026-05-01 (505023a2) # Conflicts: # Modules/ThirdParty/Eigen3/src/itkeigen/Eigen/src/Core/products/SelfadjointMatrixVector.h
The warning is purely from the Eigen master post-5.0.1 update (EIGEN_VERSION_STRING="5.0.1-dev+master") changing instantiation/ inlining. Eigen's own CMakeLists.txt already adds -Wno-maybe-uninitialized for its own builds (line 444, with a comment that GCC 12+ emits false positives), and DisableStupidWarnings.h doesn't cover this one. The fix is to suppress at the ITK consumer site, mirroring Eigen's stance.
- Restore @EIGEN3_TARGETS_FILE@ substitution in Eigen3Config.cmake.in. - Remove duplicate option(ITK_USE_EIGEN_MPL2_ONLY) declaration. - Remove commented-out binary-dir generator expression. USE_SYSTEM_EIGEN for 3.3+ unaffected (all under itkeigen, only configured when USE_SYSTEM_EIGEN=OFF).
Bump line 2 from 3.10.2 to 3.16.3 to match ITK proper, and replace the if(FALSE) ... endif() wrapper around the upstream Eigen logic with #[[ ... #]] CMake multiline-comment markers so IDEs render the disabled region as dimmed dead code.
Tridiagonalization.h emits C4750 ('function with _alloca() inlined into
a loop') under MSVC whenever an ITK consumer instantiates the symmetric
eigen-decomposition path. The warning is benign (Eigen's intentional
small-allocation alloca path) but cannot be addressed inside ITK and
fails CDash because the dashboard treats any warning as fatal.
The previous attempt to set CMAKE_CXX_FLAGS in the vendored Eigen
CMakeLists was a no-op (Eigen is header-only, so no .cxx file picks up
the flag) and the alternative -- attaching /wd4750 to the eigen_internal
INTERFACE library -- would propagate to ITKCommon (which DEPENDS on
ITKEigen3) and from there to most of the toolkit, suppressing C4750
for non-Eigen ITK code too. Both rejected per @blowekamp.
Instead, extend the existing 'Modules/ThirdParty/Eigen3/.*warning:.*'
CTestCustom regex with a sibling that matches MSVC's
'warning C####:' form. Compiler still emits the warning so reviewers
see it in build logs, but the dashboard ignores it for warning-count
purposes -- exactly the same scope the GCC/Clang side has had since
this exception was added.
be77e85 to
76d09b8
Compare
# Conflicts: # CMake/CTestCustom.cmake.in
Member
Author
|
/azp run ITK.Linux.Python |
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.
Vendors Eigen master post-5.0.1 (gitlab
libeigen/eigentipfef1460e, late April 2026;EIGEN_VERSION_STRING="5.0.1-dev+master") via the canonicalUpdateFromUpstream.shflow, and demonstratesITK_USE_SYSTEM_EIGEN=ONagainst system Eigen 3.3.9, 3.4.0, and 5.0.1. The 3.3 minimum-version gate is preserved.Acceptance matrix (build + Eigen-related tests)
5a7cc61d6(Eigen 5.0.1+master)eigen=3.3.9(proves min-version gate)eigen=3.4.0eigen=5.0.1The 11 tests:
itkSymmetricEigenAnalysisTest,itkEigenAnalysis2DImageFilterTest,itkSymmetricEigenAnalysisImageFilterTest{OrderByValue,OrderByMagnitude,DoNotOrder},vnl_algo_test_{complex,generalized,real,symmetric}_eigensystem,ITKEigenKWStyleTest,ITKEigenInDoxygenGroup.What changed in the vendored tree
UpdateFromUpstream.shtag bumped to the new ISC fork tag (suffix-fef1460ek). Whitelist gainedAccelerateSupport,KLUSupport,ThreadPool,Version(theEigen/Versionheader is required because Eigen 5 movedEIGEN_{MAJOR,MINOR,PATCH}_VERSIONout ofsrc/Core/util/Macros.h).src/itkeigen/CMakeLists.txtversion parser was rewritten on the fork (be4bdb732) to readEigen/Version(semverMAJOR.MINOR.PATCH) for Eigen 5+, falling back toMacros.h(WORLD.MAJOR.MINOR) for legacy 3.4.x.Eigen3ConfigVersion.cmakenow reportsPACKAGE_VERSION "5.0.1".Eigen/src/Core/products/SelfadjointMatrixVector.h: Eigen 5 fully rewrote that kernel into 4-col / 2-col / 1-col phases, already initializing accumulators withpzero(Packet{}). Resolved by taking upstream entirely — the older in-tree COMP patch91f6232("pzero(Packet{}) for SelfadjointMatrixVector accumulators") is subsumed and obsolete.ISC fork (InsightSoftwareConsortium/eigen) state
5a7cc61d6.for/itk-masteradvanced to5a7cc61d6.fef1460e: CMake override (be4bdb732),.gitattributeslapacke relax (fb7121abd), andREADME.kitware.md(5a7cc61d6).Outer-module CMake
Modules/ThirdParty/Eigen3/CMakeLists.txtkeeps_Eigen3_min_version=3.3(no upper bound).find_package(Eigen3 REQUIRED CONFIG)plus the explicitVERSION_LESScheck accepts both 3.x and 5.x system installs without modification.