User`s manual
1 Calling C and Fortran Programs from MATLAB
1-22
Default Options File on UNIX
The default MEX options file provided with MATLAB is located in <matlab>/
bin
. The mex script searches for an options file called mexopts.sh in the
following order:
•The current directory
•
$HOME/.matlab/R12
•<matlab>/bin
<name>#<def>
Override options file setting for variable <name>.
This option is equivalent to
<ENV_VAR>#<val>,
which temporarily sets the environment variable
<ENV_VAR> to <val> for the duration of the call to
mex. <val> can refer to another environment
variable by prepending the name of the variable
with a
$, e.g., COMPFLAGS#"$COMPFLAGS -myswitch".
<name>=<def>
(UNIX) Override options file setting for variable
<name>.
-O
Build an optimized executable.
-outdir <name>
Place all output files in directory <name>.
-output <name>
Create an executable named <name>. (An
appropriate executable extension is automatically
appended.)
-setup
Set up default options file. This switch should be the
only argument passed.
-U<name>
Undefine C preprocessor macro <name>.
-v
Verbose; print all compiler and linker settings.
-V4
Compile MATLAB 4-compatible MEX-file.
Table 1-3: MEX Script Switches (Continued)
Switch Function