User`s guide
Step-by-Step Example of Fortran and xPC Target™
• libifcor e.lib
• libifcor emd.lib
• ifconsol .lib
• libifpor tmd.lib
• libifpor t.lib
• libmmd.l ib
• libm.lib
• libirc.l ib
• libmmt.l ib
• libifcor emt.lib
• svml_dis p.lib
Use the mex command wi th a C/C++ compiler such as Microsoft Visual C/C++
Version 6.0.
This topic assumes that you have created a C-MEX wrapper S-function. See
“Creating a C-MEX Wrapper S-Function” on page 13-8.
Invoking the
mex command requires you to compile the wrapper C file
sfun_atmos.c. Besuretolinkinthefollowing:
• Compiled Fortran code:
sfun_atmos_sub.obj
• Necessary Fortran run-time libraries to resolve external function references
and the Fortran run-time environment
When you are ready, mex the code. For example
mex - v LINKFLAGS="$LINKFLAGS /NODEFAULTLIB:libcmt.lib libifcoremd.lib
ifconsol.lib libifportmd.lib libmmd.lib libirc.lib svml_disp.lib" sfun_atmos.c
sfun_atmos_sub.obj
Ensure that this whole comm and is all on one line. This command compiles
and links the
sfun_atmos_sub.c file. It creates the sfun_a tmos .mex file in
thesamefolder.
13-13