GLMakie and Plots fail to precompile under Julia 1.8.4

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.

I have the same thing. In my env precompilation errors for these packages:

  ✗ HarfBuzz_jll
  ✗ libass_jll
  ✗ Pango_jll
  ✗ Cairo
  ✗ FFMPEG_jll
  ✗ FFMPEG
  ✗ GR_jll
  ✗ Makie
  ✗ Plots
  ✗ GLMakie
  ✗ CairoMakie

Unfortunately, I was not able to make sense of the stacktraces, to narrow down the problem.

1 Like

Yes, I get precompilation errors for those as well. I didn’t know which errors are most significant.

Seeing the list of *_dll that failed recompiling, I remind of my own problem earlier -
https://discourse.julialang.org/t/cygwin-mishap-with-julia-1-9-0-alpha1-plots-dlopen-cant-open-libcairo-2-dll/91179

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 again @giordano for the tip)

Hope it could help,

1 Like

I did the same (update to Julia 1.8.4) and got the same type of errors when trying to use Makie and CairoMakie, under Windows 11 Professionnel 64-bit:

Blockquote
julia> using CairoMakie
[ Info: Precompiling CairoMakie [13f3f980-e62b-5c42-98c6-ff1f3baf88f0]
ERROR: LoadError: InitError: could not load library “C:\Users\lesnoff.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\lesnoff.julia\packages\JLLWrappers\QpMQW\src\products\library_generators.jl:54 [inlined]

Blockquote
Precompiling project…
✗ HarfBuzz_jll
✗ libass_jll
✗ Pango_jll
✗ Cairo
✗ FFMPEG_jll
✗ FFMPEG
✗ Makie
✗ CairoMakie
✗ GLMakie
62 dependencies successfully precompiled in 62 seconds. 190 already precompiled.
9 dependencies errored. To see a full report either run import Pkg; Pkg.precompile() or load the packages

When I used DependencyWalker, I got:

Blockquote
Library(raw"C:\Users\lesnoff.julia\artifacts\3aff78028a0bb2ad40ebc3ae7e465a52dcbe2730\bin\libcairo-2.dll")
:black_medium_square: C:\Users\lesnoff.julia\artifacts\3aff78028a0bb2ad40ebc3ae7e465a52dcbe2730\bin\libcairo-2.dll
✗ libpixman-1-0.dll (NOT FOUND)
:black_medium_square: C:\WINDOWS\System32\USER32.dll
:black_medium_square: C:\WINDOWS\System32\win32u.dll
:black_medium_square: C:\WINDOWS\System32\GDI32.dll
:black_medium_square: C:\WINDOWS\System32\win32u.dll
:black_medium_square: C:\WINDOWS\System32\KERNELBASE.dll
:black_medium_square: C:\Users\lesnoff\AppData\Local\Programs\Julia-1.8.4\bin\libgcc_s_seh-1.dll
:black_medium_square: C:\Users\lesnoff\AppData\Local\Programs\Julia-1.8.4\bin\libwinpthread-1.dll
:black_medium_square: C:\WINDOWS\System32\msvcrt.dll
:black_medium_square: C:\WINDOWS\System32\KERNELBASE.dll
:black_medium_square: C:\WINDOWS\System32\KERNEL32.DLL
:black_medium_square: C:\WINDOWS\System32\KERNELBASE.dll
:black_medium_square: C:\WINDOWS\System32\msvcrt.dll
:black_medium_square: C:\WINDOWS\System32\KERNELBASE.dll
:black_medium_square: C:\WINDOWS\System32\KERNEL32.DLL
:black_medium_square: C:\WINDOWS\System32\KERNELBASE.dll
✗ MSIMG32.dll (NOT FOUND)
:black_medium_square: C:\WINDOWS\System32\GDI32.dll
:black_medium_square: C:\WINDOWS\System32\win32u.dll
✗ libssp-0.dll (NOT FOUND)
:black_medium_square: C:\WINDOWS\System32\msvcrt.dll
:black_medium_square: C:\WINDOWS\System32\KERNELBASE.dll
✗ libfontconfig-1.dll (NOT FOUND)
✗ libfreetype-6.dll (NOT FOUND)
:black_medium_square: C:\WINDOWS\System32\KERNEL32.DLL
:black_medium_square: C:\WINDOWS\System32\KERNELBASE.dll
✗ libpng16.dll (NOT FOUND)
:black_medium_square: C:\Users\lesnoff\AppData\Local\Programs\Julia-1.8.4\bin\libz.dll
:black_medium_square: C:\WINDOWS\System32\msvcrt.dll
:black_medium_square: C:\WINDOWS\System32\KERNELBASE.dll
:black_medium_square: C:\WINDOWS\System32\KERNEL32.DLL
:black_medium_square: C:\WINDOWS\System32\KERNELBASE.dll

Did you find a solution to fix the problem?
Is there a way to know if it comes locally from my computer or if it is a more general problem?

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.

2 Likes

Same for me, it worked after adding Julia to path.
Thanks @tt1234567 !

So I have a couple of Julia versions through juliaup and 1.8.3 works ok without adding to path.

DependencyWalker shows that 1.8.4 can’t find libcairo-2.dll although the file is exactly where Julia is searching for it.

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).

