Installing GLMakie on Linux fails

I did:

mkdir glmakie
cd glmakie
julia --project="."

and then in Julia

using Pkg
Pkg.add("GLMakie")

This results in the following error:

julia> err
PkgPrecompileError: The following 1 direct dependency failed to precompile:

GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a]

Failed to precompile GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a] to "/home/ufechner/.julia/compiled/v1.10/GLMakie/jl_zBkn6i".
Failed to load plugin: '/lib/x86_64-linux-gnu/libpango-1.0.so.0: undefined symbol: hb_ot_color_has_paint'
No plugins found, falling back on no decorations
┌ Warning:     GLFW couldn't create an OpenGL window.
│     This likely means, you don't have an OpenGL capable Graphic Card,
│     or you don't have an OpenGL 3.3 capable video driver installed.
│     Have a look at the troubleshooting section in the GLMakie readme:
│     https://github.com/MakieOrg/Makie.jl/tree/master/GLMakie#troubleshooting-opengl.
└ @ GLMakie ~/.julia/packages/GLMakie/ebMDx/src/screen.jl:250
ERROR: LoadError: GLFWError (API_UNAVAILABLE): EGL: Failed to get EGL display: Success
Stacktrace:
  [1] _ErrorCallbackWrapper(code::Int32, description::Cstring)
    @ GLFW ~/.julia/packages/GLFW/BWxfF/src/callback.jl:43
  [2] CreateWindow(width::Int64, height::Int64, title::String, monitor::GLFW.Monitor, share::GLFW.Window)
    @ GLFW ~/.julia/packages/GLFW/BWxfF/src/glfw3.jl:499
  [3] GLFW.Window(; name::String, resolution::Tuple{Int64, Int64}, debugging::Bool, major::Int64, minor::Int64, windowhints::Vector{Tuple{UInt32, Integer}}, contexthints::Vector{Tuple{UInt32, Integer}}, visible::Bool, focus::Bool, fullscreen::Bool, monitor::Nothing, share::GLFW.Window)
    @ GLFW ~/.julia/packages/GLFW/BWxfF/src/glfw3.jl:344
  [4] Window
    @ ~/.julia/packages/GLFW/BWxfF/src/glfw3.jl:302 [inlined]
  [5] empty_screen(debugging::Bool; reuse::Bool)
    @ GLMakie ~/.julia/packages/GLMakie/ebMDx/src/screen.jl:241
  [6] empty_screen
    @ ~/.julia/packages/GLMakie/ebMDx/src/screen.jl:222 [inlined]
  [7] singleton_screen(debugging::Bool)
    @ GLMakie ~/.julia/packages/GLMakie/ebMDx/src/screen.jl:329
  [8] macro expansion
    @ ~/.julia/packages/GLMakie/ebMDx/src/precompiles.jl:21 [inlined]
  [9] macro expansion
    @ ~/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:78 [inlined]
 [10] macro expansion
    @ ~/.julia/packages/GLMakie/ebMDx/src/precompiles.jl:18 [inlined]
 [11] macro expansion
    @ ~/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:140 [inlined]
 [12] top-level scope
    @ ~/.julia/packages/GLMakie/ebMDx/src/precompiles.jl:16
 [13] include(mod::Module, _path::String)
    @ Base ./Base.jl:495
 [14] include(x::String)
    @ GLMakie ~/.julia/packages/GLMakie/ebMDx/src/GLMakie.jl:1
 [15] top-level scope
    @ ~/.julia/packages/GLMakie/ebMDx/src/GLMakie.jl:89
 [16] include
    @ ./Base.jl:495 [inlined]
 [17] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2222
 [18] top-level scope
    @ stdin:3
in expression starting at /home/ufechner/.julia/packages/GLMakie/ebMDx/src/precompiles.jl:15
in expression starting at /home/ufechner/.julia/packages/GLMakie/ebMDx/src/GLMakie.jl:1
in expression starting at stdin:3
xkbcommon: ERROR: couldn't find a Compose file for locale "en_US.UTF-8" (mapped to "en_US.UTF-8")
GLFWError (PLATFORM_ERROR): Wayland: Failed to create XKB compose table
Stacktrace:
 [1] _ErrorCallbackWrapper(code::Int32, description::Cstring)
   @ GLFW ~/.julia/packages/GLFW/BWxfF/src/callback.jl:43
 [2] Terminate()
   @ GLFW ~/.julia/packages/GLFW/BWxfF/src/glfw3.jl:443
 [3] _atexit(exitcode::Int32)
   @ Base ./initdefs.jl:428
 [4] exit
   @ ./initdefs.jl:28 [inlined]
 [5] exec_options(opts::Base.JLOptions)
   @ Base ./client.jl:323
 [6] _start()
   @ Base ./client.jl:552

julia> 

Output of versioninfo():

