Magma on Windows and Visual Studio
-
- Posts: 4
- Joined: Thu Aug 04, 2011 10:32 am
Magma on Windows and Visual Studio
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
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
-
- Posts: 268
- Joined: Fri Aug 21, 2009 10:39 pm
Re: Magma on Windows and Visual Studio
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
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
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
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
-
- Posts: 4
- Joined: Thu Aug 04, 2011 10:32 am
Re: Magma on Windows and Visual Studio
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
Thanks,
Philip
-
- Posts: 4
- Joined: Thu Aug 04, 2011 10:32 am
Re: Magma on Windows and Visual Studio
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
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
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
-
- Posts: 4
- Joined: Thu Aug 04, 2011 10:32 am
Re: Magma on Windows and Visual Studio
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
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
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
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
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
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
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
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