5
votes

I tried to install openmp in OS 10.12.6 following the instructions given here https://www.quora.com/How-do-I-Install-OpenMP-on-Mac-10-11-6

but the simple command

brew install clang-omp

did not work and I got the error

Error: No available formula with the name "clang-omp".

Then following the instructions contained here

brew install clang-omp not working

I tried to reinstall llvm by doing

brew reinstall llvm

and the installation was successful but I see no trace of omp. If I try to compile with g++ or gcc a simple program including <omp.h> and compiling with the -fopenmp flag I get

clang: error: unsupported option '-fopenmp'

even if I checked that in other cases it has worked (Enable OpenMP support in clang in Mac OS X (sierra)).

I've tried to look for openmp in mac port as well but I haven't managed to find it. Thank you for your help.

1
Here how to force Apple's clang to support OpenMP: stackoverflow.com/a/47230419/3419533 - Alexey Bataev
It seems that almost all existing solutions don't work anymore. brew install gcc --without-multilib doesn't work anymore either. - Vortexfive
You just need to install llvm now. See my answer to the question you cited. - Dirk

1 Answers

3
votes

You need a recent version of llvm and libomp which you can get with

brew install llvm
brew install libomp