| MATLAB Compiler | ![]() |
Compiling a Stand-Alone Application
To create a stand-alone application from the M-file mymfunction, use the command
This creates a stand-alone executable named mymfunction.exe on Windows and mymfunction on UNIX.
Compiling a Shared Library
To create a shared library from the M-file mymfunction, use the command
This creates a shared library named mymfunction.dll on Windows and mymfunction.so on UNIX.
Stand-Alone Application That Calls a Library
To create a stand-alone (driver) application from a user-written source file named mydrivercode that calls the above library mymfunction, use the command
Note
You must call mclInitializeApplication once at the beginning of your driver application. You must make this call before calling any other MathWorks functions. You must also call your library's initialization routine before calling any functions in your library. See Calling a Shared Library for more information.
|
Testing Components on Development Machine
To test components on your development machine, make sure you have your path set properly. The following sections show how to set the path for each supported platform.
Windows
Add the following directory to your system PATH environment variable.
UNIX
Add the following platform-specific directories to your dynamic library path.
Note
For readability, the following commands appear on separate lines, but you must enter each setenv command on one line.
|
setenv LD_LIBRARY_PATH <matlabroot>/sys/os/glnx86: <matlabroot>/bin/glnx86: <matlabroot>/sys/java/jre/glnx86/jre1.5.0/lib/i386/native_threads: <matlabroot>/sys/java/jre/glnx86/jre1.5.0/lib/i386/client: <matlabroot>/sys/java/jre/glnx86/jre1.5.0/lib/i386: setenv XAPPLRESDIR <matlabroot>/X11/app-defaults
setenv LD_LIBRARY_PATH /usr/lib/lwp: <matlabroot>/sys/os/sol2: <matlabroot>/bin/sol2: <matlabroot>/sys/java/jre/sol2/jre1.5.0/lib/sparc/native_threads: <matlabroot>/sys/java/jre/sol2/jre1.5.0/lib/sparc/client: <matlabroot>/sys/java/jre/sol2/jre1.5.0/lib/sparc: setenv XAPPLRESDIR <matlabroot>/X11/app-defaults
setenv LD_LIBRARY_PATH <matlabroot>/sys/os/glnxa64: <matlabroot>/bin/glnxa64: <matlabroot>/sys/java/jre/glnxa64/jre1.4.2/lib/amd64/native_threads: <matlabroot>/sys/java/jre/glnxa64/jre1.4.2/lib/amd64/client: <matlabroot>/sys/java/jre/glnxa64/jre1.4.2/lib/amd64: setenv XAPPLRESDIR <matlabroot>/X11/app-defaults
setenv SHLIB_PATH <matlabroot>/sys/os/hpux: <matlabroot>/bin/hpux: <matlabroot>/sys/java/jre/hpux/jre1.4.1/lib/PA_RISC2.0/server: <matlabroot>/sys/java/jre/hpux/jre1.4.1/lib/PA_RISC2.0 setenv LD_PRELOAD <matlabroot>/sys/java/jre/hpux/jre1.4.1/lib/PA_RISC2.0/server/libjvm.sl setenv XAPPLRESDIR <matlabroot>/X11/app-defaults
You can then run the compiled applications on your development machine to test them.
| Quick Start | Deploying Components to Other Machines | ![]() |
© 1994-2005 The MathWorks, Inc.