julia> versioninfo()
Julia Version 1.10.4
Commit 48d4fd48430 (2024-06-04 10:41 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × AMD Ryzen 7 7840U w/ Radeon  780M Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
Threads: 1 default, 0 interactive, 1 GC (on 16 virtual cores)

Any idea?

This seams to be the relevant error:

Failed to load plugin: '/lib/x86_64-linux-gnu/libpango-1.0.so.0: undefined symbol: hb_ot_color_has_paint'

Installing GLMakie on this machine worked fine a few days ago. And it still works on Ubuntu 22.04, but not on Ubuntu 24.04 any more.

2 Likes

I don’t know if its related, by I had a similar issue and managed to solve it with some of the solutions described here. The problem was solved adding a symbolic link to the library libstdc++.so.6, but I am not sure if we are seeing the same thing here.

1 Like

Deleting libstdc++.so and libstdc++.so.6 did not solve the issue.

But did you create a symbolic link on the folder where you deleted those files to the system libraries? I had to do that in addition of removing them to get this working.

I think this old issue is long resolved and the old workaround does not fix my problem.

I created a simpler testcase:

julia> using GLFW
xkbcommon: ERROR: couldn't find a Compose file for locale "en_US.UTF-8" (mapped to "en_US.UTF-8")
┌ Warning: GLFW.GLFWError(GLFW.PLATFORM_ERROR, "Wayland: Failed to create XKB compose table")
└ @ GLFW ~/.julia/packages/GLFW/BWxfF/src/GLFW.jl:32

julia> GLFW.Window()
ERROR: GLFWError (API_UNAVAILABLE): EGL: Failed to get EGL display: Success
Stacktrace:
 [1] _ErrorCallbackWrapper(code::Int32, description::Cstring)
   @ GLFW ~/.julia/packages/GLFW/BWxfF/src/callback.jl:43
 [2] CreateWindow(width::Int64, height::Int64, title::String, monitor::GLFW.Monitor, share::GLFW.Window)
   @ GLFW ~/.julia/packages/GLFW/BWxfF/src/glfw3.jl:499
 [3] GLFW.Window(; name::String, resolution::Tuple{…}, debugging::Bool, major::Int64, minor::Int64, windowhints::Vector{…}, contexthints::Vector{…}, visible::Bool, focus::Bool, fullscreen::Bool, monitor::Nothing, share::GLFW.Window)
   @ GLFW ~/.julia/packages/GLFW/BWxfF/src/glfw3.jl:344
 [4] GLFW.Window()
   @ GLFW ~/.julia/packages/GLFW/BWxfF/src/glfw3.jl:302
 [5] top-level scope
   @ REPL[5]:1
Some type information was truncated. Use `show(err)` to see complete types.

julia> 

Any idea?

What happens if you downgrade GLFW_jll to v3.3.9 with ]add GLFW_jll@3.3.9?

This sounds to me like you’re somehow loading some system libraries.

I hazard a guess that GLMakie might have a dependency that depends on your system’s libpango.so, and another dependency that depends on libpango.so shipped through the artifacts. Updating your OS then might have caused an incompatibility.

At least I faced a similar problem recently with Vulkan.jl and GLFW.jl, where the former one wanted to use the system’s libxcb.so, whereas the latter relied on one shipped through Xorg_libxcb_jll.
The solution was to upgrade Xorg_libxcb_jll in Yggdrasil.

FWIW I updated GLFW recently and that caused issues on OSX: GLMakie GLFWError macOS icons · Issue #3997 · MakieOrg/Makie.jl · GitHub
So I’d also recommend downgrading to GLFW_jll 3.3.9 to see if that works.

About the first warning you see when using GLFW, here’s a relevant FAQ: xkbcommon FAQ · davatorium/rofi Wiki · GitHub
Could you check in your /usr/share/X11/locale directory to see if there’s a directory in there for en_US.UTF-8? If it’s there then we might be building xkbcommon incorrectly in Yggdrasil, otherwise you’ll probably need to install those keyboard compose files from the Ubuntu repos (I’m not sure what they’re packaged under).

This fixed the issue.

For the record:

I had to add the following lines to Project.toml to make it work:

[deps]
GLFW_jll = "0656b61e-2033-5cc2-a64a-77c0f6c09b89"

[compat]
GLFW_jll = "=3.3.9"

1 Like

Nitpicky question: did you need to make those additions by hand or did the suggestion of

work as given by @giordano?

If you have the Pkg REPL, ] add GLFW_jll@3.3.9 should be sufficient. It will denote the the version in your Manifest.toml rather than configuring compat in your Project.toml.

The following should be sufficient.

julia> using Pkg

julia> Pkg.add(name="GLFW_jll", version="3.3.9")

julia> Pkg.pin("GLFW_jll")
1 Like

Well, this is not sufficient because I create a system image (the script I use to create the system image deletes any existing Manifest.toml file), and I also release my packages that depend on GLMakie and users must be able to install them without extra steps.

For example I created a new release of KiteControllers.jl with a fixed version of GLFW_jll in KiteControllers.jl/Project.toml at main · aenarete/KiteControllers.jl · GitHub

2 Likes

I ran into the same issue. I also pinned GLFW_jll to =3.3.9

1 Like

I’ve been able to track this down to the new Wayland support in GLFW v3.4, and I can avoid the issue after I modify GLFW.jl to explicitly prefer using the X11 backend on Linux.

I’ve submitted what I’ve done to workaround the issue myself as Add new `InitHint` API and constants & use on Linux to prefer X11 by jmert · Pull Request #238 · JuliaGL/GLFW.jl · GitHub

3 Likes