[vtk-developers] Problem with VTK_HAS_STD_ISFINITE

David Gobbi david.gobbi at gmail.com
Wed Jul 31 08:13:25 EDT 2013


Hi Andrew,

Try to manually compile the test program that CMake generates for
VTK_HAS_STD_ISFINITE.  You can find it in your build directory, by
opening CMakeFiles/CMakeError.log and searching for
CHECK_CXX_EXPRESSION_COMPILES.  Let me know if the test
program compiles for you.

The related variable VTK_HAS_ISFINITE is being incorrectly set, but I
can fix that as soon as VTK moves to a more recent version of CMake.
Right now, VTK uses the following check:
 check_symbol_exists(isfinite "math.h" VTK_HAS_ISFINITE)
This check is not valid, because vtkMath includes "cmath", not
"math.h".  The check should really be this:
 check_cxx_symbol_exists(isfinite "cmath" VTK_HAS_ISFINITE)
Unfortunately the cmake_cxx_symbol_exists() macro is not available in
CMake 2.8.5.

 - David

On Tue, Jul 30, 2013 at 11:24 PM, Andrew Maclean
<andrew.amaclean at gmail.com> wrote:
> This may be related to https://github.com/Kitware/VTK/commit/3680d942
>
> On Ubuntu running gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3
>  VTK_HAS_STD_ISFINITE is undefined. To replicate this, remove the build
> directory and run cmake again. Cmake is defining VTK_HAS_ISFINITE instead.
>
> On the Mac I am also getting the same error.
>
> The error trace on Ubuntu is this:
> In file included from
> /home/amaclean/Development/Kitware/src/VTK/Common/Core/vtkAbstractArray.cxx:26:0:
> /home/amaclean/Development/Kitware/src/VTK/Common/Core/vtkMath.h: In static
> member function ‘static bool vtkMath::IsFinite(double)’:
> /home/amaclean/Development/Kitware/src/VTK/Common/Core/vtkMath.h:1295:21:
> error: ‘isfinite’ was not declared in this scope
> /home/amaclean/Development/Kitware/src/VTK/Common/Core/vtkMath.h:1295:21:
> note: suggested alternative:
> In file included from
> /home/amaclean/Development/Kitware/build/VTK/Common/Core/vtkMathConfigure.h:24:0,
>                  from
> /home/amaclean/Development/Kitware/src/VTK/Common/Core/vtkMath.h:42,
>                  from
> /home/amaclean/Development/Kitware/src/VTK/Common/Core/vtkAbstractArray.cxx:26:
> /usr/include/c++/4.7/cmath:821:5: note:   ‘std::isfinite’
> make[2]: ***
> [Common/Core/CMakeFiles/vtkCommonCore.dir/vtkAbstractArray.cxx.o] Error 1
> make[1]: *** [Common/Core/CMakeFiles/vtkCommonCore.dir/all] Error 2
>
>
> On the Mac I am getting a similar result:
>
> [ 18%] Building CXX object
> Common/Core/CMakeFiles/vtkCommonCore.dir/vtkAbstractArray.cxx.o
> In file included from
> /Users/andrewmaclean/Development/Kitware/src/VTK/Common/Core/vtkAbstractArray.cxx:26:
> /Users/andrewmaclean/Development/Kitware/src/VTK/Common/Core/vtkMath.h:1269:11:
> error:
>       use of undeclared identifier 'isinf'
>   return (isinf(x) != 0); // Force conversion to bool
>           ^
> /Users/andrewmaclean/Development/Kitware/src/VTK/Common/Core/vtkMath.h:1282:11:
> error:
>       use of undeclared identifier 'isnan'; did you mean 'std::isnan'?
>   return (isnan(x) != 0); // Force conversion to bool
>           ^~~~~
>           std::isnan
> /usr/include/c++/4.2.1/cmath:550:5: note: 'std::isnan' declared here
>     isnan(_Tp __f) { return ::__gnu_cxx::__capture_isnan(__f); }
>     ^
> In file included from
> /Users/andrewmaclean/Development/Kitware/src/VTK/Common/Core/vtkAbstractArray.cxx:26:
> /Users/andrewmaclean/Development/Kitware/src/VTK/Common/Core/vtkMath.h:1295:11:
> error:
>       use of undeclared identifier 'isfinite'; did you mean 'std::isfinite'?
>   return (isfinite(x) != 0); // Force conversion to bool
>           ^~~~~~~~
>           std::isfinite
> /usr/include/c++/4.2.1/cmath:542:5: note: 'std::isfinite' declared here
>     isfinite(_Tp __f) { return ::__gnu_cxx::__capture_isfinite(__f); }
>     ^
> 3 errors generated.
>
>
> Regards
>    Andrew
>
> --
> ___________________________________________
> Andrew J. P. Maclean
>
> ___________________________________________



More information about the vtk-developers mailing list