title: Include path problems for GPU library
body: <p>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. </p>
  
  <p>This is the compilation command I am using:</p>
  
  <pre>
  nvcc -o msd msd.cu -I../../include -I/util/magma/1.1 -lmagma -lmagmablas -Xcompiler -I../../include -I/util/magma/1.1 "-O3"
  </pre>
  
  <p>This is a partial printenv output:</p>
  
  <pre>
  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
  </pre>
  
  <p>As can be clearly seen, the magma libraries are included in LD_LIBRARY_PATH and yet, I get this error:</p>
  
  <pre>
  /usr/bin/ld: cannot find -lmagma
  collect2: ld returned 1 exit status
  make: *** [msd] Error 1
  </pre>
  
  <p>Any help/pointers will be greatly appreciated! Thanks!</p>
  
  <p>P.S: If relevant, the underlying C compiler being used by nvcc for host code is gcc.<br>
  P.P.S: I checked the path "/util/magma/1.1/lib" and it does contain libmagma.a and libmagmablas.a </p>
  
  <p>UPDATE: Wow.. I hate this.. but this got it working</p>
  
  <p>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"</p>
  
  <p>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?</p>