macOS GMT 6.3.0 bundle alias mystery

I’m running macOS 12 (Monterey) on an M1 Max machine, and have installed the GMT 6.3.0 bundle. If I run scripts in the Terminal window which the bundle opens, all is well. For convenience I’ll call this window the Bundle Terminal.

I have included the items at the end of the splash screen into .bash_profile so that I can run scripts in arbitrary other Terminal windows (referred to below as Other Terminal), and most things are well, except that Ghostscript fails.

I can see that in the folder pointed to by $GMSTHOME/bin the previous gs is now an alias to gsc. In the Bundle Terminal, if I type gs --version or gsc --version I get the same response.

On the other hand, in the OtherTerminal, if I type gsc --version, I get the same as before, but if I type gs --version I get several lines of errors which suggest that I’ve reached /usr/local/bin/gs-x11 instead.

If I use the alias command to point gs to gsc, then gs --version works in the Other Terminal, but my script still fails as psconvert still can’t find Ghostscript.

I don’t know why the Bundle Terminal and the Other Terminal are behaving differently in this respect.


PS: I have the GMT 6.0.0 bundle running on an Intel Mac under 10.14.6 Mojave, which still has Ghostscript as gs, and here these same scripts run fine.

Does the $GMTHOME/bin entry come head of your other paths in your .bash_profile? It would seem your shell looks elsewhere first and fins the x11 version of gs. Could you also post the message from psconvert when it fails?

I put $GMTHOME/bin after everything else:

And here is the set of messages:

MacBook-Pro-M1max:GMT_tutorial francis$ gmt end show
sh: line 1: 18853 Abort trap: 6 gs --version 2> /dev/null
psconvert [ERROR]: Cannot execute Ghostscript (gs).
end [ERROR]: Failed to call psconvert
end [ERROR]: gmtinit_process_figures returned error 79


And thanks, yes, putting it at the front of the PATH has solved it!


ID-2020-17_Bubble_Nebula.pdf (46.2 KB)

ID-2020-17_Bubble_Nebula.pdf (46.2 KB) ID-2020-17_Bubble_Nebula.pdf (46.2 KB)

Oops, too many attempts to upload it ;-(

Great, we will improve the message in the splash screen as to the placement of that path in PATH.

Thanks for getting to the bottom of it so quickly, and nice to think this has been somehow useful :wink:

Thank you, and I have updated the message to say “prepend to path”. Merged into master already.