Page 1 of 2

Magma on Windows and Visual Studio

Posted: Thu Aug 04, 2011 10:42 am
by philip_warrick
Hi Magma people,

I'm wondering what I need to do to compile 64-bit in a Windows/Visual Studio environment. There was a post a long time ago about this but I see in the RC5 release notes that there is mention of better support for Windows compilation now. Any help would be appreciated.

Thanks,

Philip

Re: Magma on Windows and Visual Studio

Posted: Fri Aug 12, 2011 2:29 pm
by Stan Tomov
Hello,
In general we have prepared the software to compile under Windows. Similar to Linux, you have to only specify where is CPU BLAS, LAPACK, and CUDA, e.g., using cmake. We would be happy if you update us on success or challenges in doing this. If it will help we will look into putting a cmake example.
Stan

Re: Magma on Windows and Visual Studio

Posted: Mon Aug 15, 2011 1:02 pm
by ffox80
Hi,
I can confirm that Magma builds on Windows. I did build magmablas as a .dll using VS2008. Magma itself was build using Mingw-w64 (32bit sezero).
I will try to build both as a .dll within the next days.
Would it be possible to decorate all functions considered as API with a macro like MAGMA_DLL_API which exports to __declspec(dllexport) or (dllimport) on Windows?

Best,
Frank

Re: Magma on Windows and Visual Studio

Posted: Mon Aug 15, 2011 4:33 pm
by philip_warrick
I was able to compile everything with mingw and magmablas via cl.exe (i.e. Visual Studio) since nvcc doesn't support gcc on windows. But no test file would link with the magmablas library. Perhaps the Frank's dll approach will resolve this. I would like to help out as I can since Window is one of my constraints.

Thanks,

Philip

Re: Magma on Windows and Visual Studio

Posted: Mon Aug 15, 2011 4:55 pm
by philip_warrick
Also I tried to avoid the need for cl.exe by first generating c files from nvcc (with the -cuda option), but that preprocessing phase, too, is dependent on the presence of cl.exe :(

Re: Magma on Windows and Visual Studio

Posted: Tue Aug 16, 2011 12:16 am
by ffox80
Hi Philip,
I found the same that linking magmablas (the nvcc compiled portion) statically does not work with the MinGW gcc compiler due to mvscrt dependencies which are introduced during the compilation with the cl.exe based nvcc. I think we can't do anything about this dependency gcc just ain't supported as a compiler for nvcc on Windows (most devs don't seem to care http://forums.nvidia.com/index.php?s=2e ... pic=207555). Although my approach - mixing static and dynamic linkage - seems to work, I would prefer to build a magmablas and magma .dll. The reason for this is that I'd like to be able to fall back to a generic BLAS/LAPACK if no Cuda card or too old drivers are being found.
The problem for building the magma library is its dependency on LAPACK routines. It's just easier to satisfy them using Mingw.

Now, what can we do to get magma windows ready, such that it compiles right out of the box?

Frank

Re: Magma on Windows and Visual Studio

Posted: Fri Aug 19, 2011 9:05 am
by philip_warrick
Hi Frank,

Are you able to successfully run a test program with the dll?

What do you need to do at the moment to create and dll and could we work together to make it run out of the box?

Best regards,

Philip

Re: Magma on Windows and Visual Studio

Posted: Sat Aug 20, 2011 3:26 am
by ffox80
Hi Philip,
yes I did run test programs (although not all of the bundled tests) successfully with the dll.
At the moment I require just a visual studio and CLAPACK + CBLAS.
I'm still looking into compiling magma as a .dll as well (remember I just compiled magmablas).

Sadly, I have very little time to spend on this but feel free to PM me for some collaboration to get this up and running.

Frank

Re: Magma on Windows and Visual Studio

Posted: Tue Jan 10, 2012 7:00 am
by yariveis
Hi,

I need to run magma on Visual Studio on Windows 7 64 bit. I already have all the Cuda drivers and environment working and I am able to run Cublas functions succesfully.
1. What else do I have to install exactly? LAPACK and BLAS?
2. Does anyone have a working Visual Studio solution for magma 1.1.0?

Any help will be appriciated,
Thanks.
Yariv

Re: Magma on Windows and Visual Studio

Posted: Tue Jan 17, 2012 5:43 am
by yariveis
Hi again,

I managed to compile and link the magma project for Visual Studio 2008 on Windows 7 64 bit, after recieving great help from the forum members.
It's possible :)

Yariv