MATLAB loadlibrary with CUBLAS and CUFFT libraries

Hi,

I would like to use the CUBLAS and CUFFT libraries from within MATLAB using the loadlibrary command. I am running MATLAB R2010a on 64-bit Linux Ubuntu 9.10, gcc 4.4, with CUDA Toolkit 3.0. Here is what I get when I try to run the loadlibrary command:

>> loadlibrary('libcublas', '/usr/local/cuda/include/cublas.h');

??? Error using ==> loadlibrary at 368

Failed to preprocess the input file.

 Output from preprocessor is:In file included from

 /usr/local/cuda/include/vector_types.h:45,

				 from /usr/local/cuda/include/cuComplex.h:44,

				 from /usr/local/cuda/include/cublas.h:94:

/usr/local/cuda/include/host_defines.h:41:2: error: #error --- !!! UNSUPPORTED COMPILER !!! ---

Apparently, the following check is failing:

#if !defined(__GNUC__) && !defined(_WIN32)

But, I would think that GNUC should be defined. Has anyone had success using loadlibrary with CUBLAS or CUFFT? I can write a MEX-file and link it with these libraries. However, I would like to use loadlibrary as it would allow me to experiment with the libraries from MATLAB’s interpreted environment. Any information would be appreciated.

Thanks in advance,

–Chris

All,

I cross-posted this question in the MATLAB Newsgroup, and received the following reply, which worked for me:

All,

I cross-posted this question in the MATLAB Newsgroup, and received the following reply, which worked for me: