MATLAB: Using the Matlab DLL – do we need a licence

dlllicense

We are a 3rd-party programming company, planning to provide an interface between two packages, one of which uses MatLab. In order to test our interface, we need to be able to link against the MatLab DLL – do we need a licence to do this or can the application that actually makes the calls into MatLab give us the DLL without us having to license it?
TIA
K

Best Answer

The license terms for Mathworks' products get very confusing when it comes to generated code and "derived" products. I do not understand the terms myself, and the parts I do understand appear to say unlikely things on the order of "You aren't allowed to do this! But if you do do it (wink wink) then here are the rules you have to follow when you don't do it (wink wink)." When it gets into those matters I would want a lawyer to look into it.
MCR, Mathworks Component Runtime, I am not sure that it is licensed as a separate entity. When someone uses MATLAB Compiler or MATLAB Compiler SDK (old names for that product included the word "Builder") to generate an executable, they are responsible for distributing MCR with the executable in a controlled way (it looked like allowing public access is still not allowed.) But anyone can download later versions of MCR from Mathworks itself, for use with executables generated by MATLAB Compiler or MATLAB Compiler SDK.
In the normal course of events, the organization that compiled their MATLAB code would provide you with MCR for use with their application and away you would go, calling their application to do things, with you not making direct reference to MCR.
But it sounds as if you intend to make direct calls into MCR. And that is a problem. My recollection is that the API / ABI for MCR is unpublished and working out the calls would require "reverse engineering" and "decompiling", both of which are prohibited by Mathworks.
If you are creating mex routines that use the published interface calls (such as getting data pointer, allocating storage) then... mumble, mumble, mumble... I don't know? The license was hard to read about that. I suspect the answer is "Not Allowed but you could pay for permission by special arrangement".
What would be allowed is for you to provide the mex routines to the company which compiled the application, and then they could compile them into the executable.
But if you are doing this all without the active participation of that company, extending a commercial product, then I believe that would be against the Mathworks terms but it would need a lawyer to work through to be sure. You would, I suspect be in a better legal position if you had a MATLAB Compiler license yourself (along with licenses for whatever toolboxes had been compiled into the other product). I do recall that there is specific information in the license terms about what form it is allowed to distribute routines in.
If you have a copy of MATLAB then go into it and start the documentation browser with "doc" and then look in the middle of the bottom, where there will be a link to the Terms and Conditions. Reading them is a bit dry. Have coffee or chocolate or chips on hand to get you through.