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 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.

Get Started with Compiler Apps

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

The following compiler apps are available with MATLAB Compiler.

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

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.

  • Export build settings as a MATLAB deployment script.

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:

  • If you do not require an installer, it is faster to execute compiler.build than use the compiler app workflow.

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

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

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

  • Packaging options have descriptive names instead of flags.

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:

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

  • Run mcc in the MATLAB Command Window or at the system command prompt.

  • The Spark™ application target is only available with mcc.

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, you can append them to this command and recompile.

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

  • You cannot create Hadoop® jobs using a compiler.build function. To create a Hadoop application, use mcc.

Compiler App Limitations

  • The compiler apps offer most, but not all, of the packaging options available with mcc.

    Before R2025a: For additional customization, you can specify mcc option flags using the Files required for your application to run section in any compiler app except Web App Compiler.

  • You cannot create Excel add-ins for MATLAB Production Server using a compiler app. To create Excel add-ins for MATLAB Production Server, use the compiler.build.excelClientForProductionServer 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.

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

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

  • Compiler projects may not be compatible across MATLAB releases. When you open deployment projects created in releases before R2025a, MATLAB automatically upgrades them to MATLAB projects. For more information, see Target-Specific Compiler Apps for MATLAB Code Deployment.

mcc Limitations

See Also

| |

Topics