I am a bit annoyed by nvcc host compiler detection logic. So if all three options --use-local-env
, --allow-unsupported-compiler
and --ccbin
are passed to nvcc please simply assume that the users knows what is going on or only print a warning.
So I would like to use another clang-cl then installed with MSVC however if I try to do that I am either greeted with:
(a) nvcc fatal : Compiler 'clang-cl.exe' in PATH different than the one specified with -ccbin
or
(b) nvcc fatal : Host compiler targets unsupported OS.
It is a bit ridiculous to be greeted with (a) when using:
nvcc warp.cu -allow-unsupported-compiler -ccbin clang-cl.exe -v --use-local-env
Since that is basically impossible (due to --use-local-env
) and nvcc is seemingly using a different environment then specified. Secondly, explicitly passing the full path e.g. C:\Program Files\LLVM\bin\clang-cl.exe
yields (b) although the target could be inferred from --use-local-env
having vcvars being setup beforehand.
Please either provide a flag to ignore these warnings or fix the detection logic to consider these cases.
From my testing nvcc is looking for the vcvars.bat within Auxiliary
folder although is --use-local-env
used. From further testing it seems to search parent folders for the /VC/
folder and then looks into Auxiliary
.