Thread Subject: Compiling Peter Boettcher's ndfun on 64bit windows?

Subject: Compiling Peter Boettcher's ndfun on 64bit windows?

From: Yuval

Date: 11 Sep, 2009 17:15:23

Message: 1 of 3

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

Subject: Compiling Peter Boettcher's ndfun on 64bit windows?

From: James Tursa

Date: 11 Sep, 2009 18:32:03

Message: 2 of 3

"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

Subject: Compiling Peter Boettcher's ndfun on 64bit windows?

From: Renwen Lin

Date: 21 Nov, 2009 03:34:04

Message: 3 of 3

I have wrote a code of ndfun on windows 64. You may have a try. Good lucky!!

http://www.mathworks.in/matlabcentral/newsreader/view_thread/258000#671583



"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

Tags for this Thread

Everyone's Tags:

ndfun(2)

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
ndfun Renwen Lin 20 Nov, 2009 22:34:07
ndfun Yuval 11 Sep, 2009 13:19:20
rssFeed for this Thread

Contact us at files@mathworks.com