Skip to content

VtkGlue fails to build because it cannot find the headers of VTK #4375

Closed

Description

@lexming

Description

VtkGlue fails to build in ITK v5.3.0 because it cannot find the headers of VTK:

[ 35%] Generating ../../castxml_inputs/itkVTKImageToImageFilter.xml
cd /rhea/scratch/brussel/vo/000/bvo00005/vsc10122/easybuild/install/skylake/build/ITK/5.3.0/foss-2023a/easybuild_obj/Wrapping/Modules/ITKVtkGlue && /user/brussel/101/vsc10122/easybuild/install/skylake/software/CastXML/0.6.2-GCCcore-12.3.0/bin/castxml -o /rhea/scratch/brussel/vo/000/bvo00005/vsc10122/easybuild/install/skylake/build/ITK/5.3.0/foss-2023a/easybuild_obj/Wrapping/castxml_inputs/itkVTKImageToImageFilter.xml --castxml-gccxml --castxml-start _wrapping_ --castxml-cc-gnu "(" /apps/brussel/RL8/skylake/software/GCCcore/12.3.0/bin/g++ -O2 -ftree-vectorize -fno-math-errno -fPIC -std=c++11 -Wall -Wcast-align -Wdisabled-optimization -Wextra -Wformat=2 -Winvalid-pch -Wno-format-nonliteral -Wpointer-arith -Wshadow -Wunused -Wwrite-strings -funit-at-a-time -Wno-strict-overflow -Wno-deprecated -Wno-invalid-offsetof -Woverloaded-virtual -Wstrict-null-sentinel -fno-sized-deallocation -fno-sized-deallocation -std=c++14 ")" -w -c @/rhea/scratch/brussel/vo/000/bvo00005/vsc10122/easybuild/install/skylake/build/ITK/5.3.0/foss-2023a/easybuild_obj/Wrapping/castxml_inputs/.castxml.inc /rhea/scratch/brussel/vo/000/bvo00005/vsc10122/easybuild/install/skylake/build/ITK/5.3.0/foss-2023a/easybuild_obj/Wrapping/castxml_inputs/itkVTKImageToImageFilter.cxx
make[2]: Leaving directory '/rhea/scratch/brussel/vo/000/bvo00005/vsc10122/easybuild/install/skylake/build/ITK/5.3.0/foss-2023a/easybuild_obj'
[ 35%] Generating ../../castxml_inputs/itkFastApproximateRankImageFilter.xml
cd /rhea/scratch/brussel/vo/000/bvo00005/vsc10122/easybuild/install/skylake/build/ITK/5.3.0/foss-2023a/easybuild_obj/Wrapping/Modules/ITKReview && /user/brussel/101/vsc10122/easybuild/install/skylake/software/CastXML/0.6.2-GCCcore-12.3.0/bin/castxml -o /rhea/scratch/brussel/vo/000/bvo00005/vsc10122/easybuild/install/skylake/build/ITK/5.3.0/foss-2023a/easybuild_obj/Wrapping/castxml_inputs/itkFastApproximateRankImageFilter.xml --castxml-gccxml --castxml-start _wrapping_ --castxml-cc-gnu "(" /apps/brussel/RL8/skylake/software/GCCcore/12.3.0/bin/g++ -O2 -ftree-vectorize -fno-math-errno -fPIC -std=c++11 -Wall -Wcast-align -Wdisabled-optimization -Wextra -Wformat=2 -Winvalid-pch -Wno-format-nonliteral -Wpointer-arith -Wshadow -Wunused -Wwrite-strings -funit-at-a-time -Wno-strict-overflow -Wno-deprecated -Wno-invalid-offsetof -Woverloaded-virtual -Wstrict-null-sentinel -fno-sized-deallocation -fno-sized-deallocation -std=c++14 ")" -w -c @/rhea/scratch/brussel/vo/000/bvo00005/vsc10122/easybuild/install/skylake/build/ITK/5.3.0/foss-2023a/easybuild_obj/Wrapping/castxml_inputs/.castxml.inc /rhea/scratch/brussel/vo/000/bvo00005/vsc10122/easybuild/install/skylake/build/ITK/5.3.0/foss-2023a/easybuild_obj/Wrapping/castxml_inputs/itkFastApproximateRankImageFilter.cxx
In file included from /rhea/scratch/brussel/vo/000/bvo00005/vsc10122/easybuild/install/skylake/build/ITK/5.3.0/foss-2023a/easybuild_obj/Wrapping/castxml_inputs/itkImageToVTKImageFilter.cxx:16:
/rhea/scratch/brussel/vo/000/bvo00005/vsc10122/easybuild/install/skylake/build/ITK/5.3.0/foss-2023a/ITK-5.3.0/Modules/Bridge/VtkGlue/include/itkImageToVTKImageFilter.h:22:10: fatal error: 'vtkImageImport.h' file not found
#include "vtkImageImport.h"
         ^~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [Wrapping/Modules/ITKVtkGlue/CMakeFiles/ITKVtkGlueCastXML.dir/build.make:80: Wrapping/castxml_inputs/itkImageToVTKImageFilter.xml] Error 1
