Today I updated to Julia 1.8.4 but GLMakie and Plots bothe fail to precompile. The first error that occurs is similar in both cases and refers to \libcairo-2.dll, eg:
using GLMakie
[ Info: Precompiling GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a]
ERROR: LoadError: InitError: could not load library "C:\Users\xxxxx\.julia\artifacts\3aff78028a0bb2ad40ebc3ae7e465a52dcbe2730\bin\libcairo-2.dll"
The specified module could not be found.
Stacktrace:
[1] dlopen(s::String, flags::UInt32; throw_error::Bool)
@ Base.Libc.Libdl .\libdl.jl:117
[2] dlopen(s::String, flags::UInt32)
@ Base.Libc.Libdl .\libdl.jl:116
[3] macro expansion
@ C:\Users\xxxxx\.julia\packages\JLLWrappers\QpMQW\src\products\library_generators.jl:54 [inlined]
[4] __init__()
@ Cairo_jll C:\Users\xxxxx\.julia\packages\Cairo_jll\HW4xi\src\wrappers\x86_64-w64-mingw32.jl:18
[5] _include_from_serialized(pkg::Base.PkgId, path::String, depmods::Vector{Any})
@ Base .\loading.jl:831
[6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt64)
@ Base .\loading.jl:1039
...
I’m using Windows 10. I tried deleting my entire .julia folder but it didn’t help.
You could try to use @giordano suggestion to debug the problem, see in the above thread :
Instead, try this:
]add DependencyWalker Cairo_jll
using DependencyWalker
using Cairo_jll # This will fail, it's ok, but it's needed to load the dependencies
Library("C:\\Users\\davidj\\.julia\\artifacts\\3aff78028a0bb2ad40ebc3ae7e465a52dcbe2730\\bin\\libcairo-2.dll")
This should hopefully show what modules cannot be found.
Thanks! DependencyWalker helped diagnose the problem: the libssp-0.dll file wasn’t found. Julia 1.8.3 happily finds this in AppData\Local\Programs\Julia-1.8.3\bin\ but for some reason Julia 1.8.4 doesn’t find it in AppData\Local\Programs\Julia-1.8.4\bin\. When I’ve installed Julia on Windows in the past I’ve never ticked the “Add Julia to PATH” box because I prefer not to clutter up my PATH unless it’s necessary but reinstalling with that option has solved the problem.
I’ve no idea why Julia suddenly needs to be on my Windows PATH when it didn’t before. It seems to me that there’s a danger of dll’s getting confused if you have different versions of Julia installed.
I used the windows installer and had the same problem so I don’t think it’s because of juliaup. I don’t fully understand these things but I thought that Windows usually looks for dll’s in the executable directory before searching the PATH so it seems a bit mysterious that the new version doesn’t find them when the old one did.
This is an issue with access privileges (I had the same problem on my machine).
You need to start your terminal with administrator privileges and then precompile the packages.
@StefanKarpinski - this is exactly the kind of issue I have raised some time ago on Slack (and we agreed that I will ping you when this issue happens again).
These type of errors are tricky and the error messages don’t help. The problem is normally related to finding a dependent lib that does not have a certain symbol and the message makes think that it’s the entire shared lib that was not found. Whatever it is, I could not reproduce it, even by having no Julia in PATH.
Agreed, bu note that error messages come from the operating system, that’s why I had to write DependencyWalker.jl: operating systems, basically all of them, don’t tell you which libraries can’t be loaded even though they know it since they just looked for them.
@mkoculak@tt1234567@matnbo or anyone else who can reproduce this problem, without running julia with admin priviliges, do you have the file joinpath(CompilerSupportLibraries_jll.artifact_dir, "bin", "libssp-0.dll") (you need to have the CompilerSupportLibraries_jll package loaded to to do this). If so, can you do
using CompilerSupportLibraries_jll, Libdl
dlopen(joinpath(CompilerSupportLibraries_jll.artifact_dir, "bin", "libssp-0.dll"))
? If so, I have no clue why libssp-0.dll can’t be loaded automatically.
Also, do note that MSIMG32.dll is a Windows system library, if it can’t be found we can do next to nothing about it. Do you have it in your system? I mentioned elsewhere that this library should be part of the Microsoft Graphical Device Interface (GDI), do you have this component in your system?
Thanks for the suggestion, got the same hash, so probably this one is just erroring downstream.
mentioned command goes through and prints:
Ptr{Nothing} @0x00007ffb24430000
I have msimg32.dll in System32 and SysWOW64 and some other places, so should be reachable by Julia. Trying the dlopen command on it also returns a pointer with no errors.
Not that I know of. On Linux and FreeBSD systems I’d use the LD_DEBUG=all environment variable to debug why a library can’t be loaded, I have no idea of what kind of debugging tools Windows offers.
I uninstalled 1.8.4, made sure the install directory was deleted and reinstalled without the add Julia to PATH checked. The problem returned. libssp-0.dll is definitely in the bin directory but DependencyWalker reports it and MSIMG32.dll as missing. The latter is definitely under C:\Windows\System32 (actually lower case msimg32.dll). I then ran dlopen(...)
The problem is reproducible on my machine. Very strange that it apparently can’t find a dll that’s in the executable’s launch directory but I haven’t much experience of loading dll’s after program start-up.