[osg-users] G++ version problem

Alberto Luaces aluaces at udc.es
Fri Apr 1 03:06:21 PDT 2011


Robert Osfield writes:

> Hi Grahame,
>
> On Fri, Apr 1, 2011 at 4:20 AM, Grahame Bowland
> <grahame at fugro-fsi.com.au> wrote:
>> Thanks very much, that was it! gcc-4.4.3 was failing the
>> _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS test, which succeeded for 4.5.2.
>> That changed the "Atomic" header file, which presumably changed the size
>> of a bunch of important classes.
>>
>> Making sure that test fails solves my problem.
>
> So binary compatibility for the build was the issue, although not
> directly due to gcc build binary incompatible libs, but different
> choosing different implementations on the OSG side.
>

Well, one never knows about ABI issues, but I was optimist because
almost all linux distributions carry software compiled with several
versions of GCC. Here in my Debian Squeeze desktop I have three versions
of gcc installed simultaneosly by different packages, with the lastest
one (4.4) as the default.

>
> The gcc _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS test should pass for both
> gcc 4.4.3 and 4.5.2.  I used plenty of gcc versions prior to 4.4.3 and
> it worked fine.   I'm currently using gcc 4.4.5 on this system and it
> pick up on _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS fine.
>
> This make me wonder why your build with 4.4.3 isn't picking up on the
> atomic support correctly.  Has anyone else had problems with picking
> up on the atmoic support?

A reason can be the fact that some systems select different default
architectures. If you are using a 32 bit system instead of amd64, and
say your compiler is set by default to produce 586 or 686 compatible
binaries, chances are that the gcc builtins are deactivated. You would
have to specify the target architecture explicitly,
eg. -march=native. Those default configurations can be checked with `gcc
-v'.

-- 
Alberto




More information about the osg-users mailing list