Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

it's not working while using Gtk.jl on centos8 #588

Open
kennywang710 opened this issue Oct 12, 2021 · 14 comments
Open

it's not working while using Gtk.jl on centos8 #588

kennywang710 opened this issue Oct 12, 2021 · 14 comments

Comments

@kennywang710
Copy link

julia> using Gtk
[ Info: Precompiling Gtk [4c0ca9eb-093a-5379-98c5-f87ac0bbbf44]
ERROR: LoadError: LoadError: InitError: could not load library "/home/kennyw/.julia/artifacts/e086922a5a3c20ca3e6866a33e42d8ec4689553e/lib/libgobject-2.0.so"
/home/kennyw/.julia/artifacts/e086922a5a3c20ca3e6866a33e42d8ec4689553e/lib/libgobject-2.0.so: undefined symbol: g_uri_ref
Stacktrace:
[1] dlopen(s::String, flags::UInt32; throw_error::Bool)
@ Base.Libc.Libdl ./libdl.jl:114
[2] dlopen(s::String, flags::UInt32)
@ Base.Libc.Libdl ./libdl.jl:114
[3] macro expansion
@ ~/.julia/packages/JLLWrappers/bkwIo/src/products/library_generators.jl:54 [inlined]
[4] init()
@ Glib_jll ~/.julia/packages/Glib_jll/nSLTF/src/wrappers/x86_64-linux-gnu.jl:36
[5] _include_from_serialized(path::String, depmods::Vector{Any})
@ Base ./loading.jl:696
[6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
@ Base ./loading.jl:782
[7] _require(pkg::Base.PkgId)
[8] require(uuidkey::Base.PkgId)
@ Base ./loading.jl:936
[9] require(into::Module, mod::Symbol)
@ Base ./loading.jl:923
[10] include(mod::Module, _path::String)
@ Base ./Base.jl:386
[11] top-level scope
@ ~/.julia/packages/JLLWrappers/bkwIo/src/toplevel_generators.jl:170
[12] include
@ ./Base.jl:386 [inlined]
[13] 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, UInt64}}, source::String)
@ Base ./loading.jl:1235
[14] top-level scope
@ none:1
[15] eval
@ ./boot.jl:360 [inlined]
[16] eval(x::Expr)
@ Base.MainInclude ./client.jl:446
[17] top-level scope
@ none:1
during initialization of module Glib_jll
in expression starting at /home/kennyw/.julia/packages/GTK3_jll/ebBBZ/src/wrappers/x86_64-linux-gnu.jl:4
in expression starting at /home/kennyw/.julia/packages/GTK3_jll/ebBBZ/src/GTK3_jll.jl:2
ERROR: LoadError: Failed to precompile GTK3_jll [77ec8976-b24b-556a-a1bf-49a033a670a6] to /home/kennyw/.julia/compiled/v1.6/GTK3_jll/jl_Kdn5f8.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:33
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY, ignore_loaded_modules::Bool)
@ Base ./loading.jl:1385
[3] compilecache(pkg::Base.PkgId, path::String)
@ Base ./loading.jl:1329
[4] _require(pkg::Base.PkgId)
@ Base ./loading.jl:1043
[5] require(uuidkey::Base.PkgId)
@ Base ./loading.jl:936
[6] require(into::Module, mod::Symbol)
@ Base ./loading.jl:923
[7] include
@ ./Base.jl:386 [inlined]
[8] 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, UInt64}}, source::Nothing)
@ Base ./loading.jl:1235
[9] top-level scope
@ none:1
[10] eval
@ ./boot.jl:360 [inlined]
[11] eval(x::Expr)
@ Base.MainInclude ./client.jl:446
[12] top-level scope
@ none:1
in expression starting at /home/kennyw/.julia/packages/Gtk/jLULV/src/Gtk.jl:2
ERROR: Failed to precompile Gtk [4c0ca9eb-093a-5379-98c5-f87ac0bbbf44] to /home/kennyw/.julia/compiled/v1.6/Gtk/jl_JXdNKK.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:33
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY, ignore_loaded_modules::Bool)
@ Base ./loading.jl:1385
[3] compilecache(pkg::Base.PkgId, path::String)
@ Base ./loading.jl:1329
[4] _require(pkg::Base.PkgId)
@ Base ./loading.jl:1043
[5] require(uuidkey::Base.PkgId)
@ Base ./loading.jl:936
[6] require(into::Module, mod::Symbol)
@ Base ./loading.jl:923

@giordano
Copy link
Contributor

After you get this error, in the same session could you please run the commands

using Libdl
filter!(lib -> occursin("glib", lib), dllist())

and copy here the output?

@kennywang710
Copy link
Author

here is output on your comment.
ulia> using Libdl

julia> filter!(lib -> occursin("glib", lib),dllist())
String[]

@giordano
Copy link
Contributor

Is that command run after you get the error above, in the same session? It doesn't make much sense there is no libglib loaded at all. Also, do you set any environment variable like LD_LIBRARY_PATH or LD_PRELOAD?

@kennywang710
Copy link
Author

here is output on terminal, did you findout any information?
===terminal===
[kennyw@localhost lib64]# ls -al libglib*
lrwxrwxrwx. 1 root root 23 Aug 10 23:36 libglib-2.0.so -> libglib-2.0.so.0.5600.4
lrwxrwxrwx. 1 root root 23 Aug 10 23:36 libglib-2.0.so.0 -> libglib-2.0.so.0.5600.4
-rwxr-xr-x. 1 root root 1167784 Aug 10 23:36 libglib-2.0.so.0.5600.4
lrwxrwxrwx. 1 root root 22 May 15 2019 libglibmm-2.4.so.1 -> libglibmm-2.4.so.1.3.0
-rwxr-xr-x. 1 root root 650744 May 15 2019 libglibmm-2.4.so.1.3.0
lrwxrwxrwx. 1 root root 42 May 15 2019 libglibmm_generate_extra_defs-2.4.so.1 -> libglibmm_generate_extra_defs-2.4.so.1.3.0
-rwxr-xr-x. 1 root root 261736 May 15 2019 libglibmm_generate_extra_defs-2.4.so.1.3.0
[kennyw@localhost lib64]# pwd
/usr/lib64
[kennyw@localhost lib64]# echo $LD_LIBRARY_PATH
/usr/lib64:/usr/local/lib:/usr/lib
[kennyw@localhost lib64]#

