GMT.jl icon indicating copy to clipboard operation
GMT.jl copied to clipboard

Precompiling error on Julia 1.8.5 on Ubuntu 22.04

Open amarux opened this issue 2 years ago • 13 comments

Hi,

I have build GMT 6.4.0 from the latest stable release, and outside Julia gmt run without problems. However, in a fresh installation of Julia 1.8.5 on Ubuntu 22.04, GMT cannot by installed by add GMT because it fails at precompiling.

If I try to load GMT in Julia by using GMT I got this error:

ERROR: InitError: could not load library "/lib/libgdal.so.30"
/opt/julia-1.8.5/bin/../lib/julia/libcurl.so: version `CURL_OPENSSL_4' not found (required by /lib/libgdal.so.30)
Stacktrace:
 [1] GDALVersionInfo(a1::String)
   @ GMT.Gdal ~/.julia/packages/GMT/7jXvi/src/gdal.jl:331
 [2] __init__()
   @ GMT.Gdal ~/.julia/packages/GMT/7jXvi/src/gdal.jl:2457
 [3] _include_from_serialized(pkg::Base.PkgId, path::String, depmods::Vector{Any})
   @ Base ./loading.jl:831
 [4] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt64)
   @ Base ./loading.jl:1039
 [5] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1315
 [6] _require_prelocked(uuidkey::Base.PkgId)
   @ Base ./loading.jl:1200
 [7] macro expansion
   @ ./loading.jl:1180 [inlined]
 [8] macro expansion
   @ ./lock.jl:223 [inlined]
 [9] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:1144
during initialization of module Gdal

The output of the Julia versioninfo() is:

Julia Version 1.8.5
Commit 17cfb8e65ea (2023-01-08 06:45 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 4 × Intel(R) Core(TM) i3-5010U CPU @ 2.10GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, broadwell)
  Threads: 4 on 4 virtual cores
Environment:
  JULIA_NUM_THREADS = 4

I think it is the same issue of #1052, but I would like to ask if you known about a temporary solution to work with GMT.jl?

Any insights will be appreciated.

Cheers,

amarux avatar Jan 25 '23 17:01 amarux

Hi, I'm sorry about this but I don't even understand what causes the error. Specially when you say that outside Julia GMT works fine. Can you please do this experiment. If you hide GMT from Julia (that is, not having it in the system path) then the first time you do add GMT it should automatically install a GMT Conda build. Now, that Conda build should be pretty recent as well but maybe it wont trigger that error. That would e helpful for us to start tracking where the hell this error is coming from.

joa-quim avatar Jan 25 '23 19:01 joa-quim

So I updated my WSL Linux to 22.04 and I'm now screwed as well (same error). But this made me finally see the problem. It's Julia again and it's dependencies. Note that what it complains is about

/opt/julia-1.8.5/bin/../lib/julia/libcurl.so

and not the system libcurl.so and that's why then CLI GMT works but errors from within Julia.

Previous experiences of me reporting Julia conflicts were not completely satisfactory. Would you mind being you bringing this issue in Julia forum or opening an issue there?

joa-quim avatar Jan 25 '23 22:01 joa-quim

You know what worked? Moving Julia's libcurl's out of the way. But I don't know what are the consequences of this for other Julia processes.

j@Marilu:~/.julia/juliaup/julia-1.8.5+0.x64.linux.gnu/lib/julia$ mv libcurl.so libcurla.so
j@Marilu:~/.julia/juliaup/julia-1.8.5+0.x64.linux.gnu/lib/julia$ mv libcurl.so.4 libcurla.so.4

joa-quim avatar Jan 25 '23 22:01 joa-quim

@joa-quim thank you so much for answering so soon.

I removed the gmt that I built previously, and also the .jullia/ and julia-1.8.5 directories. Then, I reinstalled Julia and run add GMT forcing to install gmt from Conda, just as you recommend.

Under these conditions, in which there is not a gmt on the system, GMT.jl works without problems. So, installing from Conda is the solution for this particular case.

¡Pura vida!

amarux avatar Jan 25 '23 23:01 amarux

Glad that you made it work and good to know that the GMT Conda build is still not vulnerable to this problem but I'm afraid that it's just a question of time until it starts being linked against a libcurl version that conflicts with the one shipped by Julia.

joa-quim avatar Jan 25 '23 23:01 joa-quim

I am going to open an issue in Julia. I hope it helps to find a solution.

If I can help with something else please let me know. I am not an experienced user but, I can learn and try to contribute.

Thank you!

NOTE: I already open an issue in Julia

amarux avatar Jan 26 '23 01:01 amarux

Thanks, for that. But as you can see it there this seems out of our hands. Julia and some(?) Linux package managers do not agree on what a libcurl should be.

joa-quim avatar Jan 27 '23 22:01 joa-quim

Yes, I understand that is not easy to solve it.

I am fan of gmt and Julia and, I hope this not avoid to use GMT.jl on next Ubuntu or Arch versions. By now, using gmt installed with Conda works in Ubuntu 22.04!

Thank you for all!

amarux avatar Jan 28 '23 03:01 amarux

These troubles should all have gone, right?

joa-quim avatar May 28 '23 12:05 joa-quim

I'm still having these troubles.

michaelschwob avatar Oct 19 '23 22:10 michaelschwob

Can you please give more info. OS and error messages?

joa-quim avatar Oct 19 '23 22:10 joa-quim

Hi, joa-quim. I am on Ubuntu 22.04.3 LTS in Julia 1.9.2. image. Here is my error message: image

michaelschwob avatar Oct 20 '23 14:10 michaelschwob

Preferably do not use screen-captures. Copy past the text messages (wrapped in triple back-ticks) makes them much more readable.

This is a different issue from the original post and not a GMT.jl issue. It's a problem raised bu libcurl but one that has been solved meanwhile. My guess is that you have some package that is holding the update of the netcdf library to version where that problem has been solved.

joa-quim avatar Oct 21 '23 14:10 joa-quim