User`s guide
UNIX Workstation
2-9
If you do not need to change C or C++ compilers, or you do not need to modify
your compiler options files, you can skip ahead in this section to “Creating
MEX-Fil es” on page 2-10. If you need to know how to change the options file,
continue with this section.
Changing Compilers
Changing the Default Compiler. To change your default C or C++ compiler, you
selecta different options file. You can do this at anytime by using the command
mex -setup
Using the 'mex -setup' command selects an options file that is
placed in ~/.matlab/R12 and used by default for 'mex'. An options
file in the current working directory or specified on the
command line overrides the default options file in ~/.matlab/R12.
Options files control which compiler to use, the compiler and
link command options, and the runtime libraries to link against.
To override the default options file, use the 'mex -f' command
(see 'mex -help' for more information).
The options files available for mex are:
1: <matlab>/bin/gccopts.sh :
Template Options file for building gcc MEX-files
2: <matlab>/bin/mexopts.sh :
Template Options file for building MEX-files via the
system ANSI compiler
Enter the number of the options file to use as your default options
file:
Select the proper options file for your system by entering its number and
pressing
Return.If an options file doesn’texist in your MATLAB directory, the
system displays a message stating that the options file is being copied to your
user-specific
matlab directory. If an options file already exists in your
MATLAB directory, the system prompts you to overwrite it.