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
andcompiler.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.
compiler.build.standaloneApplication
— Create standalone applications.compiler.build.standaloneWindowsApplication
— Create standalone Windows® applications.compiler.build.webAppArchive
— Create web app archives.compiler.build.excelAddIn
— Create Excel® add-ins.compiler.package.docker
— Create Docker® images.
With MATLAB Compiler SDK™, you can also use the following functions.
compiler.build.cSharedLibrary
— Create C shared libraries.compiler.build.cppSharedLibrary
— Create C++ shared libraries.compiler.build.dotNETAssembly
— Create .NET assemblies.compiler.build.javaPackage
— Create Java® packages.compiler.build.pythonPackage
— Create Python® packages.compiler.build.productionServerArchive
— Create production server archives.compiler.build.excelClientForProductionServer
— Create Excel add-ins for MATLAB Production Server™.compiler.build.comComponent
— Create COM components.compiler.package.microserviceDockerImage
— Create microservice Docker images.
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.
object.<Target>
OptionsPackaging 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.
Application Compiler — Create standalone applications and standalone Windows applications.
Hadoop Compiler — Create Hadoop® jobs.
Library Compiler — Create Excel add-ins. With MATLAB Compiler SDK, you can also create C/C++ shared libraries, .NET assemblies, COM components, Java packages, and Python packages.
Web App Compiler — Create web apps.
Production Server Compiler — Create production server archives and Excel add-ins for MATLAB Production Server.
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 theVerbose
option set totrue
, the output displays themcc
command used to compile the artifact. To specify additionalmcc
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 themcc
function.You cannot create Hadoop jobs using a
compiler.build
function. To create a Hadoop application, use themcc
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
ormcc
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
orcompiler.package.microserviceDockerImage
function.The compiler apps offer most, but not all, of the packaging options available with
mcc
. For additional customization, you can specifymcc
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 thecompiler.build.webAppArchive
function.
mcc
Limitations
You cannot create web apps using
mcc
. Create web apps using the Web App Compiler app or thecompiler.build.webAppArchive
function.You cannot create standalone Docker images using
mcc
. To create a standalone Docker image, use thecompiler.package.docker
function.You cannot create microservice Docker images using
mcc
. To create a microservice Docker image, use thecompiler.package.microserviceDockerImage
function.
See Also
compiler.build.Results
| Application Compiler | mcc
| compiler.package.installer