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=2ee3266d979dac6cc2f0cb0d48c0b684&showtopic=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?