Building gmt-mex under OS X¶
We have tested both MATLAB® 2015a to 2016b - older versions may also work but we have not tested those under OS X. The steps to build gmt-mex are several:
- Install the GMT 5.3.2 OS X bundle from the main GMT Download page; this will add GMT-5.3.2 to /Applications.
- Run the script
/Applications/GMT-5.3.2.app/Contents/Resources/share/tools/gmt_prepmex.shThis script will create a clone in /opt/gmt (so you will be asked for your sudo password) where all the shared libraries will be re-baptized to avoid clashes with MATLAB® shared libraries of the same names.
- Obtain the gmt-mex source code: cd into a suitable directory for development (e.g., GMTdev) and run
svn co svn://gmtserver.soest.hawaii.edu/gmt-mex/trunk gmt-mex
- Make sure GMT 5.3.2 is in your path; Use gmtswitch to select your active GMT version if you have more than one installed (see the gmtswitch documentation if you have never used this facility before).
- In the gmt-mex directory, run
autoconf ./configure --enable-matlab
- Then cd into src and run
make all make installThis should build the gmtmex.mexmaci64 application, which is needed by the gmt.m script you will be using, and install them with the rest of the GMT executables.
- Add /opt/gmt/bin to your MATLAB path, or alternatively copy these two files to a place where MATLAB can find them.