GMT installation in MacOsX

Hello!, I was wondering if you would help me out with some issues related to GMT Installation at MacOsX I am not able to use the scripts from the terminal window, essentially I am copying and pasting the code on the terminal window, even if the script is in a folder at the Users directory please have a look on the top of the image enclosed, I think it is in the Mac’s Temp folder which, to be honest, I don’t understand how it got there in the first place. I have tried with other GMT Version and the problem actually becomes worse, I have tried uninstalling the current version and make a new installation however the issue persists.

. Thank you for your support!

So what happens when you try to run a script in that terminal? You did not say. What are the message you get?

For example, just type in your terminal β€˜gmt psxy’ (without single quotes) and see what happens.

Here is what happens when I Try to run a script.

When I try to use gmt psxy in the termianl is okey I think

Looks like perhaps you are mixing up GMT modern mode module names (coast, basemap, colormap) in GMT classic scripts (which expect pscoast, psbasemap, psscale)?

Well I must say that, I have been following the material that you guys have upload on GAGE Short Course, and I am a new GMT user then I would expect that I am using GMT modern mode but If I type in GMT classic command they would work as well. I try also to look at the Default GMT settings and set them as Default not sure if this could be the problem why I can not run Scripts from the terminal window…

Sorry, we are not involved in any GAGE short course. We are, however, involved in running the UNAVCO GMT for Geodesy course and we only present GMT modern mode there to keep it simple. I understand that this can be confusing for new users. We strongly recommend using modern mode for new users but I think many long-time GMT users running workshops that involve GMT will take a while to switch. Just a heads up.

I see this is the course I am following I think it is the same you have mention.
I there any reason why scripts still can not be used from the terminal? I have try to reintall the GMT 6 version but still things are presenting issues

I mean I still can use GMT and get maps but I always have to copy the comans at the terminal windows, I have check if there is an lack of permids with chmod +x comand and this is not the problem.

OK, yes that is us from 2019! Could you please post your Venezuela_1.sh script so I can see what you are doing?

#!/usr/bin/env bash

Make a GMT map of Venezuela

gmt begin Venezuela pdf,png # Starting our new gmt modern mode session, calling plot Venezuela and ask for pdf and png
#Lay down painted continent with national borders on a Mercator map
gmt coast -R-075/-055/00.0/030.0 -Wfaint -Gwhite -Df -Sazure -B -N1/thick,blue -JM15c -Tdg-72/27+w1.2ci+f3+l, -Lx2.5c/3.8c.+c10+w500k+l+f+at+u
#Tdg Norte -LjBR … Scale

Show where Venezuela is in the world via a map inset

gmt inset begin -DjTR+w4c+o0.2c -M0 -F+gwhite+pthick
    gmt coast -Rg -JG70W/15S/4c -Ggray -Bg -EVE+gblue
gmt inset end

gmt end show # end will finish the plots and open them in a viewer

This is how I get to run the any script I have to copy on the terminal window the comands

So if you look at your first screen shot with the error message, it says β€œUnrecognized graphics format Venezuela”. When I copied your script from your most recent post it ran. So for whatever reasons the gmt begin command gets confused about the session name and the graphics formats. Please type

bash -xv venezuela_1.sh

and post the entire result.

1 Like

like this ?

no, forgot the word β€œbash”

Sorry … I thought this was the prompt…

and SUCCES! …bash -xv venezuela_1.sh

Last login: Tue Jul 14 23:23:11 on ttys002
/bin/bash β€œ/Applications/GMT-6.0.0.app/Contents/MacOS/GMT-6.0.0” GMT_PROMPT
(base) Keylas-MBP:~ Keyla$ /bin/bash β€œ/Applications/GMT-6.0.0.app/Contents/MacOS/GMT-6.0.0” GMT_PROMPT

