[ITK] [ITK-dev] Linux c++11 build issue v4.8.2

Matt McCormick matt.mccormick at kitware.com
Thu Dec 17 12:47:59 EST 2015


ITK supports C++11 with GCC 4.8.2 -- we even have a a dashboard build with
that configuration, and it has been clean for a long time:

  https://open.cdash.org/buildSummary.php?buildid=4150934

When configuring ITK (and other applications and libraries), make sure that
the -std=c++11 flag is passed during the *initial* CMake configuration.
There are CMake try_compiles that occur that assess the compiler, and their
results are cached.


FYI, there was a good recent post on C++ standard ABI compatibility with
GCC here:

  https://developerblog.redhat.com/2015/02/05/gcc5-and-the-c11-abi/

A good general rule is to use the same standard for everything that is
linked together.


Regardless, the work Hans has been doing to improved and modernize VXL is
very exciting, and it will be great to have that available.


Matt




On Thu, Dec 17, 2015 at 10:37 AM, David Burns <david.mo.burns at gmail.com>
wrote:

> With 4.8.2 - I built ITK with C++11 (this required -fpermissive to
> complete)
> Despite doing that, I was still unable to built ITK applications with
> C++11 (even when also using -fpermissive).
>
> Let me know if you've had different results. I was hoping this would be
> resolved with 4.9.
>
> - David
>
>
> On 12/17/2015 10:18 AM, Bradley Lowekamp wrote:
>
> Hello,
>
> I thought we are requiring ITK to be built with C++11 if your application
> was going to be build with C++11.
>
> Is this saying we are going to support changing the C++ language after
> CMake configuration of ITK?
>
> I would think using the C++11 features of explicit constructor delete or
> default specifier may results is ABI compatibilities, among many other
> things.
>
> Thanks,
> Brad
>
>
>
> On Dec 15, 2015, at 5:06 PM, David Burns < <david.mo.burns at gmail.com>
> david.mo.burns at gmail.com> wrote:
>
> Thanks Hans, based on the release schedule it looks like that will be out
> pretty soon.
>
> That's a big improvement to ITK to add c++11 support in my opinion.
> Thanks.
>
> David
>
> On 12/15/15 15:36, Johnson, Hans J wrote:
>
> This will be fixed when VXL is updated after the 4.9 release.
>
> Hans
>
>
> From: Insight-developers < <insight-developers-bounces at itk.org>
> insight-developers-bounces at itk.org> on behalf of David Burns <
> <david.mo.burns at gmail.com>david.mo.burns at gmail.com>
> Date: Tuesday, December 15, 2015 at 2:10 PM
> To: " <insight-developers at itk.org>insight-developers at itk.org" <
> insight-developers at itk.org>
> Subject: [ITK-dev] Linux c++11 build issue v4.8.2
>
> Dear Insight Developers
>
> I have compiled v4.8.2 on Ubuntu 14.04 successfully (g++ 4.8), however, I
> get compiler errors when building my own ITK applications with the
> following cmake flag
>
> set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11"
>
> I can compile ITK applications when not using this flag.
>
> I have tried using -fpermissive when building my application. I have also
> tried compiling ITK using -std=c++11 -fpermissive, individually and in
> combination. I always get the same errors.
>
> Any suggestions would be welcome. Thanks
>
> David
>
>
>
> Compiler errors
>
> /usr/local/include/ITK-4.8/vnl/vnl_numeric_traits.h:387:60: warning:
> '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);
>                                                             ^
> /usr/local/include/ITK-4.8/vcl_config_compiler.h:152:48: note: in
> definition of macro 'VCL_STATIC_CONST_INIT_FLOAT_DECL'
>  # define VCL_STATIC_CONST_INIT_FLOAT_DECL(x) = x
>                                                 ^
> /usr/local/include/ITK-4.8/vnl/vnl_numeric_traits.h:389:59: warning:
> '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);
>                                                            ^
> /usr/local/include/ITK-4.8/vcl_config_compiler.h:152:48: note: in
> definition of macro 'VCL_STATIC_CONST_INIT_FLOAT_DECL'
>  # define VCL_STATIC_CONST_INIT_FLOAT_DECL(x) = x
>                                                 ^
> /usr/local/include/ITK-4.8/vnl/vnl_numeric_traits.h:391:62: warning:
> '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);
>                                                               ^
> /usr/local/include/ITK-4.8/vcl_config_compiler.h:152:48: note: in
> definition of macro 'VCL_STATIC_CONST_INIT_FLOAT_DECL'
>  # define VCL_STATIC_CONST_INIT_FLOAT_DECL(x) = x
>                                                 ^
> /usr/local/include/ITK-4.8/vnl/vnl_numeric_traits.h:410:61: warning:
> '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);
>                                                              ^
> /usr/local/include/ITK-4.8/vcl_config_compiler.h:152:48: note: in
> definition of macro 'VCL_STATIC_CONST_INIT_FLOAT_DECL'
>  # define VCL_STATIC_CONST_INIT_FLOAT_DECL(x) = x
>                                                 ^
> /usr/local/include/ITK-4.8/vnl/vnl_numeric_traits.h:412:60: warning:
> '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);
>                                                             ^
> /usr/local/include/ITK-4.8/vcl_config_compiler.h:152:48: note: in
> definition of macro 'VCL_STATIC_CONST_INIT_FLOAT_DECL'
>  # define VCL_STATIC_CONST_INIT_FLOAT_DECL(x) = x
>                                                 ^
> /usr/local/include/ITK-4.8/vnl/vnl_numeric_traits.h:414:63: warning:
> '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);
>                                                                ^
> /usr/local/include/ITK-4.8/vcl_config_compiler.h:152:48: note: in
> definition of macro 'VCL_STATIC_CONST_INIT_FLOAT_DECL'
>  # define VCL_STATIC_CONST_INIT_FLOAT_DECL(x) = x
>                                                 ^
> /usr/local/include/ITK-4.8/vnl/vnl_numeric_traits.h:433:66: warning:
> '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);
>                                                                   ^
> /usr/local/include/ITK-4.8/vcl_config_compiler.h:152:48: note: in
> definition of macro 'VCL_STATIC_CONST_INIT_FLOAT_DECL'
>  # define VCL_STATIC_CONST_INIT_FLOAT_DECL(x) = x
>                                                 ^
> /usr/local/include/ITK-4.8/vnl/vnl_numeric_traits.h:435:65: warning:
> '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);
>                                                                  ^
> /usr/local/include/ITK-4.8/vcl_config_compiler.h:152:48: note: in
> definition of macro 'VCL_STATIC_CONST_INIT_FLOAT_DECL'
>  # define VCL_STATIC_CONST_INIT_FLOAT_DECL(x) = x
>                                                 ^
> /usr/local/include/ITK-4.8/vnl/vnl_numeric_traits.h:437:68: warning:
> '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);
>                                                                     ^
> /usr/local/include/ITK-4.8/vcl_config_compiler.h:152:48: note: in
> definition of macro 'VCL_STATIC_CONST_INIT_FLOAT_DECL'
>  # define VCL_STATIC_CONST_INIT_FLOAT_DECL(x) = x
>                                                 ^
>
>
> ------------------------------
> Notice: This UI Health Care e-mail (including attachments) is covered by
> the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
> confidential and may be legally privileged.  If you are not the intended
> recipient, you are hereby notified that any retention, dissemination,
> distribution, or copying of this communication is strictly prohibited.
> Please reply to the sender that you have received the message in error,
> then delete it.  Thank you.
> ------------------------------
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-developers
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20151217/634301c9/attachment-0001.html>
-------------- next part --------------
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-developers


More information about the Community mailing list