InsightSoftwareConsortium / ITK

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
https://itk.org
Apache License 2.0
1.43k stars 668 forks source link

Warning 401: Nothing known about base class 'itk::ImageBase< 2 >'. Ignored #4112

Closed kevinsmia1939 closed 1 year ago

kevinsmia1939 commented 1 year ago

Description

Compiling ITK for Flatpak package on Linux cause the error below.

[ 84%] Generating ITKFastMarchingBasePython.cpp, ../../Generators/Python/itk/ITKFastMarchingBasePython.py
cd /run/build/ITK/_flatpak_build/Wrapping/Typedefs/python && /app/bin/swig -c++ -python -O -features autodoc=2 -py3 -doxygen -Werror -w302 -w303 -w312 -w314 -w361 -w362 -w350 -w383 -w384 -w389 -w394 -w395 -w467 -w508 -w509 -o /run/build/ITK/_flatpak_build/Wrapping/Modules/ITKFastMarching/ITKFastMarchingBasePython.cpp -I/app/share/swig/4.0.2/python -I/app/share/swig/4.0.2 -I/run/build/ITK/Wrapping/Generators -I/run/build/ITK/_flatpak_build/Wrapping/Typedefs/python -I/run/build/ITK/_flatpak_build/Wrapping/Typedefs -outdir /run/build/ITK/_flatpak_build/Wrapping/Generators/Python/itk /run/build/ITK/_flatpak_build/Wrapping/Typedefs/ITKFastMarchingBase.i
/run/build/ITK/_flatpak_build/Wrapping/Typedefs/ITKLabelMapBase.i:1099: Warning 401: Nothing known about base class 'itk::ImageBase< 2 >'. Ignored.
/run/build/ITK/_flatpak_build/Wrapping/Typedefs/ITKLabelMapBase.i:1099: Warning 401: Maybe you forgot to instantiate 'itk::ImageBase< 2 >' using %template.
/run/build/ITK/_flatpak_build/Wrapping/Typedefs/ITKLabelMapBase.i:1099: Warning 401: Nothing known about base class 'itk::ImageBase< 2 >'. Ignored.
/run/build/ITK/_flatpak_build/Wrapping/Typedefs/ITKLabelMapBase.i:1099: Warning 401: Maybe you forgot to instantiate 'itk::ImageBase< 2 >' using %template.
make[2]: *** [Wrapping/Modules/ITKLabelMap/CMakeFiles/ITKLabelMapPython.dir/build.make:695: Wrapping/Modules/ITKLabelMap/itkStatisticsUniqueLabelMapFilterPython.cpp] Error 2
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [Wrapping/Modules/ITKLabelMap/CMakeFiles/ITKLabelMapPython.dir/build.make:236: Wrapping/Modules/ITKLabelMap/ITKLabelMapBasePython.cpp] Error 2
make[2]: Leaving directory '/run/build/ITK/_flatpak_build'
make[1]: *** [CMakeFiles/Makefile2:12102: Wrapping/Modules/ITKLabelMap/CMakeFiles/ITKLabelMapPython.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Steps to Reproduce

ITK compile with cmake with flags as listed.


      - -DITK_LEGACY_REMOVE:BOOL=ON
      - -DITK_LEGACY_SILENT:BOOL=ON
      - -DModule_ITKBridgeNumPy:BOOL=ON
      - -DBUILD_TESTING:BOOL=OFF
      - -DITK_WRAP_unsigned_short:BOOL=ON
      - -DITK_WRAP_rgb_unsigned_char:BOOL=OFF
      - -DITK_WRAP_rgba_unsigned_char:BOOL=OFF
      - -DITK_BUILD_DEFAULT_MODULES:BOOL=OFF
      - -DITKGroup_Core:BOOL=ON
      - -DITKGroup_Filtering:BOOL=ON
      - -DITKGroup_Segmentation:BOOL=ON
      - -DITKGroup_Nonunit:BOOL=ON
      - -DPython_ADDITIONAL_VERSIONS:STRING=3
      - -DITK_WRAP_PYTHON:BOOL=ON
      - -DBUILD_EXAMPLES:BOOL=OFF
      - -DBUILD_SHARED_LIBS:BOOL=ON
      - -DITK_USE_SYSTEM_LIBRARIES:BOOL=ON
      - -DITK_USE_SYSTEM_CASTXML:BOOL=ON
      - -DITK_USE_SYSTEM_GDCM:BOOL=ON
      - -DITK_USE_SYSTEM_SWIG:BOOL=ON
      - -DITK_USE_SYSTEM_VXL:BOOL=OFF
      - -DITK_FORBID_DOWNLOADS=ON
      - -DCMAKE_VERBOSE_MAKEFILE=ON

Expected behavior

Actual behavior

Reproducibility

Versions

Environment

ITK commit: 2338bdc487feaace8bbfd7e6a6d7a8881f7ccab6 cmake version 3.26.4 gcc (GCC) 12.2.0 Python 3.10.11 SWIG Version 4.0.2 flatpak-builder 1.2.3

Host OS Operating System: openSUSE Tumbleweed 20230707 KDE Plasma Version: 5.27.6 KDE Frameworks Version: 5.107.0 Qt Version: 5.15.10 Kernel Version: 6.3.9-1-default (64-bit) Graphics Platform: X11 Processors: 12 × AMD Ryzen 5 4600H with Radeon Graphics Memory: 7.6 GiB of RAM Graphics Processor: NVIDIA GeForce GTX 1650 Ti/PCIe/SSE2 Manufacturer: LENOVO Product Name: 82B5 System Version: Lenovo Legion 5 15ARH05

Additional Information

Possible similar issue https://github.com/InsightSoftwareConsortium/ITK/pull/3415

github-actions[bot] commented 1 year ago

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. 📖

thewtex commented 1 year ago

@kevinsmia1939 thank you for packaging in flat pack and the report :1st_place_medal:

I created a build with your options, and it succeeded for me.

kevinsmia1939 commented 1 year ago

Hi, I comment out the groups below, and I can build again. Thanks.

-DITKGroup_Filtering:BOOL=ON
-DITKGroup_Segmentation:BOOL=ON
hubutui commented 1 year ago

Hi, I comment out the groups below, and I can build again. Thanks.

-DITKGroup_Filtering:BOOL=ON
-DITKGroup_Segmentation:BOOL=ON

Hmm, but this fix did not mean this issue was fixed. It works just fine if you don't need this group. Disabling ITK_WRAP_covariant_vector_double might also work if you don't need ITK_WRAP_covariant_vector_double.

Update: Disabling ITK_WRAP_covariant_vector_double is not working.

hubutui commented 1 year ago

I also got this error:

[ 75%] Generating itkAtanImageFilterPython.cpp, ../../Generators/Python/itk/itkAtanImageFilterPython.py
[ 75%] Generating itkBinaryMagnitudeImageFilterPython.cpp, ../../Generators/Python/itk/itkBinaryMagnitudeImageFilterPython.py
[ 75%] Generating itkBoundedReciprocalImageFilterPython.cpp, ../../Generators/Python/itk/itkBoundedReciprocalImageFilterPython.py
[ 75%] Generating itkClampImageFilterPython.cpp, ../../Generators/Python/itk/itkClampImageFilterPython.py
/build/itk-git/src/build/Wrapping/Typedefs/ITKLabelMapBase.i:2803: Warning 401: Nothing known about base class 'itk::ImageBase< 2 >'. Ignored.
/build/itk-git/src/build/Wrapping/Typedefs/ITKLabelMapBase.i:2803: Warning 401: Maybe you forgot to instantiate 'itk::ImageBase< 2 >' using %template.
/build/itk-git/src/build/Wrapping/Typedefs/ITKLabelMapBase.i:2803: Warning 401: Nothing known about base class 'itk::ImageBase< 2 >'. Ignored.
/build/itk-git/src/build/Wrapping/Typedefs/ITKLabelMapBase.i:2803: Warning 401: Maybe you forgot to instantiate 'itk::ImageBase< 2 >' using %template.
[ 75%] Generating itkSmoothingRecursiveGaussianImageFilterPython.cpp, ../../Generators/Python/itk/itkSmoothingRecursiveGaussianImageFilterPython.py

The config I used:

    -DBUILD_SHARED_LIBS=ON
    -DBUILD_TESTING=OFF
    -DCMAKE_BUILD_TYPE=Release
    -DCMAKE_CXX_COMPILER=g++-12
    -DCMAKE_C_COMPILER=gcc-12
    -DCMAKE_INSTALL_PREFIX=/usr
    -DCMAKE_SKIP_INSTALL_RPATH=ON
    -DCMAKE_SKIP_RPATH=ON
    -DITK_BUILD_DEFAULT_MODULES=ON
    -DITK_LEGACY_REMOVE=ON
    -DITK_USE_MKL=ON
    -DITK_USE_SYSTEM_CASTXML=ON
    -DITK_USE_SYSTEM_DCMTK=ON
    -DITK_USE_SYSTEM_DOUBLECONVERSION=ON
    -DITK_USE_SYSTEM_EIGEN=ON
    -DITK_USE_SYSTEM_EXPAT=ON
    -DITK_USE_SYSTEM_FFTW=ON
    -DITK_USE_SYSTEM_GDCM=ON
    -DITK_USE_SYSTEM_GOOGLETEST=ON
    -DITK_USE_SYSTEM_HDF5=ON
    -DITK_USE_SYSTEM_JPEG=ON
    -DITK_USE_SYSTEM_MINC=OFF
    -DITK_USE_SYSTEM_PNG=ON
    -DITK_USE_SYSTEM_SWIG=OFF
    -DITK_USE_SYSTEM_TIFF=ON
    -DITK_USE_SYSTEM_VXL=ON
    -DITK_USE_SYSTEM_ZLIB=ON
    -DITK_WRAP_IMAGE_DIMS="2;3;4"
    -DITK_WRAP_PYTHON=ON
    -DITK_WRAP_complex_double=ON
    -DITK_WRAP_covariant_vector_double=ON
    -DITK_WRAP_double=ON
    -DITK_WRAP_rgb_unsigned_short=ON
    -DITK_WRAP_rgba_unsigned_short=ON
    -DITK_WRAP_signed_char=ON
    -DITK_WRAP_signed_long_long=ON
    -DITK_WRAP_unsigned_long_long=ON
    -DITK_WRAP_unsigned_short=ON
    -DITK_WRAP_vector_double=ON
    -DModule_MorphologicalContourInterpolation=ON
    -DITK_USE_GPU=OFF

env:

hubutui commented 1 year ago

@kevinsmia1939 @thewtex Ok, I found it's related to -DITK_USE_SYSTEM_CASTXML:BOOL=ON. If fails if you're using castxml 0.6.0. -DITK_USE_SYSTEM_CASTXML:BOOL=OFF fix this issue. I'm not sure why.