fortran matlab

4 次查看(过去 30 天)
Michael
Michael 2012-5-9
Hi, I am trying to run mex files on matlab, I got intel fortran to work (somehow) but now I am getting an error message when running the mex command. Here is what I get (sorry for some german terms in there), any idea what could be wrong?
mex -v yprimef.F
***************************************************************************
Warning: Neither -compatibleArrayDims nor -largeArrayDims is selected.
Using -compatibleArrayDims. In the future, MATLAB will require
the use of -largeArrayDims and remove the -compatibleArrayDims
option. For more information, see:
http://www.mathworks.com/help/techdoc/matlab_external/bsflnue-1.html
****************************************************************************
-> Default options filename found in D:\Users\Michael\AppData\Roaming\MathWorks\MATLAB\R2012a
----------------------------------------------------------------
-> Options file = D:\Users\Michael\AppData\Roaming\MathWorks\MATLAB\R2012a\mexopts.bat
MATLAB = C:\Program Files\MATLAB\R2012a
-> COMPILER = ifort
-> Compiler flags:
COMPFLAGS = /fpp /Qprec "/IC:\Program Files\MATLAB\R2012a/extern/include" -c -nologo -DMATLAB_MEX_FILE /fixed /MD /fp:source /assume:bscc
OPTIMFLAGS = /O2 /DNDEBUG
DEBUGFLAGS = /Z7
arguments =
Name switch = /Fo
-> Pre-linking commands =
-> LINKER = link
-> Link directives:
LINKFLAGS = /dll /export:MEXFUNCTION /LIBPATH:"C:\Program Files\MATLAB\R2012a\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib /implib:"D:\TEMP\mex_iU7hRj\templib.x" /MAP:"yprimef.mexw64.map" /NOLOGO /manifest /INCREMENTAL:NO
LINKDEBUGFLAGS = /debug /PDB:"yprimef.mexw64.pdb"
LINKFLAGSPOST =
Name directive = /out:"yprimef.mexw64"
File link directive =
Lib. link directive =
Rsp file indicator = @
-> Resource Compiler = rc /fo "mexversion.res"
-> Resource Linker =
----------------------------------------------------------------
--> ifort /fpp /Qprec "/IC:\Program Files\MATLAB\R2012a/extern/include" -c -nologo -DMATLAB_MEX_FILE /fixed /MD /fp:source /assume:bscc /FoD:\TEMP\mex_iU7hRj\yprimef.obj /O2 /DNDEBUG -DMX_COMPAT_32 yprimef.F
Contents of D:\TEMP\mex_iU7hRj\mex_tmp.rsp:
D:\TEMP\mex_iU7hRj\yprimef.obj
--> link /out:"yprimef.mexw64" /dll /export:MEXFUNCTION /LIBPATH:"C:\Program Files\MATLAB\R2012a\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib /implib:"D:\TEMP\mex_iU7hRj\templib.x" /MAP:"yprimef.mexw64.map" /NOLOGO /manifest /INCREMENTAL:NO @D:\TEMP\mex_iU7hRj\mex_tmp.rsp
LINK : error LNK2001: Nicht aufgelöstes externes Symbol "MEXFUNCTION".
D:\TEMP\mex_iU7hRj\templib.x : fatal error LNK1120: 1 nicht aufgelöste externe Verweise.
C:\PROGRA~1\MATLAB\R2012A\BIN\MEX.PL: Error: Link of 'yprimef.mexw64' failed.
  1 个评论
Walter Roberson
Walter Roberson 2012-5-9
Did you resolve your previous question http://www.mathworks.com/matlabcentral/answers/37926-intel-fortran-matlab-2012a

请先登录,再进行评论。

采纳的回答

Kaustubha Govind
Kaustubha Govind 2012-5-9
Seems like a permissions/UAC issue. Are you running the command from a directory that you have write access to? Also, try copying yprimef.F to a location in your home directory so that the MEX command doesn't attempt to write to the MATLAB installation root (inside C:\Program Files). If that still doesn't work, try starting MATLAB as Administrator and run the command.
  4 个评论
Michael
Michael 2012-5-20
thanks for the advice. I ran it as administrator and it didn't help. When I set it to c++ compiler via mex -setup and let matlab search, it finds it, i choose it and I can run mex yprime.c without problem. Thus this must be a different issue with the intel fortran
Kaustubha Govind
Kaustubha Govind 2012-5-22
Oops, just noticed the "Unresolved external symbol" error in your question. Sorry, this missed my eye because it was in German. It looks like the issue is not the compiler, but your MEX-file yprimef.F - is there a function called mexFunction defined in it? This function is required as an entry-point in MEX-function.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Write C Functions Callable from MATLAB (MEX Files) 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by