Schedule
Mechanical
- Jun 28, 2006
- 5
Hi all,
I am new to Mex. I tried to compile a fortran code.
I use the following simple fortran code to test.
**********************************
subroutine return_a(a)
real, intent(out) :: a
a=1
end subroutine return_a
**********************************
the fortran compiler is Compaq Visual Fortran 6.6. Matlab is 7.2.0.232 (R2006)
In matlab command windows, I typed
mex -v return_a.f90
Then I got the following error message
This is mex, Copyright 1984-2005 The MathWorks, Inc.
-> Default options filename found in C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R2006a
----------------------------------------------------------------
-> Options file = C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R2006a\mexopts.bat
MATLAB = C:\Program Files\MATLAB\R2006a
-> COMPILER = df
-> Compiler flags:
COMPFLAGS = /fpp:"/m /SC:\Program Files\MATLAB\R2006a/extern/include" -c -nokeep -G5 -nologo -DMATLAB_MEX_FILE /fixed
OPTIMFLAGS = /MD -Ox -DNDEBUG
DEBUGFLAGS = /MD -Zi
arguments =
Name switch = /Fo
-> Pre-linking commands =
-> LINKER = link
-> Link directives:
LINKFLAGS = /DLL /EXPORT:_MEXFUNCTION@16 /MAP /LIBPATH:"C:\Program Files\MATLAB\R2006a\extern\lib\win32\microsoft" libmx.lib libmex.lib libmat.lib /implib:C:\DOCUME~1\Administrator\LOCALS~1\Temp_lib4621.lib /NOLOGO
LINKDEBUGFLAGS = /debug
LINKFLAGSPOST =
Name directive = "/out:return_a.mexw32"
File link directive =
Lib. link directive =
Rsp file indicator = @
-> Resource Compiler = rc /fo "mexversion.res"
-> Resource Linker =
----------------------------------------------------------------
--> "df /fpp:"/m /SC:\Program Files\MATLAB\R2006a/extern/include" -c -nokeep -G5 -nologo -DMATLAB_MEX_FILE /fixed /FoC:\DOCUME~1\Administrator\LOCALS~1\Temp\return_a.obj /MD -Ox -DNDEBUG return_a.f90"
C:\PROGRAM FILES\MATLAB\R2006A\BIN\MEX.PL: Error: Compile of 'return_a.f90' failed.
??? Error using ==> mex
Unable to complete successfully
What should I do to fix it?
Thanks?
I am new to Mex. I tried to compile a fortran code.
I use the following simple fortran code to test.
**********************************
subroutine return_a(a)
real, intent(out) :: a
a=1
end subroutine return_a
**********************************
the fortran compiler is Compaq Visual Fortran 6.6. Matlab is 7.2.0.232 (R2006)
In matlab command windows, I typed
mex -v return_a.f90
Then I got the following error message
This is mex, Copyright 1984-2005 The MathWorks, Inc.
-> Default options filename found in C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R2006a
----------------------------------------------------------------
-> Options file = C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R2006a\mexopts.bat
MATLAB = C:\Program Files\MATLAB\R2006a
-> COMPILER = df
-> Compiler flags:
COMPFLAGS = /fpp:"/m /SC:\Program Files\MATLAB\R2006a/extern/include" -c -nokeep -G5 -nologo -DMATLAB_MEX_FILE /fixed
OPTIMFLAGS = /MD -Ox -DNDEBUG
DEBUGFLAGS = /MD -Zi
arguments =
Name switch = /Fo
-> Pre-linking commands =
-> LINKER = link
-> Link directives:
LINKFLAGS = /DLL /EXPORT:_MEXFUNCTION@16 /MAP /LIBPATH:"C:\Program Files\MATLAB\R2006a\extern\lib\win32\microsoft" libmx.lib libmex.lib libmat.lib /implib:C:\DOCUME~1\Administrator\LOCALS~1\Temp_lib4621.lib /NOLOGO
LINKDEBUGFLAGS = /debug
LINKFLAGSPOST =
Name directive = "/out:return_a.mexw32"
File link directive =
Lib. link directive =
Rsp file indicator = @
-> Resource Compiler = rc /fo "mexversion.res"
-> Resource Linker =
----------------------------------------------------------------
--> "df /fpp:"/m /SC:\Program Files\MATLAB\R2006a/extern/include" -c -nokeep -G5 -nologo -DMATLAB_MEX_FILE /fixed /FoC:\DOCUME~1\Administrator\LOCALS~1\Temp\return_a.obj /MD -Ox -DNDEBUG return_a.f90"
C:\PROGRAM FILES\MATLAB\R2006A\BIN\MEX.PL: Error: Compile of 'return_a.f90' failed.
??? Error using ==> mex
Unable to complete successfully
What should I do to fix it?
Thanks?