brew install clang-omp无法正常工作

mta*_*ari 22 homebrew openmp clang osx-elcapitan

我需要在Mac上使用OpenMP编译C++代码.不幸的是,Mac上安装的默认版本的clang(703.0.31)不支持OpenMP.因此,我正在尝试使用brew安装clang-omp包(例如,遵循指南).问题是brew找不到libiomp,也找不到clang-omp包:

$ brew install clang-omp
Error: No available formula with the name "clang-omp"
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
Error: No formulae found in taps.
Run Code Online (Sandbox Code Playgroud)

我想知道clang-omp是否仍由brew提供.或者我做错了什么?有任何想法吗?

编辑:如果我做brew搜索,我得到以下内容:

$ brew search clang
clang-format           emacs-clang-complete-async
Caskroom/cask/openclonk-c54d917-darwin-amd64-clang
Run Code Online (Sandbox Code Playgroud)

因此,没有铿锵的证据.我是否有必要更改存储库或类似的东西?

sle*_*120 31

您可以使用brew安装llvm,因为它现在包含openmp.

brew install llvm
Run Code Online (Sandbox Code Playgroud)

如果需要,您可以创建符号链接

ln -s /usr/local/opt/llvm/bin/clang /usr/local/bin/clang-omp
Run Code Online (Sandbox Code Playgroud)

我的makefile看起来像这样

CPP = /usr/local/opt/llvm/bin/clang
CPPFLAGS = -I/usr/local/opt/llvm/include -fopenmp
LDFLAGS = -L/usr/local/opt/llvm/lib

example: example.c
    $(CPP) $(CPPFLAGS) $^ -o $@ $(LDFLAGS)
Run Code Online (Sandbox Code Playgroud)


Mic*_*oos 11

安装已删除的公式

brew install homebrew/boneyard/clamp-omp
Run Code Online (Sandbox Code Playgroud)

要么

brew tap homebrew/boneyard
brew install clang-omp
Run Code Online (Sandbox Code Playgroud)

参考:https://superuser.com/questions/1110414/install-a-deleted-homebrew-formulae/1110934#1110934

然后你需要设置环境:

export C_INCLUDE_PATH=/usr/local/Cellar/libiomp/20150401/include/libiomp:$C_INCLUDE_PATH

export CPLUS_INCLUDE_PATH=/usr/local/Cellar/libiomp/!date!/include/libiomp:$CPLUS_INCLUDE_PATH

export LIBRARY_PATH=/usr/local/Cellar/libiomp/!date!/lib:$LIBRARY_PATH
Run Code Online (Sandbox Code Playgroud)

  • @coatless对不起,我只是想帮忙.希望你不介意. (3认同)

小智 8

clang-omp已被保管.请参阅此提交:https://github.com/Homebrew/homebrew-core/commit/c57e30773:

clang-omp:迁移到boneyard

功能现在可作为Homebrew中LLVM的一部分提供. 所以只需安装llvm

  • 我刚刚使用“ brew install llvm”安装了“ llvm”。仍然,我要使用的程序([LDSTORE](http://www.christianbenner.com/#))无法正常工作,并声明`dyld:库未加载:/ usr / local / opt / libiomp / lib / libiomp5 .dylib`。如何确保已正确加载?我在哪里做? (3认同)