필터 지우기
필터 지우기

fortran matlab

조회 수: 3 (최근 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