[Insight-developers] RE: netlib changes are breaking builds

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Wed Sep 27 17:13:33 EDT 2006


Le Wed, 27 Sep 2006 16:06:23 +0200, Luis Ibanez <luis.ibanez at kitware.com>  
a écrit:

>
> Hi Gaetan,
>
>
> We have a policy of testing #includes for all the files in ITK.
> A header file shouldn't produce problems when included unnecessarily,
> instead, things should be configured so that the file is silently
> ignored.
>
> That's the reason for using the BuildHeaderTest.tcl script. We generate
> test that blindly include all the header files and make sure that they
> do not produce problems just for being included.
>
> Why is that the files are not usable when the two FFTW options
> are disabled ?

Currently in ITK, to use fftw, we must:
(1) have fftw installed and define USE_FFTWD or USE_FFTWF
(2) have fftw installed and have set USE_FFTWD or USE_FFTWF to ON in cmake  
while building ITK (and include itkConfigure.h)
If the user try to use a FFTW class without have done that, he get an  
obfucated message about undefined type at compile time.
So, it can work, but it's everything but simple.

Without the if blocks, the only thing to do is to have fftw installed.
If fftw is not installed, the user get a clear error message: the compiler  
cant find the file fftw3.h.

Not including the FFTW files to test the headers is consistant with FFTW  
tests: the tests are built only if the user has chosen to build them.

To make something easily usable, we can:
(1) include the FFTW files in the tests only if USE_FFTWF or USE_FFTWD are  
defined, and remove the if blocks elsewhere
(2) move the FFTW files, and all the files which are using them, to  
insight application
(3) include fftw in ITK

(1) is the simplest way to go. (3) should be useful if more filters are  
using the FFTW ones.

Gaetan


>
>
>     Luis
>
>
>
>
> ---------------------
> Gaetan Lehmann wrote:
>>  Hi,
>>  Please do not re-add the "#if defined(USE_FFTW?)" blocks in the code  
>> which  can be used directly by the user. At least if you really want to  
>> do that,  the file itkConfigure.h must be included in this file, but  
>> even with that  include, it will be a problem for the final user if  
>> he/she has not set one  of the option USE_FFTWF or USE_FFTWD while  
>> building ITK: those files will  not be usable.
>>  I think the "#if defined(USE_FFTW)" blocks should be only in the test   
>> code, not in the one used by the users.
>>  Regards,
>>  Gaetan
>>   On Tue, 26 Sep 2006 17:19:07 +0200, Lorensen, William E (GE,  
>> Research)  <lorensen at crd.ge.com> wrote:
>>
>>> I think it is OK to update the header tests once in a while. We can   
>>> clean them up over the next few days.
>>>
>>> Bill
>>>
>>> -----Original Message-----
>>> From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
>>> Sent: Tuesday, September 26, 2006 9:44 AM
>>> To: Lorensen, William E (GE, Research)
>>> Cc: ITK
>>> Subject: Re: netlib changes are breaking builds
>>>
>>>
>>>
>>> Hi Bill,
>>>
>>> I see...
>>>
>>> The #defines in the AlgorithmHeader are now redundant
>>> with the #defines in itkFFTWCommon.h.
>>>
>>> -- It seems that overall, it wasn't a good idea to run the
>>> BuildHeaderTest.tcl script. I didn't realized that we had
>>> to manually retouch the results.
>>>
>>> Should I roll back the changes and only keep the modifications
>>> of the Copyrights ?
>>>
>>>
>>>    Luis
>>>
>>>
>>>
>>> ------------------------------------------
>>> Lorensen, William E (GE, Research) wrote:
>>>
>>>> Actually, I edited the Algorithms header test to fix the problem.   
>>>> Sometimes we need to hand-edit these generated files. For example,  
>>>> one  of the windows compilers is getting an internal compiler error  
>>>> on  COmmonHeaderTests. Sometimes a reordering of include's fixes the   
>>>> problem.
>>>>
>>>> Bill
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
>>>> Sent: Tuesday, September 26, 2006 8:58 AM
>>>> To: Lorensen, William E (GE, Research)
>>>> Cc: ITK
>>>> Subject: Re: netlib changes are breaking builds
>>>>
>>>>
>>>>
>>>> Hi Bill,
>>>>
>>>> We removed yesterday the last traces of itknetlib.
>>>> That shouldn't be a problem anymore.
>>>>
>>>> Today we have a red Dashboard due to a change I made yesterday.
>>>>
>>>> I reran the BuildHeaderTest.tcl script in order to fix the
>>>> copyright notices of the HeaderTest (that were appearing as
>>>> copyrighted by the NLM).
>>>>
>>>> This included the itkFFTWCommon.h file that recently was
>>>> changed so that it was only included in builds that have
>>>> USE_FFTWF or USE_FFTWD enabled.
>>>>
>>>> Since the Header Tests blindly add all the headers, I just
>>>> added back the #defines to itkFFTWCommon.h, so that, if it
>>>> is included in the HeaderTest from a build that has USE_FFTWF
>>>> and USE_FFTWD disable, it shouldn't cause any compilation
>>>> problems.
>>>>
>>>>
>>>> There may be other quirks to iron out today too....
>>>>
>>>>
>>>>
>>>>      Luis
>>>>
>>>>
>>>> ---------------------
>>>> Bill Lorensen wrote:
>>>>
>>>>> Luis,
>>>>>
>>>>> There are some builds failing after you netlib changes. For example:
>>>>>
>>>>> http://www.itk.org/Testing/Sites/crunch1.isi.nl/Linux64-g++-4.0.2/20060925-0100-Nightly/BuildError.html  
>>>>> http://www.itk.org/Testing/Sites/camelot.kitware/Linux-g++-2.95-WrapITK/20060925-0100-Nightly/BuildError.html  
>>>>>
>>>>>
>>>>> Bill
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Insight-developers mailing list
>>> Insight-developers at itk.org
>>> http://www.itk.org/mailman/listinfo/insight-developers
>>
>
>



-- 
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