Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API not defined GMT 6.1.1 Julia 1.5.3 #485

Closed
RobertVattenfall opened this issue Dec 15, 2020 · 6 comments
Closed

API not defined GMT 6.1.1 Julia 1.5.3 #485

RobertVattenfall opened this issue Dec 15, 2020 · 6 comments

Comments

@RobertVattenfall
Copy link

I have upgraded to a new computer from GMT 5.4.3 / Julia 1.2 to now GMT 6.1.1 Julia 1.5.3.
Getting the error "API not defined" when calling any GMT module with gmt(). Another question is why do I get a version 5 no longer support on the first using GMT?:
Thank you in advance.

Version 1.5.3 (2020-11-09)
julia> readlines(gmt --version)
1-element Array{String,1}:
"6.1.1"

julia> using GMT

    GMT version 5 is no longer supported (support ended at 0.23). Must uptdate.

julia> using GMT

julia> gmt("pscoast -R-10/0/35/45 -B1 -W1 -Gbrown -JM14c -P -V > lixo.ps")
ERROR: UndefVarError: API not defined
Stacktrace:
[1] gmt(::String) at C:\Users\username.julia\packages\GMT\3tQ7w\src\gmt_main.jl:163
[2] top-level scope at REPL[3]:1

julia>

@joa-quim
Copy link
Member

So strange. First, the two problems are the same. If it doesn't detect a GMT6 then the API error naturally follows. What does GMTver prints?

The strange thing is that inside GMT.jl it seems to fail in detecting the GMT version but the same instruction correctly detects it from REPL.

@RobertVattenfall
Copy link
Author

julia> GMTver
5.45
I forgot to mention, that I first installed Julia 1.5.3, then GMT 5.4. Then discovered that GMT5 was no longer supported. Then installed GMT6, then got the above errors. Then uninstalled GMT.jl using the package manager and reinstalled GMT.
So it appears to me that Julia thinks I am using GMT5, but by issuing readlines(gmt --version), the "gmt" is read via the OS, and the OS thinks correctly, I am using GMT6.
If you have no other suggestion, then perhaps I should uninstall GMT5 and see where this leaves me?

@RobertVattenfall
Copy link
Author

I guess my comment above did not make sense as GMTver shows 5.45. Seems like GMT.jl somehow thinks the path points to GMT5, while the OS thinks it is correctly GMT6. This I hoped would have been corrected by reinstalling the GMT.jl package. Maybe I have to erase everything Julia, GMT, Ghostscript and start over.?

@joa-quim
Copy link
Member

It should be possible to use different GMT versions (I do) where the one is picked is the first found in the OS path.
The problem is clearly that somehow Julia kept the info about the previous GMT and I don't understand why the readlines(gmt --version) command is giving different results when run from within GMT.jl and from the REPL.

Try removing .......\.julia\compiled\v1.5\GMT dir

@RobertVattenfall
Copy link
Author

That worked. Thanks so much. Saved me lots of time while teaching me something new.
/Robert

@joa-quim
Copy link
Member

Good. I also learned that I must do something more if I want to detect when different GMT6 versions may have arrived.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants