Testing Failures
After you have successfully compiled your application, the next step is to test it on
a development machine and deploy it on a target machine. Typically, the target machine
does not have a MATLAB® installation and requires MATLAB Runtime to be installed. A distribution includes all of the files that are
required by your application to run, which include the executable, deployable archive,
and MATLAB Runtime.
Test the application on the development machine by running the application against the
MATLAB Runtime shipped with MATLAB
Compiler™. This will verify that library dependencies are correct, that the
deployable archive can be extracted, and that all MATLAB code, MEX—files and support files required by the application have
been included in the archive. If you encounter errors testing your application, the
following questions may help you isolate the problem.
Are you able to execute the application from MATLAB?
On the development machine, you can test your application's execution by issuing
!application-name
at the MATLAB prompt. If your application executes within MATLAB but not from outside, this can indicate an issue with the system
PATH variable.
Does the application begin execution and result in MATLAB or other errors?
Ensure that you included all necessary files when compiling your application (see
the readme.txt file generated with your compilation for more
details).
Functions that are called from your main MATLAB file are automatically included by MATLAB
Compiler; however, functions that are not explicitly called, for example
through EVAL, need to be included at compilation using the -a
switch of the mcc command. Also, any support files like
.mat, .txt, or .html
files need to be added to the archive with the -a switch. There
is a limitation on the functionality of MATLAB and associated toolboxes that can be compiled. Check the documentation
to see that the functions used in your application's MATLAB files are valid. Check the file
mccExcludedFiles.log on the development machine. This file
lists all functions called from your application that cannot be compiled.
Do you have multiple MATLAB versions installed?
Executables generated by MATLAB
Compiler are designed to run in an environment where multiple versions of
MATLAB are installed. Some older versions of MATLAB may not be fully compatible with this architecture.
On Windows®, ensure that the
matlabroot\runtime\win64 of the
version of MATLAB in which you are compiling appears ahead of
matlabroot\runtime\win64 of
other versions of MATLAB installed on the PATH environment variable on your
machine.
Similarly, on UNIX, ensure that the dynamic library paths
(LD_LIBRARY_PATH on Linux®) match. Do this by comparing the outputs of
!printenv at the MATLAB prompt and printenv at the shell prompt. Using this
path allows you to use mcc from the operating system command
line.
If you are testing a standalone executable or shared library and driver
application, did you install the MATLAB Runtime?
All shared libraries required for your standalone executable or shared library are
contained in the MATLAB Runtime. Installing the MATLAB Runtime is required for any of the deployment targets.
Do you receive an error message about a missing DLL?
Error messages indicating missing DLLs such as mclmcrrt7x.dll
or mclmcrrt7x.so are generally caused by incorrect installation
of the MATLAB Runtime. It is also possible that the MATLAB Runtime is installed correctly, but that the PATH,
LD_LIBRARY_PATH, or DYLD_LIBRARY_PATH
variables is set incorrectly. For information on installing the MATLAB Runtime on a deployment machine, see Install and Configure MATLAB Runtime.
Caution
Do not solve these problems by moving libraries or other files within the
MATLAB Runtime folder structure. The system is designed to accommodate
different MATLAB Runtime versions operating on the same machine. The folder structure
is an important part of this feature.
Does your system’s graphics card support the graphics application?
In situations where the existing hardware graphics card does not support the
graphics application, you should use software OpenGL. OpenGL libraries are visible
for an application by appending matlab/sys/opengl/lib/arch to the
LD_LIBRARY_PATH. For example:
setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH:matlab/sys/opengl/lib/arch
For issues with MATLAB graphics in Linux, set the environment variable LD_LIBRARY_PATH to:
setenv LD_LIBRARY_PATH $MATLAB/sys/opengl/lib/glnxa64:$LD_LIBRARY_PATH
Is OpenGL properly installed on your system?
When searching for OpenGL libraries, the MATLAB Runtime first looks on the system library path. If OpenGL is not found there,
it will use the LD_LIBRARY_PATH environment variable to locate
the libraries. If you are getting failures due to the OpenGL libraries not being
found, you can append the location of the OpenGL libraries to the
LD_LIBRARY_PATH environment variable. For example:
setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH:matlab/sys/opengl/lib/arch