[vtk-developers] Errors when compiling VTK v6.0.0 in C++11 mode

Kyle Lutz kyle.lutz at kitware.com
Tue Jul 16 13:59:56 EDT 2013


On Tue, Jul 16, 2013 at 1:48 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> Hi Robert,
>
> I can hardly assume that std::isinf is a template, on some systems it
> is simply an overloaded function.  A try_compile is a messier solution
> than I'm hoping for, but I've already developed a nice, compact check
> and am refining it with some advice from Brad.

Just to clarify, the C++11 standard specifies (26.8.10) that
std::isinf() is an overloaded function for the three floating point
types (float, double, long double).

-kyle

>
>  - David
>
> On Tue, Jul 16, 2013 at 9:19 AM, Robert Maynard
> <robert.maynard at kitware.com> wrote:
>> The problem actually is that CHECK_CXX_SYMBOL_EXISTS doesn't support
>> templated functions.
>> If you look at the CMakeError.log you will see that the
>> check_cxx_symbol_exists tries to determine
>> if the function ((int*)(&std::isinf))[argc]; is valid. This won't work
>> for templated functions instead you
>> need to check for ((int*)(&std::isinf<int>))[argc];
>>
>> I don't know if VTK should extend CheckCXXSymbolExists to state that
>> they are looking for a templated
>> function, or just write a custom try_compile.
>>
>>
>> On Tue, Jul 16, 2013 at 10:21 AM, David Gobbi <david.gobbi at gmail.com> wrote:
>>> Hi Robert,
>>>
>>> I tried.  Turns out that CHECK_CXX_SYMBOL_EXISTS is only for
>>> preprocessor symbols or symbols with C linkage, the only difference
>>> from CHECK_SYMBOL_EXISTS is that it does these checks with a C++
>>> compiler.  It will always return false when used to check for
>>> std::isnan.
>>>
>>> - David
>>>
>>> On Tue, Jul 16, 2013 at 7:42 AM, Robert Maynard
>>> <robert.maynard at kitware.com> wrote:
>>>> If you need to use the c++ compiler to verify that symbols exist
>>>> inside a namespace, you should use CHECK_CXX_SYMBOL_EXISTS.
>>>>
>>>> On Sat, Jul 13, 2013 at 1:21 PM, David Gobbi <david.gobbi at gmail.com> wrote:
>>>>> Hi Kevin,
>>>>>
>>>>> Thanks for the report.  I believe that this can be fixed.  The patch
>>>>> that Kyle provided will not work (we already tried that in earlier
>>>>> rounds of testing) so now I am investigating in more depth. I've
>>>>> discovered that our cmake check for VTK_HAS_STD_ISINF doesn't work
>>>>> because cmake's check_symbol_exists() function uses the C compiler,
>>>>> rather than the C++ compiler, for its try_compile and therefore
>>>>> doesn't work with namespaced functions.  I hope to have a patch up on
>>>>> gerrit soon.
>>>>>
>>>>>  - David
>>>>>
>>>>> On Sat, Jul 13, 2013 at 4:51 AM, Sean McBride <sean at rogue-research.com> wrote:
>>>>>> On Wed, 10 Jul 2013 16:31:47 +0200, Kevin Funk said:
>>>>>>
>>>>>>>/home/krf/devel/src/VTK-master/Common/Core/vtkMath.h: In static member
>>>>>>>function 'static int vtkMath::IsInf(double)':
>>>>>>>/home/krf/devel/src/VTK-master/Common/Core/vtkMath.h:1249:18: error: call of
>>>>>>>overloaded 'isinf(double&)' is ambiguous
>>>>>>>
>>>>>>> *SNIP*
>>>>>>>
>>>>>>>Since there are C++11 checks all over the code base I'd assume one can
>>>>>>>compile
>>>>>>>VTK in C++11 mode.
>>>>>>
>>>>>> With which compiler, standard library, and OS do you see this?
>>>>>>
>>>>>> My Rogue7 dashboard builds as C++11 nightly with clang on OS X, and this doesn't happen there.
>>>>>>
>>>>>> The patch looks reasonable, but this code is fragile, it took David Gobbi and I a while to get it working with all (mmmm, most!) compiler/library/OS/language combinations.
>>>>>>
>>>>>> I'm away on vacation, and have no VTK or compiler to look at this until next week, but maybe David can...
>>>>>>
>>>>>> Cheers,
>>>>>>
>>>>>> --
>>>>>> ____________________________________________________________
>>>>>> Sean McBride, B. Eng                 sean at rogue-research.com
>>>>>> Rogue Research                        www.rogue-research.com
>>>>>> Mac Software Developer              Montréal, Québec, Canada
>>>>>>
>>>>>>
>>>>> _______________________________________________
>>>>> Powered by www.kitware.com
>>>>>
>>>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>>>>
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://www.vtk.org/mailman/listinfo/vtk-developers
>>>>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtk-developers
>>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>



More information about the vtk-developers mailing list