This directory contains instructions (this file) and supporting files for 
setting up mex to use MinGW compilers to produce MEX-files.

NOTE: This does not apply to the 'MATLAB Support for MinGW-w64 C/C++ Compiler' 
Add-On: what we are concerned with here is setting mex to use external MinGW 
compilers.

==========================================
Setup MinGW compilers to produce MEX files
==========================================
- Start an instance of MATLAB
- Navigate to $ISSM_DIR/externalpackages/mingw-mex
- In the MATLAB Command Window run,

	>> configuremingw

- In the resulting prompt, navigate to the root MinGW gcc directory (if you 
have followed the Windows installation instructions on our Web site, 
https://issm.jpl.nasa.gov/download/windows, this should be 
'C:\msys64\mingw64').
- Verify that configuration was successful,

	>> mex -setup C
	MEX configured to use 'MinGW64 Compiler (C)' for C language compilation.
	>> mex -setup C++
	MEX configured to use 'MinGW64 Compiler (C++)' for C++ language compilation.

If configuration was unsuccessful, see if a new version of configuremingw.p is 
available at,

	https://www.mathworks.com/matlabcentral/answers/313298-i-already-have-mingw-on-my-computer-how-do-i-configure-it-to-work-with-matlab

If so, please notify us on the ISSM Forum at https://issm.ess.uci.edu/forum so 
that we can update the file in our repository.

=========================
Building yprime.c Example
=========================
- Start an instance of MATLAB
- Navigate to $ISSM_DIR/externalpackages/mingw-mex
- In the MATLAB Command Window run,

	>> copyfile(fullfile(matlabroot,'extern','examples','mex','yprime.c'),'.','f')
	>> mex yprime.c

- Test the generate MEX file with,

	>> yprime(1,1:4)

	ans =

	    2.0000    8.9685    4.0000   -1.0947

Sources:
- https://www.mathworks.com/help/matlab/matlab_external/install-mingw-support-package.html
