File tree 3 files changed +12
-6
lines changed 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -16,9 +16,6 @@ if [[ "$UNAMESTR" == "Darwin" ]]; then
16
16
export CXXFLAGS=" $CXXFLAGS -I/usr/local/opt/libomp/include"
17
17
export LDFLAGS=" $LDFLAGS -L/usr/local/opt/libomp/lib -lomp"
18
18
export DYLD_LIBRARY_PATH=/usr/local/opt/libomp/lib
19
-
20
- # avoid error due to multiple OpenMP libraries loaded simultaneously
21
- export KMP_DUPLICATE_LIB_OK=TRUE
22
19
fi
23
20
24
21
make_conda () {
Original file line number Diff line number Diff line change 38
38
export CXXFLAGS=" $CXXFLAGS -I/usr/local/opt/libomp/include"
39
39
export LDFLAGS=" $LDFLAGS -L/usr/local/opt/libomp/lib -lomp"
40
40
export DYLD_LIBRARY_PATH=/usr/local/opt/libomp/lib
41
-
42
- # avoid error due to multiple OpenMP libraries loaded simultaneously
43
- export KMP_DUPLICATE_LIB_OK=TRUE
44
41
fi
45
42
46
43
make_conda () {
Original file line number Diff line number Diff line change 16
16
import re
17
17
import warnings
18
18
import logging
19
+ import os
19
20
20
21
from ._config import get_config , set_config , config_context
21
22
47
48
__version__ = '0.21.dev0'
48
49
49
50
51
+ # On OSX, we can get a runtime error due to multiple OpenMP libraries loaded
52
+ # simultaneously. This can happen for instance when calling BLAS inside a
53
+ # prange. Setting the following environment variable allows multiple OpenMP
54
+ # libraries to be loaded. It should not degrade performances since we manually
55
+ # take care of potential over-subcription performance issues, in sections of
56
+ # the code where nested OpenMP loops can happen, by dynamically reconfiguring
57
+ # the inner OpenMP runtime to temporarily disable it while under the scope of
58
+ # the outer OpenMP parallel section.
59
+ os .environ .setdefault ("KMP_DUPLICATE_LIB_OK" , "True" )
60
+
61
+
50
62
try :
51
63
# This variable is injected in the __builtins__ by the build
52
64
# process. It is used to enable importing subpackages of sklearn when
You can’t perform that action at this time.
0 commit comments