My client has a network that doesn't have access to the internet. They intend to buy (very few) Matlab licenses just for the development efforts of me and my colleague. For the operational use by their staff, however, I should compile my Matlab code to *.exe files so that the operators don't use up licenses just to execute my Matlab "app"/"solution" (the language seems to be changing these days). They won't actually have mcc
licenses, so the compiling will be done on my home organization's network.
The problem is that when the compiled executable runs, there doesn't seem to be an obvious way to force it to use Matlab Compiler Runtime (MCR). If there are Matlab licenses on the target system, it can use that as well. The whole point of compiling, however, is to avoid using the few licenses on the client network so that the licenses are available for m-file development work when needed. So the unique feature about this situation seems to be that the target environment will eventually have both Matlab licenses and MCR, as well as the requirement that compiled executables use only the MCR rather than the Matlab licenses.
The Mathworks is looking into the problem, but prospects of finding a solution are unclear. I am hoping that it won't involve manual rejigging login scripts to customize environment PATH variables, as that will break whenever login scripts are updated. I'm hoping for a solution like a pragma-like statement in the top-level m-file, or an mcc
switch. In perusing the mcc
documentation, however, no switches present themselves as likely candidates except for -Y license.lic
, and it's not clear how to use that.
With regard to the client, another limitation I face is that I don't want to pester them with trial-and-error (it's not their job). This is complicated by the fact that there is also no efficient way to convey electronic content to them, so quick, iterative trial-and error is out. As well, their target environment, with Matlab licenses, doesn't yet exist, though the process to get there is in the works. It's a bit of an chicken-and-egg problem; they are getting Matlab based on the assumption that we can find solutions for the challenges, but it's hard to derisk the assumption beforehand by investigating solutions when the target environment doesn't yet exist.
On my home organization's system, I also face the limitation that I don't have rights to install MCR. Hence, I can't undertake trial-and-error to identify an incantation or recipe that ignores the presence of Matlab licenses and forces the use of MCR. Not that I have the time to do that, as it is a very inefficient way to achieve this objective.
Because of the many circumstantial challenges, trial-and-error isn't the way to go, and I'm hoping there is a canned method for forcing the use of MCR over any Matlab licenses that might be present. I am using R2015b.