Closed kevinsmia1939 closed 4 days ago
A newer SWIG might be required: https://github.com/InsightSoftwareConsortium/ITK/blob/v5.4.0/Wrapping/Generators/SwigInterface/CMakeLists.txt#L16
A newer SWIG might be required: https://github.com/InsightSoftwareConsortium/ITK/blob/v5.4.0/Wrapping/Generators/SwigInterface/CMakeLists.txt#L16
Hi, So I remove SWIG 4.0.2 that come with Ubuntu 22.04 and build and install SWIG 4.2.0 from source. I still got the same error.
To build SWIG 4.2.0, I just go with the default. https://github.com/swig/swig/archive/refs/tags/v4.2.0.tar.gz
mkdir build && cd build
cmake ..
make
sudo make install
[ 70%] Generating itkImportImageFilterPython.cpp, ../../Generators/Python/itk/itkImportImageFilterPython.py
[ 71%] Generating itkKernelFunctionBasePython.cpp, ../../Generators/Python/itk/itkKernelFunctionBasePython.py
[ 71%] Generating itkLaplacianOperatorPython.cpp, ../../Generators/Python/itk/itkLaplacianOperatorPython.py
[ 71%] Generating itkMetaDataObjectPython.cpp, ../../Generators/Python/itk/itkMetaDataObjectPython.py
[ 71%] Generating itkMinimumMaximumImageCalculatorPython.cpp, ../../Generators/Python/itk/itkMinimumMaximumImageCalculatorPython.py
[ 71%] Generating itkNeighborhoodOperatorPython.cpp, ../../Generators/Python/itk/itkNeighborhoodOperatorPython.py
[ 71%] Generating itkNumericTraitsPython.cpp, ../../Generators/Python/itk/itkNumericTraitsPython.py
[ 71%] Generating itkOptimizerParametersPython.cpp, ../../Generators/Python/itk/itkOptimizerParametersPython.py
[ 71%] Generating itkPointSetPython.cpp, ../../Generators/Python/itk/itkPointSetPython.py
[ 71%] Generating itkPointSetToImageFilterPython.cpp, ../../Generators/Python/itk/itkPointSetToImageFilterPython.py
[ 71%] Generating itkSimpleDataObjectDecoratorPython.cpp, ../../Generators/Python/itk/itkSimpleDataObjectDecoratorPython.py
[ 71%] Generating itkSobelOperatorPython.cpp, ../../Generators/Python/itk/itkSobelOperatorPython.py
[ 71%] Generating itkSpatialFunctionPython.cpp, ../../Generators/Python/itk/itkSpatialFunctionPython.py
[ 71%] Generating itkStreamingImageFilterPython.cpp, ../../Generators/Python/itk/itkStreamingImageFilterPython.py
[ 71%] Generating ITKCommonPython.cpp, ../../Generators/Python/itk/ITKCommonPython.py
[ 71%] Building CXX object Wrapping/Modules/ITKCommon/CMakeFiles/ITKCommonPython.dir/ITKCommonPython.cpp.o
/home/kevin/Desktop/Flatpak/org.tomviz.Tomviz-1/ITK-5.4.0/build/Wrapping/Modules/ITKCommon/ITKCommonPython.cpp: In function ‘PyObject* PyInit__ITKCommonPython()’:
/home/kevin/Desktop/Flatpak/org.tomviz.Tomviz-1/ITK-5.4.0/build/Wrapping/Modules/ITKCommon/ITKCommonPython.cpp:3892:5: error: ‘SWIG_Py_DECREF’ was not declared in this scope; did you mean ‘Py_DECREF’?
3892 | SWIG_Py_DECREF( itkFixedArrayModule);
| ^~~~~~~~~~~~~~
| Py_DECREF
/home/kevin/Desktop/Flatpak/org.tomviz.Tomviz-1/ITK-5.4.0/build/Wrapping/Modules/ITKCommon/ITKCommonPython.cpp:3901:5: error: ‘SWIG_Py_DECREF’ was not declared in this scope; did you mean ‘Py_DECREF’?
3901 | SWIG_Py_DECREF( itkVectorModule);
| ^~~~~~~~~~~~~~
| Py_DECREF
/home/kevin/Desktop/Flatpak/org.tomviz.Tomviz-1/ITK-5.4.0/build/Wrapping/Modules/ITKCommon/ITKCommonPython.cpp:3910:5: error: ‘SWIG_Py_DECREF’ was not declared in this scope; did you mean ‘Py_DECREF’?
3910 | SWIG_Py_DECREF( itkCovariantVectorModule);
| ^~~~~~~~~~~~~~
| Py_DECREF
/home/kevin/Desktop/Flatpak/org.tomviz.Tomviz-1/ITK-5.4.0/build/Wrapping/Modules/ITKCommon/ITKCommonPython.cpp:3919:5: error: ‘SWIG_Py_DECREF’ was not declared in this scope; did you mean ‘Py_DECREF’?
3919 | SWIG_Py_DECREF( itkPointModule);
| ^~~~~~~~~~~~~~
| Py_DECREF
@thewtex do you have some suggestion?
Please try SWIG master
.
Please try SWIG
master
.
The build pass with master branch of SWIG.
Description
I tried to build ITK 5.4.0 on Ubuntu 22.04 from source. But got this error.
Steps to Reproduce
Download https://github.com/InsightSoftwareConsortium/ITK/archive/refs/tags/v5.4.0.tar.gz
Environment
Ubuntu 22.04 inside distrobox(podman) on openSUSE Tumbleweed cmake/jammy-updates,now 3.22.1-1ubuntu1.22.04.2 amd64 swig/jammy,now 4.0.2-1ubuntu1 all castxml/jammy,now 0.4.4-1 amd64 Python 3.10.12