Compiling Magma on Windows

Open discussion for MAGMA library (Matrix Algebra on GPU and Multicore Architectures)
Post Reply
pinnacleman98
Posts: 1
Joined: Wed Jul 01, 2020 2:20 pm

Compiling Magma on Windows

Post by pinnacleman98 » Wed Jul 01, 2020 2:37 pm

Hi, all:

I'm porting a large fortran code with many blas and lapack calls to GPU with OpenAcc and PGI compilers. I want to use magma to maximize the portability of the GPU code. I downloaded Magma 2.5.3. I'm using CMake to configure and generate a solution file for VS 2013. After some struggle, I managed to genereate the solution file. But when I tried to build, VS gives me lots of error of
Error 112 error MSB6006: "cmd.exe" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets 170 5 magma

I tried to compile the source file one by one in magma project manually and found the problem is happened when compiling all .cu files (all cuda kernel files). I don't know how to fix this error. Here is my system information

Configure output from CMake configure:
CMake Warning at CMakeLists.txt:62 (message):
The compiler C:/Program Files (x86)/Microsoft Visual Studio
12.0/VC/bin/x86_amd64/cl.exe doesn't support the -std=c++11 flag. Some
code may not compile.


CMake Warning at CMakeLists.txt:69 (message):
The compiler C:/Program Files (x86)/Microsoft Visual Studio
12.0/VC/bin/x86_amd64/cl.exe doesn't support the -std=c99 flag. Some code
may not compile.


Found OpenMP
OpenMP_C_FLAGS -openmp
OpenMP_CXX_FLAGS -openmp
Found CUDA 10.1
CUDA_INCLUDE_DIRS: C:/Program Files/PGI/win64/2019/cuda/10.1/include
CUDA_CUDART_LIBRARY: C:/Program Files/PGI/win64/2019/cuda/10.1/lib/x64/cudart.lib
compile for CUDA arch 3.0 (Kepler)
compile for CUDA arch 3.5 (Kepler)
compile for CUDA arch 5.0 (Maxwell)
compile for CUDA arch 6.0 (Pascal)
Define -DHAVE_CUBLAS -DMIN_CUDA_ARCH=300
User set LAPACK_LIBRARIES. To change, edit LAPACK_LIBRARIES using ccmake (set to empty to enable search).
CMake Warning at CMakeLists.txt:300 (message):
LAPACK_LIBRARIES has MKL, but MKLROOT not set; can't add include directory.


pkgconfig lib/pkgconfig/magma.pc
Flags
CMAKE_INSTALL_PREFIX: C:/Program Files (x86)/MAGMA
CFLAGS: /DWIN32 /D_WINDOWS -openmp -W4 -MP -DMAGMA_NOAFFINITY
CXXFLAGS: /DWIN32 /D_WINDOWS /GR /EHsc -openmp -W4 -MP -DMAGMA_NOAFFINITY
NVCCFLAGS: -Xcompiler;-fPIC;-DHAVE_CUBLAS;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_60,code=compute_60
FFLAGS: /W1 /nologo /fpp /libs:dll /threads -Dmagma_devptr_t="integer(kind=8)"
LIBS: c:\Program Files (x86)\Intel\Composer XE\mkl\lib\intel64\mkl_intel_lp64_dll.lib c:\Program Files (x86)\Intel\Composer XE\mkl\lib\intel64\mkl_intel_thread_dll.lib c:\Program Files (x86)\Intel\Composer XE\mkl\lib\intel64\mkl_core_dll.lib c:\Program Files (x86)\Intel\Composer XE\compiler\lib\intel64\libiomp5md.lib C:/Program Files/PGI/win64/2019/cuda/10.1/lib/x64/cudart.lib C:/Program Files/PGI/win64/2019/cuda/10.1/lib/x64/cublas.lib C:/Program Files/PGI/win64/2019/cuda/10.1/lib/x64/cusparse.lib
blas_fix: (MacOS Accelerate only)
LAPACK_LIBRARIES: c:\Program Files (x86)\Intel\Composer XE\mkl\lib\intel64\mkl_intel_lp64_dll.lib;c:\Program Files (x86)\Intel\Composer XE\mkl\lib\intel64\mkl_intel_thread_dll.lib;c:\Program Files (x86)\Intel\Composer XE\mkl\lib\intel64\mkl_core_dll.lib;c:\Program Files (x86)\Intel\Composer XE\compiler\lib\intel64\libiomp5md.lib
CUDA_CUDART_LIBRARY: C:/Program Files/PGI/win64/2019/cuda/10.1/lib/x64/cudart.lib
CUDA_CUBLAS_LIBRARIES: C:/Program Files/PGI/win64/2019/cuda/10.1/lib/x64/cublas.lib
CUDA_cusparse_LIBRARY: C:/Program Files/PGI/win64/2019/cuda/10.1/lib/x64/cusparse.lib
Fortran modules:
Configuring done
Generating done

I'm using windows 10.

Any help and advice will be deeply appreciated.

John

BTW, It seems that the developer of the Magma didn't build the windows version before release as there is apparent error in CMakeLists.txt which causes cmake fail to configure.

mgates3
Posts: 918
Joined: Fri Jan 06, 2012 2:13 pm

Re: Compiling Magma on Windows

Post by mgates3 » Mon Jul 13, 2020 1:04 pm

We have had difficulty with CMake compiling MAGMA on Windows. This appears to be a bug or deficiency in CMake. It is unclear when this occurred -- whether some new version of CUDA, CMake, or MAGMA broke it -- as we have previously compiled MAGMA with CMake on Windows. See this thread:

viewtopic.php?f=2&t=4119

Mark

kerry87
Posts: 8
Joined: Wed May 20, 2020 11:34 am
Contact:

Re: Compiling Magma on Windows

Post by kerry87 » Thu Aug 06, 2020 10:23 am

It seems there are some incompatibilites from C++ of VS and Linux. I am reading some threads talking about similar issue, just googled this:

Code: Select all

cl.exe doesn't support the -std
But it seems more like a change on the codebase of the project than from your side.

Post Reply