苹果叮当声-fopenmp无法正常工作 [英] apple clang -fopenmp not working
问题描述
我正在尝试将openmp与Apple clang一起使用,但无法使其正常工作.我确实从llvm下载并编译了openmp库.我的问题是clang无法识别-fopenmp
标志.我收到以下错误:
I am trying to use openmp with Apple clang but can't make it work. I did download and compile the openmp library from llvm. My problem is that clang doesn't recognize the -fopenmp
flag. I get the following error:
clang: error: unsupported option '-fopenmp'
我有Xcode和Clang的版本8.任何帮助将不胜感激.
I have version 8 of Xcode and clang. Any help would be much appreciated.
推荐答案
据我到目前为止的了解,xcode附带的clang不支持openmp.另外,版本也不同.因此,xcode 8随附的clang具有版本8 ...
From what I learned so far is that clang that comes with xcode does not support openmp. Also, the versions are different. So clang that comes with xcode 8 has version 8...
到目前为止,我找到的最好的解决方案是使用自制软件brew install llvm --with-clang
安装clang.现在我有了3.9.0版本,它确实支持openmp,因此可以解决我的问题.
The best solution I have found so far is to install clang using homebrew: brew install llvm --with-clang
. Right now I got version 3.9.0 and it does support openmp, so it solves my problem.
这篇关于苹果叮当声-fopenmp无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!