Main Content

Choose Deployment Option

MATLAB® Compiler™ provides several options for packaging MATLAB code into software components for standalone deployment or integration with other programming languages, depending on the desired build target. You can package code at the command line or using a compiler app associated with the build target.

  • The deploytool compiler apps allow you to package MATLAB code using a graphical interface.

  • The compiler.build and compiler.package functions allow you to package MATLAB code at the command line using a simplified interface.

  • The mcc function allows you to package MATLAB code at the command line and offers additional, less common options to control the packaging process.

For more information on the steps required to package and deploy code, see Steps for Deployment with MATLAB Compiler.

Compile Using compiler.build Command Line Functions

Functions in the compiler.build family provide a modern command line interface for packaging MATLAB code. Each function is associated with a specific build target and allows you to customize the packaging process using name-value arguments.

compiler.build functions do not generate an application installer. To create an installer for an application created using a compiler.build function, see compiler.package.installer.

Several compiler.build functions are available.

With MATLAB Compiler SDK™, you can also use the following functions.

compiler.build advantages include:

  • Functions have a familiar command line interface similar to other MATLAB functions.

  • Use the compiler.build.Results output for post-processing tasks, such as creating an installer.

  • Perform batch deployment tasks using deployment scripts or using a compiler.build.<Target>Options object.

  • Packaging options have descriptive names instead of flags.

Get Started with Compiler Apps

You can package code using a graphical user interface with compiler apps. The apps provide a simplified interface to specify packaging options and generate an installer that installs your application along with MATLAB Runtime.

The following compiler apps are available.

To open a compiler app, you can also type deploytool in the MATLAB Command Window.

Compiler app advantages include:

  • Perform related deployment tasks with a single intuitive interface.

  • Maintain related information in a convenient project file.

  • Your project state persists between sessions.

  • Load previously stored compiler projects from a prepopulated menu.

  • Automatically generate an installer to package applications for distribution.

Specify Additional Packaging Options Using mcc

mcc is a MATLAB function that allows you to compile MATLAB code for deployment to any available build target.

mcc has many option flags that let you control the output and packaging method. For example, you can use the -R option to specify run time options for MATLAB Runtime. Use mcc if you require fine control of the packaging process.

mcc does not generate an application installer. To create an installer for an application created using mcc, see compiler.package.installer.

mcc advantages include:

  • The Spark™ application target is only available when you use mcc.

  • Specify advanced compiler options not available with other packaging methods.

  • You can run mcc in the MATLAB Command Window or at the system command prompt.

Limitations

compiler.build Limitations

  • These functions offer most, but not all, of the packaging options available with mcc.

    Note

    If you call a compiler.build function with the Verbose option set to true, the output displays the mcc command used to compile the artifact. To specify additional mcc build options, append them to this command and recompile.

  • You cannot create Spark applications using a compiler.build function. To create a Spark application, use the mcc function.

  • You cannot create Hadoop jobs using a compiler.build function. To create a Hadoop application, use the mcc function or the Hadoop Compiler app.

Compiler App Limitations

  • If you know the commands for the type of application you want to deploy and do not require an installer, it is faster to execute either compiler.build or mcc than use the compiler app workflow.

  • You cannot create Spark applications using a compiler app. To create a Spark application, use the mcc function.

  • You cannot create Docker images or microservice images using a compiler app. To create a Docker image, use the compiler.package.docker or compiler.package.microserviceDockerImage function.

  • The compiler apps offer most, but not all, of the packaging options available with mcc. For additional customization, you can specify mcc option flags in a compiler app using the Files required for your application to run section in any compiler app except Web App Compiler.

  • The Web App Compiler app does not accept additional mcc option flags. To specify additional build options, such as a secret manifest file, use the compiler.build.webAppArchive function.

mcc Limitations

See Also

| | |

Related Topics