brew install clang-omp无法正常工作 [英] brew install clang-omp not working

查看:564
本文介绍了brew install clang-omp无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I need to compile a C++ code with OpenMP on my Mac. Unfortunately the default version of clang installed on the Mac (703.0.31) does not support OpenMP. Therefore, I am trying to install the clang-omp package with brew (e.g., following this guide). The issue is that brew cannot find neither the libiomp, nor the clang-omp package:

$ 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.

我想知道brew是否仍然提供clang-omp.还是我做错了什么?有什么想法吗?

I am wondering whether clang-omp is still provided by brew. Or am I doing something wrong? Any ideas?

如果我进行搜索搜索,则会得到以下信息:

If I do brew search I get the following:

$ brew search clang
clang-format           emacs-clang-complete-async
Caskroom/cask/openclonk-c54d917-darwin-amd64-clang

因此,没有clang-omp的证据.我可能需要更改存储库或类似的东西吗?

Thus, no evidence of clang-omp. Is it possible I have to change repository or something like this?

推荐答案

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

You can install llvm using brew since it now includes openmp.

brew install llvm

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

You can make a symlink if you want

ln -s /usr/local/opt/llvm/bin/clang /usr/local/bin/clang-omp

我的makefile看起来像这样

My makefile looks like this

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)

这篇关于brew install clang-omp无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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