brew install clang-omp not working
Solution 1
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
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)
Solution 2
Install a deleted formula
brew install homebrew/boneyard/clamp-omp
OR
brew tap homebrew/boneyard
brew install clang-omp
Reference: https://superuser.com/questions/1110414/install-a-deleted-homebrew-formulae/1110934#1110934
Then you need to set the environment:
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
Solution 3
clang-omp has been boneyarded. See this commit: https://github.com/Homebrew/homebrew-core/commit/c57e30773:
clang-omp: migrate to boneyard
Functionality is now available as part of LLVM in Homebrew. So just install llvm
Solution 4
OpenMP was officially included in the brew (before the method, either install llvm, or outdated clang-omp).
brew install libomp
Related videos on Youtube
mtazzari
Updated on April 12, 2020Comments
-
mtazzari about 4 years
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.
I am wondering whether clang-omp is still provided by brew. Or am I doing something wrong? Any ideas?
Edit: 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
Thus, no evidence of clang-omp. Is it possible I have to change repository or something like this?
-
Hristo Iliev almost 8 yearsHave you updated the
brew
recipes by callingbrew update
first? -
mtazzari almost 8 years@HristoIliev Yes, I did it. Just to be sure, I have re-done it right now (I have updated Homebrew from 87173cb to 984ed83) but still clang-omp is not found (I get the same error above).
-
Jim Cownie almost 8 yearsLLVM 3.8 and later should support OpenMP "out of the box". Therefore there should no longer be any need to have a specific, different, clang-omp...
-
Mark Setchell almost 8 yearsYou could use
gcc v6
to compile C++ with OpenMP. You can install withbrew install gcc --without-multilib
-
Mark Setchell almost 8 years@JimCownie How would you compile C++11 compliant
main.cpp
which uses OpenMP with LLVM please - what would be the full command-line? -
冯剑龙 about 5 yearsyou can reference to link macappstore.org/clang-omp
-
-
Piyush Chauhan over 7 yearsIt says
omp.h
doesn't exists. Is it possible if you could provide an example, will be very helpful as i'm struggling to get it work with openmp. -
slek120 over 7 years@PiyushChauhan If I run
make
using the makefile in the answer, it would run/usr/local/opt/llvm/bin/clang -I/usr/local/opt/llvm/include -fopenmp example.c -o example -L/usr/local/opt/llvm/include
-
coatless over 7 yearsNice copy & paste of the deleted formula part from superuser.com/a/1110934/429046 without credit.
-
Microos over 7 years@coatless Sorry, I just want to help. Hope you won't mind.
-
coatless over 7 yearsJust give credit where credit is due, especially if you copy wording...
-
coatless over 7 yearsAlso, you may wish to remove the <formula> in the first example in favor of clamp-omp
-
SumNeuron almost 7 yearsthis doesnt work when you have to use an older command lines tools
-
Sander W. van der Laan over 6 yearsI've just install
llvm
usingbrew install llvm
. Still, the program I want to use (LDSTORE) is not working, statingdyld: Library not loaded: /usr/local/opt/libiomp/lib/libiomp5.dylib
. How do I make sure that it is properly loaded? Where do I do this? -
gaelgarcia about 6 yearsWhat is the optional symlink step for?
ln -s /usr/local/opt/llvm/bin/clang /usr/local/bin/clang-omp
-
slek120 about 6 yearsThe symlink is to put it in your path. I added the
-omp
to separate it from defaultclang
and because it used to be calledclang-omp
in brew. -
gbrennon over 5 yearsI think this doesnt work anymore... We cant use brew tap anymore