GMT - The Generic Mapping Tools, Version 6.0.0 [64-bit] [8 cores]
(c) 1991-2019 The GMT Team (https://www.generic-mapping-tools.org/team.html).

Supported in part by the US National Science Foundation (http://www.nsf.gov/)
and volunteers from around the world.

GMT is distributed under the GNU LGP License (GNU Lesser General Public License v3.0 - GNU Project - Free Software Foundation).

usage: gmt [options]
gmt []

options:
–help List descriptions of available GMT modules.
–new-script[=L] Write GMT modern mode script template to stdout.
Optionally specify bash|csh|batch [Default is current shell]
–show-bindir Show directory with GMT executables.
–show-citation Show the most recent citation for GMT.
–show-cores Show number of available cores.
–show-datadir Show directory/ies with user data.
–show-dataserver Show URL of the remote GMT data server.
–show-doi Show the DOI for the current release.
–show-modules Show all module names.
–show-library Show path of the shared GMT library.
–show-plugindir Show directory for plug-ins.
–show-sharedir Show directory for shared GMT resources.
–version Print GMT version number.

if is β€˜=’ we call exit (0) if module exist and non-zero otherwise.

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.0.0.app/Contents/Resources
b) add $GMTHOME/bin to your path
c) export PROJ_LIB=$GMTHOME/share/proj6
d) export MAGICK_CONFIGURE_PATH=$GMTHOME/lib/GraphicsMagick-1.3.33/config
Note 2: GMT may use Ghostscript, GraphicsMagick, FFmpeg, and GDAL executables; see
/Applications/GMT-6.0.0.app/Contents/Resources/share/Licenses for details.

