FFTW版本:fftw-3.2.2-arm 和 fftw-3.3.4 (两个版本均成功编译)
本人所适用的arm平台是单核cortex-A7平台。
2. 配置:
2.1 查看配置参数
./configure --help
其中最后有一段话:
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
MPICC MPI C compiler command
F77 Fortran 77 compiler command
FFLAGS Fortran 77 compiler flags
因为,随后的配置中,我们需要配置CC 和CFLAGS这两个变量。
./configure --prefix=/home/zhouxiaoyong/fftw3_test --disable-fortran --with-slow-timer --host=arm-none-linux-gnueabi --enable-single --enable-neon --enable-shared CC=arm-none-linux-gnueabi-gcc CFLAGS="-march=armv7-a -mfpu=neon -fPIC -ldl -mfloat-abi=softfp"
2.3 配置参数含义
CC=arm-none-linux-gnueabi-gcc
CFLAGS="-march=armv7-a -mfpu=neon -fPIC -ldl -mfloat-abi=softfp"
-march=armv7-a: 选择armv7系列指令集a系列,适用于cortex A系列指令集;
-mfpu=neon: 选择neon协处理器作为浮点处理器;
-fPIC : Position Independent Code means that the generated machine code is not dependent on being located at a specific address in order to work
-ldl: link dynamic linking library, libdl.so
-mfloat-abi=softfp: 选择软浮点ABI
3.编译:
make -j8
make install
4. 参考:
http://blog.csdn.net/zwjzwj108108/article/details/24305547
http://blog.163.com/qimo601@126/blog/static/15822093201382524244772/
http://blog.jimjh.com/compiling-open-source-libraries-with-android-ndk-part-2.html
http://stackoverflow.com/questions/26644610/how-to-cross-compile-fftw3-for-aarch64-with-ndk