Trying to set up a new MacBook Pro with GMT. If this question has been addressed already in the forum, please feel free to point me to it… I’ve searched but cannot find what I am looking for. Been using GMT a long time, but always have issues with set up as I can never remember what I did n years ago when I set up the previous machine. Presently working on a Windows machine through cygwin, so I haven’t had to set up a Mac in nearly 10 years (and yes, that old machine is still going, sort of…) Anyway, I digress…
Situation so far, I have downloaded installed and launched GMT 6.4 for the first time. I used the Application Bundles from the GitHub. Trying to get the GMT to be callable from other directories. I tried the commands below, but I am not sure what to do on (b)…
Note 1: If you want to use GMT outside of this terminal or in scripts, then follow these steps:
a) export GMTHOME=/Applications/GMT-6.4.0.app/Contents/Resources
b) prepend $GMTHOME/bin to your path
c) export PROJ_LIB=$GMTHOME/share/proj
d) export GS_LIB=$GMTHOME/share/ghostscript/Resource/Init
e) export MAGICK_CONFIGURE_PATH=$GMTHOME/lib/GraphicsMagick/config
I did something (followed some instructions from somewhere on the web) and now when I go:
Hi Jose, if you wish to continue to run GMT4-style commands (no leading “gmt”) then see the sidebar item called Migrating from an Earlier Version on how to handle the missing gmt command.
Also, if you installed 6.4 you will need to edit your init file (.bashrc, .bash_profile, .profile, .cshrc or whatever) to change that 6.3 to 6.4 in the PATH.
See the list of init files I mentioned (.bashrc etc) and open in editor and make the changes in the file that mas the /Application/GMT-6.3.0.app entry (fix it so it ends with the bin dir). Then quit terminal and start it up again. Now the PATH will be updated.
I changed the ‘3’ to a ‘4’ and now it works. didn’t notice that it was on ‘3’. was a leftover from when I first tried a few days ago before you released 6.4. then I downloaded 6.4 and threw away 6.3, so yeah, that’s why…
As for the /.profile thing, I have no Idea, I saw it somewhere online, lost the link now.
I got it all working, calling GMT from anywhere, so that is good,
I then modified my ancient script to add the ‘GMT’ bit before each command (still working in classic for now).
Everything runs fine but the GMT psconvert fails because I never ran items c, d or e above. I can see the plot I am making just fine in the .ps file
As a test, I ran those commands (a, c, d and e) in the terminal window where I was working, and after that, my GMT script worked great, I got the .png I was looking for.
but, as I suspected, when I quit terminal and started up again, those configurations were lost.
also, now I cannot replicate that behavior, i.e. running commands a, c, d, and e before running my script does not lead to successfully running GMT psconvert
do I put them in the .profile file as part of the $PATH? if so, I’m just not sure how that looks.
In order to assist anyone else searching through the forum for this type of info, here is what I did:
Computer:
MacBook Pro 2021 Model
macOS Monterey (12.4)
Installed GMT 6.4 from application bundles, double clicked it from inside ‘Applications’ folder. It gives you the following notes/instructions:
"Note 1: If you want to use GMT outside of this terminal or in scripts, then follow these steps:
a) export GMTHOME=/Applications/GMT-6.4.0.app/Contents/Resources
b) prepend $GMTHOME/bin to your path
c) export PROJ_LIB=$GMTHOME/share/proj
d) export GS_LIB=$GMTHOME/share/ghostscript/Resource/Init
e) export MAGICK_CONFIGURE_PATH=$GMTHOME/lib/GraphicsMagick/config
Note 2: GMT may use Ghostscript, GraphicsMagick, FFmpeg, and GDAL executables; see
/Applications/GMT-6.4.0.app/Contents/Resources/share/Licenses for details."
To accomplish the above:
change the default shell to bash in the Terminal preferences (original default is zsh)