Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shrink gmtmex.c by growing gmtmex_parser.c to be included in GMT core #12

Open
PaulWessel opened this issue Sep 22, 2020 · 6 comments
Open

Comments

@PaulWessel
Copy link
Member

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?

@welcome
Copy link

welcome bot commented Sep 22, 2020

👋 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!

@PaulWessel
Copy link
Member Author

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.

@joa-quim
Copy link
Member

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.

@PaulWessel
Copy link
Member Author

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?

@joa-quim
Copy link
Member

Yes, had forgotten about those. So, nope it seems there is nothing valuable that we can move.

@PaulWessel
Copy link
Member Author

I will look but it reduces the scope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants