Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am aware that installing GMT with Julia only adds the wrapper. I have downloaded GMT and followed the directions from its git repository: https://github.com/GenericMappingTools/gmt/blob/master/INSTALL.md.

GMT is installed and runs fine from my terminal. However whenever I try to use GMT in Julia I get the following message:

You don't seem to have GMT installed and I don't install it automatically,
so you will have to do it yourself.
https://github.com/GenericMappingTools/gmt/blob/master/INSTALL.md#linux

This is a common problem where the solution is to show julia where my gmt library is. I did this by adding the following lines to my startup.jl:

using Libdl
push!(Libdl.DL_LOAD_PATH, "/usr/lib/x86_64-linux-gnu/libgmt.so.5")
push!(Libdl.DL_LOAD_PATH, "/usr/lib/x86_64-linux-gnu/libgmt.so.5.4.3")

I added both paths because I was not sure which one was the correct library (running gmt --version says its version 5.4.3)

However, when I load GMT I get the same message as before. Furthermore when I do ] test GMT I get the following error:

You don't seem to have GMT installed and I don't install it automatically,
so you will have to do it yourself.
https://github.com/GenericMappingTools/gmt/blob/master/INSTALL.md#linux
5.4.3
ERROR: LoadError: UndefVarError: GMT_Get_Version not defined
Stacktrace:
 [1] getproperty(::Module, ::Symbol) at ./Base.jl:26
 [2] top-level scope at /home/charper/.julia/packages/GMT/3tQ7w/test/runtests.jl:17
 [3] include(::String) at ./client.jl:439
 [4] top-level scope at none:6
in expression starting at /home/charper/.julia/packages/GMT/3tQ7w/test/runtests.jl:12
ERROR: Package GMT errored during testing

Finally when I trace that back to the file mentioned here are lines 12-17...I am not exactly sure what to do next.

using GMT
using Test

try
    run(`gmt --version`)    # Will fail if GMT is not installed.
    global got_it = true
catch
    @test 1 == 1            # Let tests pass for sake of not triggering a PkgEval failure
    global got_it = false
end

if (got_it)                 # Otherwise go straight to end

    const dbg2 = 3          # Either 2 or 3. 3 to test the used kwargs
    const dbg0 = 0          # With 0 prints only the non-consumed options. Set to -1 to ignore this Vd

    GMT.GMT_Get_Version();
    ma=[0];mi=[0];pa=[0];
    GMT.GMT_Get_Version(ma,mi,pa);
    API = GMT.GMT_Create_Session("GMT", 2, GMT.GMT_SESSION_NOEXIT + GMT.GMT_SESSION_EXTERNAL);
    GMT.GMT_Get_Ctrl(API);

Not sure what to do next, any help is appreciated!

question from:https://stackoverflow.com/questions/65907518/issues-installing-the-gmt-package-with-julia

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
497 views
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...