[Insight-developers] VS2010 and itkStdAlgorithm

Williams, Norman K norman-k-williams at uiowa.edu
Thu Apr 25 15:30:43 EDT 2013


Perhaps a more sophisticated configuration checking technique would be to
capture __cplusplus at configure time, and include it in itkConfigure.

Then at compile time (for both ITK and apps that use ITK) compare that
captured value against __cplusplus to make sure they match.

Which would solve David Doria's problem, and the test in itkStdAlgorithm.h
could be relaxed or eliminated.
--
Kent Williams norman-k-williams at uiowa.edu






On 4/25/13 8:12 AM, "Bradley Lowekamp" <blowekamp at mail.nih.gov> wrote:

>Niels,
>
>It would solve your problem. But.. why was it added?
>
>$ git log Modules/Core/Common/include/itkStdAlgorithm.h
>commit 137b5c35a733782cb443a19ef4901520e98bac98
>Author: Kent Williams <norman-k-williams at uiowa.edu>
>Date:   Wed Apr 17 09:57:37 2013 -0500
>
>    COMP: Further changes to the use of std::copy_n
>
>    1. Add preprocessor test for condition (detected by David
>    Doria) where ITK was configured & built with a compiler that
>    supports C++11 std::copy_n, but a user program was not.
>
>    2. Small changes suggested by Bradley Lowencamp that didn't
>    make it into the last patch.
>
>    Change-Id: I1635cccc52b2dbf3621b896db9a139f33cda4fe2
>
>
>So doing the change you suggest would undo this bug fix and this prior
>work.
>
>The the problem presented above is that ITK was compiled with a newer
>version of C++ then an application... So the solution is to make sure the
>version of C++ the compiler supports at build time is greater than to
>equal to that used during configuration.
>
>1) A small program an be compiled and run during cmake configuration to
>get the __cplusplus values into a cmake variable.
>2) This variable can be placed into the itkConfigure.h.in configuration
>file as say ITK__CPLUSPLUS
>3) Using C preprocess it can be checked if   __cplusplus >=
>ITK__CPLUSPLUS
>
>Brad
>
>On Apr 25, 2013, at 8:59 AM, Niels Dekker <niels-xtk at xs4all.nl> wrote:
>
>> On 2013-04-25 14:39, Bradley Lowekamp wrote:
>>> I think the solution to this problem to obtain the __cplusplus version
>>>at CMake configuration time,
>>> stash it in a variable to be used in a configuration file, and make
>>>sure that it is always greater
>>> than or equal to that in the itkConfigure.h.in file.
>>
>> Sorry, Brad, I don't really understand this solution. Wouldn't it be
>>sufficient to just remove the line which says "#error ITK built with
>>C++11, current source file is not." from itkStdAlgorithm.h?
>>
>> Kind regard, Niels
>>
>
>_______________________________________________
>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://www.itk.org/mailman/listinfo/insight-developers



________________________________
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.
________________________________


More information about the Insight-developers mailing list