bash-3.2$ ls
2020-Venezuela Untitled.ipynb ex04.pdf samp_sat.pg
Adlm Untitled1.ipynb ex04c.pdf samp_ship.pg
Applications Untitled2.ipynb ex46.pdf sat.pg
Area_Va_Ma.tif.aux.xml Untitled3.ipynb gmt.conf seisan11
Desktop Venezuela.bin gmt.history seismic-unix
Documents Venezuela.pdf great_NY_Canaries.txt seismicVels.cpt
Downloads Venezuela.png great_NY_Paris.txt seisplotF
Dropbox Venezuela_1.sh inset.pdf ship.pg
Ds Venezuela_Contornos.png italy.pdf solid_tide_up.grd
GEOPSY Venezuela_Polygon.pdf italy.png spectrum.admit
GMTHOME Venezuela_Polygon.png lines.pdf spectrum.coh
KRAMIREZ PHD CANDIDATE VirtualBox VMs lines.png spectrum.cpower
Library anaconda3 main.sh spectrum.gain
LogFiles api_colors2cpt_8868.cpt map.pdf spectrum.npower
Maps.qpt api_colors2cpt_9132.cpt meca.dat spectrum.phase
Movies api_colors2cpt_9164.cpt mosaico.qgs spectrum.xpower
Music beachball.pdf mulplt.out spectrum.ypower
Perfiles beachball.png opsnr.stt t.cpt
Pictures beachballs opt t.dat
Plots centers.txt pratt.txt test1.pdf
Public colors.cpt reseisplot
SEISMO count.mp4 sac
Seisplot5 count.webm samp.x
bash-3.2$
bash-3.2$ bash -xv venezuela_1.sh
gmtget () { gmt gmtget β€œ$@”
}
grdproject () { gmt grdproject β€œ$@”
}
grdvector () { gmt grdvector β€œ$@”
}
x2sys_merge () { gmt x2sys_merge β€œ$@”
}
ternary () { gmt ternary β€œ$@”
}
clip () { gmt clip β€œ$@”
}
grdview () { gmt grdview β€œ$@”
}
grd2kml () { gmt grd2kml β€œ$@”
}
gmtspatial () { gmt gmtspatial β€œ$@”
}
sph2grd () { gmt sph2grd β€œ$@”
}
velo () { gmt velo β€œ$@”
}
polar () { gmt polar β€œ$@”
}
originater () { gmt originater β€œ$@”
}
grdcontour () { gmt grdcontour β€œ$@”
}
grdedit () { gmt grdedit β€œ$@”
}
grdgradient () { gmt grdgradient β€œ$@”
}
gshhg () { gmt gshhg β€œ$@”
}
grdblend () { gmt grdblend β€œ$@”
}
kml2gmt () { gmt kml2gmt β€œ$@”
}
triangulate () { gmt triangulate β€œ$@”
}
xyz2grd () { gmt xyz2grd β€œ$@”
}
grdclip () { gmt grdclip β€œ$@”
}
subplot () { gmt subplot β€œ$@”
}
polespotter () { gmt polespotter β€œ$@”
}
blockmean () { gmt blockmean β€œ$@”
}
gmtinfo () { gmt gmtinfo β€œ$@”
}
mask () { gmt mask β€œ$@”
}
nearneighbor () { gmt nearneighbor β€œ$@”
}
mgd77header () { gmt mgd77header β€œ$@”
}
gmtregress () { gmt gmtregress β€œ$@”
}
legend () { gmt legend β€œ$@”
}
mgd77path () { gmt mgd77path β€œ$@”
}
mgd77sniffer () { gmt mgd77sniffer β€œ$@”
}
grdreformat () { gmt grdreformat β€œ$@”
}
movie () { gmt movie β€œ$@”
}
fitcircle () { gmt fitcircle β€œ$@”
}
text () { gmt text β€œ$@”
}
rotconverter () { gmt rotconverter β€œ$@”
}
x2sys_solve () { gmt x2sys_solve β€œ$@”
}
grdtrend () { gmt grdtrend β€œ$@”
}
greenspline () { gmt greenspline β€œ$@”
}
image () { gmt image β€œ$@”
}
sphtriangulate () { gmt sphtriangulate β€œ$@”
}
dimfilter () { gmt dimfilter β€œ$@”
}
gmtdp () { gmt gmtdp β€œ$@”
}
blockmedian () { gmt blockmedian β€œ$@”
}
grdgravmag3d () { gmt grdgravmag3d β€œ$@”
}
grd2xyz () { gmt grd2xyz β€œ$@”
}
img2grd () { gmt img2grd β€œ$@”
}
solar () { gmt solar β€œ$@”
}
gmtselect () { gmt gmtselect β€œ$@”
}
psconvert () { gmt psconvert β€œ$@”
}
grdtrack () { gmt grdtrack β€œ$@”
}
histogram () { gmt histogram β€œ$@”
}
gmtpmodeler () { gmt gmtpmodeler β€œ$@”
}
grdmath () { gmt grdmath β€œ$@”
}
grdredpol () { gmt grdredpol β€œ$@”
}
x2sys_put () { gmt x2sys_put β€œ$@”
}
splitxyz () { gmt splitxyz β€œ$@”
}
grdseamount () { gmt grdseamount β€œ$@”
}
grdpaste () { gmt grdpaste β€œ$@”
}
mgd77list () { gmt mgd77list β€œ$@”
}
mgd77magref () { gmt mgd77magref β€œ$@”
}
segyz () { gmt segyz β€œ$@”
}
coupe () { gmt coupe β€œ$@”
}
hotspotter () { gmt hotspotter β€œ$@”
}
x2sys_report () { gmt x2sys_report β€œ$@”
}
trend2d () { gmt trend2d β€œ$@”
}
mgd77manage () { gmt mgd77manage β€œ$@”
}
mgd77track () { gmt mgd77track β€œ$@”
}
sac () { gmt sac β€œ$@”
}
x2sys_cross () { gmt x2sys_cross β€œ$@”
}
docs () { gmt docs β€œ$@”
}
mapproject () { gmt mapproject β€œ$@”
}
rose () { gmt rose β€œ$@”
}
gpsgridder () { gmt gpsgridder β€œ$@”
}
gmtconnect () { gmt gmtconnect β€œ$@”
}
gravfft () { gmt gravfft β€œ$@”
}
minmax () { gmt minmax β€œ$@”
}
gmtwhich () { gmt gmtwhich β€œ$@”
}
grdfilter () { gmt grdfilter β€œ$@”
}
gmtstitch () { gmt gmtstitch β€œ$@”
}
segy () { gmt segy β€œ$@”
}
sphdistance () { gmt sphdistance β€œ$@”
}
grdrotater () { gmt grdrotater β€œ$@”
}
grdsample () { gmt grdsample β€œ$@”
}
gmtset () { gmt gmtset β€œ$@”
}
grd2cpt () { gmt grd2cpt β€œ$@”
}
x2sys_datalist () { gmt x2sys_datalist β€œ$@”
}
grdfill () { gmt grdfill β€œ$@”
}
talwani2d () { gmt talwani2d β€œ$@”
}
begin () { gmt begin β€œ$@”
}
end () { gmt end β€œ$@”
}
inset () { gmt inset β€œ$@”
}
project () { gmt project β€œ$@”
}
segy2grd () { gmt segy2grd β€œ$@”
}
grdimage () { gmt grdimage β€œ$@”
}
earthtide () { gmt earthtide β€œ$@”
}
surface () { gmt surface β€œ$@”
}
coast () { gmt coast β€œ$@”
}
gmtdefaults () { gmt gmtdefaults β€œ$@”
}
grdconvert () { gmt grdconvert β€œ$@”
}
grdspotter () { gmt grdspotter β€œ$@”
}
basemap () { gmt basemap β€œ$@”
}
gmt () { β€œ${BUNDLE_RESOURCES}/bin/gmt” β€œ$@”
}
sphinterpolate () { gmt sphinterpolate β€œ$@”
}
x2sys_list () { gmt x2sys_list β€œ$@”
}
ps2raster () { gmt ps2raster β€œ$@”
}
grdinfo () { gmt grdinfo β€œ$@”
}
grdmask () { gmt grdmask β€œ$@”
}
sample1d () { gmt sample1d β€œ$@”
}
gmtflexure () { gmt gmtflexure β€œ$@”
}
mgd77info () { gmt mgd77info β€œ$@”
}
meca () { gmt meca β€œ$@”
}
grdfft () { gmt grdfft β€œ$@”
}
grdhisteq () { gmt grdhisteq β€œ$@”
}
grdvolume () { gmt grdvolume β€œ$@”
}
figure () { gmt figure β€œ$@”
}
plot3d () { gmt plot3d β€œ$@”
}
gmtconvert () { gmt gmtconvert β€œ$@”
}
gmtvector () { gmt gmtvector β€œ$@”
}
talwani3d () { gmt talwani3d β€œ$@”
}
grdpmodeler () { gmt grdpmodeler β€œ$@”
}
rotsmoother () { gmt rotsmoother β€œ$@”
}
makecpt () { gmt makecpt β€œ$@”
}
plot () { gmt plot β€œ$@”
}
gmtmath () { gmt gmtmath β€œ$@”
}
trend1d () { gmt trend1d β€œ$@”
}
grdflexure () { gmt grdflexure β€œ$@”
}
wiggle () { gmt wiggle β€œ$@”
}
gmt2rgb () { gmt gmt2rgb β€œ$@”
}
colorbar () { gmt colorbar β€œ$@”
}
x2sys_get () { gmt x2sys_get β€œ$@”
}
gmtlogo () { gmt gmtlogo β€œ$@”
}
blockmode () { gmt blockmode β€œ$@”
}
contour () { gmt contour β€œ$@”
}
grdlandmask () { gmt grdlandmask β€œ$@”
}
gmtgravmag3d () { gmt gmtgravmag3d β€œ$@”
}
x2sys_init () { gmt x2sys_init β€œ$@”
}
events () { gmt events β€œ$@”
}
grdcut () { gmt grdcut β€œ$@”
}
mgd77convert () { gmt mgd77convert β€œ$@”
}
x2sys_binlist () { gmt x2sys_binlist β€œ$@”
}
filter1d () { gmt filter1d β€œ$@”
}
gmtsimplify () { gmt gmtsimplify β€œ$@”
}
gmt2kml () { gmt gmt2kml β€œ$@”
}
spectrum1d () { gmt spectrum1d β€œ$@”
}
clear () { gmt clear β€œ$@”
}
backtracker () { gmt backtracker β€œ$@”
}
#!/usr/bin/env bash

