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 here 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.
But now Im trying to compile and keep getting the following error: nvcc fatal: Path to libdevice library not specified.
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?