SOS! Errors! Can't even start building TorchAudio from source? Why!

TechVillain: <p>I have a Kepler sm_30 graphic card, in order to use CUDA, I need to build PyTorch from source.</p>
<p>So I did. I installed CUDA 10.2 and cuDNN 7.6.5 on my Windows 7 Professional 64 bit OS, installed CMake, Ninja in the conda environment, along with Microsoft Visual Studio Community 2019.</p>
<p>Then I successfully have PyTorch 1.10.0 wheel built. Awesome!</p>
<p>Under the same conda environment, I then successfully built TorchVision 0.11.0 wheel. Great!</p>
<p>Finally, when I tried to build TorchAudio, errors occurred, and the build process couldn’t even start.</p>
<p>Below are the detailed screenshot of the build process. What can I do? Please please please help!</p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/3/9/3940c24a9d0e3ecb34a426a79f8611487804761c.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/3940c24a9d0e3ecb34a426a79f8611487804761c" title="TorchAudio Error_Page_1"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/3/9/3940c24a9d0e3ecb34a426a79f8611487804761c_2_386x500.jpeg" alt="TorchAudio Error_Page_1" data-base62-sha1="8atXAXBCdoPNsIILkqc18lWop40" width="386" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/3/9/3940c24a9d0e3ecb34a426a79f8611487804761c_2_386x500.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/3/9/3940c24a9d0e3ecb34a426a79f8611487804761c_2_579x750.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/3/9/3940c24a9d0e3ecb34a426a79f8611487804761c_2_772x1000.jpeg 2x" data-dominant-color="0C0F0F"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">TorchAudio Error_Page_1</span><span class="informations">961×1243 272 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/2/4/248d8211f9980db063ad9930a920622e5ec2dc0c.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/248d8211f9980db063ad9930a920622e5ec2dc0c" title="TorchAudio Error_Page_2"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/2/4/248d8211f9980db063ad9930a920622e5ec2dc0c_2_386x500.jpeg" alt="TorchAudio Error_Page_2" data-base62-sha1="5dmmQWZSdEQAlVNGu6Xn97oc0W0" width="386" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/2/4/248d8211f9980db063ad9930a920622e5ec2dc0c_2_386x500.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/2/4/248d8211f9980db063ad9930a920622e5ec2dc0c_2_579x750.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/2/4/248d8211f9980db063ad9930a920622e5ec2dc0c_2_772x1000.jpeg 2x" data-dominant-color="1C1D1D"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">TorchAudio Error_Page_2</span><span class="informations">961×1243 238 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/7/d/7dfec26f6502d201052a4e4feaf3bd108da23a19.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/7dfec26f6502d201052a4e4feaf3bd108da23a19" title="TorchAudio Error_Page_3"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/7/d/7dfec26f6502d201052a4e4feaf3bd108da23a19_2_386x500.jpeg" alt="TorchAudio Error_Page_3" data-base62-sha1="hYBvdCAL5uk5Y1yQ7LpiA4ygBqp" width="386" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/7/d/7dfec26f6502d201052a4e4feaf3bd108da23a19_2_386x500.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/7/d/7dfec26f6502d201052a4e4feaf3bd108da23a19_2_579x750.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/7/d/7dfec26f6502d201052a4e4feaf3bd108da23a19_2_772x1000.jpeg 2x" data-dominant-color="141412"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">TorchAudio Error_Page_3</span><span class="informations">961×1243 442 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>

apivovarov: <p>The error messages say you have issues with C++ / C compilers. C compiler is unknown.</p>
<p>Try Ubuntu first - Pytorch is well tested on it.</p>
<p>BTW, this discussion Category is for <code>torch.compile</code> and PyTorch 2.0 related compiler issues, not for Pytorch building issues.</p>

TechVillain: <p>Thanks for helping move this post from “compile” to the “audio” category.</p>
<p>Well, I still need some expert opinions here, as I only use Windows, and never use Linux or Ubuntu.</p>
<p>I am a musician, not a tech CEO.</p>
<p>Has anyone in this forum ever tried to build a torchaudio wheel on the Windows platform?</p>

moto: <p>Need to enable MSVC tool chain so that <code>cl</code> command is recognized.</p>
<p>For MSVC 2019 it’s</p>
<pre><code class="lang-auto">call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
</code></pre>
<p>See <a href="https://pytorch.org/audio/stable/build.windows.html" class="inline-onebox" rel="noopener nofollow ugc">Building on Windows — Torchaudio 2.0.1 documentation</a></p>