I am currently writing a genre classification application as my final year project in Computer Engineering. I initially wrote the feature extraction code (implementing FFTW) in C and now I need to implement it on Android via the NDK.
This is my first NDK project so I’m still getting the hang of things but I have compiled the FFTW3 library for Android according to this guide. I didn’t do the very last step because I didn’t think it was right for what I need.
My question is how do I, after the compile step, use the library in the main NDK application that calls on it? Do I everything normally in Application.mk just with LOCAL_STATIC_LIBRARIES set to the libfftw3.a that I just compiled? And then I don’t need to have any -lfftw3 linker flags like I normally would right?
You can use prebuit FFTW library (no matter how did you build it).
Or you can build FFTW in
Android.mkmakefile with the whole project.Android.mkcontent will be:I have written
path_to_fftw_sources/$(LOCAL_MODULE).mkfor building fftw static library andpath_to_your_project/$(LOCAL_MODULE).mkfor building your shared library. It is often better to putLOCAL_SRC_FILESandLOCAL_C_INCLUDESto the separate.mkfile.You can read more about
Android.mkfile indocs/ANDROID-MK.htmldocument in your NDK distribution.