Compile MATLAB functions for deployment
mcc
compiles the functions as specified by the options.options
mfilename1 mfilename2...mfilenameN
The options used depend on the intended results of the compilation. For information on compiling:
standalone applications, Excel® add-ins,
or Hadoop® jobs see mcc
for MATLAB®
Compiler™
mcc -l
compiles the listed functions into a C shared library and generates C wrapper
code for integration with other applications.options
mfilename1 mfilename2...mfilenameN
This syntax is equivalent to -W
lib:
.libname
-T link:lib
mcc -W cpplib:
compiles the listed functions into a C++ shared library and generates C++
wrapper code for integration with other applications.library_name
[,{all|legacy|generic}] options
mfilename1 mfilename2...mfilenameN
library_name
— Specifies the name of
the shared library.
all
— Generates shared libraries using both
the mwArray
API and the generic interface that uses
the MATLAB Data API. This is
the default.
legacy
— Generates shared libraries using the
mwArray
API.
generic
— Generates shared libraries using
the MATLAB Data API.
mcc -W com:
compiles the listed functions into a generic Microsoft® COM component.component_name
,className
-T link:lib options
class{className
:mfilename1 mfilename2...mfilenameN
}
component_name
— Specifies the name
of the COM component.
className
— Specifies the name of
the class.
mcc -W dotnet:
creates a .NET assembly with a single class from the specified files.assembly_name
,className
,framework_version
,security
,remote_type
-T
link:lib options
mfilename1 mfilename2...mfilenameN
assembly_name
—
Specifies the name of the assembly preceded by its namespace, which
is a period-separated list, such as companyname.groupname.component
.
className
— Specifies
the name of the .NET class to be created.
framework_version
—
Specifies the version of the Microsoft .NET Framework you want
to use to compile the assembly. Specify either:
0.0
— Use the latest supported
version on the target machine.
—
Use a specific version of the framework.version_major
.version_minor
Features are often version-specific. Consult the documentation for the feature you are implementing to get the Microsoft .NET Framework version requirements.
security
— Specifies
whether the assembly to be created is a private assembly or a shared
assembly.
To create a private assembly, specify Private
.
To create a shared assembly, specify the full path to the encryption key file used to sign the assembly.
remote_type
— Specifies
the remoting type of the assembly. Values are remote
and local
.
mcc -W dotnet:
creates a .NET assembly with multiple classes from the specified files.assembly_name
,className
,framework_version
,security
,remote_type
-T
link:lib options
class{className
:mfilename1 mfilename2...mfilenameN
}
assembly_name
—
Specifies the name of the assembly and its namespace, which is a period-separated
list, such as companyname.groupname.component
.
className
— Specifies
the name of the .NET class to be created.
Note
You can include multiple class specifiers.
framework_version
—
Specifies the version of the Microsoft .NET Framework you want
to use to compile the assembly. Specify either:
0.0
— Use the latest supported
version on the target machine.
—
Use a specific version of the framework.version_major
.version_minor
Features are often version-specific. Consult the documentation for the feature you are implementing to get the Microsoft .NET Framework version requirements.
security
— Specifies
whether the assembly to be created is a private assembly or a shared
assembly.
To create a private assembly, specify Private
.
To create a shared assembly, specify the full path to the encryption key file used to sign the assembly.
remote_type
— Specifies
the remoting type of the assembly. Values are remote
and local
.
mcc -W java:
creates a Java® package from the specified files.packageName
,className
options
mfilename1 mfilename2...mfilenameN
packageName
— Specifies
the name of the Java package and its namespace, which is a period-separated
list, such as companyname.groupname.component
.
className
— Specifies
the name of the class to be created. If you do not specify the class
name, mcc
uses the last item in packageName
.
mcc -W java:
creates a Java package with multiple classes from the specified files.packageName
,className
options
class{className
:mfilename1 mfilename2...mfilenameN
}
packageName
— Specifies
the name of the Java package and its namespace, which is a period-separated
list, such as companyname.groupname.component
.
className
— Specifies
the name of the class to be created. If you do not specify the class
name, mcc
uses the last item in packageName
.
Note
You can include multiple class specifiers.
mcc -W python:
creates a Python® package from the specified files.namespace
.packageName
-T
link:lib options
mfilename1 mfilename2...mfilenameN
namespace
— Specifies
the optional namespace for the package, which is a period-separated
list, such as companyname.groupname.component
packageName
— Specifies
the name of the Python package.
mcc -W CTF:
instructs the compiler to create a deployable archive (archive_name
-U options
mfilename1 mfilename2...mfilenameN
.ctf
file) for use with a MATLAB
Production Server™ instance.
The syntax also creates the server-side deployable archive
(.ctf
file) for Microsoft
Excel add-ins.
mcc -W mpsxl:
creates a client-side Microsoft
Excel add-in from the
specified files that can be used to send requests to MATLAB
Production Server from Excel. Creating the client-side add-in must be
preceded by creating a server-side deployable archive (addin_name
,className
,version
input_marshaling_flags
output_marshaling_flags
-T
link:lib options
mfilename1 mfilename2...mfilenameN
.ctf
file) from the specified files. A purely client side add-in is not viable.
addin_name
— Specifies the name of
the add-in and its namespace, which is a period-separated list, such as
companyname.groupname.component
.
className
— Specifies the name of
the class to be created. If you do not specify the class name,
mcc
uses the
addin_name
as the default.
version
— Specifies the version of
the add-in specified as
major
.minor
.
major
— Specifies the major
version number. If you do not specify a version number,
mcc
uses the latest version.
minor
— Specifies the minor
version number. If you do not specify a version number,
mcc
uses the latest version.
input_marshaling_flags
— Specifies
options for how data is marshaled between Microsoft
Excel and MATLAB.
-replaceBlankWithNaN
— Specifies
that a blank in Microsoft
Excel is mashaled into NaN in MATLAB. If you do not specify this flag, blanks are
marshaled into 0.
-convertDateToString
— Specifies
that dates in Microsoft
Excel are marshaled into MATLAB character vectors. If you do not specify this
flag, dates are marshaled into MATLAB doubles.
output_marshaling_flags
— Specifies
options for how data is marshaled between MATLAB and Microsoft
Excel.
-replaceNaNWithZero
— Specifies that
NaN in MATLAB is marshaled into a 0 in Microsoft
Excel. If you do not specify this flag, NaN is
marshalled into #QNAN
in Visual Basic®.
-convertNumericToDate
— Specifies
that MATLAB numeric values are marshaled into Microsoft
Excel dates. If you do not specify this flag,
Microsoft
Excel does not receive dates as output.
mcc -l mymagic.m
Create a C shared library in Windows® with version number 4.3.1.7
.
mcc -W 'lib:myCSharedLib,version=4.3.1.7' -T link:lib mymagic.m
Use the mwArray
API
mcc -W 'cpplib:mymagic,legacy' mymagic.m
Use the MATLAB Data API
mcc -W 'cpplib:mymagic,generic' mymagic.m
Use both the mwArray
API and the MATLAB Data
API
mcc -W 'cpplib:mymagic,all' mymagic.m
mcc -W 'cpplib:mymagic' mymagic.m
Create a C++ shared library in Windows with version number 3.7.1.5
.
mcc -W 'cpplib:mymagic,all,version=3.7.1.5' -T link:lib mymagic.m
Create a COM component in Windows with version number 7.10.1.3
.
mcc -W 'com:myCOMComponent,myClass,version=7.10.1.3' -T link:lib class{myClass:mymagic.m}
mcc -W 'java:myMatrix,add' class{add:add.m} class{sub:minus.m}
mcc -W python:myMagic -T link:lib magic.m
mcc -W CTF:myDeployableArchive -U mymagic.m
mcc -W 'mpsxl:myDeployableArchvie,myExcelClass,version=1.0' -T link:lib mymagic.m
On Windows, you can generate a system-level file version number for your
target file by appending
version=
version_number
to the
target generating mcc
syntax. For an example, see Create a C++ shared library with a system-level file version number (Windows only).
version_number
— Specifies the version of the
target file as major.minor.bug.build
in the file
system. You are not required to specify a version number. If you do not specify
a version number, mcc
sets the version number, by default,
to 1.0.0.0
.
major
— Specifies the major version
number. If you do not specify a version number,
mcc
sets major
to 1
.
minor
— Specifies the minor version
number. If you do not specify a version number,
mcc
sets minor
to 0
.
bug
— Specifies the bug fix maintenance
release number. If you do not specify a version number,
mcc
sets bug
to
0
.
build
— Specifies build number. If you
do not specify a version number, mcc
sets
build
to 0
.
This functionality is supported for C shared libraries, C++ shared libraries,
COM components, .NET assemblies, and Excel add-ins for MATLAB
Production Server in MATLAB
Compiler SDK. For supported targets in MATLAB
Compiler, see the Tips section in
mcc
.