BUG: Restore eigen_internal export to ITK's main targets set (#6239)#6247
BUG: Restore eigen_internal export to ITK's main targets set (#6239)#6247hjmjohnson wants to merge 1 commit into
Conversation
|
@greptile review |
SimpleITK build verification — before/after differentialReproduced the SimpleITK failure against latest SimpleITK upstream (
Both ITK builds: Pre-flight:
|
find_package(ITK) |
FetchContent fallback | Error cascade | |
|---|---|---|---|
| baseline (no fix) | FAILED | yes — _deps/itk-src/ present |
itksys imported-target collision (exact #6239) |
| PR #6247 | -- ITK found via find_package() |
no | unrelated SimpleITK codegen issues |
The fix resolves the export-set regression cleanly. Whatever else SimpleITK CI surfaces is independent of this PR.
…SoftwareConsortium#6239) Commit 64ddc66 (Eigen 5.0.1 vendored update, 2026-05-01) silently moved eigen_internal out of ITK's main `${ITK3P_INSTALL_EXPORT_NAME}` export set into a standalone `ITKInternalEigen3Targets`. Because `ITKConfig.cmake` only loads `ITKTargets.cmake`, downstream `find_package(ITK)` could no longer resolve `eigen_internal` and any consumer using FetchContent with `FIND_PACKAGE_ARGS` (SimpleITK's pattern) hit a target-collision cascade as CMake fell back to `add_subdirectory`. Re-add the install rule that registers `eigen_internal` in `${ITK3P_INSTALL_EXPORT_NAME}` while keeping the existing standalone `ITKInternalEigen3Targets` install for `find_package(ITKInternalEigen3)` consumers. Both export sets now reference the same target. Issue: InsightSoftwareConsortium#6239
This comment was marked as resolved.
This comment was marked as resolved.
5dfd84a to
c1715d9
Compare
|
How was the ITK eigen for updated? ITK commit 7aa8ae2 indicates set of changes in the eigen fork: Were these changes from the prior eigen commit included in the update to the fork? |
Downstream-consumer end-to-end verification (BRAINSTools + SimpleITK)Built two real-world ITK consumers against the SimpleITK — full build ✅
BRAINSTools — configure clean, build blocked by unrelated module-config issue
|
Four minor ITK-side overlays that previously lived only in ITK proper as post-import patches (commits f6eb95b9f8 and 85577ae354 on the InsightSoftwareConsortium/ITK side): 1. cmake_minimum_required(VERSION 3.16.3) — bump from 3.10.2 to match ITK's minimum CMake requirement. 2. if(FALSE) ... endif() wrapper -> #[[ ... #]] block-comment wrapper around the upstream-Eigen CMakeLists.txt body. The block-comment form is cleaner; both achieve 'skip the upstream Eigen config' when this file is included into ITK's third-party glue. 3. Remove duplicate ITK_USE_EIGEN_MPL2_ONLY option(...) declaration (the option is also declared once earlier in the file). 4. Trim a stray BUILD_INTERFACE comment line. Carrying these in the fork makes the next ITK subtree-update truly no-op rather than re-introducing the pre-fixup forms. Issue: InsightSoftwareConsortium/ITK#6239 PR: InsightSoftwareConsortium/ITK#6247
This was done incorrectly with the previous eigen update. I am preparing a new PR to properly include the set of ITK vendored patches in the ITK/eigen branch. Tests are running now. A new PR that supercedes this PR is expected later this morning. I'm currently running a matrix of builds using both vendored and system installed eigen for SimpleITK, BRAINSTools. |
|
Superceeded by #6249. |
Restores
eigen_internalto ITK's main${ITK3P_INSTALL_EXPORT_NAME}export set sofind_package(ITK)resolves it for downstream consumers (closes #6239 — SimpleITK CI red since 2026-05-01).Scope note: this addresses only the most immediate regression. The broader Eigen3 design questions (header-path policy #5952 vs #6225, symbol mangling, VNL→Eigen migration, the
_SYSTEM_INCLUDE_DIRSasymmetry #6224) remain in the master tracking issue #6230 and are deliberately not touched here.Root cause (issue #6239)
Commit
64ddc666(Eigen 5.0.1 vendored update, 2026-05-01) silently movedeigen_internalout of ITK's main${ITK3P_INSTALL_EXPORT_NAME}export set into a standaloneITKInternalEigen3Targets. BecauseITKConfig.cmakeonly loadsITKTargets.cmake, downstreamfind_package(ITK)could no longer resolveeigen_internaland any consumer using FetchContent withFIND_PACKAGE_ARGS(SimpleITK's pattern) hit a target-collision cascade as CMake fell back toadd_subdirectory.The fix re-adds the install rule that registers
eigen_internalin the main export set while keeping the standaloneITKInternalEigen3Targetsinstall forfind_package(ITKInternalEigen3)consumers. Both export sets now reference the same target — same pattern as every other ITK-vendored third party (NrrdIO, NIFTI, Expat, OpenJPEG, DICOMParser).Local verification — SimpleITK before/after differential
Reproduced against latest SimpleITK upstream (
853c78a9, 2026-05-09) using two parallel ITK installs at the same configuration (ITK_BUILD_DEFAULT_MODULES=ON+Module_ITKIOTransformMINC=ON+Module_ITKReview=ON, matchingSuperBuild/External_ITK.cmake):7820bbcfb8(no fix)~/src/ITK-eigen-baseline-install~/src/ITK-build-test-tree-eigen/install-fixPre-flight:
eigen_internalin installedITKTargets.cmakeSimpleITK configure against each install:
find_package(ITK)_deps/itk-src/)add_library cannot create target "itksys" because an imported target with the same name already exists(exact #6239 cascade)-- ITK found via find_package()The fix resolves the export-set regression cleanly. Verification comment with full reproduction steps posted to this PR.
What remains for #6230
This PR does not address (deferred per #6230 design discussion 2026-05-07/09):
ITK_EIGEN(X)for ITK internals; PRs ENH: Use standard header approach for eigen e.g. itk_Eigenvalues #5952 (per-module wrappers) and ENH: Migrate Eigen3 includes to canonical <Eigen/x> via Eigen3::Eigen (supersedes #5952) #6225 (canonical<Eigen/X>migration) both pending design resolution.Eigen3::Eigenconsumer exposure — emerging consensus is "no, useITK::ITKEigen3Module" but no code change here.eigen_internal, not_SYSTEM_INCLUDE_DIRSglue. Larger refactor.test/); deferred to avoid precedent-setting in a regression-fix PR.UpdateFromUpstream.shoverlay-patch checklist — was prototyped in an earlier revision of this PR but removed per maintainer preference; documenting the no-mangling decision and the dual-export requirement belongs elsewhere.