-
Notifications
You must be signed in to change notification settings - Fork 7
Initial draft of MEX best practice #23
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
base: main
Are you sure you want to change the base?
Conversation
This will require internal MathWorks review before it's merged into main. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
I'm glad this is its own standalone document and not part of the main Toolbox Design doc.
At the top, maybe give etymology of MEX as "MATLAB EXecutable file".
"Let's explore the world of MEX integration!" This sounds a little too ChatGPT chirpy.
Maybe mention earlier that the actual compiled MEX files themselves are derived via the build process and so don't even appear in the folder. We only see, for example, subtract.m and subtract.cpp.
We should be clear about the fact that derived files shouldn't be checked into revision control. The whole concept of derived files is alien to a lot of our pure MATLAB users (i.e. they never really trained on any other language or language ecosystem).
Typo? line 47 "mex function" => "MEX function"?
It would be great if this documentation included some comments to address forward / backward compatibility of MEX binaries with different versions of MATLAB. From what I've read, there is no guarantee that a MEX file compiled and linked against one version of ML will work with another (this appears to be the official stance, and these forum posts agree: post 1, post 2). With that in mind, it seems like the official best practices for building a toolbox which targets different versions of ML might be either:
|
Hi @colbysparks, thanks for commenting on this -- definitely interested in any and all insights you have.
I would offer a third option: Automated multirelease testing of your MEX functions. Our GitHub Actions provide a way to run your tests automatically against a range of releases and platforms. Visit my Climate Data Store Toolbox for an example of doing that. That said, I will consult with some of our experts to see if there's something we can do to provide guidance on this. Would you open an issue on the repository about this? Thanks, |
|
||
```matlab | ||
function plan = buildfile | ||
% !!Revise to work in 24b!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- @bpancras to revise this (or delete the comment
* Removed commented out sections. Revised use of "YML" to "YAML" (which is [preferred](https://stackoverflow.com/questions/22268952/what-is-the-difference-between-yaml-and-yml-extension)) * Corrected copyright
When merged, this Closes: #10 |
The proposed organization is meant for toolboxes that implement MEX functions using C/ C++/ Fortran for implementing features. They might also interface with external libraries.