This is the old version of the GMT install page. For the new version go here.
NOTE: You need to make sure xcode is installed before compiling GMT. I will add instructions soon, but for now try a web search.
Start off by installing fink if you don't have it already. If you urgently want a working version of GMT then just type "fink install gmt" to install it and it will install its dependencies too. I don't recommend this as they are generally behind in versions and if you then add a newer version to your machine you may have to remove the /sw/bin (or similar) path from your executable path list which means other programs may not be available (in theory "gmtswich" should help here but it didn't work with me).
So why do I need fink? Well I couldn't easily get GMT to auto-compile netCDF3.6, it seems to have something to do with the c++ compiler available as part of gcc on OS X, so I'm going to get that from fink... Even though the GMT website tells you to get netCDF version 3.6 I have experienced no problems with version 3.5. So, do this:
"fink install gcc3.3"
"fink install netcdf"
You will need to know the netCDF path for the GMT install so find that out by typing
"which ncdump"
Don't forget if you have just added this path then you will need to open a new shell window or type "source ~/.cshrc" (assuming c shell - perhaps "source ~/.profile" for bourne-type shells on the mac).
I thought this was going to be easy to write up. Bloody Hell.
So I think you are ready to install GMT. Create your directory where you want to put all GMT versions; I recommend using just "GMT" or "GMTdev" but it doesn't really matter as long as you know where everything is. OK, here goes. Go to the GMT website, click on downloads and read the instructions! Go to the fast-track section and click on the install form link. Once again read the instructions. This form creates a file you use to download and compile GMT automatically so get it right from the start. See the 'Basic Requirements' section? Make sure you download the "install_gmt" script from the link provided and save it in your newly created GMT directory; it will need executable permission too so check that
"ls -al" will show the permissions and
"chmod u+x" will add user executable permission.
Right then, the form.
1. Choose your desired GMT version from the drop-down menu.
2. Use bzip2 if you can as it gives smaller archives to download, but hardly a critical decision unless you are extremely impatient (if this is the case then perhaps you should consider never attempting to compile anything ever).
3. SI units obviously.
4. I use eps for compatibility, but not critical.
5. YES.
Section B
1. Select netCDF is already installed and insert your netCDF path here. Probably /sw/bin if you installed it using fink.
Section C
1. Yawn. Whatever.
2. Passive.
3. Select everything as in my experience you will randomly want something later that you didn't even know existed before and have to do this all over again.
Umm, 3. again. Use Shewchuck unless you plan on making bucketloads of cash using your scripts or are otherwise are going to break the license agreement. Of course if you are following the cash plan then you are hardly likely to be in academia and reading this are you?
4. Static, but I'm not much of a risk taker.
5. Select "gcc" from the drop-down menu. Probably doesn't matter as on my system fink helpfully created "cc" as well and made a static link that pointed it to "gcc".
6. Use make.
7. In each of these type the path to your gmt directory followed by something suitable. I use bin, lib, include, data, man, www for each of the options but it really doesn't matter as long as you know. An example would be "/usr_apps/GMT/GMT4.1.1/bin".
8. Can be left blank or type it in if you are anal.
9. Yes, put them all in $GMTHOME/share, if you have enough space.
10. All of them, I'm bored of working out what might be relevant now. Also put your matlab path here, mine was "/Applications/MATLAB704" for example.
11. Delete them unless you like wasting space and run the example scripts for the sake of it. Doesn't take much extra time and at least you know it works.
Click "Get parameters" and save the file much as it says. Make sure it is in your GMT path you created. You can get the parameter files I used and edit them for your system if you like for v4.1.1 and v3.4.6. You are ready to install now.
v4.1.3 GMTparam file is now available.
Still here? This is the easy bit.
Within a terminal window go to your GMT path.
Type
"sh install_gmt <parameter file>" where <parameter file> is the name of your parameter file that you lovingly nurtured to life not a couple of minutes ago. Sit back and watch the archives being downloaded, unpacked and compiled. Make a cup of tea. Browse the web. Flirt with your neighbour. Quite frankly I don't care what you do.
Once this has successfully compiled take a careful note of the instructions given at the end. Assuming you use a c shell then add the path to your .cshrc file and it will work beautifully. Add the other lines too!
If want the alternative version on GMT too (I did) then repeat the process by either recreating the parameter file or modifying the existing one. When you do have multiple versions then you should have one executable path commented out in your .cshrc file so you control which version you use. Apparently "gmtswich" should make this unnecessary, but it doesn't work for me as I believe I mentioned before.
Finally if you do have an old version of GMT installed by fink I recommend removing it from your system as you may end up using that instead of your own carefully crafted versions.
"fink remove gmt" should do the trick.