GR_jll not compiling in Julia 1.10.3

I just installed Julia 1.10.3 and GR_jll is not compiling, so I can’t use Plots. The error message I get is this:

 ERROR: LoadError: InitError: could not load library "/home/WIN/eschein1/.julia/artifacts/e18a60e84fd8aefa967cb9f1d11dc6cbd9cac88b/lib/"
│ cannot open shared object file: No such file or directory

Here is the output of versioninfo():

Julia Version 1.10.3
Commit 0b4590a5507 (2024-04-30 10:59 UTC)
Build Info:
  Official release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 32 × Intel(R) Xeon(R) CPU E5-2660 0 @ 2.20GHz
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, sandybridge)
Threads: 1 default, 0 interactive, 1 GC (on 32 virtual cores)
  LD_LIBRARY_PATH = :/home/WIN/eschein1/software/gurobi/linux64

Furthermore: I deleted my .julia directory, used juliaup to return to version 1.10.2, but when I tried to install Plots I’m getting the same error for GR_jll.


I’ve just updated but did not have a problem. Maybe running this will give more information

strace julia -e "using GR" 2>&1 | grep libLerc

You may also do following in a julia session if some needed files/libraries for GR are missing.

]build GR

I’m having the same problem.

The strace gave no output and

]build GR

doesn’t fix the issue (I’m running OSX 14.41 and I’ve tried this on Juila 1.9.3, 1.10.0, 1.10.2 and 1.10.3)

What does ]status GR and ]status -m GR_jll give?

[28b8d3ca] GR v0.73.3


[d2c73de3] GR_jll v0.73.3+0

PS installing StatsPlots from Pluto does work fine… which I guess isolates this problem to artefact location?

Okay I now updated packages too in addition to julia itself. I see an update for Lerc_jll and GR fails after this update.

1 Like

I had LoadError: InitError: UndefVarError: GR_jll not defined when using StatsPlots in Pluto.


@giordano Was just about to link that myself… hopefully this will get fixed shortly

Pinning LERC_jll to v3 was not enough. I needed to remove caches of Plots, GR_jll, GR, LERC_jll, Libtiff_jll to be able to compile Plots again.

1 Like

Here’s workaround until the registry changes propagate. This includes force precompilation of GR.

using Pkg
# skip activation of a temp environment if you are trying to fix your environment
Pkg.activate(; temp=true)
# Add LERC_jll version 3
    PackageSpec(name="LERC_jll", version="3")
# Force GR to precompile
Base.compilecache(Base.PkgId(Base.UUID("28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"), "GR")) 

Ideally any version of package e.g. Plots and GR_jll you used successfully in previous Julia should work in later, e.g. 1.10.3. Without updating any packages, but at least latest version of any package should work, and it should then be simple to get that latest version (and should happen if needed automatically), with all its dependencies at the latest version too.

TL;DR It worked for me out of the box, but when not Julia can trigger a special kind of hell in Linux the oom_killer (despite me having 32 GB of RAM) when precompiling, just testing for you it seemingly killed julia, but maybe a first for me and/or the whole terminal windows, with all its other tabs. And on second try it rather killed Firefox (not too unusual).

From /var/log/syslog:

May 1 14:33:21 ryksugan kernel: [11232041.146150] julia invoked oom-killer: gfp_mask=0x1100cca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=0

That was when I was trying to update to latest versions of packages.

Note, before:

(@v1.10) pkg> st -m
⌅ [28b8d3ca] GR v0.72.8
⌃ [91a5bcdd] Plots v1.39.0

i.e. you are possibly not at latest versions (and those should still work, like for me, assuming all their dependencies also at same version; and possibly you need to be running on same platform too).

This worked for me to go to latest version (but not it does NOT update dependencies like GR_jll, and you only see it with -m option above, not from the Project.toml file):

(@v1.10) pkg> add Plots@v1.40.4

This might work for you (the version I use currently):

(@v1.10) pkg> add GR_jll@v0.72.8

For me it does NOT work to go to the latest version (nor did I find a workaround):

(@v1.10) pkg> add GR_jll@v0.73.3
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package SDL2_image_jll [41f3cfe1]:
 SDL2_image_jll [41f3cfe1] log:
 ├─possible versions are: 2.0.5-2.6.2 or uninstalled
 └─restricted by compatibility requirements with Libtiff_jll [89763e89] to versions: uninstalled — no versions left
   └─Libtiff_jll [89763e89] log:
     ├─possible versions are: 4.0.10-4.6.0 or uninstalled
     └─restricted by compatibility requirements with GR_jll [d2c73de3] to versions: 4.5.1
       └─GR_jll [d2c73de3] log:
         ├─possible versions are: 0.51.2-0.73.3 or uninstalled
         └─restricted to versions 0.73.3 by an explicit requirement, leaving only versions: 0.73.3

As I stated, the current versions DID work out of the box (not installing anything since I had it from previous Julia version):

julia> @time using Plots
  2.625603 seconds (1.29 M allocations: 81.508 MiB, 6.11% gc time, 1.52% compilation time)

though I think slower than before (also startup of julia itself a tiny bit slower it seems).

after updating Plots only I get:

julia> @time using Plots
  1.887266 seconds (1.29 M allocations: 82.422 MiB, 8.64% gc time, 1.91% compilation time)

Before that (still strange after):

