OSX 10.11上的OpenMP支持,“没有找到文件omp.h”的gcc错误 [英] OpenMP support on OSX 10.11, gcc errors with "file omp.h not found"

查看:166
本文介绍了OSX 10.11上的OpenMP支持,“没有找到文件omp.h”的gcc错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用gcc版本5.3.0。它说它带有openmp支持。但每当我使用gcc [通过终端]或通过xCode 7编译程序时,我都会得到同样的错误,找不到文件omp.h。我在这个问题上搜索得太多,并尝试几乎所有我发现的东西。




  • 首先,我尝试在我的Mac上找到omp.h。我找到了一些文件;然后在头文件中,我使用omp.h的特定位置,但没有帮助[它给了我链接器错误]。
  • 我安装了gcc版本6.0(预发布版),但没有帮助。我尝试更改C_INCLUDE_PATH [现在是,之前设置为none],但这对我也没有帮助。
  • 我重新安装了clang-omp,但没有任何帮助。

  • 我正在使用llvm编译器7.0版本。虽然我已经安装了clang-omp,但是在我的/ usr / include / *


解决方案我改变了编译器,现在我可以运行它了。 [这是铿锵声,我无法解决]。
我是学生,英特尔正在英特尔Parallel Studio
> 免费给学生使用> 1年的许可证
所以我下载并安装了它。
在xCode中,在编译设置下,我将编译器设置为'Intel C / C ++编译器',并且在并行化中,我将它转换为'yes'。就是这样。然后它编译成功。但是,请注意,您将不再使用头文件'omp.h'。
顺便说一句,我仍在寻找答案,只是为了知道我做错了什么。


I have been using gcc version 5.3.0. It says that it comes with openmp support. But every time when I compile a program using either gcc [by terminal] or via xCode 7, I get same error, "file omp.h not found". I have searched too much on this issue and tried almost everything I found.

  • First I tried to locate omp.h on my mac. I found some files; then in header file, I used that specific location of omp.h but no help [it gave me linker error].
  • I installed gcc version 6.0 (pre-release) but no help. I tried changing C_INCLUDE_PATH [which is now, and previously set to none] but that didn't helped me as well.
  • I reinstalled clang-omp but no help.
  • I am using llvm compiler version 7.0. Although i have installed clang-omp, there is no omp.h in my /usr/include/*

解决方案

I changed the compiler and now I am able to run it. [It was issue of clang, which I couldn't solve]. I am a student and Intel is giving Intel Parallel Studio 1 year licence for free to students. So I downloaded, and installed it. In xCode, under build settings, I set my compiler to 'Intel C/C++ compiler' and in parallalization, I turned it to 'yes'. That was it. Then it compiled successfully. But, note that you won't be using header file 'omp.h' anymore. By the way, I am still looking for answers, just to know what I was doing wrong.

这篇关于OSX 10.11上的OpenMP支持,“没有找到文件omp.h”的gcc错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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