Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

missing fftw_alignment_of #2173

Closed
GaborOszlanyi opened this Issue · 13 comments

8 participants

@GaborOszlanyi

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?

@stevengj
Collaborator

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

@GaborOszlanyi

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

@pao
Collaborator
pao commented

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

@stevengj
Collaborator

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?

@vtjnash
Collaborator

int() ?

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

@Keno
Owner

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

@kmsquire
Collaborator

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

@Keno
Owner

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

@stevengj
Collaborator

Patch seems fine to me.

@tkelman
Owner

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.

@stevengj
Collaborator

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.

@tkelman
Owner

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.

@stevengj
Collaborator

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
Something went wrong with that request. Please try again.