Matlab plug-in for CUDA , OS XPsp2, VC2005 Error Error C2088

[b]Key words:

Error C2088

Matlab

VC2005 sp1

CUDA

Windows XP sp2[/b]

[b]Title:

Matlab plug-in for CUDA , OS XP-sp2, VC2005 Error C2088 during compilation of the demo examples [/b]External Media

Error Origin:

Changes in VC2005 sp1 :

please see this link for details: External Media

http://connect.microsoft.com/VisualStudio/…edbackID=229419

Status: no fix External Media

Possible solutions:

a) recompilation of provided CUDA libraries with different names!

B) Switch to 64bit Vista to make mexw64 and run with 64-bit matlab External Media

Steps to reproduce:

Install VC2005 sp1, run examples from the matlab CUDA 1.1 kit.

OS XP(pro) sp2

tested with matlab 7.1 , 2007b, 2008a

The compilation of examples with VC 2005 sp1 compiler …

>> mex fft2_cuda.c -IC:\CUDA\include -LC:\CUDA\lib -lcudart -lcufft

mex fft2_cuda_sp_dp.c -IC:\CUDA\include -LC:\CUDA\lib -lcudart -lcufft

mex ifft2_cuda.c -IC:\CUDA\include -LC:\CUDA\lib -lcudart -lcufft

and

nvmex -f nvmexopts.bat Szeta.cu -IC:\cuda\include -LC:\cuda\lib -lcufft -lcudart

…results with an error code: C2088.

Here is the printout:

mex fft2_cuda.c -IE:\CUDA\include -LE:\CUDA\lib -lcudart -lcufft -v

This is mex, Copyright 1984-2007 The MathWorks, Inc.

→ Default options filename found in E:\Documents and Settings\revera\Application Data\MathWorks\MATLAB\R2008a


→ Options file = E:\Documents and Settings\revera\Application Data\MathWorks\MATLAB\R2008a\mexopts.bat

  MATLAB                 = E:\PROGRA~1\MATLAB\R2008a 

→ COMPILER = cl

→ Compiler flags:

     COMPFLAGS           = /c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD 

     OPTIMFLAGS          = /O2 /Oy- /DNDEBUG 

     DEBUGFLAGS          = /Zi /Fd"fft2_cuda.mexw32.pdb" 

     arguments           =  -IE:\CUDA\include 

     Name switch         = /Fo 

→ Pre-linking commands =

→ LINKER = link

→ Link directives:

     LINKFLAGS           = /dll /export:mexFunction /MAP /LIBPATH:"E:\PROGRA~1\MATLAB\R2008a\extern\lib\win32\microsoft" libmx.lib libmex.lib libmat.lib /implib:E:\DOCUME~1\revera\LOCALS~1\Temp\mex_wthYtP\templib.x /MACHINE:X86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib 

     LINKDEBUGFLAGS      = /DEBUG /PDB:"fft2_cuda.mexw32.pdb" 

     LINKFLAGSPOST       =  

     Name directive      = /out:"fft2_cuda.mexw32" 

     File link directive =  

     Lib. link directive =  

     Rsp file indicator  = @ 

→ Resource Compiler = rc /fo “mexversion.res”

→ Resource Linker =


→ cl -IE:\CUDA\include /c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /FoE:\DOCUME~1\revera\LOCALS~1\Temp\mex_wthYtP\fft2_cuda.obj -IE:\PROGRA~1\MATLAB\R2008a\extern\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 “E:\Program Files\MATLAB\R2008a\toolbox\CUDA\fft2_cuda.c”

fft2_cuda.c

E:\Program Files\MATLAB\R2008a\toolbox\CUDA\fft2_cuda.c(49) : error C2088: ‘[’ : illegal for struct

E:\Program Files\MATLAB\R2008a\toolbox\CUDA\fft2_cuda.c(50) : error C2088: ‘[’ : illegal for struct

E:\Program Files\MATLAB\R2008a\toolbox\CUDA\fft2_cuda.c(62) : error C2088: ‘[’ : illegal for struct

E:\Program Files\MATLAB\R2008a\toolbox\CUDA\fft2_cuda.c(63) : error C2088: ‘[’ : illegal for struct

E:\Program Files\MATLAB\R2008a\toolbox\CUDA\fft2_cuda.c(79) : error C2088: ‘[’ : illegal for struct

E:\Program Files\MATLAB\R2008a\toolbox\CUDA\fft2_cuda.c(80) : error C2088: ‘[’ : illegal for struct

E:\Program Files\MATLAB\R2008a\toolbox\CUDA\fft2_cuda.c(97) : error C2088: ‘[’ : illegal for struct

E:\Program Files\MATLAB\R2008a\toolbox\CUDA\fft2_cuda.c(98) : error C2088: ‘[’ : illegal for struct

E:\Program Files\MATLAB\R2008a\toolbox\CUDA\fft2_cuda.c(110) : error C2088: ‘[’ : illegal for struct

E:\Program Files\MATLAB\R2008a\toolbox\CUDA\fft2_cuda.c(111) : error C2088: ‘[’ : illegal for struct

E:\Program Files\MATLAB\R2008a\toolbox\CUDA\fft2_cuda.c(154) : warning C4244: ‘=’ : conversion from ‘double’ to ‘int’, possible loss of data

E:\Program Files\MATLAB\R2008a\toolbox\CUDA\fft2_cuda.c(155) : warning C4244: ‘=’ : conversion from ‘double’ to ‘int’, possible loss of data

E:\PROGRA~1\MATLAB\R2008A\BIN\MEX.PL: Error: Compile of ‘fft2_cuda.c’ failed.

??? Error using ==> mex at 207

Unable to complete successfully. External Media

Some possible solutions to common MATLAB CUDA errors
[url=“http://cs.ucf.edu/~janaka/gpu/”]http://cs.ucf.edu/~janaka/gpu/[/url]