make[2]: *** Waiting for unfinished jobs....

The issues stems from

include_directories(${_vtk_lib_include_dirs})

VtkGlue correctly adds the paths to the include directories from VTK through this include_directories, but those are not inherited outside the VtkGlue subdirectory. Therefore, the paths from VTK are missing in the final Wrapping/castxml_inputs/.castxml.inc file.

Steps to Reproduce

Build ITK v5.3.0 setting Module_ITKVtkGlue=ON in cmake:

cmake  -DCMAKE_INSTALL_PREFIX=/user/brussel/101/vsc10122/easybuild/install/skylake/software/ITK/5.3.0-foss-2023a -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DBUILD_SHARED_LIBS=ON -DBUIL_TESTING=OFF -DModule_SimpleITKFilters=ON -DModule_ITKReview=ON -DModule_ITKVtkGlue=ON -DITK_WRAP_PYTHON:BOOL=ON -DPython3_EXECUTABLE=$EBROOTPYTHON/bin/python -DSWIG_EXECUTABLE=$EBROOTSWIG/bin/swig -DSWIG_DIR=$EBROOTSWIG -DITK_USE_SYSTEM_CASTXML=ON -DITK_USE_SYSTEM_DOUBLECONVERSION=ON -DITK_USE_SYSTEM_EIGEN=ON -DITK_USE_SYSTEM_EXPAT=ON -DITK_USE_SYSTEM_FFTW=ON -DITK_USE_SYSTEM_HDF5=ON -DITK_USE_SYSTEM_JPEG=ON -DITK_USE_SYSTEM_PNG=ON -DITK_USE_SYSTEM_SWIG=ON -DITK_USE_SYSTEM_TIFF=ON -DITK_USE_SYSTEM_ZLIB=ON /rhea/scratch/brussel/vo/000/bvo00005/vsc10122/easybuild/install/skylake/build/ITK/5.3.0/foss-2023a/ITK-5.3.0/

Expected behavior

ITK v5.3.0 builds with VtkGlue

Actual behavior

Compilation fails with aforementioned error

Reproducibility

100%

Versions

ITK v5.3.0

Environment

CMake v3.26.3
VTK v9.3.0

Activity

  1. added
    type:BugInconsistencies or issues which will cause an incorrect result under some or all circumstances
    on Dec 21, 2023
  2. github-actions commented on Dec 21, 2023

    @github-actions

    Thank you for contributing an issue! 🙏

    Welcome to the ITK community! 🤗👋☀️

    We are glad you are here and appreciate your contribution. Please keep in mind our community participation guidelines. 📜
    Also, please check existing open issues and consider discussion on the ITK Discourse. 📖

    This is an automatic message. Allow for time for the ITK community to be able to read the issue and comment on it.

  3. added this to the ITK 6.0 Beta 1 milestone on Jan 23, 2025
  4. seanm commented on Jul 7, 2025

    @seanm
    Contributor

    Is this still an issue?

    This bot of mine builds with VTKGlue and is green: https://open.cdash.org/builds/10518895/notes#note0

  5. AlexyPellegrini commented on Sep 4, 2025

    @AlexyPellegrini
    Contributor

    This should be fixed now that #5502 is merged!

  6. dzenanz commented on Sep 4, 2025

    @dzenanz
    Member

    @lexming if the issue is fixed, please close it. If not, provide additional details.

  7. hjmjohnson commented on Jun 16, 2026

    @hjmjohnson
    Member

    Resolved by merged PR #5502 ("Bring back itkVtkGlue to Python wrapping", merged 2025-09-03). The failure reported here (vtkImageImport.h not found during castxml/Python wrapping) is in the same code path that PR #5502 restored. This issue was filed against ITK v5.3.0; the fix is present in current ITK main. If the build failure persists against a recent ITK version, please open a new issue with updated reproduction steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:BugInconsistencies or issues which will cause an incorrect result under some or all circumstances

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions