missing fftw_alignment_of #2173

Closed
goszlanyi opened this Issue Feb 2, 2013 · 13 comments

Comments

Projects
None yet
8 participants

The latest Windows version fails on 32-bit Vista with the following error message:

julia> fft([1:5])
in Plan: ccall: could not find function fftw_alignment_of in library libfftw3

Could anyone else confirm the same behaviour?

Owner

stevengj commented Feb 2, 2013

Whoops, I forgot about this: On Windows, you cannot call a function in a shared library unless it is explicitly exported via a _dllexport decoration when it is declared. Because fftw_alignment_of is an undocumented internal function of FFTW, this decoration was not included. (In a future version of FFTW, I intend to document it and export it properly.)

In the meantime, the patch to FFTW is to change the declaration of int X(alignment_of)(R *p) in fftw-3.*/kernel/ifftw.h to IFFTW_EXTERN int X(alignment_of)(R *p).

Thank you.
Can we expect this change with the next binary Windows release?
(Obviously I do not understand the meaning of the upstream label.)

Member

pao commented Feb 3, 2013

The "upstream" tag means this needs to be fixed in an upstream dependency; here, FFTW.

Owner

stevengj commented Feb 4, 2013

Alternatively, instead of calling an FFTW internal function for this, we could just have our own alignment_of function in Julia which computes the alignment of a pointer mod 16. Anyone know how to typecast a pointer to an Int in Julia?

Member

vtjnash commented Feb 4, 2013

int() ?

or I can also apply this (adding _dllexport) as a patch until it gets included in a FFTW release version

Owner

Keno commented Feb 4, 2013

Either int(ptr) or convert(Int,ptr) will work.

Member

kmsquire commented Feb 4, 2013

or I can also apply this (adding _dllexport) as a patch until it gets included in a FFTW release version

Probably better to do it in julia, since some users (e.g., on Debian) will have USE_SYSTEM_FFTW=1

Owner

Keno commented Feb 4, 2013

This only affects windows though, so it doesn't matter, since we don't support outside FFTW libraries on windows at the moment.

Owner

stevengj commented Feb 8, 2013

Patch seems fine to me.

Contributor

tkelman commented Mar 3, 2014

Hi, is there any intention to incorporate this patch upstream in a new release in the near future? Or is there a workaround inside Julia while using a non-patched FFTW library? There are MinGW binaries of FFTW available various places (e.g. https://apps.fedoraproject.org/packages/mingw-fftw) which can be useful for speeding up build times.

Owner

stevengj commented Mar 3, 2014

The patch has already been incorporated upstream (FFTW/fftw3@b862318 and FFTW/fftw3@53e1fdb). It should be in 3.3.4, which I'm hoping to release soon.

Contributor

tkelman commented Mar 3, 2014

Great thanks, I wasn't sure where to look for that (fftw.org was being flaky last night). Just a matter of waiting for the next release to percolate out then, sounds good.

Owner

stevengj commented Mar 16, 2014

FFTW 3.3.4 is now released; would be good to update to this at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment