Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9af8da6

Browse filesBrowse files
committed
31359: add Documentation improvement for macOS Homebrew libomp installation
1 parent efe3b63 commit 9af8da6
Copy full SHA for 9af8da6

File tree

Expand file treeCollapse file tree

1 file changed

+27
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+27
-0
lines changed

‎doc/developers/advanced_installation.rst

Copy file name to clipboardExpand all lines: doc/developers/advanced_installation.rst
+27Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,38 @@ Set the following environment variables:
286286

287287
export CC=/usr/bin/clang
288288
export CXX=/usr/bin/clang++
289+
290+
Next, configure flags for OpenMP. The specific paths for ``libomp`` depend on your
291+
Mac's architecture as Homebrew uses different installation prefixes. You can find the
292+
correct paths by running the following command:
293+
294+
.. prompt:: bash $
295+
296+
brew --prefix libomp
297+
298+
For Intel-based Macs
299+
300+
.. prompt:: bash $
301+
289302
export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp"
290303
export CFLAGS="$CFLAGS -I/usr/local/opt/libomp/include"
291304
export CXXFLAGS="$CXXFLAGS -I/usr/local/opt/libomp/include"
292305
export LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/local/opt/libomp/lib -L/usr/local/opt/libomp/lib -lomp"
293306

307+
For Apple Silicon Macs
308+
309+
.. prompt:: bash $
310+
311+
export CPPFLAGS="-I/opt/homebrew/opt/libomp/include"
312+
export LDFLAGS="-L/opt/homebrew/opt/libomp/lib"
313+
314+
.. prompt:: bash $
315+
316+
export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp"
317+
export CFLAGS="$CFLAGS -I/opt/homebrew/opt/libomp/include"
318+
export CXXFLAGS="$CXXFLAGS -I/opt/homebrew/opt/libomp/include"
319+
export LDFLAGS="$LDFLAGS -Wl,-rpath,/opt/homebrew/opt/libomp/lib -L/opt/homebrew/opt/libomp/lib -lomp"
320+
294321
Finally, build scikit-learn in verbose mode (to check for the presence of the
295322
``-fopenmp`` flag in the compiler commands):
296323

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.