[vtkusers] vtkConfigure.h and machine byte ordering: do I worry too much?

William A. Hoffman bill.hoffman at kitware.com
Mon Apr 9 09:46:50 EDT 2001


You should be building, or at least configuring VTK out of the source directory.
For example:

vtk/...
vtk-Solaris
vtk-linux
vtk-irix

To configure for one of those:

cd vtk-Solaris
../vtk/configure

All the generated .h files will be in vtk-Solaris.

-Bill


At 10:20 AM 4/9/2001 +0200, Robert Belleman wrote:
>Hi all,
>
>In response to the email from Jose Romero a short while ago, something
>got me thinking...
>
>I maintain an installation for Solaris/sparc, Linux/i386, and Irix/mips
>systems from a single source tree.  People use this source tree to obtain
>the include files for their C++ programs.
>
>This includes vtkConfigure.h, which (amongst others) defines
>VTK_WORDS_BIGENDIAN to signify the byte ordering of the architecture.
>In my case, this will be defined on some systems (my sparc and mips
>systems) and not on others (the i386 systems), depending on the
>architecture where I run configure.
>
>In my case, common/vtkConfigure.h will only reflect the "correct"
>settings for the *last* system I configured. In general this is not a
>problem since none of Vtk's include files rely on this constant in the
>headers, only in .cxx files, which in my opinion is good practice. 
>
>However, users could check for this constant in their C++ programs
>(instead of determining byte ordering at run-time). In principle their
>code could think their running on a little endian system while, in fact,
>it is a big endian machine...
>
>I haven't seen my users relying on vtkConfigure.h definitions yet, but
>in principle they could. We may want to think of a way to avoid these
>problems from happening (e.g. all compilers that I know have a compile
>time constant to signify the machine architecture which could be tested
>to "protect" the definition of VTK_WORDS_BIGENDIAN). The same applies
>to other definitions in common/vtkConfigure.h and those in vtkToolkits.h.
>
>Any thoughts on this?
>
>Best,
>-- Rob
>
>[] Robert Belleman         X  Section Computational Science            []
>[] robbel at science.uva.nl  |X| University of Amsterdam, the Netherlands []
>[] tel: (+31) 20 525 7510  X  http://www.science.uva.nl/~robbel/       []
>
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers 





More information about the vtkusers mailing list