Matthias Pospiech
Matthias Pospiech

Reputation: 3488

remove curve fitting toolbox for packaging

I have a matlab guide program I want to compile (package). This program is not using the curve fitting toolbox.

Nevertheless the compiler complains about a missing licence.

mcc -C -o ...
Compiler version: 5.0 (R2013b)
Dependency analysis by DEPFUN.
Processing C:\Program Files\MATLAB\R2013b\toolbox\matlab\win64\mcc.enc
Processing C:\Program Files\MATLAB\R2013b\toolbox\curvefit\win64\mcc.enc
Depfun error: 'License checkout failed.
License Manager Error -4
Maximum number of users for Curve_Fitting_Toolbox reached. 

How can I remove this dependancy for compilation?

Upvotes: 1

Views: 609

Answers (2)

Igor
Igor

Reputation: 1737

Personally, I simply temporarily rename toolbox folders I don't need.

  • Just manually navigate to "matlabroot()\toolbox\" and rename, say, "signal" -> "signal_".

  • Surprisingly, the same could be done from the script, calling mcc() - almost no files in those folders are locked by matlab.exe.

This method doesn't sound like a "solution", of course it's just a "quick-and-dirty workaround". But, for me, it seem to work (R2015a).

Note, that you can easily check, what's actually included in your "deployed" dll (or exe), with 7z. Including files, added from toolboxes - see "my.dll.text\toolbox\"

PS1: From my experience ,"-N" removes some unrelated stuff. Not all. Moreover, when using "-N", you should carefully add stuff you need with "-I".

PS2: In ".prj" file, created by deploytool(), there's something, that sounds related:

<matlab>
  <root>D:\Program Files\MATLAB\MATLAB Production Server\R2015a</root>
  <toolboxes>
    <toolbox name="matlabcoder" />
    ...
  </toolboxes> 
  ...  
</matlab>

but I've not checked, whether this actually controls witch toolboxes are used by mcc.

Upvotes: 0

lennon310
lennon310

Reputation: 12689

According to the mcc document,

-N Clear Path

Passing -N effectively clears the path of all folders except the following core folders 
(this list is subject to change over time):

matlabroot\toolbox\matlab
matlabroot\toolbox\local
matlabroot\toolbox\compiler\deploy
It also retains all subfolders of the above list that appear on the MATLAB path at compile time.      
Including -N on the command line lets you replace folders from the original path,
while retaining the relative ordering of the included folders. 
All subfolders of the included folders that appear on the original path are also included. 
In addition, the -N option retains all folders that you included on the path that are not under matlabroot\toolbox.

In other words, you can clear all folders from the path and only keep the core MATLAB ones.

If you want to include some toolbox folders, you can use the -a option:

mcc ... -a C:\Program Files\MATLAB\R2013b\toolbox\...\...

Upvotes: 1

Related Questions