Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB Builder NE   

The Application Deployment Products and the Deployment Tool

What Is the Difference Between the Deployment Tool and the mcc Command Line?

When you use the Deployment Tool (deploytool) GUI, you perform any function you would invoke using the MATLAB Compiler mcc command-line interface. The Deployment Tool interactive menus and dialogs build mcc commands that are customized to your specification. As such, your MATLAB code is processed the same way as if you were compiling it using mcc.

Deployment Tool advantages include:

How Does MATLAB Compiler Software Build My Application?

To build an application, MATLAB Compiler software performs these tasks:

  1. Parses command-line arguments and classifies by type the files you provide.

  2. Analyzes files for dependencies using the Dependency Analysis Function (depfun). Dependencies affect deployability and originate from functions called by the file. Deployability is affected by:

    • File type — MATLAB, Java, MEX, and so on.

    • File location — MATLAB, MATLAB toolbox, user code, and so on.

    • File deployability — Whether the file is deployable outside of MATLAB

    For more information about depfun, see What You Should Know About the Dependency Analysis Function (depfun).

  3. Validates MEX-files. In particular, mexFunction entry points are verified. For more details about MEX-file processing, see Compiling MEX-Files, DLLs, or Shared Libraries.

  4. Creates a CTF archive from the input files and their dependencies. For more details about CTF archives see The Role of the Component Technology File (CTF Archive).

  5. Generates target-specific wrapper code. For example, a C main function requires a very different wrapper than the wrapper for a Java interface class.

  6. Invokes a third-party target-specific compiler to create the appropriate binary software component (a standalone executable, a Java JAR file, and so on).

For details about how MATLAB Compiler software builds your deployable component, see How Does MATLAB Compiler Software Build My Application?.

What You Should Know About the Dependency Analysis Function (depfun)

MATLAB Compiler uses a dependency analysis function (depfun) to determine the list of necessary files to include in the CTF package. Sometimes, this process generates a large list of files, particularly when MATLAB object classes exist in the compilation and depfun cannot resolve overloaded methods at compile time. Dependency analysis also processes include/exclude files on each pass (see the mcc flag -a Add to Archive).

depfun searches for executable content such as:

depfun does not search for data files of any kind (except MAT files). You must manually include data files in the search

Compiling MEX-Files, DLLs, or Shared Libraries

When you compile MATLAB functions containing MEX-files, ensure that depfun can find them. Doing so allows you to avoid many common compilation problems. In particular, note that:

The Role of the Component Technology File (CTF Archive)

Each application or shared library you produce using MATLAB Compiler has an associated Component Technology File (CTF) archive. The archive contains all the MATLAB based content (MATLAB files, MEX-files, and so on) associated with the component.

MATLAB Compiler also embeds a CTF archive in each generated binary. The CTF houses all deployable files. All MATLAB files encrypt in the CTF archive using the Advanced Encryption Standard (AES) cryptosystem.

If you choose the extract the CTF archive as a separate file the files remain encrypted. For more information on how to extract the CTF archive refer to the references in the following table.

Information on CTF Archive Embedding/Extraction and Component Cache

ProductRefer to
MATLAB CompilerOverriding Default CTF Archive Embedding Using the MCR Component Cache
MATLAB Builder NEExtracting the CTF Archive Manually Using the MCR Component Cache
MATLAB Builder JAUsing MCR Component Cache and MWComponentOptions
MATLAB Builder EXOverriding Default CTF Archive Embedding for Components Using the MCR Component Cache

Additional Details

Multiple CTF archives, such as those generated with COM, .NET, or Excel® components, can coexist in the same user application. You cannot, however, mix and match the MATLAB files they contain. You cannot combine encrypted and compressed MATLAB files from multiple CTF archives into another CTF archive and distribute them.

All the MATLAB files from a given CTF archive associate with a unique cryptographic key. MATLAB files with different keys, placed in the same CTF archive, do not execute. If you want to generate another application with a different mix of MATLAB files, recompile these MATLAB files into a new CTF archive.

MATLAB Compiler deleted the CTF archive and generated binary following a failed compilation, but only if these files did not exist before compilation initiates. Run help mcc -K for more information.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2010- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS