|
"Yuval" <yuval.tassa@geemail.dot.com> wrote in message <h8e0jb$i4s$1@fred.mathworks.com>...
> Has anyone succeeded in doing this ?
>
> On 64-bit Vista with Microsoft Visual C++ 2008 SP1 and Matlab 2009a, if I use
>
> mex ndfun.c 'C:/Program Files/MATLAB/R2009a/extern/lib/win64/microsoft/libmwlapack.lib' 'C:/Program Files/MATLAB/R2009a/extern/lib/win64/microsoft/libmwblas.lib'
>
> The file compiles but then crashes Matlab on use.
>
> If I add the -largeArrayDims flag for 64-bit addressing, again the file compiles, but always reports incompatible dimensions upon use.
>
> Any ideas?
>
> Thanks
> YT
I have never used ndfun so I am guessing here. I looked at the code and he has hard coded the integer types passed to the BLAS routines as int. The MATLAB doc, however, states that for BLAS calls the types should be mwSignedIndex. That is because the BLAS routines support 64-bit integers for the arguments. So my guess is that int on your compiler is a 32-bit whereas the BLAS routines you have linked with are expecting 64-bit integer types, i.e. mwSignedIndex. It works on a 32-bit setup because in that case mwSignedIndex is just an int. But on a 64-bit setup it is probably a long long. Using the -largeArrayDims flag by itself will not fix this problem. You will have to manually edit the ndfun.c source code and find all the int variables that are used for BLAS arguments and change them to mwSignedIndex. The BLAS function prototypes would also have to be changed. Be advised, however, that
I do not have a 64-bit setup so I cannot check that my advice is correct ...
James Tursa
|