title: Cannot compile cuda using sudo command
body: <p>Ive tried to compile a cuda program using nvcc but with the sudo command. First, it couldnt find the nvcc compiler, so I did as suggested <a href="https://askubuntu.com/questions/428234/nvcc-not-found-but-only-when-using-sudo">here</a> and created a symlink to nvcc in one of the directories listed in secure_path, like this: sudo ln -s /path/to/nvcc /sbin/nvcc.</p>
  
  <p>But now Im trying to compile and keep getting the following error: nvcc fatal: Path to libdevice library not specified. </p>
  
  <p>I guess that it has to do with the LD_LIBRARY_PATH variable that isnt set properly in root mode, but I cant find the way to solve it.
  Any ideas?</p>