openmp 使用的 fftw3 配置问题
我正在尝试在 mac os Lion 下使用 openmp 选项编译 fftw3。 正如 http://www.fftw.org/release-notes.html 中所公开的,我用以下 命令行 ./configure --enable-openmp
配置在以下行停止: 检查 C 编译器的 OpenMP 标志...未知 配置:错误:不知道如何启用 OpenMP
我知道 xcode 提供了 openmp,但我不知道如何将其提供给配置选项,有人可以帮助我吗?我已经在其他程序中成功使用 openmp 了。
我希望这是足够的信息来帮助我。
谢谢,
注意: 我有 Xcode 4.2、gcc 4.2.1。
在 config.log 的“输出变量”部分中,我发现:
CFLAGS='-O3 -fomit-frame-pointer -mtune=native -fstrict-aliasing -ffast-math'
失败似乎是(在 config.log 中):
configure:18427: gcc -std=gnu99 -o conftest conftest.c -lm >&5
体系结构 x86_64 的未定义符号:
“_omp_set_num_threads”,引用自 _ccfUItzL.o 中的主目录
ld:未找到架构 x86_64 的符号
collect2: ld 返回 1 退出状态
配置:18427:$? = 1
配置:失败的程序是: /.../
I am trying to compile fftw3 with the openmp option under mac os Lion.
As exposed in http://www.fftw.org/release-notes.html, I use the following
command line
./configure --enable-openmp
The configure stops at the line:
checking for OpenMP flag of C compiler... unknown
configure: error: don't know how to enable OpenMP
I know that openmp is given with xcode but I don't know how to give it to configure option, does anybody can help me please? I have already succeed in using openmp in other programs.
I hope this is enough information for helping me.
Thank you,
Note:
I have Xcode 4.2, gcc 4.2.1.
In the section "Output variables" of config.log, I find:
CFLAGS='-O3 -fomit-frame-pointer -mtune=native -fstrict-aliasing -ffast-math'
The failure seems to be (in the config.log):
configure:18427: gcc -std=gnu99 -o conftest conftest.c -lm >&5
Undefined symbols for architecture x86_64:
"_omp_set_num_threads", referenced from
_main in ccfUItzL.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
configure:18427: $? = 1
configure: failed program was:
/.../
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
仔细观察,我认为我不明白 fftw3 的 openmp 配置测试应该如何工作。
编辑配置脚本;将两次出现的
omp_set_num_threads()
替换为omp_get_num_threads()
并以./configure --enable-openmp
重新运行配置。完成此操作后,似乎可以在使用 Lion 和 Xcode 4.2.1 的 Macbook Pro 上构建并通过 make check 中的大部分测试。请记住,gcc 4.2 的 OpenMP 支持不是很好或性能不佳,因此您可能无法通过这种方式充分利用 fftw3 的多核。
Looking closely, I don't think I understand how fftw3's configure test for openmp is supposed to work.
Edit the configure script; replace the two occurances of
omp_set_num_threads()
toomp_get_num_threads()
and re-run the configure as./configure --enable-openmp
. Having done that, it seems to build and pass most of the tests in make check on my Macbook Pro with Lion and Xcode 4.2.1.Keep in mind that gcc 4.2's OpenMP support wasn't very good or performant, so you may not get the most out of your multicores with fftw3 this way.