[Insight-developers] Building ITK with STD_DEBUG_MODE

Bill Lorensen bill.lorensen at gmail.com
Tue May 15 14:27:44 EDT 2007


Mathieu and Mathieu,

I just tried to build on my Fedora Core 6 with gcc 4.1, -D_GLIBCXX_DEBUG and
I get the same compile error as Mathieu C. I applied Mathieu C's compile
change and everything built. In Testing/Code/Common, itkCommonPrintTest
failed as did his on the Mac. The failure was caused by the GLIBCXX_DEBUG
finding an actual error in itkValarrayImageContainer.h.

My machine (it's my old basement machine) is rather slow, so it may take
most of the day to compile everything and test.

It looks as though we should have a machine build with these debug flags.
I'll set my machine up for a nightly in the next few days.

Thanks to the Mathieu's (and Sean) for keeping this thread alive,

Bill


On 5/14/07, Mathieu Coursolle <mcoursolle at rogue-research.com> wrote:
>
> 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
> >
>
>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20070515/4b82cf38/attachment.htm


More information about the Insight-developers mailing list