Skip to content

Commit 868990d

Browse files
Merge pull request #119 from nauaneed/master2main
doc: omp install on macos
2 parents e53cc0d + 5ecb6c9 commit 868990d

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

docs/source/installation.rst

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,27 @@ OpenMP on MacOS
110110
These instructions are a bit old and only if you are not using conda as
111111
discussed above.
112112

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

118118
$ brew install libomp
119119

120-
Once that is done, it should "just work". If you get strange errors, try
121-
setting the ``MACOSX_DEPLOYMENT_TARGET`` as shown in the previous section.
120+
`LLVM <https://formulae.brew.sh/formula/llvm>`_ can also be installed using
121+
brew_, likewise. Once this is done, you
122+
can use the following config_::
123+
124+
import os
125+
os.environ['CC'] = '/opt/homebrew/opt/llvm@15/bin/clang'
126+
os.environ['CXX'] = '/opt/homebrew/opt/llvm@15/bin/clang++'
127+
OMP_CFLAGS=['-I/opt/homebrew/opt/libomp/include', '-I/opt/homebrew/opt/llvm@15/include', '-Xclang', '-fopenmp']
128+
OMP_LINK=['-L/opt/homebrew/opt/libomp/lib', '-L/opt/homebrew/opt/llvm@15/lib', '-lomp']
129+
130+
The above config assumes that you have installed `llvm@15`. You can change the
131+
config according to the version at the time of installing. Once that is done,
132+
it should "just work". If you get strange errors, you can also try
133+
setting the ``MACOSX_DEPLOYMENT_TARGET`` as shown in the previous section.
122134

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

0 commit comments

Comments
 (0)