HEYO can you tell me where cl.exe is located within VS Code? I don't have full Visual…
- User
HEYO can you tell me where cl.exe is located within VS Code? I don't have full Visual Studio - I need it to compile something via PyTorch's cpp_extension.py.
Here's the full code of the setup-script I'm trying to run for installing custom C++ CUDA extentions:
from setuptools import setup, Extension from torch.utils import cpp_extension
setup( name='quant_cuda', ext_modules=[cpp_extension.CUDAExtension( 'quant_cuda', ['quant_cuda.cpp', 'quant_cuda_kernel.cu'] )], cmdclass={'build_ext': cpp_extension.BuildExtension} )
and here's the error:
“C:\Users\MyUserName\miniconda3\envs\ai-env\lib\site-packages\torch\utils\cpp_extension.py:359: UserWarning: Error checking compiler version for cl: [WinError 2] Das System kann die angegebene Datei nicht finden warnings.warn(f’Error checking compiler version for {compiler}: {error}') error: [WinError 2] Das System kann die angegebene Datei nicht finden”
The German in the error message translates to “File not found”. I read something about a path to “cl.exe”, but I don’t know what that’s supposed to mean… I’m running on an AMD processor, thought I’d mention that because I’ve seen the name AMD pop up a few times while looking for solutions. Thanks in advance!
- Assistant
It seems like the compiler (cl.exe) is not found in your system. Since you don't have full Visual Studio, you need to install the necessary build tools for compiling C++ code.
Follow these steps to install the build tools:
- Download the "Build Tools for Visual Studio" installer from this link: https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019
- Run the installer, and you will see the "Visual Studio Workloads" page.
- Check the option called "C++ build tools" and click "Install" to install the necessary tools.
After the installation is complete, you need to set up the environment variables to let VSCode know where to find the cl.exe.
- Open the "Environment Variables" window by right-clicking on "This PC" -> Properties -> Advanced system settings -> Environment Variables.