fortran matlab
1 view (last 30 days)
Show older comments
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 Comment
Walter Roberson
on 9 May 2012
Did you resolve your previous question http://www.mathworks.com/matlabcentral/answers/37926-intel-fortran-matlab-2012a
Accepted Answer
Kaustubha Govind
on 9 May 2012
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 Comments
Kaustubha Govind
on 22 May 2012
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.
More Answers (0)
See Also
Categories
Find more on Write C Functions Callable from MATLAB (MEX Files) in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!