[vtkusers] Can't compile 5.2.1, CVS. *fixed* Bug in Cmake scripts with 64bit systems
Paul
massivemonkeymayhem at gmail.com
Wed Mar 25 12:31:25 EDT 2009
I started from a clean binary tree. I'm really not doing anything
particularly deviant... fresh Ubuntu 8.10 install (I later upgraded to
9.04).. downloaded VTK 5.2.1 (also tried CVS), enable Python, compile. I
didn't change around the compiler after running cmake. I only have the one
version on my system (4.3.3 bundled with ubuntu 9.04). I ran "cmake ../"
just last night and witnessed it scroll by:
-- Checking if ostream supports long long -- no
I was reading about the use of "long long" vs "long long signed int" and
thought that perhaps gcc was being strict and only supporting the later.
That would explain why the test failed. Thus I changed vtkTypeId from "long
long" to "long long signed int", flipped VTK_[I/O]STREAM_SUPPORTS_LONG_LONG
to 1, and rejoiced at the apparent success.
This morning I thought to check to see if perhaps the "long long"s were fine
and it was merely the test that was mis-reporting, so I reverted vtkTypeId
back to "long long" and had a successful compile. There's been some
discussion here as to whether or not "long long"s are indeed supported and
whether I might have just tricked the compiler, so I might switch back to
"long long signed int" just to be safe.
gcc -v
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
4.3.3-5ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4)
I'm no C++ programmer, and this bug has been absolutely killing me, because
I haven't been able to get VTK onto my new system for the past week. I would
usually delete my build directory completely in between build attempts in
order to get a completely fresh start. As I said, I very distinctly observed
"-- Checking if ostream supports long long -- no" scroll by last night which
led me to make the small change that finally got vtk to compile. When you
asked for me to try a fresh clean build, having done it umpteen times in the
past week and knowing full-well the result, I figured I'd humour you anyway.
That is why I was floored with what I got (see below). "long long" support
was detected. Sure enough, VTK_[I/O]STREAM_SUPPORTS_LONG_LONG is set to 1.
Not only that, but I was subsequently able to build VTK without trouble. CVS
worked fine too.
Nothing has changed since last night and today other than that I had the
successful compile after my initial trick, and I rebooted. I only have the
one OS-installed version of GCC on my computer. I can only surmise that when
I forced VTK_OSTREAM_SUPPORTS_LONG_LONG=1 initially, added a compile flag
which in turn did something to add permanent support for istream/ostream <<
long long.
Perhaps "long long" in the VTK code should be changed to "long long int" in
the code anyway?
I'm way out of my area of expertise here. Hope this information helps.
Paul
cmake ../
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Performing Test Support for 64 bit file systems
-- Performing Test Support for 64 bit file systems - Success
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so -
found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/libX11.so
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of int
-- Check size of int - done
-- Check size of long
-- Check size of long - done
-- Check size of void*
-- Check size of void* - done
-- Check size of char
-- Check size of char - done
-- Check size of short
-- Check size of short - done
-- Check size of float
-- Check size of float - done
-- Check size of double
-- Check size of double - done
-- Looking for include files CMAKE_HAVE_LIMITS_H
-- Looking for include files CMAKE_HAVE_LIMITS_H - found
-- Looking for include files CMAKE_HAVE_UNISTD_H
-- Looking for include files CMAKE_HAVE_UNISTD_H - found
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - found
-- Looking for include files CMAKE_HAVE_SYS_PRCTL_H
-- Looking for include files CMAKE_HAVE_SYS_PRCTL_H - found
-- Check if the system is big endian
-- Searching 16 bit integer
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Looking for C++ include iostream
-- Looking for C++ include iostream - found
-- Check for STD namespace
-- Check for STD namespace - found
-- Check for ANSI scope
-- Check for ANSI scope - found
-- Check for sstream
-- Check for sstream - found
-- Check size of long long
-- Check size of long long - done
-- Check size of __int64
-- Check size of __int64 - failed
-- Checking support for C++ type bool
-- Checking support for C++ type bool -- yes
-- Checking signedness of char
-- Checking signedness of char -- signed
-- Looking for getsockname in socket
-- Looking for getsockname in socket - not found
-- Checking for getsockname with socklen_t
-- Checking for getsockname with socklen_t -- yes
-- Looking for SO_REUSEADDR
-- Looking for SO_REUSEADDR - found
-- Checking support for full template specialization syntax
-- Checking support for full template specialization syntax -- yes
-- Checking support for C++ explicit template instantiation
-- Checking support for C++ explicit template instantiation -- yes
-- CTest cannot determine repository type. Please set UPDATE_TYPE to 'cvs'
or 'svn'. CTest update will not work.
-- Looking for C++ include iosfwd
-- Looking for C++ include iosfwd - found
-- Looking for C++ include iostream.h
-- Looking for C++ include iostream.h - not found
-- Checking ANSI streams end-of-file bug level
-- Checking ANSI streams end-of-file bug level - 0
-- Checking if ostream supports long long
-- Checking if ostream supports long long -- yes
-- Checking if istream supports long long
-- Checking if istream supports long long -- yes
-- Found PythonInterp: /usr/bin/python2.6
-- Checking for Large File Support
-- Checking for Large File Support - yes
-- Checking whether STL classes are in std namespace
-- Checking whether STL classes are in std namespace - yes
-- Checking whether ANSI stream headers are available
-- Checking whether ANSI stream headers are available - yes
-- Checking whether ANSI streams are in std namespace
-- Checking whether ANSI streams are in std namespace - yes
-- Checking whether ANSI string stream is available
-- Checking whether ANSI string stream is available - yes
-- Checking whether header cstddef is available
-- Checking whether header cstddef is available - yes
-- Checking whether stl string has operator!= for char*
-- Checking whether stl string has operator!= for char* - yes
-- Checking whether stl has iterator_traits
-- Checking whether stl has iterator_traits - yes
-- Checking whether stl has standard template allocator
-- Checking whether stl has standard template allocator - yes
-- Checking for rebind member of stl allocator
-- Checking for rebind member of stl allocator - yes
-- Checking for non-standard argument to stl allocator<>::max_size
-- Checking for non-standard argument to stl allocator<>::max_size - no
-- Checking whether stl containers support allocator objects.
-- Checking whether stl containers support allocator objects. - yes
-- Checking whether "<>" is needed for template friends
-- Checking whether "<>" is needed for template friends - yes
-- Checking for member template support
-- Checking for member template support - yes
-- Checking for standard template specialization syntax
-- Checking for standard template specialization syntax - yes
-- Checking whether argument dependent lookup is supported
-- Checking whether argument dependent lookup is supported - yes
-- Checking whether struct stat has st_mtim member
-- Checking whether struct stat has st_mtim member - yes
-- Check size of char
-- Check size of char - done
-- Check size of short
-- Check size of short - done
-- Check size of int
-- Check size of int - done
-- Check size of long
-- Check size of long - done
-- Check size of long long
-- Check size of long long - done
-- Check size of __int64
-- Check size of __int64 - failed
-- Checking whether char is signed
-- Checking whether char is signed - yes
-- Checking whether C compiler has ptrdiff_t in stddef.h
-- Checking whether C compiler has ptrdiff_t in stddef.h - yes
-- Checking whether C compiler has ssize_t in unistd.h
-- Checking whether C compiler has ssize_t in unistd.h - yes
-- Looking for include files HAVE_ASSERT_H
-- Looking for include files HAVE_ASSERT_H - found
-- Looking for include files HAVE_DLFCN_H
-- Looking for include files HAVE_DLFCN_H - found
-- Looking for include files HAVE_FCNTL_H
-- Looking for include files HAVE_FCNTL_H - found
-- Looking for include files HAVE_INTTYPES_H
-- Looking for include files HAVE_INTTYPES_H - found
-- Looking for include files HAVE_LIMITS_H
-- Looking for include files HAVE_LIMITS_H - found
-- Looking for include files HAVE_MALLOC_H
-- Looking for include files HAVE_MALLOC_H - found
-- Looking for include files HAVE_MEMORY_H
-- Looking for include files HAVE_MEMORY_H - found
-- Looking for include files HAVE_STDLIB_H
-- Looking for include files HAVE_STDLIB_H - found
-- Looking for include files HAVE_STRING_H
-- Looking for include files HAVE_STRING_H - found
-- Looking for include files HAVE_STRINGS_H
-- Looking for include files HAVE_STRINGS_H - found
-- Looking for include files HAVE_SYS_STAT_H
-- Looking for include files HAVE_SYS_STAT_H - found
-- Looking for include files HAVE_SYS_TIME_H
-- Looking for include files HAVE_SYS_TIME_H - found
-- Looking for include files HAVE_UNISTD_H
-- Looking for include files HAVE_UNISTD_H - found
-- Looking for include files HAVE_WINDOWS_H
-- Looking for include files HAVE_WINDOWS_H - not found.
-- Looking for include files HAVE_IEEEFP_H
-- Looking for include files HAVE_IEEEFP_H - not found.
-- Looking for floor
-- Looking for floor - not found
-- Looking for getopt
-- Looking for getopt - found
-- Looking for isascii
-- Looking for isascii - found
-- Looking for memmove
-- Looking for memmove - found
-- Looking for memset
-- Looking for memset - found
-- Looking for mmap
-- Looking for mmap - found
-- Looking for pow
-- Looking for pow - not found
-- Looking for sqrt
-- Looking for sqrt - not found
-- Looking for strcasecmp
-- Looking for strcasecmp - found
-- Looking for strchr
-- Looking for strchr - found
-- Looking for strrchr
-- Looking for strrchr - found
-- Looking for strstr
-- Looking for strstr - found
-- Looking for strtol
-- Looking for strtol - found
-- Looking for areroul
-- Looking for areroul - not found
-- Check size of int
-- Check size of int - done
-- Check size of long
-- Check size of long - done
-- Looking for dlopen in dl;
-- Looking for dlopen in dl; - found
-- Looking for shl_load in dld;dl
-- Looking for shl_load in dld;dl - not found
-- Looking for dlopen in dl;-lpthread;dl;m
-- Looking for dlopen in dl;-lpthread;dl;m - found
-- Looking for include files HAVE_STDIO_H
-- Looking for include files HAVE_STDIO_H - found
-- Looking for include files HAVE_NETDB_H
-- Looking for include files HAVE_NETDB_H - found
-- Looking for include files HAVE_SYS_SOCKET_H
-- Looking for include files HAVE_SYS_SOCKET_H - found
-- Looking for include files HAVE_NETINET_IN_H
-- Looking for include files HAVE_NETINET_IN_H - found
-- Looking for include files HAVE_SYS_SELECT_H
-- Looking for include files HAVE_SYS_SELECT_H - found
-- Looking for include files HAVE_TIME_H
-- Looking for include files HAVE_TIME_H - found
-- Looking for include files HAVE_SIGNAL_H
-- Looking for include files HAVE_SIGNAL_H - found
-- Looking for include files HAVE_ERRNO_H
-- Looking for include files HAVE_ERRNO_H - found
-- Looking for include files HAVE_ANSIDECL_H
-- Looking for include files HAVE_ANSIDECL_H - not found.
-- Looking for include files HAVE_ARPA_INET_H
-- Looking for include files HAVE_ARPA_INET_H - found
-- Looking for include files HAVE_ARPA_NAMESER_H
-- Looking for include files HAVE_ARPA_NAMESER_H - found
-- Looking for include files HAVE_CTYPE_H
-- Looking for include files HAVE_CTYPE_H - found
-- Looking for include files HAVE_DIRENT_H
-- Looking for include files HAVE_DIRENT_H - found
-- Looking for include files HAVE_DL_H
-- Looking for include files HAVE_DL_H - not found.
-- Looking for include files HAVE_FLOAT_H
-- Looking for include files HAVE_FLOAT_H - found
-- Looking for include files HAVE_FP_CLASS_H
-- Looking for include files HAVE_FP_CLASS_H - not found.
-- Looking for include files HAVE_MATH_H
-- Looking for include files HAVE_MATH_H - found
-- Looking for include files HAVE_NAN_H
-- Looking for include files HAVE_NAN_H - not found.
-- Looking for include files HAVE_NDIR_H
-- Looking for include files HAVE_NDIR_H - not found.
-- Looking for include files HAVE_PTHREAD_H
-- Looking for include files HAVE_PTHREAD_H - found
-- Looking for include files HAVE_RESOLV_H
-- Looking for include files HAVE_RESOLV_H - found
-- Looking for include files HAVE_STDARG_H
-- Looking for include files HAVE_STDARG_H - found
-- Looking for include files HAVE_SYS_MMAN_H
-- Looking for include files HAVE_SYS_MMAN_H - found
-- Looking for include files HAVE_SYS_TIMEB_H
-- Looking for include files HAVE_SYS_TIMEB_H - found
-- Looking for finite
-- Looking for finite - found
-- Looking for fpclass
-- Looking for fpclass - not found.
-- Looking for fp_class
-- Looking for fp_class - not found.
-- Looking for fprintf
-- Looking for fprintf - found
-- Looking for ftime
-- Looking for ftime - found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for localtime
-- Looking for localtime - found
-- Looking for printf
-- Looking for printf - found
-- Looking for sscanf
-- Looking for sscanf - found
-- Looking for sprintf
-- Looking for sprintf - found
-- Looking for snprintf
-- Looking for snprintf - found
-- Looking for signal
-- Looking for signal - found
-- Looking for strdup
-- Looking for strdup - found
-- Looking for strndup
-- Looking for strndup - found
-- Looking for strerror
-- Looking for strerror - found
-- Looking for strftime
-- Looking for strftime - found
-- Looking for stat
-- Looking for stat - found
-- Looking for _stat
-- Looking for _stat - not found.
-- Looking for vfprintf
-- Looking for vfprintf - found
-- Looking for vsnprintf
-- Looking for vsnprintf - found
-- Looking for vsprintf
-- Looking for vsprintf - found
-- Checking for getaddrinfo.
-- Checking for getaddrinfo. - yes
-- Checking for socklen_t
-- Checking for socklen_t - yes
-- Checking for DIR in sys/dir.h
-- Checking for DIR in sys/dir.h - yes
-- Checking for DIR in sys/ndir.h
-- Checking for DIR in sys/ndir.h - no
-- Checking for va_copy
-- Checking for va_copy - yes
-- Checking for __va_copy
-- Checking for __va_copy - yes
-- Checking for ipv6 support.
-- Checking for ipv6 support. - yes
-- Looking for include files STDC_HEADERS
-- Looking for include files STDC_HEADERS - found
-- Looking for include files HAVE_ALLOCA_H
-- Looking for include files HAVE_ALLOCA_H - found
-- Looking for alloca
-- Looking for alloca - found
-- Check size of size_t
-- Check size of size_t - done
-- Check size of ssize_t
-- Check size of ssize_t - done
-- Check size of ptrdiff_t
-- Check size of ptrdiff_t - done
-- Check size of off_t
-- Check size of off_t - done
-- Check size of double
-- Check size of double - done
-- Check size of float
-- Check size of float - done
-- Check size of short
-- Check size of short - done
-- Check size of uchar
-- Check size of uchar - failed
-- Performing NetCDF Test HAVE_ST_BLKSIZE
-- Performing NetCDF Test HAVE_ST_BLKSIZE - Success
-- Performing NetCDF Test HAVE_FTRUNCATE
-- Performing NetCDF Test HAVE_FTRUNCATE - Success
-- Looking for malloc.h
-- Looking for malloc.h - found
-- Looking for glXGetProcAddressARB
-- Looking for glXGetProcAddressARB - found
-- Looking for glXGetProcAddressARB in GL/glx.h
-- Looking for glXGetProcAddressARB in GL/glx.h - TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /blahblahblah
On Wed, Mar 25, 2009 at 11:55 AM, Mathieu Malaterre <
mathieu.malaterre at gmail.com> wrote:
> Hi paul,
>
> Thanks for the bug report. I feel there is something else going on
> wrong. Did you start from a empty binary tree ? Did you change the
> compiler *after* the first cmake configure step ?
> The test for VTK_[IO]STREAM_SUPPORTS_LONG_LONG is so obviously
> simple, that I do not see how in the world it would possibly fails.
>
> Could you please try to reproduce the issue in a fresh (empty)
> binary directory. Simply configure VTK (no need to build). And grep
> for the value of VTK_ISTREAM_SUPPORTS_LONG_LONG in the generated
> CMakeCache.txt.
>
> Thanks for your help
>
>
> On Wed, Mar 25, 2009 at 2:55 PM, Paul <massivemonkeymayhem at gmail.com>
> wrote:
> > Oh yeah.
> >
> > The fix is to simply edit CMakeCache.txt and set
> > VTK_ISTREAM_SUPPORTS_LONG_LONG=1 and VTK_OSTREAM_SUPPORTS_LONG_LONG=1
> (when
> > using VTK_USE_64BIT_IDS=True, which is default on 64bit systems).
> >
> > Paul
> >
> >
> > On Wed, Mar 25, 2009 at 11:11 AM, Paul <massivemonkeymayhem at gmail.com>
> > wrote:
> >>
> >> Fixed the problem. Turns out it's an issue related to 64bit systems.
> >>
> >> In the CMake scripts, it is incorrectly determining that my system
> doesn't
> >> support "long long"'s for istream/ostream. Despite this, it would still
> use
> >> long long's as vtkIdType. (This should generate a warning)
> >>
> >> Thus VTK would try to build without a compiler flag enabling long long
> >> support, thereby generating errors anywhere a vtkIdType (long long) is
> fed
> >> to istream/ostream.
> >>
> >> Paul
> >>
> >>
> >> On Mon, Mar 23, 2009 at 11:45 AM, Paul <massivemonkeymayhem at gmail.com>
> >> wrote:
> >>>
> >>> Bleh. I'm still having problems getting VTK to compile on my new
> machine.
> >>> It's running on the new Intel Core i7, I'm wondering if there might be
> a bug
> >>> with it and gcc/libstdc++. I flattened my disk and installed the Ubuntu
> 9.04
> >>> alpha - still no go. Is it definitely a problem with my build
> environment?
> >>>
> >>> Paul
> >>>
> >>> On Wed, Mar 18, 2009 at 3:08 PM, Paul <massivemonkeymayhem at gmail.com>
> >>> wrote:
> >>>>
> >>>> I haven't had any compile problems that I couldn't work out in the
> past,
> >>>> but I'm a bit puzzled over this one.
> >>>>
> >>>> Running fresh, updated Ubuntu 8.10 64bit, gcc version 4.3.2.
> >>>>
> >>>> /home/pd/Software/vtk-5.2.1/Common/vtkAbstractArray.cxx: In member
> >>>> function ‘virtual void vtkAbstractArray::PrintSelf(std::ostream&,
> >>>> vtkIndent)’:
> >>>> /home/pd/Software/vtk-5.2.1/Common/vtkAbstractArray.cxx:251: error:
> >>>> ambiguous overload for ‘operator<<’ in ‘std::operator<< [with _Traits
> =
> >>>> std::char_traits<char>](((std::basic_ostream<char,
> std::char_traits<char>
> >>>> >&)((std::ostream*)operator<<(((std::ostream&)((std::ostream*)os)),
> ((const
> >>>> vtkIndent&)((const vtkIndent*)(& indent)))))), ((const char*)"Size:
> ")) <<
> >>>> ((vtkAbstractArray*)this)->vtkAbstractArray::Size’
> >>>> /usr/include/c++/4.3/ostream:112: note: candidates are:
> >>>> std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
> >>>> _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>&
> >>>> (*)(std::basic_ostream<_CharT, _Traits>&)) [with _CharT = char,
> _Traits =
> >>>> std::char_traits<char>] <near match>
> >>>> /usr/include/c++/4.3/ostream:121: note:
> >>>> std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT,
> >>>> _Traits>::operator<<(std::basic_ios<_CharT, _Traits>&
> >>>> (*)(std::basic_ios<_CharT, _Traits>&)) [with _CharT = char, _Traits =
> >>>> std::char_traits<char>] <near match>
> >>>> ...
> >>>> etc
> >>>> ...
> >>>>
> >>>> I get the same error with VTK nightly (March 17 2009)
> >>>>
> >>>> Any suggestions?
> >>>
> >>
> >
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
>
>
>
> --
> Mathieu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090325/4db8a66e/attachment.htm>
More information about the vtkusers
mailing list