Xcode 5和更高版本中的OpenMP支持 [英] OpenMP Support in Xcode 5 and later

查看:53
本文介绍了Xcode 5和更高版本中的OpenMP支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个量子力学C ++代码的专有库(> 150,000行),该库依赖于OpenMP进行并行化.该代码过去可以使用Xcode 4.6及其' real GCC编译器很好地进行编译,但是Xcode 5附带的LLVM编译器似乎不支持OpenMP.我的代码是在Mac上开发的,但是需要移植到非Apple硬件(例如大规模并行超级计算机)上,因此无法重写代码.有人知道可以使用合适的编译器吗?非常感谢您的帮助.

I have a proprietary library (>150,000 lines) of quantum mechanics C++ code that relies on OpenMP for parallisation. This code used to compile fine with Xcode 4.6 and its' real GCC compiler, but the LLVM compiler that ships with Xcode 5 doesn't seem to support OpenMP. My code is developed on a Mac but needs to be portable to non-Apple hardware such as massively parallel supercomputers, so re-writing the code is not an option. Does anyone know of a suitable compiler that can be used? Many thanks for any help.

推荐答案

当我测试hpc.sourceforge.net时,我从评论中回来了,它对我来说就像是一种魅力.

I come back from my comment as I tested hpc.sourceforge.net and it is working like a charm for me.

只需按以下说明解压缩存档文件即可:

Simply untar the archive as explained:

sudo tar -xvf gcc-4.8-bin.tar -C /

根据需要将.profile更新为默认使用gcc的hpc编译版本.

Update your .profile to use by default the hpc compiled version of gcc if you want.

使用-fopenmp选项编译程序,然后将其与-lgomp选项链接.

Compile your program with option -fopenmp then link it with option -lgomp.

这篇关于Xcode 5和更高版本中的OpenMP支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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