Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,27 @@ OpenMP on MacOS
These instructions are a bit old and only if you are not using conda as
discussed above.

The default clang compiler available on MacOS uses an LLVM backend and does
The default clang compiler available on MacOS uses an LLVM backend and does
not support OpenMP_ out of the box. There are two ways to support OpenMP. The
first involves installing the OpenMP support for clang. This can be done with
brew_ using::

$ brew install libomp

Once that is done, it should "just work". If you get strange errors, try
setting the ``MACOSX_DEPLOYMENT_TARGET`` as shown in the previous section.
`LLVM <https://formulae.brew.sh/formula/llvm>`_ can also be installed using
brew_, likewise. Once this is done, you
can use the following config_::

import os
os.environ['CC'] = '/opt/homebrew/opt/llvm@15/bin/clang'
os.environ['CXX'] = '/opt/homebrew/opt/llvm@15/bin/clang++'
OMP_CFLAGS=['-I/opt/homebrew/opt/libomp/include', '-I/opt/homebrew/opt/llvm@15/include', '-Xclang', '-fopenmp']
OMP_LINK=['-L/opt/homebrew/opt/libomp/lib', '-L/opt/homebrew/opt/llvm@15/lib', '-lomp']

The above config assumes that you have installed `llvm@15`. You can change the
config according to the version at the time of installing. Once that is done,
it should "just work". If you get strange errors, you can also try
setting the ``MACOSX_DEPLOYMENT_TARGET`` as shown in the previous section.

Another option is to install GCC for MacOS available on brew_ using ::

Expand Down
Loading