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.
我想知道clang-omp是否仍由brew提供.或者我做错了什么?有任何想法吗?
编辑:如果我做brew搜索,我得到以下内容:
$ brew search clang
clang-format           emacs-clang-complete-async
Caskroom/cask/openclonk-c54d917-darwin-amd64-clang
因此,没有铿锵的证据.我是否有必要更改存储库或类似的东西?
sle*_*120 31
您可以使用brew安装llvm,因为它现在包含openmp.
brew install llvm
如果需要,您可以创建符号链接
ln -s /usr/local/opt/llvm/bin/clang /usr/local/bin/clang-omp
我的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)
Mic*_*oos 11
安装已删除的公式
brew install homebrew/boneyard/clamp-omp
要么
brew tap homebrew/boneyard
brew install clang-omp
参考: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
小智 8
clang-omp已被保管.请参阅此提交:https://github.com/Homebrew/homebrew-core/commit/c57e30773:
clang-omp:迁移到boneyard
功能现在可作为Homebrew中LLVM的一部分提供. 所以只需安装llvm