Make a GMT map of Venezuela

gmt begin Venezuela pdf,png # Starting our new gmt modern mode session, calling plot Venezuela and ask for pdf and png

  • gmt begin Venezuela pdf,png
  • /Applications/GMT-6.0.0.app/Contents/Resources/bin/gmt begin Venezuela pdf,png
    #Lay down painted continent with national borders on a Mercator map
    gmt coast -R-075/-055/00.0/030.0 -Wfaint -Gwhite -Df -Sazure -B -N1/thick,blue -JM15c -Tdg-72/27+w1.2ci+f3+l, -Lx2.5c/3.8c.+c10+w500k+l+f+at+u
  • gmt coast -R-075/-055/00.0/030.0 -Wfaint -Gwhite -Df -Sazure -B -N1/thick,blue -JM15c -Tdg-72/27+w1.2ci+f3+l, -Lx2.5c/3.8c.+c10+w500k+l+f+at+u
  • /Applications/GMT-6.0.0.app/Contents/Resources/bin/gmt coast -R-075/-055/00.0/030.0 -Wfaint -Gwhite -Df -Sazure -B -N1/thick,blue -JM15c -Tdg-72/27+w1.2ci+f3+l, -Lx2.5c/3.8c.+c10+w500k+l+f+at+u
    gmt [ERROR]: GMT_COMPATIBILITY: Expects values from 6 to 6; reset to 6.
    #Tdg Norte -LjBR … escala

