« Previous « Start » Next »
4 Making a minimal copy
When an application runs fine in Matlab mode and one wants to
compile it, it is highly recommended to make a minimal TOMLAB copy in
which only the m-files and dll's being called are included. The
profiler will show which files to add.
The files should be copied to a single directory, and the
application checked so that it runs without
tomlab/startup.m
being executed (make sure that the Matlab paths for TOMLAB are not
cached). Do not forget the standalone tomlablic.dll and any other
dll's. Continue to fill this directory with TOMLAB m-files and dll's
until the standalone application is working.
One can then compile, naming all the dll's the program is using, as
well as the m-files called through
feval. It is usually a bit
of a trial-and-error process before everything is running smoothly.
The main advantage with creating a minimal TOMLAB is that the final
executable size is brought down. For example, on one user case a
4MB executable was reduced to about 700kB when only the essential
files were compiled.
It is recommended not to use the universal driver routine
tomRun (or the optimization toolbox interface) when compiling
as it references many unnecessary files. Replace the following code:
Prob = conAssign( ... );
...
...
Result = tomRun('snopt', Prob, 0);
with:
Prob = conAssign( ... );
...
...
Prob = ProbCheck(Prob, 'snopt');
Result = snoptTL(Prob);
« Previous « Start » Next »