Variable stack allocations, Microsoft Visual Studio 2010

Open discussion for MAGMA

Variable stack allocations, Microsoft Visual Studio 2010

Postby tkacvins » Mon Feb 25, 2013 4:44 pm

I have made enough progress with porting MAGMA 1.3.0 to 64 bit Windows with Intel Fortran 12.1, NVIDIA CUDA 5.0, MKL 11.0, and Microsoft Visual Studio 2010. I can compile Fortran and C++ source. I am using MinGW's msys for this work, as it seemed easier than making a Visual Stdio project. I had to change the Makefiles to support the syntax of the relevant compiler options, and take into account the default names of object and archive files.I have yet to get to compiling cu files, as I get stuck on this problem:

MAGMA is using variable stack allocations, like this (in zunmqr.cpp)

magma_int_t nb = magma_get_zgeqrf_nb( min( m, n ));
...
cuDoubleComplex T[ 2*nb*nb ];


The Microsoft compiler throws an error while trying to compile this code:

zunmqr.cpp(124) : error C2057: expected constant expression
zunmqr.cpp(124) : error C2466: cannot allocate an array of constant size 0
zunmqr.cpp(124) : error C2133: 'T' : unknown size


I could fix this and get on my way, but I though it would better to report this and have it fixed officially, as it will cause other people problems when they build MAGMA on Windows. Even if I could get a Windows compiler to support this (I doubt I can, nvcc is tied to cl), there is still the issue of potentially blowing out the stack at run time...

Regards,

Tom
tkacvins
 
Posts: 3
Joined: Mon Feb 25, 2013 10:33 am

Re: Variable stack allocations, Microsoft Visual Studio 2010

Postby Stan Tomov » Tue Feb 26, 2013 7:31 pm

Thanks for pointing this out! We will fix it for the next release.
Stan Tomov
 
Posts: 251
Joined: Fri Aug 21, 2009 10:39 pm

Re: Variable stack allocations, Microsoft Visual Studio 2010

Postby tkacvins » Wed Feb 27, 2013 5:41 pm

Stan Tomov wrote:Thanks for pointing this out! We will fix it for the next release.


Stan,

Will this be in the 1.3 branch, or will it go into the 1.4 branch? We'd like to use the 1.3 branch due to some time constraints we have, unless 1.4 is coming out soon.

Thanks,

Tom
tkacvins
 
Posts: 3
Joined: Mon Feb 25, 2013 10:33 am

Re: Variable stack allocations, Microsoft Visual Studio 2010

Postby Stan Tomov » Thu Feb 28, 2013 1:55 pm

Tom,
It will be in 1.4. We are incorporating some new eigensolvers for 1.4 and along that we will include bug fixes and other small changes (to be released within a month).
Stan
Stan Tomov
 
Posts: 251
Joined: Fri Aug 21, 2009 10:39 pm

Re: Variable stack allocations, Microsoft Visual Studio 2010

Postby Bryant Lee » Sun Mar 17, 2013 9:42 am

tkacvins wrote:I have made enough progress with porting MAGMA 1.3.0 to 64 bit Windows with Intel Fortran 12.1, NVIDIA CUDA 5.0, MKL 11.0, and Microsoft Visual Studio 2010. I can compile Fortran and C++ source. I am using MinGW's msys for this work, as it seemed easier than making a Visual Stdio project. I had to change the Makefiles to support the syntax of the relevant compiler options, and take into account the default names of object and archive files.I have yet to get to compiling cu files, as I get stuck on this problem:

MAGMA is using variable stack allocations, like this (in zunmqr.cpp)

magma_int_t nb = magma_get_zgeqrf_nb( min( m, n ));
...
cuDoubleComplex T[ 2*nb*nb ];


The Microsoft compiler throws an error while trying to compile this code:

zunmqr.cpp(124) : error C2057: expected constant expression
zunmqr.cpp(124) : error C2466: cannot allocate an array of constant size 0
zunmqr.cpp(124) : error C2133: 'T' : unknown size


I could fix this and get on my way, but I though it would better to report this and have it fixed officially, as it will cause other people problems when they build MAGMA on Windows. Even if I could get a Windows compiler to support this (I doubt I can, nvcc is tied to cl), there is still the issue of potentially blowing out the stack at run time...

Regards,

Tom



Hello Tom!

I wonder how you install MAGMA successfully, could you please tell me in detail ? I'm using VS2010, MKL 11.0, Intel Fortran Compiler, and CUDA 5.0, and I'm using cmake, but when I click configure , I got this error and I can't figure it out:
Building on LIZHENG-IDEAPAD
Building for target Windows
Build for 32 bits
Add -nofor_main to the Fortran linker
Looking Fortran mangling
CMake Error at cmake_modules/buildsystem/FortranMangling.cmake:60 (MESSAGE):
Looking Fortran mangling - error
Call Stack (most recent call first):
CMakeLists.txt:183 (FortranMangling)

could you please help me ?
regard,
Bryant Lee
Bryant Lee
 
Posts: 2
Joined: Sun Mar 17, 2013 9:31 am


Return to User discussion

Who is online

Users browsing this forum: Google [Bot] and 2 guests