User`s manual

4 Calling MATLAB from C and Fortran Programs
4-18
#include <float.h>
.
.
.
_control87(MCW_EM,MCW_EM);
.
.
.
Compiling and Linking on UNIX
Under UNIX at runtime, you must tell the system where the API shared
libraries reside. These sections provide the necessary UNIX commands
depending on your shell and system architecture.
Setting Runtime Library Path
In C shell, the command to set the library path is
setenv LD_LIBRARY_PATH <matlab>/extern/lib/$Arch:$LD_LIBRARY_PATH
In Bourne shell, the commands to set the library path are
LD_LIBRARY_PATH=<matlab>/extern/lib/$Arch:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
where <matlab> is the MATLAB root directory and $Arch is your system
architecture (
alpha, glnx86, sgi, sol2, hp700, or ibm_rs).
Note that the environment variable (
LD_LIBRARY_PATH in this example) varies
on several platforms. This table lists the different environment variable names
you should use on these systems.
It is convenient to place these commands in a startup script such as
~/.cshrc
for C shell or
~/.profile for Bourne shell.
Table 4-3: Environment Variable Names
Architecture Environment Variable
HP700
SHLIB_PATH
IBM RS/6000
LIBPATH