DGtal-team / DGtal

Digital Geometry Tools and Algorithm Library
https://dgtal.org
GNU Lesser General Public License v3.0
370 stars 115 forks source link

ITK compilation error / Ubuntu 11.10 with insighttoolkit (3.20.0-13ubuntu1) #250

Closed mtola closed 12 years ago

mtola commented 12 years ago

example of error:

Scanning dependencies of target testCheckImageConcept [ 78%] Building CXX object tests/images/CMakeFiles/testCheckImageConcept.dir/testCheckImageConcept.cpp.o In file included from /usr/include/InsightToolkit/Common/itkMathDetail.h:24:0, from /usr/include/InsightToolkit/Common/itkMath.h:27, from /usr/include/InsightToolkit/Common/itkIndex.h:24, from /usr/include/InsightToolkit/Common/itkImageRegion.h:25, from /usr/include/InsightToolkit/Common/itkImageBase.h:25, from /usr/include/InsightToolkit/Common/itkImage.h:20, from /home/mepp/Desktop/DGtal.git/DGtal/src/DGtal/images/ImageContainerByITKImage.h:47, from /home/mepp/Desktop/DGtal.git/DGtal/tests/images/testCheckImageConcept.cpp:37: /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_math.h:86:53: error: ‘constexpr’ needed for in-class initialization of static data member ‘e’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_math.h:87:53: error: ‘constexpr’ needed for in-class initialization of static data member ‘log2e’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_math.h:88:53: error: ‘constexpr’ needed for in-class initialization of static data member ‘log10e’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_math.h:89:53: error: ‘constexpr’ needed for in-class initialization of static data member ‘ln2’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_math.h:90:53: error: ‘constexpr’ needed for in-class initialization of static data member ‘ln10’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_math.h:91:53: error: ‘constexpr’ needed for in-class initialization of static data member ‘pi’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_math.h:92:53: error: ‘constexpr’ needed for in-class initialization of static data member ‘pi_over_2’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_math.h:93:53: error: ‘constexpr’ needed for in-class initialization of static data member ‘pi_over_4’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_math.h:94:53: error: ‘constexpr’ needed for in-class initialization of static data member ‘one_over_pi’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_math.h:95:53: error: ‘constexpr’ needed for in-class initialization of static data member ‘two_over_pi’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_math.h:96:53: error: ‘constexpr’ needed for in-class initialization of static data member ‘two_over_sqrtpi’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_math.h:97:53: error: ‘constexpr’ needed for in-class initialization of static data member ‘one_over_sqrt2pi’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_math.h:98:53: error: ‘constexpr’ needed for in-class initialization of static data member ‘sqrt2’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_math.h:99:53: error: ‘constexpr’ needed for in-class initialization of static data member ‘sqrt1_2’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_math.h:102:52: error: ‘constexpr’ needed for in-class initialization of static data member ‘eps’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_math.h:103:52: error: ‘constexpr’ needed for in-class initialization of static data member ‘sqrteps’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_math.h:105:52: error: ‘constexpr’ needed for in-class initialization of static data member ‘float_eps’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_math.h:106:52: error: ‘constexpr’ needed for in-class initialization of static data member ‘float_sqrteps’ of non-integral type In file included from /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_c_vector.h:25:0, from /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_vector.h:20, from /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_vector_ref.h:20, from /usr/include/InsightToolkit/Common/itkVector.h:23, from /usr/include/InsightToolkit/Common/itkPoint.h:23, from /usr/include/InsightToolkit/Common/itkContinuousIndex.h:20, from /usr/include/InsightToolkit/Common/itkImageRegion.h:27, from /usr/include/InsightToolkit/Common/itkImageBase.h:25, from /usr/include/InsightToolkit/Common/itkImage.h:20, from /home/mepp/Desktop/DGtal.git/DGtal/src/DGtal/images/ImageContainerByITKImage.h:47, from /home/mepp/Desktop/DGtal.git/DGtal/tests/images/testCheckImageConcept.cpp:37: /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_numeric_traits.h:340:27: error: ‘constexpr’ needed for in-class initialization of static data member ‘zero’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_numeric_traits.h:342:26: error: ‘constexpr’ needed for in-class initialization of static data member ‘one’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_numeric_traits.h:344:29: error: ‘constexpr’ needed for in-class initialization of static data member ‘maxval’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_numeric_traits.h:363:28: error: ‘constexpr’ needed for in-class initialization of static data member ‘zero’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_numeric_traits.h:365:27: error: ‘constexpr’ needed for in-class initialization of static data member ‘one’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_numeric_traits.h:367:30: error: ‘constexpr’ needed for in-class initialization of static data member ‘maxval’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_numeric_traits.h:386:33: error: ‘constexpr’ needed for in-class initialization of static data member ‘zero’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_numeric_traits.h:388:32: error: ‘constexpr’ needed for in-class initialization of static data member ‘one’ of non-integral type /usr/include/InsightToolkit/Utilities/vxl/core/vnl/vnl_numeric_traits.h:390:35: error: ‘constexpr’ needed for in-class initialization of static data member ‘maxval’ of non-integral type make[2]: * [tests/images/CMakeFiles/testCheckImageConcept.dir/testCheckImageConcept.cpp.o] Error 1 make[1]: * [tests/images/CMakeFiles/testCheckImageConcept.dir/all] Error 2 make: *\ [all] Error 2

dcoeurjo commented 12 years ago

I confirm. That's a gcc-4.6.1 bug (default ubuntu compiler). Unfortunately, there is nothing we can do in DGtal for that...

kerautret commented 12 years ago

I have also some ITK related compilation errors with i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1

[ 11%] Building CXX object tests/base/CMakeFiles/testBasicFunctors.dir/testBasicFunctors.cpp.o /Users/kerautre/EnCours/DGtal/src/DGtal/base/BasicFunctors.h: In member function ‘Composer<TFunctor1, TFunctor2, ReturnType>& Composer<TFunctor1, TFunctor2, ReturnType>::operator=(const Composer<TFunctor1, TFunctor2, ReturnType>&) [with TFunctor1 = ConstValueFunctor, TFunctor2 = CastFunctor, ReturnType = int]’: /opt/local/include/boost/concept_check.hpp:142: instantiated from ‘boost::Assignable::~Assignable() [with TT = Composer<ConstValueFunctor, CastFunctor, int>]’ /opt/local/include/boost/concept/detail/general.hpp:38: instantiated from ‘static void boost::concepts::requirement<boost::concepts::failed**** Model::****>::failed() [with Model = boost::Assignable<Composer<ConstValueFunctor, CastFunctor, int> >]’ /Users/kerautre/EnCours/DGtal/tests/base/testBasicFunctors.cpp:50: instantiated from ‘void basicFunctorsConceptChecking() [with TFunctor = Composer<ConstValueFunctor, CastFunctor, int>]’ /Users/kerautre/EnCours/DGtal/tests/base/testBasicFunctors.cpp:167: instantiated from here /Users/kerautre/EnCours/DGtal/src/DGtal/base/BasicFunctors.h:275: warning: no return statement in function returning non-void

dcoeurjo commented 12 years ago
dcoeurjo commented 12 years ago

Ok got it: if DGtal uses cpp0x features (tested during the cmake), ITK must be compiled with "-std=gnu++0x" as well.

I'll add a message during cmakelist