Is this the correct way of installing GMT.jl on Ubuntu?
https://github.com/GenericMappingTools/gmt/blob/master/BUILDING.md#build-and-runtime-dependencies
It seems there are a lot of manual steps.
Is this the correct way of installing GMT.jl on Ubuntu?
https://github.com/GenericMappingTools/gmt/blob/master/BUILDING.md#build-and-runtime-dependencies
It seems there are a lot of manual steps.
You shouldnât have to build GMT yourself, rather use the available GMT package from apt:
sudo apt-get install gmt gmt-dcw gmt-gshhg
this is from here:
https://github.com/GenericMappingTools/gmt/blob/master/INSTALL.md#ubuntudebian
And the GMT.jl README says, that it would install it via conda if it is not available in the system.
When you have installed the GMT package you can install the GMT.jl package in Julia via:
pkg>add GMT
Many thanks!
As a newbie to Linux, Iâm very glad to hear about this.
Unfortunately, I got the below error, while running Pkg.add(âGMTâ):
ERROR: The following 1 direct dependency failed to precompile:
GMT [5752ebe1-31b9-557e-87aa-f909b540aa54]
Failed to precompile GMT [5752ebe1-31b9-557e-87aa-f909b540aa54] to /home/name/.julia/compiled/v1.7/GMT/jl_96Uy7O.
ldd: /usr/lib/x86_64-linux-gnu/libgmt.so: No such file or directory
ERROR: LoadError: failed processes:
Process(ldd /usr/lib/x86_64-linux-gnu/libgmt.so
, ProcessExited(1)) [1]
Process(grep libgdal
, ProcessExited(1)) [1]
My guess is that you installed from one of those package managers that do not create a symbolic link to the library as is common use on unix and that is why it doesnât find the libgmt.so
If you run, in a unix shell, gmt --show-bindir
it will show you the location of the GMT executable. Then use ldd
to find its dependencies. Something like
ldd /usr/bin/gmt | grep libgmt
you will see references to (in my linux box)
libgmt.so.6 => /lib64/libgmt.so.6 (0x00007f45f97ee000)
and
[jluis@fct-gmt lib64]$ ls /usr/lib64/libgmt*
/usr/lib64/libgmt.so /usr/lib64/libgmt.so.6 /usr/lib64/libgmt.so.6.1.0
The problem in your case (again, my guess) is that your installation lacks the libgmt.so
, which is a symbolic link (that should be there). The solution is to create one yourself (in the directory of the shared libs, /usr/lib64/
in this example) do
ln -s libgmt.so libgmt.so.6
Many thanks, Joa-quim! Unfortunately, it did not work.
Path to the file: /lib/x86_64-linux-gnu/
$ ln -s libgmt.so libgmt.so.6
ln: failed to create symbolic link âlibgmt.so.6â: File exists
So itâs the other way around. I never remember the order.
ln -s libgmt.so.6 libgmt.so
Many thanks! I think it did something good. However, when I tried Pkg.add("GMT")
, it went through the process really quickly. I got a different error when using GMT
.
**ERROR:** InitError: failed process: Process(
gmt --show-userdir, ProcessExited(78)) [78]
Below are the details:
(@v1.6) pkg> add GMT
Updating registry at ~/.julia/registries/General
Resolving package versionsâŚ
No Changes to ~/.julia/environments/v1.6/Project.toml
No Changes to ~/.julia/environments/v1.6/Manifest.toml
julia> using GMT
[ Info: Precompiling GMT [5752ebe1-31b9-557e-87aa-f909b540aa54]
GMT - The Generic Mapping Tools, Version 6.0.0 [64-bit] [12 cores]
(c) 1991-2019 The GMT Team (https://www.generic-mapping-tools.org/team.html).
Supported in part by the US National Science Foundation (http://www.nsf.gov/)
and volunteers from around the world.
GMT is distributed under the GNU LGP License (http://www.gnu.org/licenses/lgpl.html).
usage: gmt [options]
gmt []
options:
âhelp List descriptions of available GMT modules.
ânew-script[=L] Write GMT modern mode script template to stdout.
Optionally specify bash|csh|batch [Default is current shell]
âshow-bindir Show directory with GMT executables.
âshow-citation Show the most recent citation for GMT.
âshow-cores Show number of available cores.
âshow-datadir Show directory/ies with user data.
âshow-dataserver Show URL of the remote GMT data server.
âshow-doi Show the DOI for the current release.
âshow-modules Show all module names.
âshow-library Show path of the shared GMT library.
âshow-plugindir Show directory for plug-ins.
âshow-sharedir Show directory for shared GMT resources.
âversion Print GMT version number.
if is â=â we call exit (0) if module exist and non-zero otherwise.
GMT - The Generic Mapping Tools, Version 6.0.0 [64-bit] [12 cores]
(c) 1991-2019 The GMT Team (https://www.generic-mapping-tools.org/team.html).
Supported in part by the US National Science Foundation (http://www.nsf.gov/)
and volunteers from around the world.
GMT is distributed under the GNU LGP License (http://www.gnu.org/licenses/lgpl.html).
usage: gmt [options]
gmt []
options:
âhelp List descriptions of available GMT modules.
ânew-script[=L] Write GMT modern mode script template to stdout.
Optionally specify bash|csh|batch [Default is current shell]
âshow-bindir Show directory with GMT executables.
âshow-citation Show the most recent citation for GMT.
âshow-cores Show number of available cores.
âshow-datadir Show directory/ies with user data.
âshow-dataserver Show URL of the remote GMT data server.
âshow-doi Show the DOI for the current release.
âshow-modules Show all module names.
âshow-library Show path of the shared GMT library.
âshow-plugindir Show directory for plug-ins.
âshow-sharedir Show directory for shared GMT resources.
âversion Print GMT version number.
if is â=â we call exit (0) if module exist and non-zero otherwise.
ERROR: InitError: failed process: Process(gmt --show-userdir
, ProcessExited(78)) [78]
Stacktrace:
[1] pipeline_error
@ ./process.jl:525 [inlined]
[2] (::Base.var"#644#645"{Base.Process})()
@ Base ./process.jl:319
[3] iterate(itr::Base.EachLine{Base.PipeEndpoint}, state::Nothing) (repeats 2 times)
@ Base ./io.jl:1014
[4] _collect(cont::UnitRange{Int64}, itr::Base.EachLine{Base.PipeEndpoint}, #unused#::Base.HasEltype, isz::Base.SizeUnknown)
@ Base ./array.jl:613
[5] collect
@ ./array.jl:602 [inlined]
[6] #readlines#340
@ ./io.jl:551 [inlined]
[7] readlines
@ ./io.jl:551 [inlined]
[8] init(test::Bool)
@ GMT ~/.julia/packages/GMT/XBGE9/src/GMT.jl:280
[9] init()
@ GMT ~/.julia/packages/GMT/XBGE9/src/GMT.jl:260
[10] _include_from_serialized(path::String, depmods::Vector{Any})
@ Base ./loading.jl:696
[11] _require_from_serialized(path::String)
@ Base ./loading.jl:749
[12] _require(pkg::Base.PkgId)
@ Base ./loading.jl:1053
[13] require(uuidkey::Base.PkgId)
@ Base ./loading.jl:936
[14] require(into::Module, mod::Symbol)
@ Base ./loading.jl:923
during initialization of module GMT
Oh man you have a nose to fall into troubles. Thatâs Ubuntu stability installing a old GMT version (6.0.0) (> 2 years). I had to drop support that version in GMT.jl
As I see it, you either find a way to use packagers that install a newer version (there is a way but I donât remember), or build from source, or remove it and let the default Conda version be installed.
Iâm a happy Windows user, *nix is not good for my sanity.
Many thanks for your big help anyway! Happy holidaysâŚ
Season greetings for you too.
If you are on a long term support version of Ubuntu, this means, Ubuntu 20.04 or 18.04 you should be able to get GMT version 6.1.1 from the UbuntuGIS PPA
To add the UbuntuGIS PPA to your list of repositories do:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ubuntugis/ppa
as described here.
Then you should reinstall GMT and get the version 6.1.1
You might have to do the soft link again after reinstallation.
Many thanks!
Iâm able to build one from source files by following the below link:
https://github.com/GenericMappingTools/gmt/blob/master/BUILDING.md
Now I have GMT 6.3.0 running successfully on my machine and also on my Julia.
Nice. And sorry but havenât had time to give this other suggestion. If you are building from source then with just a small extra step you can build the master version from Github. The interest is when this GMT issue is worked out, it will give native support for the Interrupted Good Homolosine projection. See the amazing images at at the issue page that Paul created with a twisted bash script.