[osg-users] G++ version problem

Grahame Bowland grahame at fugro-fsi.com.au
Mon Apr 4 00:43:19 PDT 2011


On Mon, 2011-04-04 at 09:33 +0200, Alberto Luaces wrote:
> Hi Mathias, Grahame,
> 
> Mathias Fröhlich writes:

> > There is a configure time switch in gcc that changes the default architecture. 
> > Distributions usually have their compiler configured for something that 
> > includes support for atomics. But your hand configured gcc uses the really 
> > conservative i386 (not i486, really 80386) default which did not have any smp 
> > support at this very old time.
> > So either give -march=i686 or something sensible for your project to the c and 
> > c++ flags when doing the cmake configure step. Or rebuild gcc with the 
> > configure flag --with-cpu=i686 or something sensible for your build 
> > environment. Then rebuild osg from scratch.
> 
> I agree; if you are only going to use that OSG version with the same
> computer or with another having the same or later CPU, maybe the easiest
> way is to use -march=native as I said earlier. If you are not sure about
> what kind of processors are going to run the code, you'll have to find a
> common base architecture like the one suggested by Mathias, -march=i686.
> 
> There is a comprehensive list at
> 
> http://gcc.gnu.org/onlinedocs/gcc-4.4.5/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options
> 
> Again, please note that this will enforce a constraint on the minimum
> CPU requirement for the systems running your software.

We can definitely assume people running our software have an i686 (and
we could probably assume SSE2 as well.) We're building our own stack of
libraries (glib, gtk, pango, openscenegraph, ...) that allows us to ship
our software to people running very old Linux distributions like RHEL4.

Unfortunately I've already shipped several versions of my program that
depend on the openscenegraph library which was miscompiled without
atomic support. I've patched the test so that it always fails, which
solves my problem for now.

Thanks for everyone's help!

Cheers
Grahame




More information about the osg-users mailing list