Repository navigation
COMP: Report a VTK/ITK Python mismatch clearly in ITKVtkGlue - #6983
Conversation
[Medium impact] The PR appears safe to merge; no actionable defects were established.
|
|
Can we review/merge this today? I hit this problem again on my Mac. |
blowekamp
left a comment
There was a problem hiding this comment.
The changes in VtkGlue look good.
I have concern that directory calling VtkGlue's its-module-init.cmake out of order may have side-effects. Additionally it's not a sustainable practice for other modules that have pre-requisites.
If you set the configuration of ITK to the matching VTK's python executable does the configuration work with out the addition of the line to the top-level cmake?
A Python-wrapped VTK's config fills Python3_INCLUDE_DIR and Python3_LIBRARY from its build but keeps an already selected Python3_EXECUTABLE. When the two Pythons differ, FindPython3 failed inside VTK's config with a misleading missing Development.Module error. Find VTK without REQUIRED and report the selected interpreter and VTK's Python paths instead.
|
@blowekamp Good call. I dropped the top-level To your question: yes. With |
When ITK's selected Python differs from the one a Python-wrapped VTK was built with, ITKVtkGlue now fails with an error naming both, instead of FindPython3's misleading "missing: Development.Module".
Root cause
On Windows, FindPython3 searches the registry before
PATHand takes the newest version in range, so ITK's interpreter lookup can select e.g. Python 3.14. VTK'svtk-find-package-helpers.cmakethen fillsPython3_INCLUDE_DIR/Python3_LIBRARYwith its build-time (3.12) paths but keeps the already-set 3.14 interpreter. The mixed artifacts make VTK's ownfind_package(Python3 ... Development.Module)fail.find_package(VTK)is no longerREQUIRED, so the failure surfaces asVTK_Python_FOUND=0and ITK reports the interpreter and VTK's include/library paths, pointing atPython3_EXECUTABLE. A missing VTK gets its own error.Test results
Windows 11, VS 2026, CMake 4.4.4, configure only (
ITK_BUILD_DEFAULT_MODULES=OFF,Module_ITKVtkGlue=ON,BUILD_SHARED_LIBS=ON,BUILD_TESTING=ON), VTK 9.7 wrapped with Python 3.12, Python 3.14 also installed:Python3_EXECUTABLEmainAI assistance
PR Checklist
🤖 Generated with Claude Code