1 Like

@staticfloat or @giordano, any idea what could be going on here?

In my case running Julia with admin privileges and precompiling failed in the same way.

Adding the trace from DpendencyWalker for the puroptedly missing libcairo-2.dll

◼ C:\Users\Marcin\.julia\artifacts\3aff78028a0bb2ad40ebc3ae7e465a52dcbe2730\bin\libcairo-2.dll
  ◼ C:\Users\Marcin\.julia\artifacts\6a5456c156251deff41ae40ac8dfbb3d8c808ffe\bin\libpixman-1-0.dll
    ◼ C:\users\Marcin\.julia\juliaup\julia-1.8.4+0.x64.w64.mingw32\bin\libgcc_s_seh-1.dll
      ◼ C:\users\Marcin\.julia\juliaup\julia-1.8.4+0.x64.w64.mingw32\bin\libwinpthread-1.dll
        ◼ C:\WINDOWS\System32\msvcrt.dll
          ◼ C:\WINDOWS\System32\KERNELBASE.dll
        ◼ C:\WINDOWS\System32\KERNEL32.DLL
          ◼ C:\WINDOWS\System32\KERNELBASE.dll
      ◼ C:\WINDOWS\System32\msvcrt.dll
        ◼ C:\WINDOWS\System32\KERNELBASE.dll
      ◼ C:\WINDOWS\System32\KERNEL32.DLL
        ◼ C:\WINDOWS\System32\KERNELBASE.dll
    ◼ C:\WINDOWS\System32\msvcrt.dll
      ◼ C:\WINDOWS\System32\KERNELBASE.dll
    ◼ C:\WINDOWS\System32\KERNEL32.DLL
      ◼ C:\WINDOWS\System32\KERNELBASE.dll
  ◼ C:\WINDOWS\System32\USER32.dll
    ◼ C:\WINDOWS\System32\win32u.dll
    ◼ C:\WINDOWS\System32\GDI32.dll
      ◼ C:\WINDOWS\System32\win32u.dll
    ◼ C:\WINDOWS\System32\KERNELBASE.dll
  ◼ C:\users\Marcin\.julia\juliaup\julia-1.8.4+0.x64.w64.mingw32\bin\libgcc_s_seh-1.dll
    ◼ C:\users\Marcin\.julia\juliaup\julia-1.8.4+0.x64.w64.mingw32\bin\libwinpthread-1.dll
      ◼ C:\WINDOWS\System32\msvcrt.dll
        ◼ C:\WINDOWS\System32\KERNELBASE.dll
      ◼ C:\WINDOWS\System32\KERNEL32.DLL
        ◼ C:\WINDOWS\System32\KERNELBASE.dll
    ◼ C:\WINDOWS\System32\msvcrt.dll
      ◼ C:\WINDOWS\System32\KERNELBASE.dll
    ◼ C:\WINDOWS\System32\KERNEL32.DLL
      ◼ C:\WINDOWS\System32\KERNELBASE.dll
  ✗ MSIMG32.dll (NOT FOUND)
  ◼ C:\WINDOWS\System32\GDI32.dll
    ◼ C:\WINDOWS\System32\win32u.dll
  ✗ libssp-0.dll (NOT FOUND)
  ◼ C:\WINDOWS\System32\msvcrt.dll
    ◼ C:\WINDOWS\System32\KERNELBASE.dll
  ◼ C:\Users\Marcin\.julia\artifacts\c916a560fa109a4db3d6938a8ab1a6a8b4a09731\bin\libfontconfig-1.dll
    ◼ C:\users\Marcin\.julia\juliaup\julia-1.8.4+0.x64.w64.mingw32\bin\libgcc_s_seh-1.dll
      ◼ C:\users\Marcin\.julia\juliaup\julia-1.8.4+0.x64.w64.mingw32\bin\libwinpthread-1.dll
        ◼ C:\WINDOWS\System32\msvcrt.dll
          ◼ C:\WINDOWS\System32\KERNELBASE.dll
        ◼ C:\WINDOWS\System32\KERNEL32.DLL
          ◼ C:\WINDOWS\System32\KERNELBASE.dll
      ◼ C:\WINDOWS\System32\msvcrt.dll
        ◼ C:\WINDOWS\System32\KERNELBASE.dll
      ◼ C:\WINDOWS\System32\KERNEL32.DLL
        ◼ C:\WINDOWS\System32\KERNELBASE.dll
    ◼ C:\WINDOWS\System32\msvcrt.dll
      ◼ C:\WINDOWS\System32\KERNELBASE.dll
    ◼ C:\Users\Marcin\.julia\artifacts\5af028f5ee6fc5d6923b4769eca4bc199914e6bd\bin\libfreetype-6.dll
      ◼ C:\WINDOWS\System32\msvcrt.dll
        ◼ C:\WINDOWS\System32\KERNELBASE.dll
      ◼ C:\WINDOWS\System32\KERNEL32.DLL
        ◼ C:\WINDOWS\System32\KERNELBASE.dll
      ◼ C:\users\Marcin\.julia\juliaup\julia-1.8.4+0.x64.w64.mingw32\bin\libz.dll
        ◼ C:\WINDOWS\System32\msvcrt.dll
          ◼ C:\WINDOWS\System32\KERNELBASE.dll
        ◼ C:\WINDOWS\System32\KERNEL32.DLL
          ◼ C:\WINDOWS\System32\KERNELBASE.dll
    ◼ C:\WINDOWS\System32\KERNEL32.DLL
      ◼ C:\WINDOWS\System32\KERNELBASE.dll
    ◼ C:\Users\Marcin\.julia\artifacts\41eb25ea50f277f03154d52354602687fb1abc84\bin\libexpat-1.dll
      ◼ C:\WINDOWS\System32\msvcrt.dll
        ◼ C:\WINDOWS\System32\KERNELBASE.dll
      ◼ C:\WINDOWS\System32\KERNEL32.DLL
        ◼ C:\WINDOWS\System32\KERNELBASE.dll
  ◼ C:\Users\Marcin\.julia\artifacts\5af028f5ee6fc5d6923b4769eca4bc199914e6bd\bin\libfreetype-6.dll
    ◼ C:\WINDOWS\System32\msvcrt.dll
      ◼ C:\WINDOWS\System32\KERNELBASE.dll
    ◼ C:\WINDOWS\System32\KERNEL32.DLL
      ◼ C:\WINDOWS\System32\KERNELBASE.dll
    ◼ C:\users\Marcin\.julia\juliaup\julia-1.8.4+0.x64.w64.mingw32\bin\libz.dll
      ◼ C:\WINDOWS\System32\msvcrt.dll
        ◼ C:\WINDOWS\System32\KERNELBASE.dll
      ◼ C:\WINDOWS\System32\KERNEL32.DLL
        ◼ C:\WINDOWS\System32\KERNELBASE.dll
  ◼ C:\WINDOWS\System32\KERNEL32.DLL
    ◼ C:\WINDOWS\System32\KERNELBASE.dll
  ◼ C:\Users\Marcin\.julia\artifacts\72037f1415327f12277eed0521c861517630a0ba\bin\libpng16.dll
    ◼ C:\WINDOWS\System32\msvcrt.dll
      ◼ C:\WINDOWS\System32\KERNELBASE.dll
    ◼ C:\WINDOWS\System32\KERNEL32.DLL
      ◼ C:\WINDOWS\System32\KERNELBASE.dll
    ◼ C:\users\Marcin\.julia\juliaup\julia-1.8.4+0.x64.w64.mingw32\bin\libz.dll
      ◼ C:\WINDOWS\System32\msvcrt.dll
        ◼ C:\WINDOWS\System32\KERNELBASE.dll
      ◼ C:\WINDOWS\System32\KERNEL32.DLL
        ◼ C:\WINDOWS\System32\KERNELBASE.dll
  ◼ C:\users\Marcin\.julia\juliaup\julia-1.8.4+0.x64.w64.mingw32\bin\libz.dll
    ◼ C:\WINDOWS\System32\msvcrt.dll
      ◼ C:\WINDOWS\System32\KERNELBASE.dll
    ◼ C:\WINDOWS\System32\KERNEL32.DLL
      ◼ C:\WINDOWS\System32\KERNELBASE.dll
