User`s manual

Building MEX-Files
1-11
Building MEX-Files
This section covers the following topics:
“Compiler Requirements”
“Testing Your Configuration on UNIX”
“Testing Your Configuration on Windows”
“Specifying an Options File”
Compiler Requirements
Your installed version of MATLAB contains all the tools you need to work with
the API. MATLAB includes a C compiler for the PC called Lcc, but does not
include a Fortran compiler. If you choose to use your own C compiler, it must
be an ANSI C compiler. Also, if you are working on a Microsoft Windows
platform, your compiler must be able to create 32-bit windows dynamically
linked libraries (DLLs).
MATLAB supports many compilers and provides preconfigured files, called
options files, designed specifically for these compilers. The Options Files table
lists all supported compilers and their corresponding options files. The purpose
of supporting this large collection of compilers is to provide you with the
flexibility to use the tool of your choice. However, in many cases, you simply can
use the provided Lcc compiler with your C code to produce your applications.
The MathWorks also maintains a list of compilers supported by MATLAB at
the following location on the web:
http://www.mathworks.com/support/
tech-notes/v5/1600/1601.shtml
.
Note The MathWorks provides an option (setup) for the mex script that lets
you easily choose or switch your compiler.
The following sections contain configuration information for creating
MEX-files on UNIX and Windows systems. More detailed information about
the
mex script is provided in “Custom Building MEX-Files” on page 1-20. In
addition, there is a section on “Troubleshooting” on page 1-32, if you are having
difficulties creating MEX-files.