[Insight-developers] Building ITK with STD_DEBUG_MODE
Mathieu Coursolle
mcoursolle at rogue-research.com
Mon May 14 16:15:38 EDT 2007
The code which causes the compiler error is the == and != operator overload
of the itkConstShapedNeighborhoodIterator.h:
bool operator!=(const ConstIterator &o) const
{ return m_ListIterator.operator != (o.m_ListIterator); }
bool operator==(const ConstIterator &o) const
{ return m_ListIterator.operator == (o.m_ListIterator); }
In fact, the != and == operators are not defined in the _gnu_cxx namespace
used in STL debug mode. From what I understand, it is to prevent those
operators to be used the way they are used above.
Why is the operator called explicitly?
Could the code be replaced by this?
bool operator!=(const ConstIterator &o) const
{ return m_ListIterator != o.m_ListIterator; }
bool operator==(const ConstIterator &o) const
{ return m_ListIterator == o.m_ListIterator; }
I tried and all ITK tests passed.
However, if I set GLIBCXX_DEBUG and GLIBCXX_DEBUG_PEDANTIC back, some
tests fail, but I am able to build ITK, which I was not before.
The following tests FAILED:
186 - itkCommonPrintTest (OTHER_FAULT)
516 - itkSimplexMeshToTriangleMeshFilterTest (OTHER_FAULT)
517 - itkSimplexMeshAdaptTopologyFilterTest (OTHER_FAULT)
540 - itkTriangleMeshToSimplexMeshFilterTest (OTHER_FAULT)
541 - itkTriangleMeshToSimplexMeshFilter2Test (OTHER_FAULT)
558 - itkTriangleMeshToBinaryImageFilterTest2 (OTHER_FAULT)
720 - itkRegionGrow2DTest (OTHER_FAULT)
724 - itkSimplexMeshVolumeCalculatorTest (OTHER_FAULT)
735 - itkDeformableSimplexMesh3DBalloonForceFilterTest (OTHER_FAULT)
736 - itkDeformableSimplexMesh3DGradientConstaintForceFilterTest
(OTHER_FAULT)
737 - itkDeformableSimplexMesh3DFilterTest (OTHER_FAULT)
745 - itkVoronoiDiagram2DTest (OTHER_FAULT)
746 - itkVoronoiSegmentationImageFilterTest (OTHER_FAULT)
757 - itkVoronoiPartitioningImageFilterTest1 (OTHER_FAULT)
758 - itkVoronoiPartitioningImageFilterTest2 (OTHER_FAULT)
919 - itkPolygonGroupSpatialObjectTest (OTHER_FAULT)
Errors while running CTest
If ITK can be build on some platforms with stl debug flags, are those tests
passing on such a build?
Thanks.
Mathieu
>I compiled VTK and ITK on linux debian oldstable with: _GLIBCXX_DEBUG
>without any problem. I suspect (once again) that the gcc shipped with
>a Mac is not very well tested for such advanced option. I would
>suggest
>
>On 5/11/07, Sean McBride <sean at rogue-research.com> wrote:
>> On 2007-05-11 12:58, Mathieu Coursolle said:
>>
>> >Sorry, I really meant using those flags:
>> >
>> >-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC
>>
>> And BTW, these flags are not Mac-specific. I suspect ITK would have the
>> same problems on say linux if the same flags were added.
>>
>> It would be nice if kitware added these flags to at least one of its gcc
>> dashboards. CMake, VTK, and ITK all had/have problems with this.
>>
>> --
>> ____________________________________________________________
>> Sean McBride, B. Eng sean at rogue-research.com
>> Rogue Research www.rogue-research.com
>> Mac Software Developer Montréal, Québec, Canada
>>
>>
>>
>
>
>--
>Mathieu
>Tel: +33 6 32 13 33 40
>_______________________________________________
>Insight-developers mailing list
>Insight-developers at itk.org
>http://www.itk.org/mailman/listinfo/insight-developers
>
More information about the Insight-developers
mailing list