glehmann / wrapitk

Automatically exported from code.google.com/p/wrapitk
0 stars 0 forks source link

Swig Warnings/Errors in ITKCmmonBase #35

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build current GIT version of ITK with USE_WRAP_ITK enabled

What is the expected output? What do you see instead?
I get a lot of warnings from swig, always concerning ITKCommonBase:

9>D:\Programming\CC\build\vs09x32_shared_release\itk\Wrapping\WrapITK\Typedefs\I
TKCommonBase.i(200) : Warning 350: operator new ignored
9>D:\Programming\CC\build\vs09x32_shared_release\itk\Wrapping\WrapITK\Typedefs\I
TKCommonBase.i(201) : Warning 394: operator new[] ignored
9>D:\Programming\CC\build\vs09x32_shared_release\itk\Wrapping\WrapITK\Typedefs\I
TKCommonBase.i(203) : Warning 395: operator delete[] ignored
9>Project : error PRJ0019: A tool returned an error code from "Generating 
itkSpatialFunctionPython.cpp, ../../../../bin/itkSpatialFunctionPython.py"

Since these warnings are not masked by -w flags for swig, the build does not 
succeed.

What version of the product are you using? On what operating system?
GIT version of ITK (2011-02-08)
Visual Studio 2008 (and 2010)
Swig 2.0.0 and Swig 2.0.1

swig is called like this:
"C:\Program Files (x86)\pythonxy\swig\swig.exe" -c++ -python -O -features 
autodoc=1 -Werror -w508 -w312 -w314 -w509 -w302 -w362 -w389 -w384 -w383 -w361 
-w467 -o 
D:/Programming/CC/build/vs09x32_shared_release/itk/Wrapping/WrapITK/Libraries/De
noising/itkVectorCurvatureAnisotropicDiffusionImageFilterPython.cpp 
-Id:/Programming/CC/ITK/Wrapping/WrapITK/Languages 
-ID:/Programming/CC/build/vs09x32_shared_release/itk/Wrapping/WrapITK/Typedefs/p
ython 
-ID:/Programming/CC/build/vs09x32_shared_release/itk/Wrapping/WrapITK/Typedefs 
-outdir D:/Programming/CC/build/vs09x32_shared_release/itk/bin 
D:/Programming/CC/build/vs09x32_shared_release/itk/Wrapping/WrapITK/Typedefs/itk
VectorCurvatureAnisotropicDiffusionImageFilter.i

Can these warnings be safely ignored and should thus be deactivated by adding 
them to CSWIG_IGNORE_WARNINGS or is there something severely wrong?

Original issue reported on code.google.com by maddin@gmail.com on 8 Feb 2011 at 9:39

GoogleCodeExporter commented 9 years ago
Could you attach the file ITKCommonBase.i to this bug?
It would let me see where those warning come from and if they can be safely 
disabled.

Original comment by gaetan.l...@gmail.com on 8 Feb 2011 at 9:45

GoogleCodeExporter commented 9 years ago
I attached the ITKCommonBase.i together with the complete BuildLog.

I also tried disabling the warnings in WrapITK/Languages/Python/CMakeLists.txt 
by adding -w350 -w394 -w395 to the two definitions of SWIG calls. Compilation 
succeeded. I'm not sure how to test the Python wrappers, though. Is there any 
unit-testing done on the python side? What does work is this (in IPython):

In [5]: import itk

In [6]: itk?
Type:           LazyITKModule
Base Class:     <class 'itkLazy.LazyITKModule'>
String Form:    <module 'itk' (built-in)>
Namespace:      Interactive
File:           
d:\programming\cc\install\vs09x32_shared_release\lib\insighttoolkit-4.0\wrapitk\
python\itklazy.py
Docstring:
    <no docstring>
Class Docstring:
    Subclass of ModuleType that implements a custom __getattribute__ method
to allow lazy-loading of attributes from ITK sub-modules.

In [7]: im = itk.Image[itk.F, 3]

In [8]: im?
Type:           type
Base Class:     <type 'type'>
String Form:    <class 'itkImagePython.itkImageF3'>
Namespace:      Interactive
File:           
d:\programming\cc\install\vs09x32_shared_release\lib\insighttoolkit-4.0\wrapitk\
lib\itkimagepython.py
Docstring:
    Proxy of C++ itkImageF3 class

Constructor information:
Definition:     im(self, *args, **kwargs)

Original comment by maddin@gmail.com on 8 Feb 2011 at 1:37

Attachments:

GoogleCodeExporter commented 9 years ago
you can run the tests by building the target RUN_TESTS in visual studio, or by 
running

   ctest -C Release

in the ITK build tree root.

I don't have those methods at all on my linux build, so I'd say it's safe to 
ignore them.
Would you agree to submit your changes to gerrit? 

Original comment by gaetan.l...@gmail.com on 8 Feb 2011 at 3:34

GoogleCodeExporter commented 9 years ago
Done. Hope it works.

Original comment by maddin@gmail.com on 8 Feb 2011 at 4:54