Repository navigation
Conversation
Member
Author
|
@N-Dekker We ran into this little issue in a certain build configuration with missing ITK interface libraries or include paths when using Elastix as a library. We could add an explicit "if ITK v6" block add the library dependency in Elastix. What do you think? |
Member
Author
|
A proper fix should still be done in Elastix, but this should work to clean up the BatchBuild CI for now. |
zivy
approved these changes
Apr 23, 2026
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.
Problem
When building SimpleITK with Elastix in Superbuild mode on Windows (using
ITK_USE_BUILD_DIR=ON), the build fails with:See the failing dashboard build: https://open.cdash.org/builds/11201211/build
Root Cause
The issue originates from a recent change in the
origin/mainbranch of the elastix repository (commitaf47e22— "ENH: Use target based includes in CMakeLists"). That commit replaced globalinclude_directories(${elxINCLUDE_DIRECTORIES})with proper target-basedtarget_include_directories(). This is a good change, but it exposed a missing dependency.The header chain is:
itkMultiResolutionPyramidImageFilter.hlives in theITKRegistrationCommonITK module (Modules/Registration/Common/include/). This is a header-only module — its targetITK::ITKRegistrationCommonModuleis anINTERFACElibrary, and it is not included in the${ITK_LIBRARIES}variable that elastix uses.With installed ITK: all headers are merged into a single install include directory, so any ITK-linked target can find all ITK headers regardless of which module they belong to. The build works.
With
ITK_USE_BUILD_DIR=ON(build tree ITK): each ITK module has its own separate include directory. Without an explicit dependency onITK::ITKRegistrationCommonModule, its include path is never added to the compile command, and the header cannot be found. This is the configuration used in the Windows Superbuild CI.Fix
Add
ITK::ITKRegistrationCommonModuleas a PRIVATE link dependency ofSimpleElastix. This propagates the include directory foritkMultiResolutionPyramidImageFilter.hwhen building against an ITK build tree.Note to the Elastix Team
The underlying deficiency is in elastix itself:
elxCore's public headers (elxFixedImagePyramidBase.h,elxMovingImagePyramidBase.h)#include "itkMultiResolutionPyramidImageFilter.h", butelxCore'starget_link_libraries()does not declare a PUBLIC dependency onITK::ITKRegistrationCommonModule. As a result, consumers ofelxCore(and transitivelyelastix_lib) do not automatically get theITKRegistrationCommoninclude path when using a non-installed ITK.The proper fix in elastix would be to add to
Core/CMakeLists.txt:This SimpleITK workaround links it directly in
SimpleElastixto unblock the Windows CI build in the interim.