Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FFTW threads: ld: error: undefined symbol: fftwf_threads_set_callback #347

Open
fjrdev opened this issue Feb 22, 2024 · 3 comments
Open

Comments

@fjrdev
Copy link

fjrdev commented Feb 22, 2024

I want to use FFTW for an Android NDK project. Therefore I build with the following flags

./configure --host=aarch64-none-linux-android33 --enable-threads --enable-float
sudo make
sudo make install

After linking the library with: -L/path/to/fftwf/.libs/ -lfftw3f_threads -lfftw3f -lm, I get the following linking error when compiling:
ld: error: undefined symbol: fftwf_threads_set_callback.

Is there anything else I have to consider when cross-compiling on MacOS for aarch64 android? I could not find anything in the documentation regarding this.

@stevengj
Copy link
Contributor

stevengj commented Feb 23, 2024

If I recall correctly, the library isn't renamed to libfftw3f until it is installed?

Generally you should do a make install (set the --prefix to some local directory if you don't want to install systemwide) rather than trying to link into the .libs directory.

@fjrdev
Copy link
Author

fjrdev commented Feb 24, 2024

@stevengj Thanks for your help! I cross-compiled the library on a silicon mac for armv8a. So the library is already named libfftw3f.a when I push it onto the android device. I get the error when I link .lib inside the NDK application (in build.gradle).

The error occurs in tests/fftw-bench.c:

ld: error: undefined symbol: fftwf_threads_set_callback
>>> referenced by fftw-bench.c:101   (/path/to/fftwf_3.3.10/tests/fftw-bench.c:101)
>>>               fftwf_3.3.10/CMakeFiles/bench.dir/tests/fftw-bench.c.o:(useropt)

It seems like fftwf_threads_set_callback the first call to a thread-related function in fftw-bench.c, so I assumed it might be my build-process that resulted in this error.

@rdolbeau
Copy link
Contributor

rdolbeau commented Jul 3, 2024

You may first want to check if the symbol is in the library or not (e.g. using 'nm'). If it isn't (or under the wrong prefix) it's a build problem. If it is, then it might just be a link command issue, and for static library sometimes changing the order help (i.e. put fftw3f before fftw3f_threads)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants