Matlab compilation error

In Matlab it try to compile the example in matlab using the instruction in the readme.txt but I get an error.

Dont understand where the mistake is.

The script is using Visual studio.

Run " mex -setup" to select Visual Studio as your default compiler for mex.
There are instructions on the web on how to use Visual Studio Express if you don’t have the full version.

Did the setup, still does not work with the same error. <img src=‘http://hqnveipbwb20/public/style_emoticons/<#EMO_DIR#>/crying.gif’ class=‘bbc_emoticon’ alt=’:’(’ />

Can you post the output of:

  1. a verbose build of a simple C mex file: mex -v file.c

  2. a verbose output of the cuda mex file: nvmex -v … Seta.cu

dont have problems with mex compilations , but okay:

mex -v ifft2_cuda.c -IF:\CUDA\include -LF:\CUDA\lib -lcudart -lcufft

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

-> Default options filename found in F:\Documents and Settings\Cem Bassoy\Application Data\MathWorks\MATLAB\R2007a


-> Options file = F:\Documents and Settings\Cem Bassoy\Application Data\MathWorks\MATLAB\R2007a\mexopts.bat

  MATLAB                 = F:\PROGRA~1\MATLAB\R2007a 

-> 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 

     OPTIMFLAGS          = /MD /O2 /Oy- /DNDEBUG 

     DEBUGFLAGS          = /MD /Zi /Fd"ifft2_cuda.mexw32.pdb" 

     arguments           =  -IF:\CUDA\include 

     Name switch         = /Fo 

-> Pre-linking commands =

-> LINKER = link

-> Link directives:

     LINKFLAGS           = /dll /export:mexFunction /MAP /LIBPATH:"F:\PROGRA~1\MATLAB\R2007a\extern\lib\win32\microsoft" libmx.lib libmex.lib libmat.lib /implib:F:\DOCUME~1\CEMBAS~1\LOCALS~1\Temp\mex_7020BEAB-D22D-410A-9CA4-1678BE7F4843\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:"ifft2_cuda.mexw32.pdb" 

     LINKFLAGSPOST       =  

     Name directive      = /out:"ifft2_cuda.mexw32" 

     File link directive =  

     Lib. link directive =  

     Rsp file indicator  = @ 

-> Resource Compiler = rc /fo “mexversion.res”

-> Resource Linker =


–> “cl -IF:\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 /FoF:\DOCUME~1\CEMBAS~1\LOCALS~1\Temp\mex_7020BEAB-D22D-410A-9CA4-1678BE7F4843\ifft2_cuda.obj -IF:\PROGRA~1\MATLAB\R2007a\extern\include -IF:\PROGRA~1\MATLAB\R2007a\simulink\include /MD /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 ifft2_cuda.c”

ifft2_cuda.c

ifft2_cuda.c(43) : warning C4244: ‘=’ : conversion from ‘double’ to ‘float’, possible loss of data

ifft2_cuda.c(44) : warning C4244: ‘=’ : conversion from ‘double’ to ‘float’, possible loss of data

ifft2_cuda.c(62) : warning C4244: ‘=’ : conversion from ‘double’ to ‘float’, possible loss of data

ifft2_cuda.c(63) : warning C4244: ‘=’ : conversion from ‘double’ to ‘float’, possible loss of data

ifft2_cuda.c(90) : warning C4244: ‘=’ : conversion from ‘double’ to ‘float’, possible loss of data

ifft2_cuda.c(106) : warning C4244: ‘=’ : conversion from ‘double’ to ‘float’, possible loss of data

ifft2_cuda.c(150) : warning C4244: ‘=’ : conversion from ‘double’ to ‘int’, possible loss of data

ifft2_cuda.c(151) : warning C4244: ‘=’ : conversion from ‘double’ to ‘int’, possible loss of data

ifft2_cuda.c(120) : warning C4101: ‘output_single’ : unreferenced local variable

ifft2_cuda.c(118) : warning C4101: ‘i’ : unreferenced local variable

Contents of F:\DOCUME~1\CEMBAS~1\LOCALS~1\Temp\mex_7020BEAB-D22D-410A-9CA4-1678BE7F4843\mex_tmp.rsp: 

F:\DOCUME~1\CEMBAS~1\LOCALS~1\Temp\mex_7020BEAB-D22D-410A-9CA4-1678BE7F4843\ifft2_cuda.obj

–> "link /out:“ifft2_cuda.mexw32” /dll /export:mexFunction /MAP /LIBPATH:“F:\PROGRA~1\MATLAB\R2007a\extern\lib\win32\microsoft” libmx.lib libmex.lib libmat.lib /implib:F:\DOCUME~1\CEMBAS~1\LOCALS~1\Temp\mex_7020BEAB-D22D-410A-9CA4-1678BE7F4843\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 @F:\DOCUME~1\CEMBAS~1\LOCALS~1\Temp\mex_7020BEAB-D22D-410A-9CA4-1678BE7F4843\mex_tmp.rsp F:\CUDA\lib\cudart.lib F:\CUDA\lib\cufft.lib "

Microsoft ® Incremental Linker Version 8.00.50727.42

Copyright © Microsoft Corporation. All rights reserved.

F:\DOCUME~1\CEMBAS~1\LOCALS~1\Temp\mex_7020BEAB-D22D-410A-9CA4-1678BE7F4843\ifft2_cuda.obj

Creating library F:\DOCUME~1\CEMBAS~1\LOCALS~1\Temp\mex_7020BEAB-D22D-410A-9CA4-1678BE7F4843\templib.x and object F:\DOCUME~1\CEMBAS~1\LOCALS~1\Temp\mex_7020BEAB-D22D-410A-9CA4-1678BE7F4843\templib.exp

–> “del “ifft2_cuda.map””

–> “del F:\DOCUME~1\CEMBAS~1\LOCALS~1\Temp\mex_7020BEAB-D22D-410A-9CA4-1678BE7F4843\templib.x”

–> “mt -outputresource:“ifft2_cuda.mexw32”;2 -manifest “ifft2_cuda.mexw32.manifest””

Microsoft ® Manifest Tool version 5.2.3790.2014

Copyright © Microsoft Corporation 2005.

All rights reserved.

–> “del “ifft2_cuda.mexw32.manifest””

nvmex -v -f nvmexopts.bat Szeta.cu -IF:\cuda\include -LF:\cuda\lib -lcufft -lcudart

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

-> Options file specified on command line


-> Options file = nvmexopts.bat

  MATLAB                 = F:\PROGRA~1\MATLAB\R2007a 

-> COMPILER = nvcc

-> Compiler flags:

     COMPFLAGS           = -c -Xcompiler "/c /Zp8 /GR /W3 /EHsc- /Zc:wchar_t- /DMATLAB_MEX_FILE /nologo" 

     OPTIMFLAGS          = -Xcompiler "/MD /O2 /Oy- /DNDEBUG" 

     DEBUGFLAGS          = -Xcompiler "/MD /Zi /Fd"Szeta.mexw32.pdb" 

     arguments           =  -IF:\cuda\include 

     Name switch         = -o 

-> Pre-linking commands =

-> LINKER = link

-> Link directives:

     LINKFLAGS           = /dll /export:mexFunction /MAP /LIBPATH:"F:\PROGRA~1\MATLAB\R2007a\extern\lib\win32\microsoft" libmx.lib libmex.lib libmat.lib /implib:F:\DOCUME~1\CEMBAS~1\LOCALS~1\Temp\mex_921B5419-D03C-44B8-C296-3FB29C1B5B68\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:"Szeta.mexw32.pdb" 

     LINKFLAGSPOST       =  

     Name directive      = /out:"Szeta.mexw32" 

     File link directive =  

     Lib. link directive =  

     Rsp file indicator  = @ 

-> Resource Compiler = rc /fo “mexversion.res”

-> Resource Linker =


–> “nvcc -IF:\cuda\include -c -Xcompiler “/c /Zp8 /GR /W3 /EHsc- /Zc:wchar_t- /DMATLAB_MEX_FILE /nologo” -o F:\DOCUME~1\CEMBAS~1\LOCALS~1\Temp\mex_921B5419-D03C-44B8-C296-3FB29C1B5B68\Szeta.obj -IF:\PROGRA~1\MATLAB\R2007a\extern\include -IF:\PROGRA~1\MATLAB\R2007a\simulink\include -Xcompiler “/MD /O2 /Oy- /DNDEBUG” -DMX_COMPAT_32 Szeta.cu”

‘cl’ is not recognized as an internal or external command,

operable program or batch file.

F:\PROGRA~1\MATLAB\R2007A\BIN\NVMEX.PL: Error: Compile of ‘Szeta.cu’ failed.

Hello All

I’m new here… I just begin with Cuda and as it seems i’m not only to have some problem for using/installing it I NEED HELP :

So I have VS05, I’ve installed the SDK the toolkit and i want to use cuda with MATLAB…?

I can compile Mex File, but when i try to compile cuda file (the example) i have :

nvcc fatal : Could not open input file C:\DOCUME~1\rootlocal\Local Settings\Temp/tmpxft_00000430_00000000-1

C:\PROGRA~1\MATLAB\R2007B\BIN\NVMEX.PL: Error: Compile of ‘Szeta.cu’ failed.

Somebody know what can i do

Thks a lot

I am getting the same error. I have set my compiler to Microsoft Visual Studio 2008 (done using the mex -setup command), and am using Matlab 2008a. When I try to compile, I get the following error. Please let me know what I can do to fix this.

Thanks!

nvmex -f nvmexopts.bat Szeta.cu -IC:\cuda\include -LC:\cuda\lib -lcufft -lcudart
nvcc fatal : nvcc cannot find a supported cl version. Only MSVC 8.0 and MSVC 9.0 are supported

C:\PROGRA~1\MATLAB\R2008A\BIN\NVMEX.PL: Error: Compile of ‘Szeta.cu’ failed.

??? Error using ==> nvmex at 206
Unable to complete successfully.