The content of this document may be incorrect or out dated.
Incorporating Fortran functions into MatlabWhat is wrong with trying to use the .MEX method of incorporating Fortran functions into Matlab as subroutines?
The problem is that Mathworks does not load the libraries in a way that all symbols can be resolved.
- Set environment variable LD_LIBRARY_PATH whenever running
- /usr/opt/bin/matlab (4.2c)
- /usr/opt/bin/fmex (4.2c)
- /usr/opt/bin/cmex (4.2c)
- csh and relatives setenv LD_LIBRARY_PATH /usr/opt/lib
- sh and relatives LD_LIBRARY_PATH=/usr/opt/lib export LD_LIBRARY_PATH
- /usr/opt/bin/fmex (4.2c). When compiling using fmex, you must force the linker to search the math library, /opt/SUNWspro/SC2.0.1/libm.a, twice in order to resolve all the symbols. The way to do this is to invoke fmex as follows: fmex func.f LD_FCLIBS='$LD_FCLIBS /opt/SUNWspro/SC2.0.1/libm.a
[Note: The script fmex itself sets LD_FCLIBS = -lM77 -lF77 -lm before it appends the command line values.]
- /usr/opt/bin/cmex (4.2c). Probably needs to be done the same way as fmex. There is no test case.
Last modified: 2007/03/07 11:53:45.022000 US/Eastern by
Created: 2007/03/07 11:53:45.022000 US/Eastern by brian.r.brinegar.1.
Type in a few keywords describing what information you are looking for in the text box below.