[ITK-dev] SimpleITK build failure on Fedora 23

Dmitry Mikhirev mikhirev at gmail.com
Sun Dec 6 15:09:48 EST 2015


Hello!

I'm trying to build SimpleITK package for Fedora. Unfortunately I'm
unfamiliar with swig, and I need help in fixing build issue. I'm
compiling SimpleITK 0.9.1 against Fedora's InsightToolkit 4.8.2 that is
built with ITKv3 compatibility enabled.

Here is the error message:

[ 47%] Building CXX object Code/BasicFilters/src/CMakeFiles/SimpleITKBasicFilters6.dir/sitkHistogramMatchingImageFilter.cxx.o
cd /builddir/build/BUILD/SimpleITK-0.9.1/build/Code/BasicFilters/src && /usr/lib64/ccache/c++   -DSITK_USE_EXPLICITITK -DSimpleITKBasicFilters6_EXPORTS -DSimpleITKBasicFilters_EXPORTS -DvtkRenderingCore_AUTOINIT="4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL)" -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic    -fPIC  -fPIC -I/usr/include/freetype2 -I/usr/include/vtk -I/usr/include/gdcm -I/usr/include/vxl/core -I/usr/include/vxl/vcl -I/usr/include/vxl/v3p/netlib -I/usr/include/InsightToolkit -I/builddir/build/BUILD/SimpleITK-0.9.1/Code/Common/include -I/builddir/build/BUILD/SimpleITK-0.9.1/Code/Registration/include -I/builddir/build/BUILD/SimpleITK-0.9.1/Code/BasicFilters/include -I/builddir/build/BUILD/SimpleITK-0.9.1/Code/IO/include -I/builddir/build/BUILD/SimpleITK-0.9.1/build/Code/BasicFilters/include -I/builddir/build/BUILD/SimpleITK-0.9.1/build/Code/Common/include -I/builddir/build/BUILD/SimpleITK-0.9.1/Code/Explicit/include -I/builddir/build/BUILD/SimpleITK-0.9.1/Code/BasicFilters/src    -o CMakeFiles/SimpleITKBasicFilters6.dir/sitkHistogramMatchingImageFilter.cxx.o -c /builddir/build/BUILD/SimpleITK-0.9.1/build/Code/BasicFilters/src/sitkHistogramMatchingImageFilter.cxx
<...>
/usr/include/InsightToolkit/itkHistogram.h:285:8: error: 'bool itk::Statistics::Histogram<TMeasurement, TFrequencyContainer>::IncreaseFrequency(const MeasurementVectorType&, itk::Statistics::Histogram<TMeasurement, TFrequencyContainer>::AbsoluteFrequencyType) [with TMeasurement = long int; TFrequencyContainer = itk::Statistics::DenseFrequencyContainer2; itk::Statistics::Histogram<TMeasurement, TFrequencyContainer>::MeasurementVectorType = itk::Array<long int>; itk::Statistics::Histogram<TMeasurement, TFrequencyContainer>::AbsoluteFrequencyType = long unsigned int]' cannot be overloaded
   bool IncreaseFrequency(
        ^
/usr/include/InsightToolkit/itkHistogram.h:279:8: error: with 'bool itk::Statistics::Histogram<TMeasurement, TFrequencyContainer>::IncreaseFrequency(const IndexType&, itk::Statistics::Histogram<TMeasurement, TFrequencyContainer>::AbsoluteFrequencyType) [with TMeasurement = long int; TFrequencyContainer = itk::Statistics::DenseFrequencyContainer2; itk::Statistics::Histogram<TMeasurement, TFrequencyContainer>::IndexType = itk::Array<long int>; itk::Statistics::Histogram<TMeasurement, TFrequencyContainer>::AbsoluteFrequencyType = long unsigned int]'
   bool IncreaseFrequency(const IndexType & index,
        ^

The corresponding piese of code in itkHistogram.h is:

#ifdef ITKV3_COMPATIBILITY
  //In ITKv4 the member functions are given unique names to dis-ambiguate
  //the intended behavior.  Make aliases of the overloaded calls
  //for ITKv3 backwards compatibility.
  bool IncreaseFrequency(const IndexType & index,
                                 AbsoluteFrequencyType value)
    {
    return IncreaseFrequencyOfIndex(index,value);
    }

  bool IncreaseFrequency(
         const MeasurementVectorType & measurement,
         AbsoluteFrequencyType value)
    {
    return IncreaseFrequencyOfMeasurement(measurement,value);
    }

#endif

It is obvious that this error wouldn't occur if InsightToolkit was
compiled without ITKv3 support, but I have to use Fedora's package. Is
it possible to fix this issue with some simple patch or even
configuration option for SimpleITK?

Thank you!


-- 
Regards,
        Dmitry Mikhirev


More information about the Insight-developers mailing list