problem to install matlab plugin

hi,

when i want to install matlab plugin i execute this code :
mex fft2_cuda.c -IC:\CUDA\include -LC:\CUDA\lib -lcudart -lcufft

and i have this error message:
Could not locate C:\CUDA\cudart.lib

have you an idea ?

my matlab version is matlab R2006a and plugin is test on R2006b

it’s the source of my problem ?

thanks

You probably first have to compile the SDK, as cudart.lib is not built, until building the SDK.

With the version 2006b of MatLab it finds the libraries, but it still returns the following error. I don’t know where ‘_cudaMalloc@8’ and the other subroutines should be…

Thanks

Writing library for ifft2_cuda.mexw32

c:\docume~1\gmi\locals~1\temp\mex_4b3e90c6-c086-470d-8ab5-a313ae8b8cc7\ifft2_cuda.obj .text: undefined reference to ‘_cudaMalloc@8’

c:\docume~1\gmi\locals~1\temp\mex_4b3e90c6-c086-470d-8ab5-a313ae8b8cc7\ifft2_cuda.obj .text: undefined reference to ‘_cudaMemcpy@16’

c:\docume~1\gmi\locals~1\temp\mex_4b3e90c6-c086-470d-8ab5-a313ae8b8cc7\ifft2_cuda.obj .text: undefined reference to ‘_cufftPlan2d@16’

c:\docume~1\gmi\locals~1\temp\mex_4b3e90c6-c086-470d-8ab5-a313ae8b8cc7\ifft2_cuda.obj .text: undefined reference to ‘_cufftExecC2C@16’

c:\docume~1\gmi\locals~1\temp\mex_4b3e90c6-c086-470d-8ab5-a313ae8b8cc7\ifft2_cuda.obj .text: undefined reference to ‘_cufftDestroy@4’

c:\docume~1\gmi\locals~1\temp\mex_4b3e90c6-c086-470d-8ab5-a313ae8b8cc7\ifft2_cuda.obj .text: undefined reference to ‘_cudaFree@4’

C:\PROGRA~1\MATLAB\R2006B\BIN\MEX.PL: Error: Link of ‘ifft2_cuda.mexw32’ failed.

It looks a lot like the error I got on linux. I believe one library should be added on the nvcc commandline. Trouble is I don’t remember which one it is…

I would at least add -lcuda, since CudaMalloc should be in that one, but it is strange you get warnings about cufft, when you have -lcufft on the commandline. But at least start with adding -lcuda

You need to set up mex to use the VS compiler.
Run “mex -setup” and follow the on-screen directions.

Thanks for the help.
I installed VS 2005 Express.

It goes further, but it stops for missing libraries:

mex fft2_cuda_sp_dp.c -IC:\CUDA\include -LC:\CUDA\lib -lcudart -lcufft
Microsoft ® Incremental Linker Version 8.00.50727.42
Copyright © Microsoft Corporation. All rights reserved.

C:\DOCUME~1\gmi\LOCALS~1\Temp\mex_407BA41E-E9F2-47D1-04BC-1552BA82D04D\fft2_cuda_sp_dp.obj
LINK : fatal error LNK1181: impossible d’ouvrir le fichier en entrée ‘user32.lib’

C:\PROGRA~1\MATLAB\R2006B\BIN\MEX.PL: Error: Link of ‘fft2_cuda_sp_dp.mexw32’ failed.

??? Error using ==> mex
Unable to complete successfully.

I tried to copy ‘user32.lib’ into the work directory, then the other .LIB required by mex.

However ‘odbccp32.lib’ is still missing.
I spent the whole day trying to fix the problem, but I probably need to install some other module.

Ciao

Giovanni

Download the pdf from this link and follow the instructions on how to use VS Express to build mex files.

http://www.mathworks.com/matlabcentral/fil…?objectId=13321

MIRACOLO !!!

It works :)

Many thanks for your precious help.

Giovanni