Hi,

your compiler does not support (the non-standard) in-class static const 
initialization for float types (at least with the provided compile 
flags). You need to apply this patch [1] to teach vnl to not do this 
non-standard stuff.

Cheers,
Sascha

[1] 
http://mitk.org/git/?p=MITK.git;a=blob;f=CMakeExternals/ITK-4.7.1-gcc-4.6.patch

On 12/02/2015 10:23 AM, Fetzer, Andreas wrote:
> Hi Hongzhi,
>
> I know that we are building GDCM by ourself and we are passing it to the
> ITK build in order to avoid a duplicate GDCM build. I am not sure if your
> setup could cause troubles in this case.
>
> Another reason could be that you first used the regular superbuild and
> afterwards you passed an external ITK / VTK.
> This could in fact cause some issues since the ITK / VTK libraries and
> include directories are installed into ep/lib and ep/include.
> If you update these toolkits you will usually have to remove the former
> libraries and include dirs to avoid linker or compile errors.
>
> You could build ITK and VTK separately and set the according build
> directories via the cmake variables ITK_DIR and VTK_DIR before starting
> the actual superbuild.
> Or you can change the ITK / VTK source tar balls in the
> CMakeExternals/(ITK/VTK).cmake that are used for the superbuild to the
> ones you want to use.
>
> Hope this helps!
>
> Andreas
>
> Am 27/11/15 18:35 schrieb "Hongzhi Lan" unter <hong...@stanford.edu>:
>
>> Hi Andreas,
>>
>> I use MITK 2015.05.2.
>>
>> First I have a MITK super build at MITK-superbuild. No problem for this.
>>
>> Then I build vtk itk separately. The source code for vtk itk is from
>> MITK-superbuild/ep/src/VTK and ITK. The build configuration is the same
>> as the MITK siperbuild. The only difference is itk uses its own gdcm not
>> system gdcm.  Then I pass my vtk itk build directories to MITK build.
>>
>> Thanks!
>> Hongzhi
>>
>>
>>> On Nov 27, 2015, at 3:49 AM, Fetzer, Andreas
>>> <a.fet...@dkfz-heidelberg.de> wrote:
>>>
>>> Hi Hongzhi,
>>>
>>> how are you building these external libraries? It is important to use
>>> the same build configuration like it is done in the superbuild.
>>> Are you passing the related source files to the superbuild or do you
>>> build them separately and then pass the build directories to the MITK
>>> build.
>>>
>>> Please note also that with MITK 2015.05.2 we already use ITK 4.7.1
>>> What MITK version are you using?
>>>
>>> Regards,
>>> Andreas
>>>
>>>
>>>
>>>
>>> Von: Hongzhi Lan <hong...@stanford.edu<mailto:hong...@stanford.edu>>
>>> Datum: Friday 27 November 2015 04:29
>>> An:
>>> "mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net
>>>> "
>>>> <mitk-users@lists.sourceforge.net<mailto:mitk-us...@lists.sourceforge.ne
>>>> t>>
>>> Betreff: [mitk-users] MITK build using external ITK
>>>
>>>
>>> Hi,
>>>
>>>
>>> I used MITK superbuild, which was very convenient. Now I'm trying to
>>> build MITK with some external such as  VTK6.2.0, ITK4.7.1, CTK ect , but
>>> there are some issues. Those issues never happened in the superbuild.
>>> Can I get some help to deal with these issues?  VTK ITK source code is
>> >from MITK website. I use Ubuntu 14.04  and gcc 4.8.4.
>>>
>>> Thanks!
>>>
>>> Hongzhi
>>>
>>>
>>> 1.  First error is  as below:
>>>
>>> --------------------------------------------------------------
>>>
>>> In file included from
>>> /home/hongzhi/SourceCode/From_MITK/ITK/Modules/ThirdParty/VNL/src/vxl/vcl
>>> /vcl_compiler.h:250:0,
>>>                  from
>>> /home/hongzhi/SourceCode/From_MITK/ITK/Modules/ThirdParty/VNL/src/vxl/vcl
>>> /vcl_limits.h:5,
>>>                  from
>>> /home/hongzhi/SourceCode/From_MITK/ITK/Modules/Core/Common/include/itkNum
>>> ericTraits.h:45,
>>>                  from
>>> /home/hongzhi/SourceCode/From_MITK/ITK/Modules/Core/Common/include/itkVec
>>> torContainer.hxx:22,
>>>                  from
>>> /home/hongzhi/SourceCode/From_MITK/ITK/Modules/Core/Common/include/itkVec
>>> torContainer.h:358,
>>>                  from
>>> /home/hongzhi/SourceCode/MITK-2015.05.2/Modules/Core/include/mitkDataStor
>>> age.h:24,
>>>                  from
>>> /home/hongzhi/SourceCode/MITK-2015.05.2/Modules/Core/include/mitkBaseRend
>>> erer.h:20,
>>>                  from
>>> /home/hongzhi/SourceCode/MITK-2015.05.2/Modules/Core/include/mitkMapper.h
>>> :22,
>>>                  from
>>> /home/hongzhi/SourceCode/MITK-2015.05.2/Modules/Core/include/mitkCoreObje
>>> ctFactoryBase.h:27,
>>>                  from
>>> /home/hongzhi/SourceCode/MITK-2015.05.2/Modules/Core/src/mitkCoreObjectFa
>>> ctoryBase.cpp:17:
>>>
>>> /home/hongzhi/SourceCode/From_MITK/ITK/Modules/ThirdParty/VNL/src/vxl/cor
>>> e/vnl/vnl_numeric_traits.h:387:27: error: Œconstexpr¹ needed for
>>> in-class initialization of static data member Œconst float
>>> vnl_numeric_traits<float>::zero¹ of non-integral type [-fpermissive]
>>>    static const float zero VCL_STATIC_CONST_INIT_FLOAT_DECL(0.0F);
>>>                            ^
>>>
>>> /home/hongzhi/SourceCode/From_MITK/ITK/Modules/ThirdParty/VNL/src/vxl/cor
>>> e/vnl/vnl_numeric_traits.h:389:26: error: Œconstexpr¹ needed for
>>> in-class initialization of static data member Œconst float
>>> vnl_numeric_traits<float>::one¹ of non-integral type [-fpermissive]
>>>    static const float one VCL_STATIC_CONST_INIT_FLOAT_DECL(1.0F);
>>>                           ^
>>>
>>> /home/hongzhi/SourceCode/From_MITK/ITK/Modules/ThirdParty/VNL/src/vxl/cor
>>> e/vnl/vnl_numeric_traits.h:391:29: error: Œconstexpr¹ needed for
>>> in-class initialization of static data member Œconst float
>>> vnl_numeric_traits<float>::maxval¹ of non-integral type [-fpermissive]
>>>    static const float maxval
>>> VCL_STATIC_CONST_INIT_FLOAT_DECL(3.40282346638528860e+38F);
>>>                              ^
>>>
>>> /home/hongzhi/SourceCode/From_MITK/ITK/Modules/ThirdParty/VNL/src/vxl/cor
>>> e/vnl/vnl_numeric_traits.h:410:28: error: Œconstexpr¹ needed for
>>> in-class initialization of static data member Œconst double
>>> vnl_numeric_traits<double>::zero¹ of non-integral type [-fpermissive]
>>>    static const double zero VCL_STATIC_CONST_INIT_FLOAT_DECL(0.0);
>>>                             ^
>>>
>>> /home/hongzhi/SourceCode/From_MITK/ITK/Modules/ThirdParty/VNL/src/vxl/cor
>>> e/vnl/vnl_numeric_traits.h:412:27: error: Œconstexpr¹ needed for
>>> in-class initialization of static data member Œconst double
>>> vnl_numeric_traits<double>::one¹ of non-integral type [-fpermissive]
>>>    static const double one VCL_STATIC_CONST_INIT_FLOAT_DECL(1.0);
>>>                            ^
>>>
>>> /home/hongzhi/SourceCode/From_MITK/ITK/Modules/ThirdParty/VNL/src/vxl/cor
>>> e/vnl/vnl_numeric_traits.h:414:30: error: Œconstexpr¹ needed for
>>> in-class initialization of static data member Œconst double
>>> vnl_numeric_traits<double>::maxval¹ of non-integral type [-fpermissive]
>>>    static const double maxval
>>> VCL_STATIC_CONST_INIT_FLOAT_DECL(1.7976931348623157E+308);
>>>                               ^
>>>
>>> /home/hongzhi/SourceCode/From_MITK/ITK/Modules/ThirdParty/VNL/src/vxl/cor
>>> e/vnl/vnl_numeric_traits.h:433:33: error: Œconstexpr¹ needed for
>>> in-class initialization of static data member Œconst long double
>>> vnl_numeric_traits<long double>::zero¹ of non-integral type
>>> [-fpermissive]
>>>    static const long double zero VCL_STATIC_CONST_INIT_FLOAT_DECL(0.0);
>>>                                  ^
>>>
>>> /home/hongzhi/SourceCode/From_MITK/ITK/Modules/ThirdParty/VNL/src/vxl/cor
>>> e/vnl/vnl_numeric_traits.h:435:32: error: Œconstexpr¹ needed for
>>> in-class initialization of static data member Œconst long double
>>> vnl_numeric_traits<long double>::one¹ of non-integral type [-fpermissive]
>>>    static const long double one VCL_STATIC_CONST_INIT_FLOAT_DECL(1.0);
>>>                                 ^
>>>
>>> /home/hongzhi/SourceCode/From_MITK/ITK/Modules/ThirdParty/VNL/src/vxl/cor
>>> e/vnl/vnl_numeric_traits.h:437:35: error: Œconstexpr¹ needed for
>>> in-class initialization of static data member Œconst long double
>>> vnl_numeric_traits<long double>::maxval¹ of non-integral type
>>> [-fpermissive]
>>>    static const long double maxval
>>> VCL_STATIC_CONST_INIT_FLOAT_DECL(1.7976931348623157E+308);
>>>
>>>
>>> 2. If the external ITK has vtkglue, the second error appears:
>>>
>>> -------------------------------------------------------------------------
>>> ------
>>> <command-line>:0:0: error: "vtkRenderingCore_AUTOINIT" redefined
>>> [-Werror]
>>> <command-line>:0:0: note: this is the location of the previous
>>> definition
>>>
>>> I found MITKCore privately use/link all ITK modules, which include
>>> ITKVtkGlue. Someone already mentioned in mailing list, but no solution
>>> provided.
>>> MITK-build/Modules/Core/CMakeFiles/MitkCore.dir/DependInfo.cmake
>>> includes:
>>>
>>>   
>>> "vtkRenderingCore_AUTOINIT=3(vtkInteractionStyle,vtkRenderingFreeType,vtk
>>> RenderingOpenGL)"
>>>   
>>> "vtkRenderingCore_AUTOINIT=4(vtkInteractionStyle,vtkRenderingFreeType,vtk
>>> RenderingFreeTypeOpenGL,vtkRenderingOpenGL)"   //from
>>>
>>> I believe the first is from  ITKVtkglue, the second is from VTK. I
>>> wonder how to solve this conflict.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> -------------------------------------------------------------------------
>>> -----
>>> _______________________________________________
>>> mitk-users mailing list
>>> mitk-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/mitk-users
>
> ------------------------------------------------------------------------------
> Go from Idea to Many App Stores Faster with Intel(R) XDK
> Give your users amazing mobile app experiences with Intel(R) XDK.
> Use one codebase in this all-in-one HTML5 development environment.
> Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
> http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
> _______________________________________________
> mitk-users mailing list
> mitk-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mitk-users


------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to