@@ -60,21 +60,29 @@ function __init__()
60
60
# we only support working with the copy of LLVM that Julia uses, because we have
61
61
# additional library calls compiled in the Julia binary which cannot be used with
62
62
# another copy of LLVM. loading multiple copies of LLVM typically breaks anyhow.
63
- libllvm_paths = filter (Libdl. dllist ()) do lib
64
- occursin (r" LLVM\b " , basename (lib))
63
+ libllvm[] = if VERSION >= v " 1.6.0-DEV.1356"
64
+ path = Base. libllvm ()
65
+ if path === nothing
66
+ error (""" Cannot find the LLVM library loaded by Julia.
67
+ Please use a version of Julia that has been built with USE_LLVM_SHLIB=1 (like the official binaries).
68
+ If you are, please file an issue and attach the output of `Libdl.dllist()`.""" )
69
+ end
70
+ String (path)
71
+ else
72
+ libllvm_paths = filter (Libdl. dllist ()) do lib
73
+ occursin (r" LLVM\b " , basename (lib))
74
+ end
75
+ if isempty (libllvm_paths)
76
+ error (""" Cannot find the LLVM library loaded by Julia.
77
+ Please use a version of Julia that has been built with USE_LLVM_SHLIB=1 (like the official binaries).
78
+ If you are, please file an issue and attach the output of `Libdl.dllist()`.""" )
79
+ end
80
+ if length (libllvm_paths) > 1
81
+ error (""" Multiple LLVM libraries loaded by Julia.
82
+ Please file an issue and attach the output of `Libdl.dllist()`.""" )
83
+ end
84
+ first (libllvm_paths)
65
85
end
66
- if isempty (libllvm_paths)
67
- error ("""
68
- Cannot find the LLVM library loaded by Julia.
69
- Please use a version of Julia that has been built with USE_LLVM_SHLIB=1 (like the official binaries).
70
- If you are, please file an issue and attach the output of `Libdl.dllist()`.""" )
71
- end
72
- if length (libllvm_paths) > 1
73
- error ("""
74
- Multiple LLVM libraries loaded by Julia.
75
- Please file an issue and attach the output of `Libdl.dllist()`.""" )
76
- end
77
- libllvm[] = first (libllvm_paths)
78
86
79
87
@debug " Using LLVM $(version ()) at $(Libdl. dlpath (libllvm[])) "
80
88
if version () != = runtime_version ()
0 commit comments