Reputation: 155
I am trying to compile a .cu program with nvcc and after every time I try and compile in Unix, my commands no longer work. I get an error:
'command': command not found.
Why is that? I have to logout/exit after each time I compile.
[EDIT] I actually found that setting the path: setenv PATH /usr/local/cuda/bin causes the problem. Commands like: ls, pico, cd, etc. do not work. I can exit and logout
Upvotes: 2
Views: 567
Reputation: 151972
You don't want to do setenv PATH /usr/local/cuda/bin
You want to do setenv PATH $PATH:/usr/local/cuda/bin
or some variant of that like setenv PATH $PATH":/usr/local/cuda/bin"
When you do it your way, you are replacing your existing PATH definition, so you lose the command path to all those other commands. Try echo $PATH
to see what it looks like before you change it. You want to add to it, not replace it.
Upvotes: 2
Reputation: 29743
You are deleting your path, you need to append to the PATH instead of overwriting it.
setenv PATH ${PATH}:/usr/local/cuda/bin
Upvotes: 4