|
I am a newbie to MEX functions.
I got Fortran 9.1 and selected it using "mex -setup"
then i tried to compile the example in this link
http://www.mathworks.com/access/helpdesk/help/techdoc/index.
html?/access/helpdesk/help/techdoc/matlab_external/f21779.ht
ml&http://www.google.com/search?
hl=en&q=mex+fortran+sample+code
But I get an error. what should I do?
the error I get is as follows
>> mex timestwo.f
ifort: Command line warning: /fp:precise evaluates in
source precision with Fortran.
fortcom: Error: Illegal character in statement label field
[m]
fortcom: Error: Illegal character in statement label field
[e]
fortcom: Error: Illegal character in statement label field
[x]
fortcom: Error: Illegal character in statement label field
[t]
fortcom: Error: First statement in file must not be
continued
timestwo.f(1) : Error: Syntax error, found POUND_BASE ''
when expecting one of: => = / . ( :: , <END-OF-
STATEMENT> ; : ) %
mex timestwo.F#include "fintrf.h"
--------------^
timestwo.f(21) : Error: Syntax error, found ',' when
expecting one of: => = . ( %
mwpointer plhs(*), prhs(*)
-----------------------^
timestwo.f(22) : Error: Syntax error, found ',' when
expecting one of: => = . ( : %
mwpointer mxGetPr, mxCreateDoubleMatrix
-----------------------^
timestwo.f(23) : Error: Syntax error, found ',' when
expecting one of: => = . ( : %
mwpointer x_pr, y_pr
--------------------^
timestwo.f(28) : Error: Syntax error, found ',' when
expecting one of: => = . ( : %
mwsize mxGetM, mxGetN
-------------------^
timestwo.f(29) : Error: Syntax error, found ',' when
expecting one of: => = . ( : %
mwsize m, n, size
--------------^
timestwo.f(27) : Error: A specification statement cannot
appear in the executable section.
integer nlhs, nrhs, mxIsNumeric
------^
timestwo.f(29) : Error: A specification statement cannot
appear in the executable section.
mwsize m, n, size
------^
timestwo.f(30) : Error: A specification statement cannot
appear in the executable section.
real*8 x, y
------^
timestwo.f(21) : Error: Object is not a pointer object
[MWPOINTERPLHS]
mwpointer plhs(*), prhs(*)
------^
timestwo.f(22) : Error: The POINTER attribute is required
[MWPOINTERMXGETPR]
mwpointer mxGetPr, mxCreateDoubleMatrix
------^
timestwo.f(22) : Error: The variable must have the TARGET
attribute or be a subobject of an object with the TARGET
attribute, or it must have the POINTER attribute.
[MXCREATEDOUBLEMATRIX]
mwpointer mxGetPr, mxCreateDoubleMatrix
-------------------------^
timestwo.f(23) : Error: The POINTER attribute is required
[MWPOINTERX_PR]
mwpointer x_pr, y_pr
------^
timestwo.f(23) : Error: The variable must have the TARGET
attribute or be a subobject of an object with the TARGET
attribute, or it must have the POINTER attribute. [Y_PR]
mwpointer x_pr, y_pr
----------------------^
timestwo.f(28) : Error: The POINTER attribute is required
[MWSIZEMXGETM]
mwsize mxGetM, mxGetN
------^
timestwo.f(28) : Error: The variable must have the TARGET
attribute or be a subobject of an object with the TARGET
attribute, or it must have the POINTER attribute.
[MXGETN]
mwsize mxGetM, mxGetN
---------------------^
timestwo.f(41) : Error: This name has not been declared as
an array or a function. [MXGETN]
n = mxGetN(prhs(1))
----------^
timestwo.f(50) : Error: This name has not been declared as
an array or a function. [PLHS]
plhs(1) = mxCreateDoubleMatrix(m,n,0)
------^
timestwo.f(50) : Error: This name has not been declared as
an array or a function. [MXCREATEDOUBLEMATRIX]
plhs(1) = mxCreateDoubleMatrix(m,n,0)
----------------^
compilation aborted for timestwo.f (code 1)
C:\PROGRA~1\MATLAB\R2007B\BIN\MEX.PL: Error: Compile
of 'timestwo.f' failed.
|