GMT.jl installation on Ubuntu 18

i am trying to install GMT.jl on my Ubunto but unable to solve it. Would you suggest any solution please?

I did not find a suitable tutorial for installation:

Below are the specifications:

julia> readlines(`gmt --version`)[1]
"6.1.1"

julia> readlines(`julia --version`)[1]
"julia version 1.6.7"

I used this command line to install GMT.jl

julia> using Pkg

julia> Pkg.add(“GMT”)
Updating registry at ~/.julia/registries/General
Resolving package versions…
Updating ~/.julia/environments/v1.6/Project.toml
[5752ebe1] + GMT v0.44.8
Updating ~/.julia/environments/v1.6/Manifest.toml
[8f4d0f93] + Conda v1.10.0
[5752ebe1] + GMT v0.44.8
[66db9d55] + SnoopPrecompile v1.0.3
[81def892] + VersionParsing v1.3.0

While using Julia, I am getting this error

julia> using GMT
[ Info: Precompiling GMT [5752ebe1-31b9-557e-87aa-f909b540aa54]
ERROR: LoadError: LoadError: syntax: “|” is not a unary operator
Stacktrace:
[1] top-level scope
@ ~/.julia/packages/GMT/1kBBX/src/statplots.jl:385
[2] include(mod::Module, _path::String)
@ Base ./Base.jl:384
[3] include(x::String)
@ GMT ~/.julia/packages/GMT/1kBBX/src/GMT.jl:1
[4] top-level scope
@ ~/.julia/packages/GMT/1kBBX/src/GMT.jl:232
[5] include
@ ./Base.jl:384 [inlined]
[6] 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
[7] top-level scope
@ none:1
[8] eval
@ ./boot.jl:360 [inlined]
[9] eval(x::Expr)
@ Base.MainInclude ./client.jl:446
[10] top-level scope
@ none:1
in expression starting at /home/abbas/.julia/packages/GMT/1kBBX/src/statplots.jl:385
in expression starting at /home/abbas/.julia/packages/GMT/1kBBX/src/GMT.jl:1
ERROR: Failed to precompile GMT [5752ebe1-31b9-557e-87aa-f909b540aa54] to /home/abbas/.julia/compiled/v1.6/GMT/jl_wvcs7f.
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

Hi, sorry that you has those problems and part of them I don’t understand how they can happen but thanks to your good report we’ll solve them.

Fist thing you have to do is to update your Julia version. “1.6.7” is probably the LTS version, which is very old from Julia standards and GMT.jl does not support it anymore. Like it doesn’t support GMT6.1.1 also (minimum is GMT6.4). See juliaup on to easily install the latest Julia version.

Next just do
] add GMT
and if you see that it is installing GMT v0.44.8 like it did for you (and it shouldn’t) when it finish, without leaving the package mode (that is set by the ] char, do up. That will install GMT.jl 1.10.1 and you are ready to go.

1 Like

@Joaquim Thank you so much. After updating the Julia, the issue is solved. :slight_smile:

1 Like