julia> @time_imports using Plots
               ┌ 1.0 ms SuiteSparse_jll.__init__() 
     43.8 ms  SuiteSparse_jll 95.97% compilation time
               ┌ 8.8 ms SparseArrays.CHOLMOD.__init__() 95.90% compilation time
    207.2 ms  SparseArrays 4.06% compilation time
      7.8 ms  CompilerSupportLibraries_jll 90.76% compilation time
     25.8 ms  GR
               ┌ 7.2 ms Plots.__init__() 93.86% compilation time
    629.7 ms  Plots 1.07% compilation time

On first use, way more compiled than really needed:

  153 dependencies successfully precompiled in 157 seconds. 6 already precompiled.
166.139589 seconds (7.65 M allocations: 565.616 MiB, 0.59% gc time, 1.40% compilation time)

Note the dependencies of GR_jll, and any of those might be a problem, needs updating:

Zlib_jll = "83775a58-1f1d-513f-b197-d71354ab007a"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Fontconfig_jll = "a3f928ae-7b40-5064-980b-68af3947d34b"
Pixman_jll = "30392449-352a-5448-841d-b1acce4e97dc"
FFMPEG_jll = "b22a6f82-2f65-5046-a5b2-351ab43fb4e5"
JpegTurbo_jll = "aacddb02-875f-59d6-b918-886e6ef4fbf8"
Cairo_jll = "83423d85-b0ee-5818-9007-b63ccbeb887a"
FreeType2_jll = "d7e528f0-a631-5988-bf34-fe36492bcfd7"
Libtiff_jll = "89763e89-9b03-5906-acba-b20f662cd828"
GLFW_jll = "0656b61e-2033-5cc2-a64a-77c0f6c09b89"
JLLWrappers = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
Bzip2_jll = "6e34b625-4abd-537c-b88f-471c36dfa7a0"
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
libpng_jll = "b53b4c65-9356-5827-b1ea-8c7a1a84506f"
Qt6Base_jll = "c0090381-4147-56d7-9ebc-da0b1113ec56"

Thank you. This seems to work for me. How might I know when this is fixed?

It has been for a couple of hours already: [Libtiff_jll] Fix compat bound with `LERC_jll` by giordano · Pull Request #105958 · JuliaRegistries/General · GitHub


Thanks. It’s all working now!

I am still having the problem:

(Downloads) pkg> precompile
Precompiling project...
  ✗ Plots
  ✗ Plots → UnitfulExt
  0 dependencies successfully precompiled in 6 seconds. 146 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]

Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to "/Users/hurak/.julia/compiled/v1.10/Plots/jl_6w0quB".
ERROR: LoadError: InitError: UndefVarError: `GR_jll` not defined
  [1] __init__()
    @ GR.GRPreferences ~/.julia/packages/GR/SdanO/src/preferences.jl:64
  [2] run_module_init(mod::Module, i::Int64)
    @ Base ./loading.jl:1134
  [3] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1122
  [4] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base ./loading.jl:1067
  [5] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base ./loading.jl:1581
  [6] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1938
  [7] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1812
  [8] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
  [9] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [10] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1803
 [11] macro expansion
    @ ./loading.jl:1790 [inlined]
 [12] macro expansion
    @ ./lock.jl:267 [inlined]
 [13] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1753
 [14] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [15] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [16] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1746
 [17] top-level scope
    @ ~/.julia/packages/Plots/ju9dp/src/backends.jl:380
 [18] eval
    @ ./boot.jl:385 [inlined]
 [19] _initialize_backend(pkg::Plots.GRBackend)
    @ Plots ~/.julia/packages/Plots/ju9dp/src/backends.jl:379
 [20] backend(pkg::Plots.GRBackend)
    @ Plots ~/.julia/packages/Plots/ju9dp/src/backends.jl:244
 [21] backend(sym::Symbol)
    @ Plots ~/.julia/packages/Plots/ju9dp/src/backends.jl:254
 [22] load_default_backend()
    @ Plots ~/.julia/packages/Plots/ju9dp/src/backends.jl:201
 [23] backend()
    @ Plots ~/.julia/packages/Plots/ju9dp/src/backends.jl:232
 [24] top-level scope
    @ ~/.julia/packages/Plots/ju9dp/src/init.jl:108
 [25] include(mod::Module, _path::String)
    @ Base ./Base.jl:495
 [26] include(x::String)
    @ Plots ~/.julia/packages/Plots/ju9dp/src/Plots.jl:1
 [27] top-level scope
    @ ~/.julia/packages/Plots/ju9dp/src/Plots.jl:176
 [28] include
    @ ./Base.jl:495 [inlined]
 [29] 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
 [30] top-level scope
    @ stdin:3
during initialization of module GRPreferences
in expression starting at /Users/hurak/.julia/packages/Plots/ju9dp/src/init.jl:108
in expression starting at /Users/hurak/.julia/packages/Plots/ju9dp/src/Plots.jl:1
in expression starting at stdin:
julia> versioninfo()
Julia Version 1.10.3
Commit 0b4590a5507 (2024-04-30 10:59 UTC)
Build Info:
  Official release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 8 × Apple M2
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)
  DYLD_LIBRARY_PATH = /Library/knitro/lib
(Downloads) pkg> st
Status `~/Downloads/Project.toml`
  [28b8d3ca] GR v0.73.3
  [91a5bcdd] Plots v1.40.4

Adding GR_jll does not help. And I have never installed it before.

Have you tried this?

1 Like

That doesn’t seem to be same issue discussed above, unless I’m missing it I don’t see references to libLerc not found. I’d recommend opening a new thread, this one is done.

1 Like