yprime.c mex linking error (windows 8.1, matlab R2013b, visual studio 2012)

1 view (last 30 days)
Hi,
I am trying to compile the simplest mex example, yprime.c, which ships with matlab. I have run mex -setup and selected the Visual Studio 12.0 compiler as found. When I run:
mex -v -c yprime.c
The object files gets generated successfully. However, when I try to run:
mex -v yprime.obj
I receive the following:
***************************************************************************
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/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html
****************************************************************************
-> Default options filename found in C:\src\mex\gpu
----------------------------------------------------------------
-> Options file = C:\src\mex\gpu\mexopts.bat
MATLAB = C:\src\MATLAB\R2013b
-> COMPILER = nvcc
-> Compiler flags:
COMPFLAGS = -gencode=arch=compute_13,code=sm_13 -gencode=arch=compute_20,code=sm_20 -gencode=arch=compute_30,code=\"sm_30,compute_30\" -c --compiler-options=/GR,/W3,/EHs,/D_CRT_SECURE_NO_DEPRECATE,/D_SCL_SECURE_NO_DEPRECATE,/D_SECURE_SCL=0,/DMATLAB_MEX_FILE,/nologo,/MD
OPTIMFLAGS = --compiler-options=/O2,/Oy-,/DNDEBUG
DEBUGFLAGS = --compiler-options=/Z7
arguments =
Name switch =
-> Pre-linking commands =
-> LINKER = link
-> Link directives:
LINKFLAGS = /dll /export:mexFunction /LIBPATH:"C:\src\MATLAB\R2013b\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib gpu.lib cudart.lib /MACHINE:X64 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /manifest /incremental:NO /implib:"C:\Windows\Temp\mex_W9oz9c\templib.x" /MAP:"yprime.mexw64.map"
LINKDEBUGFLAGS = /debug /PDB:"yprime.mexw64.pdb"
LINKFLAGSPOST =
Name directive = /out:"yprime.mexw64"
File link directive =
Lib. link directive =
Rsp file indicator = @
-> Resource Compiler = rc /fo "mexversion.res"
-> Resource Linker =
----------------------------------------------------------------
Contents of C:\Windows\Temp\mex_W9oz9c\mex_tmp.rsp:
yprime.obj
I have tried the following: 1) Move the file to the current directory in which I have administrator rights (including running matlab as administrator) 2) Reinstalling matlab in C:\src\MATLAB\R2013b to avoid spaces in the directory path
This is the simplest example, and it is fairly annoying that I have already spent 2 days trying to make it work. Matlab personnel, please advice.
Thank you, Christos

Answers (1)

Harsheel
Harsheel on 12 Dec 2013
Why are you following a two step process of first creating an obj file and then getting a .mexw64 file? Have you tried the following?:
>> mex -setup %select your compiler
>> mex -v yprime.c % this will create a yprime.mexw64 file in your current folder
>> yprime([1],[1 2 3 4]) %execute the resulting mex file

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!