<p dir="auto">I already have LLVM installed. I'd rather not download, configure, compile, and install a duplicate LLVM, wasting several hours. I realize that it's an incredible help to do this automatically for Julia users, but for those that already have LLVM version Whatever, could the Makefiles be modified to only install LLVM if it's not already on the system? E.g. <code class="notranslate">which llvm-gcc</code>.</p>
<p dir="auto">Currently, you can only access global variables by a combination of <code class="notranslate">dlsym</code> and <code class="notranslate">dlopen</code>: <code class="notranslate">convert(Ptr{T}, dlsym(dlopen("libname"), "varname"))</code>.  Not only is this ugly, but it will also make things difficult for future static compilation (where we would like to directly link any needed shared libraries with <code class="notranslate">ld</code>, rather than requiring them to be dlopened at runtime).</p>
<p dir="auto">I'd like to suggest a <code class="notranslate">cglobal(symbol, T=Void)</code> intrinsic, returning a <code class="notranslate">Ptr{T}</code>, that mirrors <code class="notranslate">ccall(symbol, ...)</code>.   That is, the <code class="notranslate">symbol</code> argument could be a symbol, a <code class="notranslate">(symbol,library)</code> pair, or a pointer returned by <code class="notranslate">dlsym</code> (although in that case cglobal wouldn't do much, just a typecast).</p>
<p dir="auto">(See <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="5207689" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/961" data-hovercard-type="issue" data-hovercard-url="/JuliaLang/julia/issues/961/hovercard" href="https://github.com/JuliaLang/julia/issues/961">#961</a> for some pre-history of this problem.)</p>