[vtkusers] float.h use could be incorrect? for 4.7.1 and 5.10.0

Andrew Parker andy.john.parker at googlemail.com
Mon Jun 25 06:13:38 EDT 2012


I've added the following code into common/cmakelists.txt under the checks
for float.h and subsequent setting of isnan and isinf.  I'm starting this
as another thread due to divergence from the mistaken indication that
infovis was the problem. See thread "Weird link error - possibly 4.7.1??"
for background.

I get a compiler linking error when building with vtk in my program that
looks like this:

vtk-5.10.0/bin/libvtkCharts.so.5.10.0: undefined reference to
`vtkMath::IsInf(double)'
vtk-5.10.0/bin/libvtkCharts.so.5.10.0: undefined reference to
`vtkMath::IsNan(double)'

If you check the source in vtkmath you'll see that these implementations
are guarded by ifdefs.  These are failing for me, i.e are not set and hence
no symbol in the library.
I've added the following below to try to find the problem under the section
that sets up isnan and isinf

check_symbol_exists(isnan "cmath" HAVE_ISNAN_IN_CMATH)
check_symbol_exists(isnan "math.h" HAVE_ISNAN_IN_MATH_H)
CHECK_SYMBOL_EXISTS(isnan "float.h" VTK_HAS_ISNAN_2)
message(STATUS "HAVE_ISNAN_IN_CMATH " ${HAVE_ISNAN_IN_CMATH})
message(STATUS "HAVE_ISNAN_IN_MATH_H " ${HAVE_ISNAN_IN_MATH_H})
message(STATUS "VTK_HAS_ISNAN_2 " ${VTK_HAS_ISNAN_2})
check_symbol_exists(isinf "cmath" HAVE_ISINF_IN_CMATH)
check_symbol_exists(isinf "math.h" HAVE_ISINF_IN_MATH_H)
message(STATUS "HAVE_ISINF_IN_CMATH " ${HAVE_ISINF_IN_CMATH})
message(STATUS "HAVE_ISINF_IN_MATH_H " ${HAVE_ISINF_IN_MATH_H})

the output is:

-- HAVE_ISNAN_IN_CMATH
-- HAVE_ISNAN_IN_MATH_H 1
-- VTK_HAS_ISNAN_2
-- HAVE_ISINF_IN_CMATH
-- HAVE_ISINF_IN_MATH_H 1
-- Configuring done
-- Generating done

Therefore I conclude that float.h is incorrect for some reason and as you
can see math.h seems to work, any thoughts, advice??  I could really do
with being able to compile my code.  To be clear, no errors when building
vtk, this is when using it in my own code all compiled, including vtk with
4.7.1

Cheers,
Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120625/2dadef2f/attachment.htm>


More information about the vtkusers mailing list