[ITK Community] Build problem using MinGW32 4.5.0 and FFT

Jan Ehrhardt ehrhardt at imi.uni-luebeck.de
Sun Jan 5 05:01:24 EST 2014


Hi Matt,

I use ITK_USE_SYSTEM_FFTW and it doesn't work. _sopen_s seems not to be
implemented in MinGW. Using _sopen instead compiles.

I think there is a bug in the Win32 code in
itkFFTWGlobalConfiguration::ExportWisdomFileDouble and
ImportWisdomFileDouble

In ImportWisdomFileDouble the method fftwf_import_wisdom_from_file() is
used resulting in an unresolved symbol. The Unix code uses
fftw_import_wisdom_from_file().

In ExportWisdomFileDouble and ExportWisdomFileFloat the
fftwf_import_wisdom_from_file() is called instead of the
fftw_export_wisdom_to_file(). (Copy and paste error?)

I changed the code in ImportWisdomFileDouble and Filtering/FFT now compiles:

#if defined(ITK_USE_FFTWD)
#ifdef _WIN32
  FILE *f;
  int  fd;
  fd = _sopen( path.c_str(), _O_RDONLY, _SH_DENYNO, _S_IREAD);
  if (fd != -1)
  {
    if ( (f = _fdopen(fd, "r")) != NULL )
      {
      ret = fftw_import_wisdom_from_file( f );
      }
    _close(fd);
  }
#else
  FILE * f = fopen( path.c_str(), "r" );
  if( f )
    {
    flock( fileno(f), LOCK_SH );
    ret = fftw_import_wisdom_from_file( f );
    flock( fileno(f), LOCK_UN );
    fclose( f );
    }
#endif
#endif

I don't know the difference between _sopen and _sopen_s, but replacing
_sopen_s compiles with MinGW.

Best regards,
Jan

Am Sa, 4.01.2014, 20:33, schrieb Matt McCormick:
> Hi Jan,
>
> Does building fftw manually, then turning on ITK_USE_SYSTEM_FFTW work?
>
> Please let use know how it goes.
>
> Thanks,
> Matt
>
> On Thu, Jan 2, 2014 at 1:30 PM, Jan Ehrhardt
> <ehrhardt at imi.uni-luebeck.de> wrote:
>> Hi folks,
>>
>> I try to compile ITK 4.4.0 on Win32 with MinGW32 4.5.0. If I use the
>> option ITK_USE_FFTWD a compile error appears in
>> itkFFTWGlobalConfiguration.cxx: "_sopen_s was not declared in this
>> scope"
>> (lines 369 and 446)
>>
>> I couldn't find a declaration of _sopen_s in any header file of MinGW -
>> maybe not implemented?
>>
>> Is there a workaround to compile ITK with FFTW enabled?
>>
>> Best regards,
>> Jan
>>
>> _______________________________________________
>> Community mailing list
>> Community at itk.org
>> http://public.kitware.com/cgi-bin/mailman/listinfo/community
>




More information about the Community mailing list