Set MATLAB® Runtime options, such as -nojvm, -nodisplay,
or -logfile by performing either of the following
tasks.
Using the Additional Runtime Settings area of the compiler apps.
Using the mcc command, specify
the -R switch.
In the Additional Runtime Settings area of the compiler apps, you can set the following options.
Note: Not all options are available for all compilation targets. |
Set MATLAB Runtime Startup Options Using the Compiler Apps
| MATLAB Runtime Startup Option | This option... | Set the options by... |
|---|---|---|
-nojvm | Disables the Java® Virtual Machine (JVM™), which is enabled by default. This can help improve the MATLAB Runtime performance. | Select the No JVM checkbox. |
-nodisplay | On Linux®, launches the MATLAB Runtime without display functionality. | In the Settings box, enter -R
-nodisplay. |
-logfile | Writes information about the MATLAB Runtime startup to a logfile. | Select the Create log file checkbox. Enter the path to the logfile, including the logfile name, in the Log File box. |
When you use the command line, specify the -R switch
to invoke the MATLAB Runtime startup options you want to use.
Following are examples of using mcc -R to
invoke -nojvm, -nodisplay, and -logfile when
building a C standalone (designated by the -m switch).
Use these functions to return data about the MATLAB Runtime state when working with shared libraries.
| Function and Signature | When to Use | Return Value | ||
|---|---|---|---|---|
bool mclIsMCRInitialized() | Use mclIsMCRInitialized() to determine whether
or not the MATLAB Runtime has been properly initialized. | Boolean (true or false).
Returns true if MATLAB Runtime is already initialized,
else returns false. | ||
bool mclIsJVMEnabled() | Use mclIsJVMEnabled() to determine if the MATLAB Runtime was
launched with an instance of a Java Virtual Machine (JVM). | Boolean (true or false).
Returns true if MATLAB Runtime is launched
with a JVM instance, else returns false. | ||
const char* mclGetLogFileName() | Use mclGetLogFileName() to retrieve the
name of the log file used by the MATLAB Runtime. | Character string representing log file name used by the MATLAB Runtime. | ||
bool mclIsNoDisplaySet() | Use mclIsNoDisplaySet() to determine if -nodisplay option
is enabled. | Boolean (true or false).
Returns true if -nodisplay is
enabled, else returns false.
|
Note: All of these attributes have properties of write-once, read-only. |
const char* options[4];
options[0] = "-logfile";
options[1] = "logfile.txt";
options[2] = "-nojvm";
options[3] = "-nodisplay";
if( !mclInitializeApplication(options,4) )
{
fprintf(stderr,
"Could not initialize the application.\n");
return -1;
}
printf("MCR initialized : %d\n", mclIsMCRInitialized());
printf("JVM initialized : %d\n", mclIsJVMEnabled());
printf("Logfile name : %s\n", mclGetLogFileName());
printf("nodisplay set : %d\n", mclIsNoDisplaySet());
fflush(stdout);