Install OpenMP in MacOS : Cannot find gcc option –without-multilib

I want to install OpenMP in my MacOS system, and there are plenty of tutorials about how to install OpenMP. Unfortunately, most of them cannot work on my computer. We I try to use  brew reinstall gcc –without-multilib ,the –without-multilib  Option seems not be well supported.

Warning: gcc: this formula has no --without-multilib option so it will be ignored!
brew options gcc
        Build just-in-time compiler
        Build with native language support (localization)
        Install HEAD version

I still do not know why this happens, may be caused by the newer MacOS, but we can use another approach mentions in  Clang + OpenMP Setup in macOS

Firstly, we use brew install llvm  to install llvm. In my system clang & clang++ was installed into /usr/local/opt/llvm/bin and be overlapped by original clang , We use the soft link to create an alias of new clang.

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

The openmp then works in my computer, we can use  clang-omp++ main.cpp -o main -fopenmp to compile an openmp program.


您的电子邮箱地址不会被公开。 必填项已用*标注