如何在iOS上编译fftw3

发布于 2024-12-11 03:15:19 字数 1487 浏览 0 评论 0原文

现在我只想在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':
configure: error: C compiler cannot create executables
See
config.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 !

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

套路撩心 2024-12-18 03:15:19

根据 ./configure --help:

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

所以关键是传递 --host=arm-apple-darwin10,并使用对 PATH、CFLAGS、LDFLAGS 等的正确更改来执行配置。

这似乎有效:

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

祝你好运。

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.

夜还是长夜 2024-12-18 03:15:19

当我尝试为 iOS 进行可爱编译时,我遇到了类似的问题。查看配置脚本,它似乎没有使用 $LDFLAGS 变量,但如果使用了,我认为您可以将以下内容添加到 configure

./configure CC=... CFLAGS="-arch armv7 -isysroot $SDKROOT" CXXFLAGS="$CFLAGS" LDFLAGS="$CFLAGS -Wl,-syslibroot $SDKROOT"

: 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 the configure line:

./configure CC=... CFLAGS="-arch armv7 -isysroot $SDKROOT" CXXFLAGS="$CFLAGS" LDFLAGS="$CFLAGS -Wl,-syslibroot $SDKROOT"

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文