Linux julia 1.8.2/1.8.3 GMT package /lib/julia/libcurl.so: version `CURL_OPENSSL_4' not found error

Hello,

I am using arch linux, I have manually downloaded and installed 64 bit linux version of julia from https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.3-linux-x86_64.tar.gz. I have added many packages like Flux, Knet, DataFrames etc. along with GMT. When I try to use GMT, I receive following error about libcurl

julia> using GMT
[ Info: Precompiling GMT [5752ebe1-31b9-557e-87aa-f909b540aa54]
ERROR: LoadError: could not load library "/usr/lib/libgmt.so"
/home/user/opt/julia-1.8.2/bin/../lib/julia/libcurl.so: version `CURL_OPENSSL_4' not found (required by /usr/lib/libgmt.so)
Stacktrace:
 [1] GMT_Create_Session (repeats 2 times)
   @ ~/.julia/packages/GMT/mzT4h/src/libgmt.jl:2 [inlined]
 [2] top-level scope
   @ ~/.julia/packages/GMT/mzT4h/src/get_enums.jl:9
 [3] include(mod::Module, _path::String)
   @ Base ./Base.jl:419
 [4] include(x::String)
   @ GMT ~/.julia/packages/GMT/mzT4h/src/GMT.jl:1
 [5] top-level scope
   @ ~/.julia/packages/GMT/mzT4h/src/GMT.jl:287
 [6] include
   @ ./Base.jl:419 [inlined]
 [7] 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:1554
 [8] top-level scope
   @ stdin:1
