2
2
3
3
# # dummy stub for https://github.com/JuliaBinaryWrappers/OpenBLAS_jll.jl
4
4
baremodule OpenBLAS_jll
5
- using Base, Libdl, CompilerSupportLibraries_jll, Base. BinaryPlatforms
5
+ using Base, Libdl, Base. BinaryPlatforms
6
+
7
+ # We are explicitly NOT loading this at runtime, as it contains `libgomp`
8
+ # which conflicts with `libiomp5`, breaking things like MKL. In the future,
9
+ # we hope to transition to a JLL interface that provides a more granular
10
+ # interface than eagerly dlopen'ing all libraries provided in the JLL
11
+ # which will eliminate issues like this, where we avoid loading a JLL
12
+ # because we don't want to load a library that we don't even use yet.
13
+ # using CompilerSupportLibraries_jll
14
+ # Because of this however, we have to manually load the libraries we
15
+ # _do_ care about, namely libgfortran
6
16
Base. Experimental. @compiler_options compile= min optimize= 0 infer= false
7
17
8
18
const PATH_list = String[]
25
35
26
36
if Sys. iswindows ()
27
37
const libopenblas = " libopenblas$(libsuffix) .dll"
38
+ const _libgfortran = string (" libgfortran-" , libgfortran_version (HostPlatform ()). major, " .dll" )
28
39
elseif Sys. isapple ()
29
40
const libopenblas = " @rpath/libopenblas$(libsuffix) .dylib"
41
+ const _libgfortran = string (" @rpath/" , " libgfortran." , libgfortran_version (HostPlatform ()). major, " .dylib" )
30
42
else
31
43
const libopenblas = " libopenblas$(libsuffix) .so"
44
+ const _libgfortran = string (" libgfortran.so." , libgfortran_version (HostPlatform ()). major)
32
45
end
33
46
34
47
function __init__ ()
@@ -50,6 +63,10 @@ function __init__()
50
63
ENV [" OPENBLAS_DEFAULT_NUM_THREADS" ] = " 1"
51
64
end
52
65
66
+ # As mentioned above, we are sneaking this in here so that we don't have to
67
+ # depend on CSL_jll and load _all_ of its libraries.
68
+ dlopen (_libgfortran)
69
+
53
70
global libopenblas_handle = dlopen (libopenblas)
54
71
global libopenblas_path = dlpath (libopenblas_handle)
55
72
global artifact_dir = dirname (Sys. BINDIR)
0 commit comments