| MATLAB Compiler | ![]() |
Microsoft Windows on PCs
This section examines the system requirements, installation procedures, and configuration procedures for the MATLAB Compiler on PCs running Microsoft Windows.
You cannot install the MATLAB Compiler unless MATLAB 6.5 (Release 13) is already installed on the system. The MATLAB Compiler imposes no operating system or memory requirements beyond what is necessary to run MATLAB. The MATLAB Compiler consumes a small amount of disk space.
Table 2-3, Requirements for Creating PC Applications, shows the requirements for creating PC applications with the MATLAB Compiler.
| Note Although the MATLAB Compiler supports the creation of stand-alone C++ applications, it does not support the creation of C++ MEX-files. |
Supported ANSI C and C++ PC Compilers
To create C MEX-files, stand-alone C/C++ applications, or dynamically linked libraries (DLLs) with the MATLAB Compiler, you must install and configure a supported C/C++ compiler. Use one of the following 32-bit C/C++ compilers that create 32-bit Windows dynamically linked libraries (DLLs) or Windows NT applications:
Note
For a list of all the compilers supported by MATLAB, see the MathWorks Technical Support Department's Technical Notes athttp://www.mathworks.com/support/tech-notes/1600/1601.shtml
|
Applications generated by the MATLAB Compiler are 32-bit applications and only run on any MATLAB-supported Microsoft Windows systems. For a complete list of supported Windows platforms, see http://www.mathworks.com/products/system.shtml/Windows.
Known Compiler Limitations. There are several known restrictions regarding the use of supported compilers:
DBL_MIN in your compiler's float.h file.
goto statements for complicated if conditions. The Borland C++ Compiler prohibits the goto statement within a try...catch block. This error can occur if you use the -A debugline:on option, because its implementation uses try...catch. To work around this limitation, simplify the if conditions.
As an aside, if all the digits are in the legal range for octal numbers (0-7), then the compiler will incorrectly treat the number as a floating-point value. So, if you have code such as
and want to use the Borland compiler, you should edit the M-code to remove the leading zeros and write it as
Compiler Options Files
The MathWorks provides options files for every supported C or C++ compiler. These files contain the necessary flags and settings for the compiler. This table shows the preconfigured PC options files that are included with MATLAB.
Locating Options Files
To locate your options file, the mex script searches the following:
user profile directory (see the following section, "The User Profile Directory Under Windows," for more information about this directory)
mex uses the first occurrence of the options file it finds. If no options file is found, mex searches your machine for a supported C compiler and uses the factory default options file for that compiler. If multiple compilers are found, you are prompted to select one.
The User Profile Directory Under Windows. The Windows user profile directory is a directory that contains user-specific information such as desktop appearance, recently used files, and Start menu items. The mex and mbuild utilities store their respective options files, mexopts.bat and compopts.bat, which are created during the -setup process, in a subdirectory of your user profile directory, named Application Data\MathWorks\MATLAB\R13. Under Windows with user profiles enabled, your user profile directory is %windir%\Profiles\username. Under Windows with user profiles disabled, your user profile directory is %windir%. You can determine whether or not user profiles are enabled by using the Passwords control panel.
| MATLAB Compiler Verification | Installation | ![]() |