User`s guide
2 Installation and Configuration
2-10
Note The setup option creates a user-specific, matlab directory in your
individual home director y and copies the appropriate options file to the
directory. (If the directory already exists, a new one is not created.) This
matlab directory is used for your individual options files only; each user can
have his or her own default options files (other MATLAB products may place
options files in this directory). Do not confuse these user-specific
matlab
directories with the system matlab directory, where MATLAB is installed.
Using the
setup option resets your default compiler so that the new compiler
is used every time you use the
mex script.
Modifying the Options File. Another use of the setup option is if you want to
chan ge youroptions file settin gs. For example ,ifyouwan tto makea change to
the current linker settings, or you want to disable a particular set of warnings,
youshouldusethe
setup option.
As the previous note says,
setup copies the appropriate options file to your
individu aldirectory.Tomake youruser- specif icchangestothe optionsfile,you
then edit your copy of the options file to correspond to your specific needs and
save the modified file. This sets your default compiler’s options file to your
specific version.
Temporarily Changing the Compiler. To temporarily change y our C or C ++ compiler,
use the
-f option, as in
mex -f <file> …
The -f optiontells themex scripttousetheoptionsfile,<file>.If<file> is not
in the current directory, then
<file> must be t he full pathname to the desired
options file. Using the
-f option tells the mex script to use the specified options
file for the current execution of
mex only; it does not reset the default compiler.
Creating MEX-Files
To create MEX-files on UNIX, first copy the source file(s) to a local directory,
and then change directory (
cd) to that local directory.