Repository navigation
Commit 302b63b
Fix macOS OpenMP duplicate-runtime abort in homebrew build
esys libs were compiled with llvm clang's -fopenmp (linking
.../opt/llvm/lib/libomp.dylib) while their openblas dependency links the
standalone 'libomp' formula (.../opt/libomp/lib/libomp.dylib). Loading two
different libomp.dylib files in one process triggers "OMP: Error #15 ...
already initialized" and an Abort trap: 6 at the first parallel region, so
examples crash under plain python3 (run-escript only papered over it with
KMP_DUPLICATE_LIB_OK=TRUE).
Put the libomp-formula lib dir first in ld_extra so the -lomp added by
-fopenmp resolves to the same physical runtime openblas uses, leaving one
OpenMP runtime in the process. Paths use HOMEBREW_PREFIX so the fix works on
both Apple Silicon (/opt/homebrew) and Intel (/usr/local).
Also drop the redundant -lz from ld_extra (zlib is already linked via
zlib_libs=['z']) to silence "ld: warning: ignoring duplicate libraries: '-lz'".
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent b5a51db commit 302b63b
1 file changed
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
174 | 189 | | |
175 | 190 | | |
176 | 191 | | |
| |||
0 commit comments