File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Original file line number Diff line number Diff line change @@ -286,11 +286,38 @@ Set the following environment variables:
286
286
287
287
export CC=/usr/bin/clang
288
288
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
+
289
302
export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp"
290
303
export CFLAGS="$CFLAGS -I/usr/local/opt/libomp/include"
291
304
export CXXFLAGS="$CXXFLAGS -I/usr/local/opt/libomp/include"
292
305
export LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/local/opt/libomp/lib -L/usr/local/opt/libomp/lib -lomp"
293
306
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
+
294
321
Finally, build scikit-learn in verbose mode (to check for the presence of the
295
322
``-fopenmp `` flag in the compiler commands):
296
323
You can’t perform that action at this time.
0 commit comments