@kennywang710
Copy link
Author

add another information ,

julia> @show ENV["LD_LIBRARY_PATH"]
ENV["LD_LIBRARY_PATH"] = "/usr/lib64:/usr/local/lib:/usr/lib"
"/usr/lib64:/usr/local/lib:/usr/lib"

julia> filter!(lib -> occursin("perl", lib),dllist())
String[]

julia>

@kennywang710
Copy link
Author

julia> @show ENV["LD_LIBRARY_PATH"]
ENV["LD_LIBRARY_PATH"] = "/usr/lib64:/usr/local/lib:/usr/lib"
"/usr/lib64:/usr/local/lib:/usr/lib"

julia> filter!(lib -> occursin("glib", lib),dllist())
String[]

@giordano
Copy link
Contributor

What if you start julia with

LD_LIBRARY_PATH="" julia

so as to clear the value of the variable before starting the session?

@kennywang710
Copy link
Author

here is output while launch julia

kennyw@localhost ~/Documents]$ echo $LD_LIBRARY_PATH
/usr/lib64:/usr/local/lib:/usr/lib
[kennyw@localhost ~/Documents]$ setenv LD_LIBRARY_PATH ""
[kennyw@localhost ~/Documents]$ echo $LD_LIBRARY_PATH

[kennyw@localhost ~/Documents]$ whoami
kennyw
[kennyw@localhost ~/Documents]$ julia
_
_ _ ()_ | Documentation: https://docs.julialang.org
() | () () |
_ _ | | __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ ` | |
| | |
| | | | (
| | | Version 1.6.3 (2021-09-23)
/ |_'|||_'_| | Official https://julialang.org/ release
|__/ |

julia> @show ENV["LD_LIBRARY_PATH"]
ENV["LD_LIBRARY_PATH"] = ""
""

julia> filter!(lib -> occursin("glib", lib),dllist())
ERROR: UndefVarError: dllist not defined
Stacktrace:
[1] top-level scope
@ REPL[2]:1

@giordano
Copy link
Contributor

giordano commented Oct 30, 2021

@kennywang710 I've been asking for the value of filter!(lib -> occursin("glib", lib),dllist()) after you load the package and the error. The code you've shown above is in a fresh session, that's not what I asked.

Also, please quote your code with triple backquotes

```
like this
```

Alternatively you can select the code and press the <> button in the toolbar. That'd would make your messages way more readable than what they are now.

@appleparan
Copy link

appleparan commented Nov 7, 2021

I'll paste the answer from discourse as it is..

  1. Situation: Building Plots.jl
  2. Error
   ~/blahblah/lib/libgobject-2.0.so: undefined symbol: g_uri_ref
  1. Environments
    1. WSL2 in Windows 11 + Ubuntu 20.04
    $ ldd -v ldd
    ldd (Ubuntu GLIBC 2.31-0ubuntu9.2) 2.31
    Copyright (C) 2020 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    Written by Roland McGrath and Ulrich Drepper.
    
  2. What I do
    1. Result of filter!(lib -> occursin("glib", lib),dllist()) after failing precompile
      String[]
    
    1. Result of ENV["LD_LIBRARY_PATH"] : "/home/appleparan/usr/lib:/home/appleparan/usr/lib64:/usr/local/cuda/lib:/lib:/usr/lib:/usr/lib/x86_64-linux-gnu"
    2. Result of precompile after setting ENV["LD_DEBUG"]=all : Link

@giordano
Copy link
Contributor

giordano commented Nov 7, 2021

Situation: Building Plots.jl

How is Plots related at all with this issue? It doesn't use Gtk.jl.

To be crystal clear, I want to see the full output of the following commands, everything run in this exact order in the same Julia session:

using Gtk # this command will fail, it's OK
using Libdl
filter!(lib -> occursin("glib", lib),dllist())

@appleparan after running the debugging commands above, what happens if you start Julia with

LD_LIBRARY_PATH="" julia

?

@appleparan
Copy link

LD_LIBRARY_PATH="" julia

This worked.

Sorry, it was my fault. I set LD_LIBRARY_PATH shell initialization files and it causes the problem. Some path in my LD_LIBRARY_PATH loads wrong glib. filter!(lib -> occursin("glib", lib),dllist()) also loads proper glib with artifact path. Thank you.

@leoTiez
Copy link

leoTiez commented Apr 4, 2022

I had this issue only when using IJulia. I don't know what I did wrong. But re-installing the package and creating a new IJulia kernel did the trick. Hope that helps.

@xueminchi
Copy link

I also have the same issue. If I start julia with the command "LD_LIBRARY_PATH="" julia", the problem will be solved. However, I don't know what cause this issue, then I check the bashrc file,which contains:

export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
export PATH="$PATH:$HOME/julia-1.6.7/bin"

Is there any conflicts or reasons that I have to start julia by "LD_LIBRARY_PATH="" julia"? When I start Julia directly without this command, I can use some packages but not the Plots package. Only when I start Julia with that command, the precompile of Plots does not trigger an issue. I tried different versions of Julia, it does not change the situation. Do you have any ideas? Thanks. @giordano

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants