Plots failed to precompile due to Error in libgobject-2.0.so and libQt5Concurrent.so

Hello. I am trying to run my julia project on my school’s cluster. They have pre installed a Julia v1.7.1 Linux x86 binary. Adding Plots in the Pkg interface causes pre-compilation to fail:

Precompiling project...
  ✗ Plots
  19 dependencies successfully precompiled in 46 seconds (114 already precompiled)
  1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package

Running Pkg.precompile() results in no output. If I then import Plots into my current session, I end up with the following error:

julia> using Plots
ERROR: InitError: could not load library "/n/home06/dochang/.julia/artifacts/303fe895f57042ea41055187ec4af6322989b5cc/lib/libgobject-2.0.so"
/n/home06/dochang/.julia/artifacts/303fe895f57042ea41055187ec4af6322989b5cc/lib/libgobject-2.0.so: undefined symbol: g_pattern_spec_copy
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:117
  [3] macro expansion
    @ ~/.julia/packages/JLLWrappers/QpMQW/src/products/library_generators.jl:54 [inlined]
  [4] __init__()
    @ Glib_jll ~/.julia/packages/Glib_jll/lyJkt/src/wrappers/x86_64-linux-gnu.jl:36
  [5] _include_from_serialized(path::String, depmods::Vector{Any})
    @ Base ./loading.jl:768
  [6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
    @ Base ./loading.jl:854
  [7] _tryrequire_from_serialized(modkey::Base.PkgId, build_id::UInt64, modpath::String)
    @ Base ./loading.jl:783
  [8] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
    @ Base ./loading.jl:843
  [9] _tryrequire_from_serialized(modkey::Base.PkgId, build_id::UInt64, modpath::String)
    @ Base ./loading.jl:783
 [10] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
    @ Base ./loading.jl:843
 [11] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1097
 [12] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1013
 [13] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:997
during initialization of module Glib_jll

I get a completely different error if I try importing again in the same session:

julia> using Plots
ERROR: InitError: could not load library "/n/home06/dochang/.julia/artifacts/988066cc974e30c89774b0c471f47201975a4423/lib/libQt5Concurrent.so"
/n/home06/dochang/.julia/artifacts/988066cc974e30c89774b0c471f47201975a4423/lib/libQt5Concurrent.so: cannot open shared object file: No such file or directory
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:117
  [3] macro expansion
    @ ~/.julia/packages/JLLWrappers/QpMQW/src/products/library_generators.jl:54 [inlined]
  [4] __init__()
    @ Qt5Base_jll ~/.julia/packages/Qt5Base_jll/lpIK6/src/wrappers/x86_64-linux-gnu-cxx11.jl:31
  [5] _include_from_serialized(path::String, depmods::Vector{Any})
    @ Base ./loading.jl:768
  [6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
    @ Base ./loading.jl:854
  [7] _tryrequire_from_serialized(modkey::Base.PkgId, build_id::UInt64, modpath::String)
    @ Base ./loading.jl:783
  [8] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
    @ Base ./loading.jl:843
  [9] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1097
 [10] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1013
 [11] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:997
during initialization of module Qt5Base_jll

Importing a third time just results in the same error as the second. I’ve tried changing my .julia/config/startup.jl to include:

ENV["LD_LIBRARY_PATH"] = ""

since I’ve seen this given as a solution in another post; but this failed to resolve my problem.

Does anyone know how to resolve this? Help would be greatly appreciated.

That’s not what I suggested. My suggestion was to set the environment variable before starting the Julia process, setting the environment variable inside the Julia process has no effect with regards to loading libraries in-process.

1 Like

Thanks! I misunderstood. That seemed to have fixed my issue.

1 Like