Running nvcc without Visual Studio -> nvcc fatal error

When I try to run nvcc on the command line, I get this error:

nvcc fatal : Visual Studio configuration file ‘(null)’ could not be found for installation at ‘C:\code\bld\msvc\8.0\VC\BIN’

I searched the forums, but other people seem to be getting this error only when trying to build on 64-bit XP.

My XP installation is 32-bit. I am able to build and run CUDA code using Visual Studio project files, but I want to use CUDA without Visual Studio.

The directory the error refers to is indeed non-standard but it does contain the MSVC compiler. Also, all relevant environment variables (the vcvars.bat or whatever it was called) are properly setup.

Any help is appreciated.

OK, I have some more info to provide.

Using filemon I saw that nvcc tries to access vcvars32.bat in the vc\bin directory (which does exist in my non-standard installation), and then it wants to open vc\common7\tools\vsvars32.bat, which I was missing. I put a zero-length vsvars32.bat and that made nvcc happy.

Why does nvcc look for these bat files? I have already made sure that the environment is properly setup when nvcc runs (that is, cl is ready, willing and available.)

Is there anything I can do to make nvcc just trust me and go for cl.exe? :)

There are many commands&environments settings in the vcvars32.bat file.
When other compiler want to use VC compiler, it should be find the vcvars32.bat file first.