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

UndefVarError: GMT_Create_Session not defined #416

Closed
machar94 opened this issue Aug 13, 2020 · 2 comments
Closed

UndefVarError: GMT_Create_Session not defined #416

machar94 opened this issue Aug 13, 2020 · 2 comments

Comments

@machar94
Copy link

machar94 commented Aug 13, 2020

Hello, I am running into an error when running the hello world for GMT.

using GMT
plot(1:10, rand(10), lw=1, lc=:blue, fmt=:png, marker=:square,
     markeredgecolor=0, size=0.2, markerfacecolor=:red, title="Hello World",
     xlabel="Spoons", ylabel="Forks", show=true)

I receive UndefVarError: GMT_Create_Session not defined.

Screen Shot 2020-08-13 at 12 22 22 AM

I've seen #402, and from the resolution tried installing both GMT and the Julia package but still run into the same issue. I've tried installing GMT on my mac with the dmg file and through homebrew. I read what you said about libgmt.jl being included in the package and I do indeed have the file so I'm really confused why gmt_main.jl cannot see the function. I've also tried running plot both in the jupyter notebook and in the REPL run into the issue still. Do you have any ideas/suggestions on what I can do to debug this? I really appreciate it. Thank you.

GMT version: 6.1.0
GMT.jl version 0.23
macOS Catalina 10.15.5
Julia version 1.4.1

@joa-quim
Copy link
Member

Sorry, I cannot make sense out of this error. The GMT.jl file imports the libgmt.jl file which defines GMT_Create_Session, so how can it not be defined? What does this do?

API = GMT.GMT_Create_Session("GMT", 2, GMT.GMT_SESSION_NOEXIT + GMT.GMT_SESSION_EXTERNAL + GMT.GMT_SESSION_COLMAJOR);

If you do a import("/path/to/GMT.jl"), does it make any difference?

Note that the dmg GMT install will probably not work due to mysterious things that OSX is doing under the hood (see #298) but the homebrew build should be fine.

Note, I'm on travel (vacations) so my replies are irregular.

@machar94
Copy link
Author

Hey Joa-quim. Appreciate your quick response. I'm not sure if I restarted my machine or what, but I did uninstall the dmg and used the homebrew install on my mac and it did work. Thanks!

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