Debug - Multiple copies of the OpenMP runtime
Problem
1 | import numpy as np |
1 | OMP: Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already initialized. OMP: Hint This means that multiple copies of the OpenMP runtime have been since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see [http://www.intel.com/software/products/support/](http://www.intel.com/software/products/support/). |
Solution
A common solution to this bug is to set the environment variable KMP_DUPLICATE_LIB_OK=TRUE
. But it is unsafe!
The root cause is static linking of the OpenMP runtime in different library is in different version. Finally, I use pip install numpy=1.26.4 and scipy=1.14.0 and everything goes well.
- Title: Debug - Multiple copies of the OpenMP runtime
- Author: Maple
- Created at : 2024-07-30 11:31:05
- Updated at : 2024-07-30 15:58:15
- Link: https://www.maple367.eu.org/Code/Python/debug-multiple-copies-of-the-openmp-runtime/
- License: This work is licensed under CC BY-NC-SA 4.0.
Comments