[Insight-developers] Compiling with c++0x patch

Bradley Lowekamp blowekamp at mail.nih.gov
Fri Dec 30 10:29:32 EST 2011


Using try compiles with pre-processor checks of compiler versions seems  a little backwards to me.

However, I seem to be in the minority that we should use optional compiler features for optimization were convenient. Also I don't think it is much of a bug when a warning comes up, when you explicitly ask for the odd ball warning for the feature you are using. There is an issue that needs to be addressed though, it's not clear why this try compile passed with this compiler flag enabled ( I questions if  the CMakeCache was empty before this flag was added. )

I also would like to point out that non-member static constant variable are not subject to this restriction. 
http://www.itk.org/Doxygen/html/namespaceitk_1_1Math.html

Brad

On Dec 30, 2011, at 10:10 AM, Matt McCormick wrote:

> A relevant patch:
> 
> http://review.source.kitware.com/#/c/3553/2
> 
> Does adjusting the pre-processor definitions help?
> 
> Thanks,
> Matt
> 
> On Fri, Dec 30, 2011 at 12:28 AM, Matthew McCormick (thewtex)
> <matt at mmmccormick.com> wrote:
>> On Thu, Dec 29, 2011 at 11:31 AM, David Doria <daviddoria at gmail.com> wrote:
>>> On Thu, Dec 29, 2011 at 10:43 AM, Bradley Lowekamp
>>> <blowekamp at mail.nih.gov> wrote:
>>>> Hello David,
>>>> 
>>>> 
>>>> Did you run into this problem when you build ITK with this flag or when this
>>>> flag was added to an application which uses ITK?
>>>> 
>>>> I believe there is a try compile for usage of this feature in VXL, so if you
>>>> compile both your application and ITK with this flag it may work?
>>>> 
>>>> Brad
>>> 
>>> I initially ran into it when compiling code that used ITK with
>>> -std=gnu++0x set in CXX_FLAGS. I just tried what you suggested -
>>> attempting to build ITK with the same flag, but I get the same
>>> 
>>> /home/doriad/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:87:53:
>>> error: ‘constexpr’ needed for in-class initialization of static data
>>> member ‘e’ of non-integral type
>>> 
>>> Has any one else tried to build ITK with this flag?
>>> 
>> 
>> I believe there was a recent thread regarding in-class VNL
>> initialization of static float's, but it was because CLang complains
>> about it, too.
>> 
>> Matt
>> _______________________________________________
>> 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.html
>> 
>> 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://www.itk.org/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.html
> 
> 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://www.itk.org/mailman/listinfo/insight-developers

========================================================
Bradley Lowekamp  
Medical Science and Computing for
Office of High Performance Computing and Communications
National Library of Medicine 
blowekamp at mail.nih.gov



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20111230/e55e58f1/attachment.htm>


More information about the Insight-developers mailing list