GMT 6.1.1_3 not supported by Julia

Hi everyone.
I just updated to GMT 6.1.1_3 in my Mac and tried to call it from Julia and I get this error:

ERROR: could not load library “/usr/local/Cellar/gmt/6.1.1_2/lib/libgmt.dylib”
dlopen(/usr/local/Cellar/gmt/6.1.1_2/lib/libgmt.dylib, 1): image not found

Any idea how can I fix it?

Did you install the GMT bundle?
Unfortunately Apple does so dark magic to it that the bundle does not work for externals (Julia, Matlab, Python, etc…). Use homebrew.


I think it means you installed GMT using Homebrew.

The problem is that although you installed GMT 6.1.1_3, GMT.jl still tries to load the old library (GMT 6.1.1_2). So you should tell GMT.jl to load the correct version.

I think you must set GMT_LIBRARY to point to this specific libgmt.dylib file before staring Julia

No, no need to set anything. But Dongdong got it. If the lib has changed address (but why would it? The public name is a symbolic link with always the same name) Julia still remembers the old address until you force a new precompile.
Anyway try to delete your equivalent of mine C:\Users\joaqu\.julia\compiled\v1.6\GMT and launch Julia again. This will force a precompile.

You need to do that but that’s because of the Xcode oddities in finding the debug lib.

Well, I did:

  • deleted GMT from:

  • Reinstalled it from brew (just in case)

  • Removed and reinstalled the packaged
    And it didn’t work

At the end, I had to go back to the original Mac zsh shell (I was using tcsh), restart my Mac and do all the previous steps. And it finally works!

Don’t understand this. In first point you deleted the pre-compiled version of GMT.jl but the second point has nothing to do with GMT.jl that you cannot install from brew (thatI know of).

Any way, thanks for bringing this up. I will have to think on a strategy for GMT.jl on Macs that change the full name of the gmtlib on each upgrade.

You are right. The first and second point don’t have any relationship. I just did it in case there was something weird with the brew install.

I think the major problem was the shell that was being used.