Show where Venezuela is in the world via a map inset

gmt inset begin -DjTR+w4c+o0.2c -M0 -F+gwhite+pthick
  • gmt inset begin -DjTR+w4c+o0.2c -M0 -F+gwhite+pthick
  • /Applications/GMT-6.0.0.app/Contents/Resources/bin/gmt inset begin -DjTR+w4c+o0.2c -M0 -F+gwhite+pthick
    gmt [ERROR]: GMT_COMPATIBILITY: Expects values from 6 to 6; reset to 6.
    gmt coast -Rg -JG70W/15S/4c -Ggray -Bg -EVE+gblue
  • gmt coast -Rg -JG70W/15S/4c -Ggray -Bg -EVE+gblue
  • /Applications/GMT-6.0.0.app/Contents/Resources/bin/gmt coast -Rg -JG70W/15S/4c -Ggray -Bg -EVE+gblue
    gmt [ERROR]: GMT_COMPATIBILITY: Expects values from 6 to 6; reset to 6.
    gmt inset end
  • gmt inset end
  • /Applications/GMT-6.0.0.app/Contents/Resources/bin/gmt inset end
    gmt [ERROR]: GMT_COMPATIBILITY: Expects values from 6 to 6; reset to 6.
    gmt end show # end will finish the plots and open them in a viewer
  • gmt end show
  • /Applications/GMT-6.0.0.app/Contents/Resources/bin/gmt end show
    gmt [ERROR]: GMT_COMPATIBILITY: Expects values from 6 to 6; reset to 6.
    bash-3.2$

I do not understand all the GMT_COMPATIBILITY errors you get. I have none of those running your script on GMT 6.0.0. Do you have an old gmt.conf file in that directory?

When I was trying to β€œfix” the issue with the terminal, I used a comand to set the default parameters of the gmt.conf and I think it made two of them. not sure really if it is duplicated

it is working, the comand that I used to set the default parameters was gmtset