[Insight-developers] CMAKE_BUILD_TYPE=Release and -frename-registers

Gaetan Lehmann gaetan.lehmann at jouy.inra.fr
Thu Aug 31 11:12:16 EDT 2006


On Thu, 31 Aug 2006 16:32:06 +0200, Luis Ibanez <luis.ibanez at kitware.com>  
wrote:

>
> Hi Gaetan,
>
> A while ago (three or four years) we confirmed that -O2 optimization
> was not enough for getting the full advantage of the templated code
> in ITK.   Since then we have use -O3 level. At the time the test we
> done in particular in relation to the ImageIterators, which as you
> know are a critical component of all ITK filters.
>
> Do you have a specific reason for not using O3 ?
>

Yes: the tests are not passing
I think that's because -O3 activate the option -frename-registers.
If I try to set this option by hand in cmake, I get the error message

   -frename-registers causes runtime bugs.  It must be removed from your  
compilation options.

So I guess that's a known problem :-)

For example on  
http://www.itk.org/Testing/Sites/marvin.jouy.inra.fr/Mandriva2006.0-i586-gcc4.0.1-ExplicitInstantiation-Release/20060809-0100-Nightly/Test.html  
, you can see several (and some other errors caused by explicit  
instantiation). I still get the same timeouts (even without explicit  
instantiation) when compiled with -O3.

Everything is fine with -O2 -finline-functions. The only option disabled  
in that case, compared to -O3, is -frename-registers.

> ---
>
>
> Also, when you say that the test are running "for ever", do you mean
> the build process (compilation + linking) or the actual run-time
> execution of the test ?

the execution of the tests - see the link above

>
> Note that we have machines submitting to the Dahsboard that complete
> in 3 hours the full build of ITK with Testing, Examples and the
> wrapping for Tcl, Python and Java starting from a scratch.
>

I have the same build, on the same host, but in debug mode. Everything is  
fine in Debug mode: there is no timeout

Gaetan



>
> ---
>
> Please let us know,
>
>
>     Thanks
>
>
>        Luis
>
>
> --------------------
> Gaetan Lehmann wrote:
>>  Hi,
>>  For some time, some tests produced by my release build are running  
>> for  ever (I have even stop submitting to the dashboard, because the  
>> tests are  too long).
>> It seems that everything is fine when building with the default options  
>> of  my distro:
>>    -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fomit-frame-pointer  
>> -march=i586  -mtune=pentiumpro -fasynchronous-unwind-tables
>>   The only important difference seems to be the -O2 instead of the -O3  
>> used  by default for the Release CMAKE_BUILD_TYPE.
>> According to gcc man:
>>    -O3 Optimize yet more.  -O3 turns on all optimizations specified by  
>> -O2
>>       and also turns on the -finline-functions and -frename-registers
>>       options.
>>  But -frename-registers is a rejected option in ITK, so shouldn't   
>> CMAKE_BUILD_TYPE=Release set the gcc options to
>>    -O2 -finline-functions -DNDEBUG
>>  instead of
>>    -O3 -DNDEBUG
>>  ?
>>  Thanks,
>>  Gaetan
>>
>



-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr


More information about the Insight-developers mailing list