File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1
1
# Copyright (c) 2023 ING Analytics Wholesale Banking
2
2
import importlib .metadata
3
+ import os
4
+
5
+ # Setting the following environment variable allows multiple OpenMP
6
+ # libraries to be loaded. This is also used without issue by Scikit-learn.
7
+ # OpenMP error msg:
8
+ # /* OMP: Error #15: Initializing libomp.dylib, but found libomp.dylib already initialized.
9
+ # * OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program.
10
+ # * That is dangerous, since it can degrade performance or cause incorrect results.
11
+ # * The best thing to do is to ensure that only a single OpenMP runtime is linked into the process,
12
+ # * e.g. by avoiding static linking of the OpenMP runtime in any library.
13
+ # * As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE
14
+ # * to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results.
15
+ # * For more information, please see http://openmp.llvm.org/
16
+ # */
17
+ os .environ .setdefault ("KMP_DUPLICATE_LIB_OK" , "True" )
18
+
19
+ # Workaround issue discovered in intel-openmp 2019.5:
20
+ # https://github.com/ContinuumIO/anaconda-issues/issues/11294
21
+ os .environ .setdefault ("KMP_INIT_AT_FORK" , "FALSE" )
3
22
4
23
__version__ = importlib .metadata .version ("sparse_dot_topn" )
5
24
from sparse_dot_topn .api import awesome_cossim_topn , sp_matmul , sp_matmul_topn , zip_sp_matmul_topn
You can’t perform that action at this time.
0 commit comments