gridap / GridapGmsh.jl

Gmsh generated meshes for Gridap
MIT License
42 stars 19 forks source link

Trouble loading GridapGmsh on Julia 1.8 but not on Julia 1.7 #62

Closed 00krishna closed 2 years ago

00krishna commented 2 years ago

I am having some trouble building or loading GridapGmsh on Ubuntu 20.04 LTS, Julia 1.8. I was trying to build the Gridap Tutorials directory, but the instantiation kept failing on using GridapGmsh. So I created a completely new directory and environment and tired to install GridapGmsh there, but still getting the build error below.

The odd thing is that on my second computer, I was able to successfully build GridapGmsh on Ubuntu 20.04 LTS, Julia 1.7. So everything else is the same, just the julia version.

The error seems related to this issue with libgobject-2.0.so and undefined symbol: g_uri_ref. Has anyone encountered this issue before? I did some google searches and it seems like it has affected people using Julia Plots, but I have not encountered that is when using Plots.

ERROR: LoadError: InitError: could not load library "/home/krishnab/.julia/artifacts/303fe895f57042ea41055187ec4af6322989b5cc/lib/libgobject-2.0.so"
/home/krishnab/.julia/artifacts/303fe895f57042ea41055187ec4af6322989b5cc/lib/libgobject-2.0.so: undefined symbol: g_uri_ref

Here is the full log.

ERROR: LoadError: InitError: could not load library "/home/krishnab/.julia/artifacts/303fe895f57042ea41055187ec4af6322989b5cc/lib/libgobject-2.0.so"
/home/krishnab/.julia/artifacts/303fe895f57042ea41055187ec4af6322989b5cc/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:117
  [2] dlopen(s::String, flags::UInt32)
    @ Base.Libc.Libdl ./libdl.jl:116
  [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(pkg::Base.PkgId, path::String, depmods::Vector{Any})
    @ Base ./loading.jl:831
  [6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt64)
    @ Base ./loading.jl:1039
  [7] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1315
  [8] _require_prelocked(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1200
  [9] macro expansion
    @ ./loading.jl:1180 [inlined]
 [10] macro expansion
    @ ./lock.jl:223 [inlined]
 [11] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1144
 [12] include(mod::Module, _path::String)
    @ Base ./Base.jl:419
 [13] top-level scope
    @ ~/.julia/packages/JLLWrappers/QpMQW/src/toplevel_generators.jl:188
 [14] include
    @ ./Base.jl:419 [inlined]
 [15] 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:1554
 [16] top-level scope
    @ stdin:1
during initialization of module Glib_jll
in expression starting at /home/krishnab/.julia/packages/Cairo_jll/HW4xi/src/wrappers/x86_64-linux-gnu.jl:4
in expression starting at /home/krishnab/.julia/packages/Cairo_jll/HW4xi/src/Cairo_jll.jl:2
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile Cairo_jll [83423d85-b0ee-5818-9007-b63ccbeb887a] to /home/krishnab/.julia/compiled/v1.8/Cairo_jll/jl_y6DG09.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base ./loading.jl:1705
  [3] compilecache
    @ ./loading.jl:1649 [inlined]
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1337
  [5] _require_prelocked(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1200
  [6] macro expansion
    @ ./loading.jl:1180 [inlined]
  [7] macro expansion
    @ ./lock.jl:223 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1144
  [9] include(mod::Module, _path::String)
    @ Base ./Base.jl:419
 [10] top-level scope
    @ ~/.julia/packages/JLLWrappers/QpMQW/src/toplevel_generators.jl:188
 [11] include
    @ ./Base.jl:419 [inlined]
 [12] 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:1554
 [13] top-level scope
    @ stdin:1
in expression starting at /home/krishnab/.julia/packages/gmsh_jll/0L4b9/src/wrappers/x86_64-linux-gnu-cxx11.jl:4
in expression starting at /home/krishnab/.julia/packages/gmsh_jll/0L4b9/src/gmsh_jll.jl:2
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile gmsh_jll [630162c2-fc9b-58b3-9910-8442a8a132e6] to /home/krishnab/.julia/compiled/v1.8/gmsh_jll/jl_tQjv16.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base ./loading.jl:1705
  [3] compilecache
    @ ./loading.jl:1649 [inlined]
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1337
  [5] _require_prelocked(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1200
  [6] macro expansion
    @ ./loading.jl:1180 [inlined]
  [7] macro expansion
    @ ./lock.jl:223 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1144
  [9] top-level scope
    @ ~/.julia/packages/GridapGmsh/ES9WT/deps/build.jl:9
 [10] include(fname::String)
    @ Base.MainInclude ./client.jl:476
 [11] top-level scope
    @ none:5
in expression starting at /home/krishnab/.julia/packages/GridapGmsh/ES9WT/deps/build.jl:3
00krishna commented 2 years ago

Okay, I figured it out. It was a strange one. In my .bashrc I had an environment variable, LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libcurl.so.4.6.0. This was causing the problem. So I just commented that line out, and GridapGmsh started to work.

I actually discovered this by using the code below.

LD_LIBRARY_PATH="" LD_PRELOAD="" julia

By manually setting the environment variable before starting julia, I was able to reset those environment variables. Once I did this and entered my environment, I was able to run using GridapGmsh. So that is how I figured this out.