octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MXE-Octave build of fftw


From: Michael Goffioul
Subject: Re: MXE-Octave build of fftw
Date: Tue, 25 Jun 2013 20:01:10 -0400

On Tue, Jun 25, 2013 at 7:44 PM, John D <address@hidden> wrote:

 

 

From: Michael Goffioul [mailto:address@hidden]
Sent: Tuesday, June 25, 2013 7:28 PM


To: John Donoghue
Cc: Octave Maintainers List; Philip Nienhuis; John W. Eaton
Subject: Re: MXE-Octave build of fftw

 

On Tue, Jun 25, 2013 at 7:18 PM, jdonoghue <address@hidden> wrote:

 

 

From: Michael Goffioul [mailto:address@hidden]
Sent: Tuesday, June 25, 2013 7:10 PM
To: John Donoghue
Cc: Octave Maintainers List; Philip Nienhuis; John W. Eaton
Subject: Re: MXE-Octave build of fftw

 

On Tue, Jun 25, 2013 at 5:08 PM, jdonoghue <address@hidden> wrote:

 

When trying to compile as native mingw, FFTW now fails to build:

 

libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I../simd -O3 -fomit-

frame-pointer -mtune=native -malign-double -fstrict-aliasing -fno-schedule-insns

-ffast-math -MT kalloc.lo -MD -MP -MF .deps/kalloc.Tpo -c kalloc.c  -DDLL_EXPOR

T -DPIC -o .libs/kalloc.o

kalloc.c: In function 'fftw_kernel_malloc':^M

kalloc.c:131:6: error: #error "Don't know how to malloc() aligned memory ... try

configuring --with-our-malloc"^M

make[4]: *** [kalloc.lo] Error 1

make[4]: Leaving directory `/home/jdonoghue/mxe-octave/tmp-fftw/fftw-3.3.2/kerne

l'

 

 

In addition (this has probally always been the case) I get a warning for unrecognized option  --enable-double:

 

cd '/home/jdonoghue/mxe-octave/tmp-fftw/fftw-3.3.2' && ./configure F77=gfortran

--enable-shared --disable-static --prefix='/home/jdonoghue/mxe-octave/usr/i686-

pc-mingw32' --enable-threads --enable-sse2 --enable-double && true

configure: WARNING: unrecognized options: --enable-double

 

 

Checking the configure.ac, there is –enable-long-double, --enable-float/--enable-single.

 

AFAIK, the only change I made recently, that could impact MinGW, is to use --enable-sse2. Is that enough to trigger the compilation error? (would make sense, as using SSE2 instructions requires properly aligned memory)

 

Michael.

 


 

Compiling without the sse2 option now, so I will let you know.

 

Looking at the code in kalloc.c, it's strange that it can't find a way to alloc aligned memory with MinGW. Maybe it's a bug in FFTW. AFAIK, MinGW also have the _aligned_malloc function defined in its header (the same is used for MSVC, but in kalloc.c, it's only used for the MSVC compiler).

 

Michael.

 

 

Verified - It works without the sse2 option

 

I don’t know why it doesn’t work with sse2 … configure output at least suggests that it thinks the compiler is ok with it .

checking whether C compiler accepts -mtune=native... yes

checking whether C compiler accepts -malign-double... yes

checking whether C compiler accepts -fstrict-aliasing... yes

checking whether C compiler accepts -fno-schedule-insns... yes

checking whether C compiler accepts -ffast-math... yes

checking whether C compiler accepts -O3 -fomit-frame-pointer -mtune=native -mali

gn-double -fstrict-aliasing -fno-schedule-insns -ffast-math... yes

checking whether C compiler accepts -msse2... yes

 

There is some configure checks for memory alignment:

checking whether memalign is declared... no

checking whether posix_memalign is declared... no

.


I think those are glibc/UNIX only. With MinGW, I think it should use _aligned_malloc, like MSVC. But kalloc.c is only using it when _MSC_VER is defined, leaving MinGW in the limbo. I tend to think the problem lies in FFTW. We can disable SSE2 in the compilation, but I'd find it a pity not being able to leverage CPU capabilities where we can.

Michael.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]