Shrink gmtmex.c by growing gmtmex_parser.c to be included in GMT core
Description of the desired feature
The gmtmex.extension library with the mexFunction needs to be built using the user's MATLAB version. Hence, we want to move as much of the code in gmtmex.c into the gmtmex_parser.c as possible to keep things simple. It seems to me that the ultimate mexFunction would just be something like this:
#include "gmtmex.h"
void mexFunction (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
gmt_mexfunction (nlhs, plus, nrhs, prhs);
return;
}
Does gmtmex.c really need more in it, @joa-quim if we just place the rest in gmt_mexfunction and stick in the gmtmex_parser.c in libgmt?
👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. We appreciate that you took the time to contribute!
The benefit of the above is you can write a short paragraph to tell people just make this 5-line file and compile it with max or similar.
I don't think you can shrink it that much. If you move any mxArray (or family) to the GMT lib than the entire GMT would depend on Matlab.
Hm, well gmtmex_parser.c calls mexErrMsgTxt, mxCreateNumericMatrix and lots of things, so it is all requiring a matlab include file, so perhaps there is nothing we can supply that does not require mex include/lib?
Yes, had forgotten about those. So, nope it seems there is nothing valuable that we can move.
I will look but it reduces the scope.