anthonix / ffts

The Fastest Fourier Transform in the South
http://anthonix.com/ffts
Other
536 stars 213 forks source link

Questions on build_android.sh #4

Open T045T opened 11 years ago

T045T commented 11 years ago

Firstly, build_android.sh seems to only build the native part of the library, not the Java wrapper that's needed to integrate into a (non-NDK) Android App, right? Is there an official .java file somewhere I've missed?

Secondly, the script fails on a 64-bit (OS X) system with appropriate 64-bit NDK, since it sets $HOSTPLAT to darwin-x86 when it should be darwin-x86_64 - the same probably holds true for Linux.

Thirdly, and lastly, I haven't been able to find any examples of Android apps that use ffts - I'm new to the whole NDK thing and could use a little guidance. Can you share / point me towards some?

Either way, thanks for building ffts! :)

anthonix commented 11 years ago

Michael Zucchi has contributed some JNI code, which I'll commit shortly.

And I'll fix the 64-bit issue.

Cheers, Anthony

chriswli commented 10 years ago

I had trouble building this with the existing configure script. I am using 64-bit Mac OSX and had to change the $HOSTPLAT to darwin-x86_64 and $CONFTARG to arm-linux-androideabi to get the configure script to discover the compilers. However, I am having trouble in the linking stage and am receiving errors of the following form. I would sincerely appreciate any feedback.

Thanks for contributing a fast FFT library, Chris

/Development/android-ndk-r9b/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtbegin_dynamic.o: No such file or directory /Development/android-ndk-r9b/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtend_android.o: No such file or directory /Development/android-ndk-r9b/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lstdc++ /Development/android-ndk-r9b/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lm /Development/android-ndk-r9b/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lc /Development/android-ndk-r9b/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lc /Development/android-ndk-r9b/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot find -ldl

inst27 commented 10 years ago

@chriswli Not sure if you have found the answer, but from your log I can see that your linker is trying to link with the standard C library rather than the android one.

Anyhow... has anyone successfully built ffts for a current Android version (e.g. 4.3)? I'm stuck with problems resulting from deprecated automake tools.

jfsantos commented 9 years ago

I managed to get it working. In addition to @chriswli instructions, you first need an autoreconf --force --install to get the required files to work with newer automake versions. Then, add the following to your android_build.sh:

export CFLAGS="-Os --sysroot=$SYS_ROOT"
export CFLAGS="--sysroot=$ANDROID_SYSROOT"
export CXXFLAGS="--sysroot=$ANDROID_SYSROOT"

This fixes the issues @chriswli had with the libraries.

Finally, add -llog to LIBS in the line calling configure, otherwise you will have issues with undefined reference to '__android_log_print'.

jfsantos commented 9 years ago

I opened #33 proposing a fix to all of these.