Installing gcc with OpenMP support on Mac using homebrew has no effect

One way to install gcc with openMP support on OSX uses Homebrew . However, when I follow the usual instructions

brew reinstall gcc --without-multilib

This gives me a warning that there is no formula matching the --without-multilib , and therefore this will have no effect. Therefore, after this reinstallation process, I do not have openMP support. Here is a detailed terminal output.

 poulin8:02-prange-parallel-loops poulingroup$ brew --version Homebrew 1.3.6 Homebrew/homebrew-core (git revision b5afc; last commit 2017-10-27) poulin8:02-prange-parallel-loops poulingroup$ brew reinstall gcc --without-multilib ==> Reinstalling gcc Warning: gcc: this formula has no --without-multilib option so it will be ignored! ==> Downloading https://homebrew.bintray.com/bottles/gcc-7.2.0.el_capitan.bottle Already downloaded: /Users/poulingroup/Library/Caches/Homebrew/gcc-7.2.0.el_capitan.bottle.tar.gz ==> Pouring gcc-7.2.0.el_capitan.bottle.tar.gz 🍺 /usr/local/Cellar/gcc/7.2.0: 1,486 files, 289.8MB poulin8:02-prange-parallel-loops poulingroup$ 

After including omp.h in the file and compiling, I get an error message

 julia.c:447:10: fatal error: 'omp.h' file not found #include <omp.h> ^ 1 error generated. error: command 'cc' failed with exit status 1 

Can someone help me with installing gcc on OSX with OpenMP support?

+4
source share
1 answer

If you can replace clang for gcc, I was able to get clang to compile OpenMP programs quite easily. I built the latest version of LLVM / clang and used homebrew to install libomp via brew install libomp .

The full steps were something like this:

 mkdir omp_clang && cd omp_clang git clone https://github.com/llvm-mirror/llvm.git -b release_60 git clone https://github.com/llvm-mirror/clang.git llvm/tools/clang -b release_60 mkdir build && cd build cmake ../llvm make brew install libomp ./bin/clang -fopenmp=libomp ~/openmp_program.c 
0
source

Source: https://habr.com/ru/post/1272948/


All Articles