@@ -110,15 +110,27 @@ OpenMP on MacOS
110110These instructions are a bit old and only if you are not using conda as
111111discussed 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
114114not support OpenMP _ out of the box. There are two ways to support OpenMP. The
115115first involves installing the OpenMP support for clang. This can be done with
116116brew _ 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
123135Another option is to install GCC for MacOS available on brew _ using ::
124136
0 commit comments