[Rock-dev] utilrb and c(xx)flags?

Sylvain Joyeux sylvain.joyeux at dfki.de
Fri Sep 16 17:03:22 CEST 2011


Please answer to rock-dev. Thanks.

On 09/16/2011 04:58 PM, Martin Fritsche wrote:
> Sylvain Joyeux schrieb:
>> On 09/16/2011 11:44 AM, Martin Fritsche wrote:
>>> Hi Sylvain,
>>> I have a rather special problem while compiling utilrb. As you might
>>> remember I and some others are using distcc to speedup compiling. Since
>>> I have a 32-bit system installed I did set C(XX)FLAGS to "-m32". This
>>> works for most packages but utilrb. It seems the flag gets lost
>>> somewhere and the 64-bit machines generate 64-bit object files which
>>> results in:
>>>       /usr/bin/ld: i386:x86-64 architecture of input file `swap.o' is
>>> incompatible with i386 output
>>>
>>> Do you have a quick fix for this other than compiling everything on only
>>> one machine?
>>>
>>> The gcc-version in use is 4.4
>> What "C(XX)FLAGS" you are referring to ? Is it an environment variable ?
> Yes, the environment variables CFLAGS and CXXFLAGS
>
>> Can you control distcc through environment variables ? I.e. would it be
>> possible to set an envvar while building utilrb (and only utilrb) to
>> disable distcc ?
> AFAIK not completely, but it would be possible to tell distcc to use
> localhost only as a workaround.
OK, so that would be a first step. Make autoproj set the relevant envvar 
during the compilation/setup of utilrb.
>> Isn't there a way to tell distcc itself what to do ?
> Distcc is not a compiler, it is a wrapper that calls the preprocessor,
> copies the resulting source to another machine, calls the compiler on
> that machine and fetches the results. The architecture part is not
> relevant for it.
I don't know how distcc works or not. I was thinking about ccache, which 
reads user-level configuration files to control its behaviour. I was 
wondering if distcc had the same ... But it seems that it does not ...
> It seems to work, when I set ' -m32' as part of the compiler command,
> but that breaks at least OpenCV and RTT because their Makefiles are then
> checking for a compiler called 'gcc -m32' which does of course not exist.
> Since it works for other packages like OpenCV I think that somehow the
> C(XX)FLAGS are lost.

>> In any case, there are a few two options, but none of them a "quickfix".
>> I'll tell you more once I have more information ...
The best option would be to make sure that ruby-extension-building takes 
into account CFLAGS and CXXFLAGS. Doable, but in principle not trivial.

Actually, I was thinking for a while to drop the use of extconf.rb (the 
standard way to generate makefiles for Ruby extensions) for Rock CMake 
macros. I already have a few done this way, maybe generalizing would be 
a good idea.

I'll have a look at what I could do quickly. Please open a ticket on the 
rock trac. Thanks

Sylvain


More information about the Rock-dev mailing list