1 Like

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.

@mkoculak - what SHA do you get for the file? I get with Get-Filehash libcairo-2.dll:

Algorithm       Hash
---------       ----
SHA256          E8CEB27E95360359940069E6B20413C78779BC55DB398B369E5A3811E3D86B41

If for you it is the same then it is indeed strange that it does not work for you if you run Julia with admin privileges.

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.

Anything else to narrow down the problem?

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.

1 Like

yes I found MSIMG32.dll in my system.

What happened in my case:

  • I have used Makie from 1.7…, until 1.8.3, without adding Julia in the path, without any problem.
  • I installed 1.8.4 and got the problem.
  • I uninstalled 1.8.4
  • I re-installed it wih activating the button “Adding Julia to path”
  • It worked.
    I don’t know why it was working with 1.8.3 and not with 1.8.4.
    Thanks

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(...)

dlopen(joinpath(CompilerSupportLibraries_jll.artifact_dir, "bin", "libssp-0.dll"))
Ptr{Nothing} @0x00007fffdf6c0000

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.

1 Like

In case it’s significant, I tried the following straight after starting Julia

using CompilerSupportLibraries_jll, Libdl
dlopen("MSIMG32.dll")
Ptr{Nothing} @0x00007fffc3090000
dlopen("libssp-0.dll")
Ptr{Nothing} @0x00007fffdf6c0000

After that, using Cairo_jll doesn’t give any errors and Library(raw"C:\Users\ .... \libcairo-2.dll") doesn’t come up with any missing dll’s.

2 Likes