如何在iOS上编译fftw3 [英] how to compile fftw3 on iOS

查看:1687
本文介绍了如何在iOS上编译fftw3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我只想在iOS上使用FFTW3,因为我已经成功编译成iOS模拟器使用的i386版本,剩下的工作是将其编译成armv6(或v7)版本和lipo这两个版本一起,下面是我不正确的配置:


./ configure
CC = / Developer / Platforms / iPhoneOS.platform / Developer / usr / bin / arm-apple-darwin10-gcc-4.2.1
LD = / Developer / Platforms / iPhoneOS.platform / Developer / usr / bin / ld
CCFLAGS = - I
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/lib/gcc/arm-apple-darwin10/4.2.1/include/
-I / Developer / Platforms / iPhoneOS。 platform / Developer / SDKs / iPhoneOS4.2.sdk / usr / include /
-miphoneos-version-min = 2.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2。 sdk
LDFLAGS = - arch armv6 -isysroot
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk
--enable-float -host = arm-apple-darwin --build = arm-apple-darwin10 --disable-fortran


当使用这个来构建fftw3,I总是得到这个:



检查BSD兼容的安装... / usr / bin / install -c
检查构建环境是否正常... yes
检查arm-apple-darwin-strip ... no
检查strip ... strip
configure:警告:使用不带主机三元组前缀的交叉工具
检查对于线程安全mkdir -p ... ./install-sh -c -d
检查gawk ... no
检查mawk ... no
检查nawk。 ..没有
检查awk ... awk
检查是否make集合$(MAKE)...是
检查是否启用Makefile的维护者特定部分... no
检查构建系统类型... arm-apple-darwin10
检查主机系统类型... arm-apple-darwin
检查arm-apple-darwin-gcc ... / Developer / Platforms /iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1
检查C编译器是否工作... no
configure:error:in /Users/chencyz/Desktop/Development/Misc/fftw3/fftw-3.3':
configure:error:C编译器无法创建可执行文件
请参阅
config.log'了解更多细节



我不太清楚这个问题(C编译器不工作?),任何人都可以给我一些指导,非常感谢!

解决方案

根据./configure --help:

   -  build = BUILD在BUILD上构建配置
--host = HOST交叉编译构建程序以在HOST上运行[BUILD]

所以关键是传递--host = arm-apple-darwin10,并使用正确的修改PATH,CFLAGS,LDFLAGS等执行configure。 p>

这似乎有效:

  PATH = / Developer / Platforms / iPhoneOS .platform / Developer / usr / bin:$ PATH \ 
../configure --host = arm-apple-darwin10 CFLAGS = - I / Developer / Platforms / iPhoneOS.platform / Developer / SDKs / iPhoneOS4。 3.sdk / usr / include -I / Library / iPhone / include -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk\
CC = arm-apple-darwin10- gcc-4.2.1 \
CPP = cpp \
LDFLAGS = - isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk\
--enable-single

祝你好运。


Nowdays I just want to use FFTW3 on iOS, since I've compiled it successfully into i386 version which is used by the iOS simulator, the rest work is to compile it into armv6(or v7) version and lipo these two versions together,below is my incorrect configure:

./configure CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1 LD=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ld CCFLAGS="-I /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/lib/gcc/arm-apple-darwin10/4.2.1/include/ -I /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/include/ -miphoneos-version-min=2.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk" LDFLAGS="-arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk" --enable-float --host=arm-apple-darwin --build=arm-apple-darwin10 --disable-fortran

when use this to build fftw3,I always get this:

checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for arm-apple-darwin-strip... no checking for strip... strip configure: WARNING: using cross tools not prefixed with host triplet checking for a thread-safe mkdir -p... ./install-sh -c -d checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking build system type... arm-apple-darwin10 checking host system type... arm-apple-darwin checking for arm-apple-darwin-gcc... /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1 checking whether the C compiler works... no configure: error: in /Users/chencyz/Desktop/Development/Misc/fftw3/fftw-3.3': configure: error: C compiler cannot create executables Seeconfig.log' for more details

I'm not so clear about the problem(C compiler not works?),could anyone give me some guides,thanks very much !

解决方案

According to ./configure --help:

--build=BUILD     configure for building on BUILD [guessed]
--host=HOST       cross-compile to build programs to run on HOST [BUILD]

So the key is to pass --host=arm-apple-darwin10, and execute configure with the correct alterations to PATH, CFLAGS, LDFLAGS, etc.

This seems to work:

PATH=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:$PATH \
../configure --host=arm-apple-darwin10 CFLAGS="-I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/include -I/Library/iPhone/include -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk" \
CC=arm-apple-darwin10-gcc-4.2.1 \
CPP=cpp \
LDFLAGS="-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk" \
--enable-single

Good luck.

这篇关于如何在iOS上编译fftw3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