如何在iOS上编译fftw3
现在我只想在iOS上使用FFTW3,因为我已经成功地将其编译成iOS模拟器使用的i386版本,剩下的工作就是将其编译成armv6(或v7)版本并将这两个版本一起lipo,如下是我的配置不正确吗:
./配置 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 时,我总是得到这个:
检查 BSD 兼容安装... /usr/bin/安装-c 检查构建环境是否正常...是的 检查arm-apple-darwin-strip...没有 检查条带...条带 配置:警告:使用不以主机三元组为前缀的交叉工具 检查线程安全 mkdir -p... ./install-sh -c -d 检查是否呆呆...没有 检查 mawk...没有 检查 nawk...没有 检查 awk...awk 检查 make 是否设置 $(MAKE)... 是 检查是否启用 Makefile 的维护者特定部分...否 检查构建系统类型...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 编译器是否工作...不 配置:错误:在 /Users/chencyz/Desktop/Development/Misc/fftw3/fftw-3.3' 中: 配置:错误:C 编译器无法创建可执行文件 有关更多详细信息,请参阅
config.log'
我不太清楚问题(C 编译器不起作用?),任何人都可以给我一些指南,非常感谢!
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':
config.log' for more details
configure: error: C compiler cannot create executables
See
I'm not so clear about the problem(C compiler not works?),could anyone give me some guides,thanks very much !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据 ./configure --help:
所以关键是传递 --host=arm-apple-darwin10,并使用对 PATH、CFLAGS、LDFLAGS 等的正确更改来执行配置。
这似乎有效:
祝你好运。
According to ./configure --help:
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:
Good luck.
当我尝试为 iOS 进行可爱编译时,我遇到了类似的问题。查看配置脚本,它似乎没有使用
$LDFLAGS
变量,但如果使用了,我认为您可以将以下内容添加到configure
行: code>$SDKROOT 默认情况下为
/Developer/Platforms/iPhone.platform/Developer/SDKs/iPhone5.0.sdk
(使用 iOS 5.0 SDK)。我从来没有得到过可爱的编译,因为我不知道如何纠正 C 编译器调用,但是,您的情况可能会有所不同。
I had a similar issue when trying to get cute compiled for iOS. Looking at the configure script, it didn't seem to use the
$LDFLAGS
variable, but if it did I think you could add the following to theconfigure
line:Where
$SDKROOT
is/Developer/Platforms/iPhone.platform/Developer/SDKs/iPhone5.0.sdk
by default (with the iOS 5.0 SDK).I never got cute compiled as I couldn't figure out how to correct the C-compiler invocation, however, your mileage may vary.