[Insight-developers] Re: ftt porblems on mac os x

Gaetan Lehmann gaetan.lehmann at jouy.inra.fr
Wed Jan 17 08:56:10 EST 2007


Hi,

On Wed, 17 Jan 2007 11:27:30 +0100, Jakub Bican <jakub.bican at matfyz.cz>  
wrote:

> Hi Gaetan, Luis.
>
> I agree that the soluiton with overriden New method is not usual in
> ITK, but i (after Gaetans suggestion) converged to it.
>
> I was writing a Phase Correlation Method implementation (PCM) for ITK
> (see Insight Journal) and i was trying to use "FFT algorithm" inside
> my filter without taking care of specific implementation
> (FFTW/VNL...). There were these possibilities:
>
> 1) use VNL by default
> a developer who configures ITK and his project to use FFTW has to
> implement and "install" his own factory to let PCM use it as well
>
> 2) use FFTW by default
> what if there is someone who does not use FFWT? then he will not be
> able even to compile his code
>
> 3) let developer pass a factory to PCM class OR specify FFT
> implementation as a template parameter
> This is strange from two views: a developer has to set up again what
> he already configured (selection of an implementation), and a there is
> also a necessity of passing some parameters to a class or instance,
> which do not belong to an interface of the algorithm.
>
> 4) override New method in a FFT base classes
> this is a little bit unsystematic in ITK, but functionable, while it
> keeps the factory mechanism working. PCM just asks base class
> (interface) to provide some implementation which is available, and
> developer seletcs the preffered implementation once during
> configuration of ITK, while he can override it by a factory.
>
> For me was 4 much more acceptable than 1-3, so i choosed it.
>
> Please, if you remove the New method form the ITK, let me know. I will
> have to change the implementation of PCM (how? :) ).
>

That's why I put you in CC :-)

I have committed some changes to fix the WrapITK build. The other builds  
are green, so I can't see any reason to remove it now.
If someone is courageous enough, it can still be implemented with  
factories in the future

Gaetan


> Regards,
>
>       Jakub
>
>
>
> 2007/1/15, Luis Ibanez <luis.ibanez at kitware.com>:
>>
>>
>> Hi Gaetan,
>>
>>
>>  From the error message:
>>
>> ld: multiple definitions of symbol __ZN12vnl_fft_baseILi3EfEC1Ev
>> CMakeFiles/FFTJava.dir/wrap_itkFFTRealToComplexConjugateImageFilterJava.o
>> definition of __ZN12vnl_fft_baseILi3EfEC1Ev in section (__TEXT,__text)
>> CMakeFiles/FFTJava.dir/wrap_itkVnlFFTRealToComplexConjugateImageFilterJava.o
>> definition of __ZN12vnl_fft_baseILi3EfEC1Ev in section (__TEXT,__text)
>> ld: multiple definitions of symbol __ZN12vnl_fft_baseILi3EfEC2Ev
>> CMakeFiles/FFTJava.dir/wrap_itkFFTRealToComplexConjugateImageFilterJava.o
>> definition of __ZN12vnl_fft_baseILi3EfEC2Ev in section (__TEXT,__text)
>> CMakeFiles/FFTJava.dir/wrap_itkVnlFFTRealToComplexConjugateImageFilterJava.o
>> definition of __ZN12vnl_fft_baseILi3EfEC2Ev in section (__TEXT,__text)
>> /usr/bin/libtool: internal link edit command failed
>>
>> It seems that the symbol is being compiled in two different cxx files.
>>
>> It is probably due to the way the wrapping instantiate base classes.
>> The base class seems to be instantiated by the derived VnlFFT class
>> and it is also instantiated as a class directly:
>>
>>
>> /Insight/Wrapping/WrapITK/Modules/FFT
>>     wrap_itkFFTRealToComplexConjugateImageFilter.cmake
>>     wrap_itkVnlFFTRealToComplexConjugateImageFilter.cmake
>>
>>
>> Curiously this does not happen for the
>> ComplexConjugateToReal classes...
>>
>>
>> The last changes used to fix Visual Studio 6.0, were related to
>> avoiding cross-including the .h and .txx files multiple times.
>>
>>
>> I agree that overloading the New() method is not how ITK was supposed
>> to operate. Such approach is not scalable and it requires all the
>> classes to know about the others. This could have been done in a
>> cleaner way by using the Factory mechanism.
>>
>>
>>
>>    Regards,
>>
>>
>>      Luis
>>
>>
>> ----------------------
>> Gaetan Lehmann wrote:
>> >
>> > Hi Luis,
>> >
>> > There are some problems with fft on mac os x - see
>> >  
>> http://www.itk.org/Testing/Sites/gbook.local/Darwin-c++/20070115-0100-Nightly/BuildError.html
>> >
>> > Do you think your last changes to fix the msvc6 build can have cause
>> > that  problem ?
>> >
>> > BTW, the New() method which return on implementation or the other was
>> > looking like a good idea, but if it is too difficult to implement with
>> > all  the compilers, we can also remove it and stay with the explicit
>> > usage as  before.
>> >
>> > 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