# Could not load library libGL.so.1

**URL:** https://discourse.julialang.org/t/could-not-load-library-libgl-so-1/52340
**Category:** New to Julia
**Created:** [December 24, 2020, 8:08pm UTC](https://discourse.julialang.org/t/could-not-load-library-libgl-so-1/52340 "2020-12-24T20:08:58Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Peter\_Adelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peter_adelman/32/11907_2.png) [@Peter\_Adelman](https://discourse.julialang.org/u/Peter_Adelman)
#### Post date: [December 24, 2020, 8:08pm UTC](https://discourse.julialang.org/t/could-not-load-library-libgl-so-1/52340/1 "2020-12-24T20:08:58Z")

</div>

GR.jl depends on GR\_jll.jl depends on Qt\_jll.jl

I am getting an error when I try to make a sysimage in a CentOS 7 container (x86\_64 gnu linux) while behind a firewall, seemingly from [this line](https://github.com/JuliaBinaryWrappers/Qt_jll.jl/blob/main/src/wrappers/x86_64-linux-gnu-cxx11.jl#L63):

```julia
ERROR: InitError: could not load library "/root/.julia/artifacts/d293cd24045ea10c3c6c81ca2dddd060feca711c/lib/libQt53DAnimation.so"
libGL.so.1: cannot open shared object file: No such file or directory
Stacktrace:
 [1] dlopen(::String, ::UInt32; throw_error::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Libdl/src/Libdl.jl:109
 [2] dlopen(::String, ::UInt32) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Libdl/src/Libdl.jl:109
 [3] macro expansion at /root/.julia/packages/JLLWrappers/KuIwt/src/products/library_generators.jl:61 [inlined]
 [4] __init__ () at /root/.julia/packages/Qt_jll/CXLZo/src/wrappers/x86_64-linux-gnu-cxx11.jl:63
 [5] _include_from_serialized(::String, ::Array{Any,1}) at ./loading.jl:697
 [6] _require_from_serialized(::String) at ./loading.jl:749
 [7] _require(::Base.PkgId) at ./loading.jl:1040
 [8] require(::Base.PkgId) at ./loading.jl:928
 [9] require(::Module, ::Symbol) at ./loading.jl:923
during initialization of module Qt_jll

--- long import statement ---

Stacktrace:
 [1] pipeline_error at ./process.jl:525 [inlined]
 [2] read(::Cmd) at ./process.jl:412
 [3] read(::Cmd, ::Type{String}) at ./process.jl:421
 [4] do_ensurecompiled(::String, ::Array{String,1}, ::String) at /root/.julia/packages/PackageCompiler/KeZOk/src/PackageCompiler.jl:194
 [5] create_sysimg_object_file(::String, ::Array{String,1}; project::String, base_sysimage::String, precompile_execution_file::Array{String,1}, precompile_statements_file::Array{String,1}, cpu_target::String, script::Nothing, isapp::Bool) at /root/.julia/packages/PackageCompiler/KeZOk/src/PackageCompiler.jl:261
 [6] create_sysimage(::Array{Symbol,1}; sysimage_path::Nothing, project::String, precompile_execution_file::String, precompile_statements_file::Array{String,1}, incremental::Bool, filter_stdlibs::Bool, replace_default::Bool, cpu_target::String, script::Nothing, base_sysimage::Nothing, isapp::Bool) at /root/.julia/packages/PackageCompiler/KeZOk/src/PackageCompiler.jl:443
...

```

I think that libQt53DAnimations.so depends on libGL.so.1, which is included in [Libglvnd\_jll.jl](https://juliapackages.com/packages/libglvnd_jll) and is not part of the Qt\_jll.jl artifacts tree, right?

Is this just a dependency bug?

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [December 24, 2020, 9:12pm UTC](https://discourse.julialang.org/t/could-not-load-library-libgl-so-1/52340/2 "2020-12-24T21:12:04Z")

</div>

> [@Peter\_Adelman](#):
>
> Is this just a dependency bug?

Yes. @barche 🙂

---

<div class="post-metadata">

### Author: ![barche](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barche/32/79_2.png) [@barche](https://discourse.julialang.org/u/barche)
#### Post date: [December 26, 2020, 12:28pm UTC](https://discourse.julialang.org/t/could-not-load-library-libgl-so-1/52340/3 "2020-12-26T12:28:45Z")

</div>

So it works if you add Libglvnd\_jll manually then? If so, we should probably add this as a real dependency instead of a build dependency. My assumption when building Qt was that it would always be used on a system that has an OpenGL driver installed. I’m not sure anymore if this causes problems at runtime on Linux systems that do have a proper OpenGL setup, though.

Note that the OpenGL stuff is needed only for QML.jl, not for GR, but Qt is a monolithic package so all of this stuff gets dragged in anyway.

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [December 26, 2020, 12:31pm UTC](https://discourse.julialang.org/t/could-not-load-library-libgl-so-1/52340/4 "2020-12-26T12:31:46Z")

</div>

> [@barche](#):
>
> My assumption when building Qt was that it would always be used on a system that has an OpenGL driver installed.

A few weeks ago this caused me quite some headaches trying to understand what was going on in a system without opengl already installed: [`LibraryProduct` doesn't point to library with soname · Issue #23 · JuliaPackaging/JLLWrappers.jl · GitHub](https://github.com/JuliaPackaging/JLLWrappers.jl/issues/23)

---

<div class="post-metadata">

### Author: ![Peter\_Adelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peter_adelman/32/11907_2.png) [@Peter\_Adelman](https://discourse.julialang.org/u/Peter_Adelman)
#### Post date: [December 26, 2020, 12:37pm UTC](https://discourse.julialang.org/t/could-not-load-library-libgl-so-1/52340/5 "2020-12-26T12:37:11Z")

</div>

> [@barche](#):
>
> So it works if you add Libglvnd\_jll manually then?

I added this to my dockerfile before the sysimage build to install libGL.so.

```julia
RUN yum install -y mesa-libGL-devel.x86_64

```

This fixed it, so not through the normal Julia mechanism but I think it would have the same effect.

---

<div class="post-metadata">

### Author: ![barche](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barche/32/79_2.png) [@barche](https://discourse.julialang.org/u/barche)
#### Post date: [December 26, 2020, 3:16pm UTC](https://discourse.julialang.org/t/could-not-load-library-libgl-so-1/52340/6 "2020-12-26T15:16:20Z")

</div>

If you have time, could you try pkg-adding `https://github.com/barche/Qt_jll.jl.git` instead of installing mesa? It works for me, but my understanding is that libglvnd will dispatch to the underlying system libraries, so it may just postpone the problem. For GR this should be fine, since no OpenGL is actually used.

---

<div class="post-metadata">

### Author: ![Peter\_Adelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peter_adelman/32/11907_2.png) [@Peter\_Adelman](https://discourse.julialang.org/u/Peter_Adelman)
#### Post date: [December 29, 2020, 9:23pm UTC](https://discourse.julialang.org/t/could-not-load-library-libgl-so-1/52340/7 "2020-12-29T21:23:20Z")

</div>

> [@barche](#):
>
> If you have time, could you try pkg-adding `https://github.com/barche/Qt_jll.jl.git` instead of installing mesa?

This also worked for me!
