Using the C Math Library | ![]() ![]() |
Distributing Stand-Alone Applications
You may freely distribute applications you develop with the MATLAB C Math Library, subject to The MathWorks software license agreement. When you package your application for distribution, remember to include, along with your application executable, these additional files:
bin
, created by mbuild
in the same directory as your application executableTo make packaging an application easier, the C Math Library has prepackaged all the necessary MATLAB run-time libraries into a single, self-extracting archive file. For more information about how you can use this archive, see Packaging the MATLAB Math Run-Time Libraries. For information about how customers who receive your application can use this archive, see Installing Your Application.
Packaging the MATLAB Math Run-Time Libraries
The MATLAB C Math library has prepackaged all the MATLAB run-time libraries required by stand-alone applications into a single, self-extracting archive file, called the MATLAB Math and Graphics Run-Time Library Installer. Instead of including all the run-time libraries individually in your stand-alone application distribution package, you can simply include this archive file.
The following table lists the name of the archive file for both PCs and UNIX systems. In the table $MATLAB
represents your MATLAB installation directory and $ARCH
represents your UNIX platform.
Platform
MATLAB Math and Graphics Run-Time Library Installer
UNIX systems
$MATLAB/extern/lib/$ARCH/mglinstaller
PCs
$MATLAB\extern\lib\win32\mglinstaller.exe
Installing Your Application
To install your application, your customers must:
bin/$ARCH
subdirectory to their path. This is the only MATLAB Math and Graphics Run-time library subdirectory that needs to be added to the path.On UNIX Systems
On UNIX systems, your customer runs the MATLAB Math and Graphics Run-Time Library Installer by executing the mglinstaller
command at the system prompt. Your customer can specify the name of the directory into which they want to install the libraries. By default, the installer puts the files in the current directory.
After the installer unpacks and uncompresses the libraries, your customers must add the name of the bin/$ARCH
subdirectory to the LD_LIBRARY_PATH
environment variable. (The equivalent variable on HP-UX systems is the SHLIB_PATH
and LIBPATH
on IBM AIX systems.)
For example, if a customer working on a Linux system specifies the installation directory mgl_runtime_dir
, then they must add mgl_runtime_dir/bin/glnx86
to the LD_LIBRARY_PATH
environment variable.
On PCs
On PCs, your customer can run the MATLAB Math and Graphics Run-Time Library Installer by double-clicking on the mglinstaller.exe
file. Your customer can specify the name of the directory into which they want to install the libraries. By default, the installer puts the files in the current directory.
After the installer unpacks and uncompresses the libraries, your customers must add the bin\win32
subdirectory to the system path variable (PATH
).
For example, if your customer specifies the installation directory mgl_runtime_dir
, then they must add mgl_runtime_dir\bin\win32
to PATH
.
![]() | mbuild Options | Problem Starting Stand-Alone Application | ![]() |