I am trying to use MAGMA (http://icl.cs.utk.edu/magma/) to perform some matrix operations on a GPU. I am able to invoke CUDA kernel's successfully, and there is no problem with that. But when I try to use the magmablas_sgemm function, I am getting errors.
This is the compilation command I am using:
nvcc -o msd msd.cu -I../../include -I/util/magma/1.1 -lmagma -lmagmablas -Xcompiler -I../../include -I/util/magma/1.1 "-O3"
This is a partial printenv output:
LD_LIBRARY_PATH=/util/magma/1.1/lib:/util/cuda/4.1.28/cuda/lib64:/util/cuda/4.1.28/cuda/lib MAGMA=/util/magma/1.1 PATH=/util/magma/1.1:/util/cuda/4.1.28/cuda/bin:/usr/lib64/qt-3.3/bin:/util/Modules/3.2.8/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/kerberos/bin _LMFILES_=/util/Modules/modulefiles/null:/util/Modules/modulefiles/modules:/util/Modules/modulefiles/cuda/4.1.28:/util/Modules/modulefiles/magma/1.1 MODULEPATH=/util/Modules/versions:/util/Modules/modulefiles LOADEDMODULES=null:modules:cuda/4.1.28:magma/1.1
As can be clearly seen, the magma libraries are included in LD_LIBRARY_PATH and yet, I get this error:
/usr/bin/ld: cannot find -lmagma collect2: ld returned 1 exit status make: *** [msd] Error 1
Any help/pointers will be greatly appreciated! Thanks!
P.S: If relevant, the underlying C compiler being used by nvcc for host code is gcc.
P.P.S: I checked the path "/util/magma/1.1/lib" and it does contain libmagma.a and libmagmablas.a
UPDATE: Wow.. I hate this.. but this got it working
nvcc -o msd msd.cu -I../../include -I/util/magma/1.1 -L/util/cuda/4.0.17/cuda/lib64 -L/util/magma/1.1/lib -lcublas -lm -lmagma -lmagmablas -Xcompiler -I../../include -I/util/magma/1.1 "-O3"
So all I did was include the library path explicitly. But I thought LD_LIBRARY_PATH will take care of stuff like that. Any idea why that did not work?
Wow.. I hate this.. but this got it working
nvcc -o msd msd.cu -I../../include -I/util/magma/1.1 -L/util/cuda/4.0.17/cuda/lib64 -L/util/magma/1.1/lib -lcublas -lm -lmagma -lmagmablas -Xcompiler -I../../include -I/util/magma/1.1 "-O3"
So all I did was include the library path explicitly.