Coder Social home page Coder Social logo

Build failed on Ubuntu 22.04 error: ‘SWIG_Py_DECREF’ was not declared in this scope; did you mean ‘Py_DECREF’? about itk HOT 5 CLOSED

kevinsmia1939 avatar kevinsmia1939 commented on July 17, 2024
Build failed on Ubuntu 22.04 error: ‘SWIG_Py_DECREF’ was not declared in this scope; did you mean ‘Py_DECREF’?

from itk.

Comments (5)

kevinsmia1939 avatar kevinsmia1939 commented on July 17, 2024 2

Please try SWIG master.

The build pass with master branch of SWIG.

from itk.

dzenanz avatar dzenanz commented on July 17, 2024

A newer SWIG might be required:
https://github.com/InsightSoftwareConsortium/ITK/blob/v5.4.0/Wrapping/Generators/SwigInterface/CMakeLists.txt#L16

from itk.

kevinsmia1939 avatar kevinsmia1939 commented on July 17, 2024

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

from itk.

dzenanz avatar dzenanz commented on July 17, 2024

@thewtex do you have some suggestion?

from itk.

thewtex avatar thewtex commented on July 17, 2024

Please try SWIG master.

from itk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.