in expression starting at /home/user/.julia/packages/GMT/mzT4h/src/get_enums.jl:9
in expression starting at /home/user/.julia/packages/GMT/mzT4h/src/GMT.jl:1
in expression starting at stdin:1
ERROR: Failed to precompile GMT [5752ebe1-31b9-557e-87aa-f909b540aa54] to /home/user/.julia/compiled/v1.8/GMT/jl_WsZzh7.
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:1707
 [3] compilecache
   @ ./loading.jl:1651 [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

I have informed this issue to GMT package maintainer at github. julia 1.8.2 compile error · Issue #1052 · GenericMappingTools/GMT.jl · GitHub

I am informed that the developer is windows guy and advised to take this issue here Julia Forum.

I appreciate any help directions. Currently GMT is broken and I can not use it.

That’s right. I still don’t know how it’s supposed to magically work by mixing libraries with incompatible ABIs.

An option to address your problem is to preload the libcurl that your libgmt would expect. The syntax is

LD_PRELOAD="/path/to/libcurl.so" julia

But you’d need to know what libcurl your libgmt expects, I can’t know what that is without having more details about your system and how libgmt was installed. My initial guess would be /usr/lib/libcurl.so

Hello,

Thank you for the response.

In my system, locates displays following for libcurl

locate libcurl
/usr/lib/libcurl-gnutls.so
/usr/lib/libcurl-gnutls.so.3
/usr/lib/libcurl-gnutls.so.4
/usr/lib/libcurl-gnutls.so.4.0.0
/usr/lib/libcurl-gnutls.so.4.1.0
/usr/lib/libcurl-gnutls.so.4.2.0
/usr/lib/libcurl-gnutls.so.4.3.0
/usr/lib/libcurl-gnutls.so.4.4.0
/usr/lib/libcurl-gnutls.so.4.5.0
/usr/lib/libcurl-gnutls.so.4.6.0
/usr/lib/libcurl-gnutls.so.4.7.0
/usr/lib/libcurl-gnutls.so.4.8.0
/usr/lib/libcurl.so
/usr/lib/libcurl.so.4
/usr/lib/libcurl.so.4.8.0
/usr/lib/pkgconfig/libcurl.pc
/usr/lib32/libcurl.so
/usr/lib32/libcurl.so.4
/usr/lib32/libcurl.so.4.8.0
/usr/lib32/pkgconfig/libcurl.pc
/usr/share/aclocal/libcurl.m4
/usr/share/licenses/libcurl-gnutls
/usr/share/man/man3/libcurl-easy.3.gz
/usr/share/man/man3/libcurl-env.3.gz
/usr/share/man/man3/libcurl-errors.3.gz
/usr/share/man/man3/libcurl-multi.3.gz
/usr/share/man/man3/libcurl-security.3.gz
/usr/share/man/man3/libcurl-share.3.gz
/usr/share/man/man3/libcurl-symbols.3.gz
/usr/share/man/man3/libcurl-thread.3.gz
/usr/share/man/man3/libcurl-tutorial.3.gz
/usr/share/man/man3/libcurl-url.3.gz
/usr/share/man/man3/libcurl.3.gz

The links are as follows:

 ls -l /usr/lib/libcurl*
lrwxrwxrwx 1 root root   19 Kas  1 15:47 /usr/lib/libcurl-gnutls.so -> libcurl-gnutls.so.4
lrwxrwxrwx 1 root root   23 Kas  1 15:47 /usr/lib/libcurl-gnutls.so.3 -> libcurl-gnutls.so.4.8.0
lrwxrwxrwx 1 root root   23 Kas  1 15:47 /usr/lib/libcurl-gnutls.so.4 -> libcurl-gnutls.so.4.8.0
lrwxrwxrwx 1 root root   23 Kas  1 15:47 /usr/lib/libcurl-gnutls.so.4.0.0 -> libcurl-gnutls.so.4.8.0
lrwxrwxrwx 1 root root   23 Kas  1 15:47 /usr/lib/libcurl-gnutls.so.4.1.0 -> libcurl-gnutls.so.4.8.0
lrwxrwxrwx 1 root root   23 Kas  1 15:47 /usr/lib/libcurl-gnutls.so.4.2.0 -> libcurl-gnutls.so.4.8.0
lrwxrwxrwx 1 root root   23 Kas  1 15:47 /usr/lib/libcurl-gnutls.so.4.3.0 -> libcurl-gnutls.so.4.8.0
lrwxrwxrwx 1 root root   23 Kas  1 15:47 /usr/lib/libcurl-gnutls.so.4.4.0 -> libcurl-gnutls.so.4.8.0
lrwxrwxrwx 1 root root   23 Kas  1 15:47 /usr/lib/libcurl-gnutls.so.4.5.0 -> libcurl-gnutls.so.4.8.0
lrwxrwxrwx 1 root root   23 Kas  1 15:47 /usr/lib/libcurl-gnutls.so.4.6.0 -> libcurl-gnutls.so.4.8.0
lrwxrwxrwx 1 root root   23 Kas  1 15:47 /usr/lib/libcurl-gnutls.so.4.7.0 -> libcurl-gnutls.so.4.8.0
-rwxr-xr-x 1 root root 656K Kas  1 15:47 /usr/lib/libcurl-gnutls.so.4.8.0
lrwxrwxrwx 1 root root   16 Kas  1 15:47 /usr/lib/libcurl.so -> libcurl.so.4.8.0
lrwxrwxrwx 1 root root   16 Kas  1 15:47 /usr/lib/libcurl.so.4 -> libcurl.so.4.8.0
-rwxr-xr-x 1 root root 670K Kas  1 15:47 /usr/lib/libcurl.so.4.8.0

The julia installation which is at my home ~/opt directory has the following related to libcurl

ll -l  /home/user/opt/julia-1.8.3/lib/julia/libcurl*
lrwxrwxrwx 1 user user   16 Kas 14 23:49 /home/user/opt/julia-1.8.3/lib/julia/libcurl.so -> libcurl.so.4.8.0
lrwxrwxrwx 1 user user   16 Kas 14 23:49 /home/user/opt/julia-1.8.3/lib/julia/libcurl.so.4 -> libcurl.so.4.8.0
-rwx------ 1 user user 638K Kas 14 23:49 /home/user/opt/julia-1.8.3/lib/julia/libcurl.so.4.8.0
[user@vostro pc]$ ls -l  /home/user/opt/julia-1.8.3/lib/julia/libcurl*
lrwxrwxrwx 1 user user   16 Kas 14 23:49 /home/user/opt/julia-1.8.3/lib/julia/libcurl.so -> libcurl.so.4.8.0
lrwxrwxrwx 1 user user   16 Kas 14 23:49 /home/user/opt/julia-1.8.3/lib/julia/libcurl.so.4 -> libcurl.so.4.8.0
-rwx------ 1 user user 638K Kas 14 23:49 /home/user/opt/julia-1.8.3/lib/julia/libcurl.so.4.8.0

Your suggestion gives following error.

LD_PRELOAD="/usr/lib/libcurl.so" julia
julia: symbol lookup error: /usr/lib/libcurl.so: undefined symbol: nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation

What do you mean? GMT (not GMT.jl) is used by thousands of users for more than 3 decades.

GMT is built with cmake. It will link against whatever libcurl version in the system that cmake tells the compiler to use.

1 Like

To find out which libcurl is used by GMT do (example from my WSL installation)

gmt --show-library

/home/j/programs/lib/libgmt.so

.

ldd /home/j/programs/lib/libgmt.so | grep libcurl
        libcurl-gnutls.so.4 => /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 (0x00007f35fbb70000)

I have installed gmt via arch linux package manager pacman from official repositories.

$ gmt --show-library
/usr/lib/libgmt.so

$ ldd /usr/lib/libgmt.so | grep libcurl
	libcurl.so.4 => /usr/lib/libcurl.so.4 (0x00007f268c6ff000)

I’m afraid the reason for the failure is that on Arch Linux, Julia’s and system’s libcurl versions are incompatible.

Well, the “whatever” is precisely the problem :person_shrugging:

I don’t think so.

Sorry to resurrect this. Could you explain? Would it be possible to resolve this incompatibility?

This is no longer an issue (as long as Julia 1.10dev is not used) because GMT now uses a GMT_jll artifact that shelters from using libcurl’s system library.

I’m seeing the error in +1.9.0, +1.9.1, +release, +alpha and +beta.

Sorry, are you saying that installing GMT for the first time (with ] add GMT) in Arch Linux gives an error of conflicting versions of the system’s libcurl library? (I have no idea on why that could occur).

Sorry, I missed the notification, and looking back I must have read the discussion too quickly. I’m seeing this error not from GMT.jl but from Plots.jl (gr backend). Taking it up on Github.