Error in Pytorch build from source on Windows

username: Kasirat_Kasfi
cooked: <p>Hi, I am trying to build Pytorch from source, I have been trying this for the last three days without any success. I have written the steps I have taken, along with my configs. Would be great if I could get some advice. Thank you!</p>
<p>GPU : GeForce RTX 3060<br>
Driver version : 516.4<br>
Windows 11</p>
<p>Steps:</p>
<ol>
<li>Installed Anaconda</li>
<li>Installed Cmake, downloaded from  <a href="https://cmake.org/download/" class="inline-onebox" rel="noopener nofollow ugc">Download | CMake</a>
</li>
<li>Added to PATH, C:\Program Files\CMake\bin</li>
<li>Installed git, which includes mingw64 which also delivers curl: <a href="https://git-scm.com/download/win" class="inline-onebox" rel="noopener nofollow ugc">Git - Downloading Package</a>
</li>
<li>Add to PATH environmental variable: C:\Program Files\Git\cmd</li>
<li>Add to PATH environmental variable: C:\Program Files\Git\mingw64\bin for curl</li>
<li>Created a conda environment : conda create –name sg –clone base</li>
<li>Activated the new environment</li>
<li>Installed these packages : conda install astunparse numpy ninja pyyaml mkl mkl-include setuptools cmake cffi typing_extensions future six requests dataclasses</li>
<li>Then installed, conda install -c conda-forge libuv</li>
<li>Downloaded Visual Studio Build Tools from : <a href="https://my.visualstudio.com/Downloads?q=visual%20studio%202019&amp;wt.mc_id=o~msft~vscom~older-downloads" class="inline-onebox" rel="noopener nofollow ugc">Azure DevOps Services | Sign In</a> --version 16.9.22</li>
<li>Installed Visual Studio 2019 Community from Visual Studio Installer</li>
<li>NVIDIA driver installed version 516.4</li>
<li>Downloaded Cuda toolkit from <a href="https://developer.nvidia.com/cuda-toolkit-archive" class="inline-onebox" rel="noopener nofollow ugc">CUDA Toolkit Archive | NVIDIA Developer</a>
</li>
<li>Downloded Download cuDNN v8.2.1 (June 7th, 2021), for CUDA 11.x from <a href="https://developer.nvidia.com/rdp/cudnn-archive" class="inline-onebox" rel="noopener nofollow ugc">cuDNN Archive | NVIDIA Developer</a>
</li>
<li>Transferred from cudnn-11.3 to cuda located in Program Files …CUDA , for the bin, include and lib/x64, to bin include and lib/x64</li>
<li>set PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin;%PATH%</li>
<li>set PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\extras\CUPTI\lib64;%PATH%</li>
<li>set PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\include;%PATH%</li>
<li>To make sure that CUDA is accessing the GPU device, found the files deviceQuery and bandWidthTest from the folder C:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.3\1_Utilities “build” and then “start without debugging”, got “RESULT=PASS” for both</li>
<li>Installed 7-Zip File Manager</li>
<li>Clicked this link to download magma :   <a href="https://s3.amazonaws.com/ossci-windows/magma_2.5.4_cuda113_release.7z" rel="noopener nofollow ugc">https://s3.amazonaws.com/ossci-windows/magma_2.5.4_cuda113_release.7z</a>
</li>
<li>Clicked this link to download mkl : <a href="https://s3.amazonaws.com/ossci-windows/mkl_2020.2.254.7z" rel="noopener nofollow ugc">https://s3.amazonaws.com/ossci-windows/mkl_2020.2.254.7z</a>
</li>
<li>Created a folder in Document called Pytorch_Requirements, and create folders magma and mkl and using 7-zip unzip the contents in the respective folders.</li>
<li>In anaconda cmd from env, “set MAGMA_HOME=C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\magma”</li>
<li>In anaconda cmd from env, “set CMAKE_INCLUDE_PATH=C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\magma\include”</li>
<li>In anaconda cmd from env, “set LIB=C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\magma\lib;%LIB%”</li>
<li>Opened PowerShell from Start, then, to download scoop</li>
<li>Opened the new conda environment, and install git by, “conda install -c anaconda git”</li>
<li>Then, “scoop install sccache”</li>
<li>In anaconda cmd fromenv, “set SCCACHE_IDLE_TIMEOUT=0”</li>
<li>GeForce RTX 3060 has compute capability = 8.6</li>
<li>In anaconda cmd from env, “set TORCH_CUDA_ARCH_LIST=8.6”</li>
</ol>
<hr>
<ol start="34">
<li>set USE_NINJA=OFF</li>
<li>set CMAKE_GENERATOR=Visual Studio 16 2019</li>
<li>set CMAKE_GENERATOR_TOOLSET_VERSION=16.9.22</li>
<li>set USE_MKLDNN=ON</li>
<li>set CUDAHOSTCXX= C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe</li>
</ol>
<hr>
<ol start="39">
<li>In the new conda environment, went to folder where I wanted Pytorch to be cloned, then cloned the pytorch github repo with :<br>
“git clone --recursive <a href="https://github.com/pytorch/pytorch%E2%80%9D" rel="noopener nofollow ugc">https://github.com/pytorch/pytorch”</a>
</li>
<li>cd pytorch</li>
<li>git checkout v1.11.0</li>
<li>git submodule sync</li>
<li>git submodule update --init --recursive --jobs 0</li>
<li>sccache --stop-server</li>
<li>sccache --start-server</li>
<li>python setup.py install --cmake</li>
</ol>
<p><strong>&gt;&gt;&gt;Getting this error:</strong><br>
CMake Error at C:/Users/Kasirat/anaconda3/envs/softgroup/Library/share/cmake-3.19/Modules/CMakeDetermineCUDACompiler.cmake:46 (message):<br>
Could not find compiler set in environment variable CUDAHOSTCXX:</p>
<p>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe.</p>
<p>Call Stack (most recent call first):<br>
cmake/public/cuda.cmake:41 (enable_language)<br>
cmake/Dependencies.cmake:43 (include)<br>
CMakeLists.txt:669 (include)</p>
<p>– Configuring incomplete, errors occurred!<br>
See also “C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeOutput.log”.<br>
See also “C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeError.log”.</p>
<p>Where am I going wrong?</p>

username: ptrblck
cooked: <p>I would recommend to check the <code>CMakeOutput.log</code> and <code>CMakeError.log</code> to see why <code>cmake</code> is failing.</p>

username: Kasirat_Kasfi
cooked: <p>Hi <a class="mention" href="/u/ptrblck">@ptrblck</a> thankyou for responding. last night I left it of this way, and this morning I can’t seem to get the same error message. It stops at “When you specify <code>CMAKE_GENERATOR_TOOLSET_VERSION</code>, you must also activate the vs environment of this version.” and no build error log files are produced (CMakeOutput.log and CMakeError.log). I need to start the entire process again.</p>

username: Kasirat_Kasfi
cooked: <p><strong>This is the output from the CMakeOutput,log</strong></p>
<p>The system is: Windows - 10.0.22000 - AMD64<br>
Compiling the CXX compiler identification source file “CMakeCXXCompilerId.cpp” succeeded.<br>
Compiler:<br>
Build flags:<br>
Id flags:</p>
<p>The output was:<br>
0</p>
<p><strong>And this is the output from the CMakeError.log</strong><br>
Performing C++ SOURCE FILE Test CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING failed with the following output:<br>
Change Dir: C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeTmp</p>
<p>Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Current/Bin/MSBuild.exe cmTC_8973d.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=16.0 /v:m &amp;&amp; Microsoft (R)<br>
Build Engine version 16.9.2+58c36d143 for .NET Framework<br>
Copyright (C) Microsoft Corporation. All rights reserved.</p>
<p>Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29924 for x64<br>
Copyright (C) Microsoft Corporation.  All rights reserved.<br>
src.cxx<br>
cl /c /Z7 /W1 /WX- /diagnostics:column /MP /Od /Ob0 /D WIN32 /D _WINDOWS /D CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING /D “CMAKE_INTDIR="Debug"” /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline<br>
/GR /std:c++14 /Fo"cmTC_8973d.dir\Debug\" /Fd"cmTC_8973d.dir\Debug\vc142.pdb" /Gd /TP /errorReport:queue  /w /bigobj -std=c++14 /w /bigobj “C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles<br>
CMakeTmp\src.cxx”<br>
cl : command line warning D9025: overriding ‘/W1’ with ‘/w’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_8973d.vcxproj]<br>
cl : command line warning D9002: ignoring unknown option ‘-std=c++14’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_8973d.vcxproj]<br>
C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\src.cxx(1,10): fatal error C1083: Cannot open include file: ‘glog/stl_logging.h’: No such file or directory<br>
[C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_8973d.vcxproj]</p>
<p>Source file was:<br>
<span class="hashtag">#include</span> &lt;glog/stl_logging.h&gt;<br>
int main(int argc, char** argv) {<br>
return 0;<br>
}<br>
Performing C++ SOURCE FILE Test COMPILER_SUPPORTS_HIDDEN_VISIBILITY failed with the following output:<br>
Change Dir: C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeTmp</p>
<p>Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Current/Bin/MSBuild.exe cmTC_ddffd.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=16.0 /v:m &amp;&amp; Microsoft (R) Build<br>
Engine version 16.9.2+58c36d143 for .NET Framework<br>
Copyright (C) Microsoft Corporation. All rights reserved.</p>
<p>Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29924 for x64<br>
Copyright (C) Microsoft Corporation.  All rights reserved.<br>
src.cxx<br>
cl /c /Z7 /W1 /WX- /diagnostics:column /MP /Od /Ob0 /D WIN32 /D _WINDOWS /D COMPILER_SUPPORTS_HIDDEN_VISIBILITY /D “CMAKE_INTDIR="Debug"” /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR<br>
/std:c++14 /Fo"cmTC_ddffd.dir\Debug\" /Fd"cmTC_ddffd.dir\Debug\vc142.pdb" /Gd /TP /errorReport:queue  /w /bigobj /w /bigobj -fvisibility=hidden “C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build<br>
CMakeFiles\CMakeTmp\src.cxx”<br>
cl : command line warning D9025: overriding ‘/W1’ with ‘/w’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_ddffd.vcxproj]<br>
cl : command line warning D9002: ignoring unknown option ‘-fvisibility=hidden’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_ddffd.vcxproj]<br>
cmTC_ddffd.vcxproj → C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\Debug\cmTC_ddffd.exe</p>
<p>Source file was:<br>
int main() { return 0; }<br>
Performing C++ SOURCE FILE Test COMPILER_SUPPORTS_HIDDEN_INLINE_VISIBILITY failed with the following output:<br>
Change Dir: C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeTmp</p>
<p>Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Current/Bin/MSBuild.exe cmTC_9f73f.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=16.0 /v:m &amp;&amp; Microsoft (R) Build<br>
Engine version 16.9.2+58c36d143 for .NET Framework<br>
Copyright (C) Microsoft Corporation. All rights reserved.</p>
<p>Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29924 for x64<br>
Copyright (C) Microsoft Corporation.  All rights reserved.<br>
src.cxx<br>
cl /c /Z7 /W1 /WX- /diagnostics:column /MP /Od /Ob0 /D WIN32 /D _WINDOWS /D COMPILER_SUPPORTS_HIDDEN_INLINE_VISIBILITY /D “CMAKE_INTDIR="Debug"” /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline<br>
/GR /std:c++14 /Fo"cmTC_9f73f.dir\Debug\" /Fd"cmTC_9f73f.dir\Debug\vc142.pdb" /Gd /TP /errorReport:queue  /w /bigobj /w /bigobj -fvisibility-inlines-hidden “C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch<br>
build\CMakeFiles\CMakeTmp\src.cxx”<br>
cl : command line warning D9025: overriding ‘/W1’ with ‘/w’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_9f73f.vcxproj]<br>
cl : command line warning D9002: ignoring unknown option ‘-fvisibility-inlines-hidden’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_9f73f.vcxproj]<br>
cmTC_9f73f.vcxproj → C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\Debug\cmTC_9f73f.exe</p>
<p>Source file was:<br>
int main() { return 0; }<br>
Performing C++ SOURCE FILE Test CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING failed with the following output:<br>
Change Dir: C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeTmp</p>
<p>Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Current/Bin/MSBuild.exe cmTC_8dca0.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=16.0 /v:m &amp;&amp; Microsoft (R) Build Engine version 16.9.2+58c36d143 for .NET Framework<br>
Copyright (C) Microsoft Corporation. All rights reserved.</p>
<p>Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29924 for x64<br>
Copyright (C) Microsoft Corporation.  All rights reserved.<br>
src.cxx<br>
cl /c /Z7 /W1 /WX- /diagnostics:column /MP /Od /Ob0 /D WIN32 /D _WINDOWS /D CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING /D “CMAKE_INTDIR="Debug"” /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /std:c++14 /Fo"cmTC_8dca0.dir\Debug\" /Fd"cmTC_8dca0.dir\Debug\vc142.pdb" /Gd /TP /errorReport:queue  /w /bigobj -std=c++14 /w /bigobj “C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\src.cxx”<br>
cl : command line warning D9025: overriding ‘/W1’ with ‘/w’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_8dca0.vcxproj]<br>
cl : command line warning D9002: ignoring unknown option ‘-std=c++14’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_8dca0.vcxproj]<br>
C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\src.cxx(1,10): fatal error C1083: Cannot open include file: ‘glog/stl_logging.h’: No such file or directory [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_8dca0.vcxproj]</p>
<p>Source file was:<br>
<span class="hashtag">#include</span> &lt;glog/stl_logging.h&gt;<br>
int main(int argc, char** argv) {<br>
return 0;<br>
}<br>
Performing C++ SOURCE FILE Test COMPILER_SUPPORTS_HIDDEN_VISIBILITY failed with the following output:<br>
Change Dir: C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeTmp</p>
<p>Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Current/Bin/MSBuild.exe cmTC_2533c.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=16.0 /v:m &amp;&amp; Microsoft (R) Build Engine version 16.9.2+58c36d143 for .NET Framework<br>
Copyright (C) Microsoft Corporation. All rights reserved.</p>
<p>Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29924 for x64<br>
Copyright (C) Microsoft Corporation.  All rights reserved.<br>
src.cxx<br>
cl /c /Z7 /W1 /WX- /diagnostics:column /MP /Od /Ob0 /D WIN32 /D _WINDOWS /D COMPILER_SUPPORTS_HIDDEN_VISIBILITY /D “CMAKE_INTDIR="Debug"” /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /std:c++14 /Fo"cmTC_2533c.dir\Debug\" /Fd"cmTC_2533c.dir\Debug\vc142.pdb" /Gd /TP /errorReport:queue  /w /bigobj /w /bigobj -fvisibility=hidden “C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\src.cxx”<br>
cl : command line warning D9025: overriding ‘/W1’ with ‘/w’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_2533c.vcxproj]<br>
cl : command line warning D9002: ignoring unknown option ‘-fvisibility=hidden’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_2533c.vcxproj]<br>
cmTC_2533c.vcxproj → C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\Debug\cmTC_2533c.exe</p>
<p>Source file was:<br>
int main() { return 0; }<br>
Performing C++ SOURCE FILE Test COMPILER_SUPPORTS_HIDDEN_INLINE_VISIBILITY failed with the following output:<br>
Change Dir: C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeTmp</p>
<p>Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Current/Bin/MSBuild.exe cmTC_f388e.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=16.0 /v:m &amp;&amp; Microsoft (R) Build Engine version 16.9.2+58c36d143 for .NET Framework<br>
Copyright (C) Microsoft Corporation. All rights reserved.</p>
<p>Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29924 for x64<br>
Copyright (C) Microsoft Corporation.  All rights reserved.<br>
src.cxx<br>
cl /c /Z7 /W1 /WX- /diagnostics:column /MP /Od /Ob0 /D WIN32 /D _WINDOWS /D COMPILER_SUPPORTS_HIDDEN_INLINE_VISIBILITY /D “CMAKE_INTDIR="Debug"” /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /std:c++14 /Fo"cmTC_f388e.dir\Debug\" /Fd"cmTC_f388e.dir\Debug\vc142.pdb" /Gd /TP /errorReport:queue  /w /bigobj /w /bigobj -fvisibility-inlines-hidden “C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\src.cxx”<br>
cl : command line warning D9025: overriding ‘/W1’ with ‘/w’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_f388e.vcxproj]<br>
cl : command line warning D9002: ignoring unknown option ‘-fvisibility-inlines-hidden’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_f388e.vcxproj]<br>
cmTC_f388e.vcxproj → C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\Debug\cmTC_f388e.exe</p>
<p>Source file was:<br>
int main() { return 0; }<br>
Performing C++ SOURCE FILE Test CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING failed with the following output:<br>
Change Dir: C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeTmp</p>
<p>Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Current/Bin/MSBuild.exe cmTC_d40c1.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=16.0 /v:m &amp;&amp; Microsoft (R) Build Engine version 16.9.2+58c36d143 for .NET Framework<br>
Copyright (C) Microsoft Corporation. All rights reserved.</p>
<p>Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29924 for x64<br>
Copyright (C) Microsoft Corporation.  All rights reserved.<br>
src.cxx<br>
cl /c /Z7 /W1 /WX- /diagnostics:column /MP /Od /Ob0 /D WIN32 /D _WINDOWS /D CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING /D “CMAKE_INTDIR="Debug"” /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /std:c++14 /Fo"cmTC_d40c1.dir\Debug\" /Fd"cmTC_d40c1.dir\Debug\vc142.pdb" /Gd /TP /errorReport:queue  /w /bigobj -std=c++14 /w /bigobj “C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\src.cxx”<br>
cl : command line warning D9025: overriding ‘/W1’ with ‘/w’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_d40c1.vcxproj]<br>
cl : command line warning D9002: ignoring unknown option ‘-std=c++14’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_d40c1.vcxproj]<br>
C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\src.cxx(1,10): fatal error C1083: Cannot open include file: ‘glog/stl_logging.h’: No such file or directory [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_d40c1.vcxproj]</p>
<p>Source file was:<br>
<span class="hashtag">#include</span> &lt;glog/stl_logging.h&gt;<br>
int main(int argc, char** argv) {<br>
return 0;<br>
}<br>
Performing C++ SOURCE FILE Test COMPILER_SUPPORTS_HIDDEN_VISIBILITY failed with the following output:<br>
Change Dir: C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeTmp</p>
<p>Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Current/Bin/MSBuild.exe cmTC_12978.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=16.0 /v:m &amp;&amp; Microsoft (R) Build Engine version 16.9.2+58c36d143 for .NET Framework<br>
Copyright (C) Microsoft Corporation. All rights reserved.</p>
<p>Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29924 for x64<br>
Copyright (C) Microsoft Corporation.  All rights reserved.<br>
src.cxx<br>
cl /c /Z7 /W1 /WX- /diagnostics:column /MP /Od /Ob0 /D WIN32 /D _WINDOWS /D COMPILER_SUPPORTS_HIDDEN_VISIBILITY /D “CMAKE_INTDIR="Debug"” /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /std:c++14 /Fo"cmTC_12978.dir\Debug\" /Fd"cmTC_12978.dir\Debug\vc142.pdb" /Gd /TP /errorReport:queue  /w /bigobj /w /bigobj -fvisibility=hidden “C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\src.cxx”<br>
cl : command line warning D9025: overriding ‘/W1’ with ‘/w’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_12978.vcxproj]<br>
cl : command line warning D9002: ignoring unknown option ‘-fvisibility=hidden’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_12978.vcxproj]<br>
cmTC_12978.vcxproj → C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\Debug\cmTC_12978.exe</p>
<p>Source file was:<br>
int main() { return 0; }<br>
Performing C++ SOURCE FILE Test COMPILER_SUPPORTS_HIDDEN_INLINE_VISIBILITY failed with the following output:<br>
Change Dir: C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeTmp</p>
<p>Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Current/Bin/MSBuild.exe cmTC_c709d.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=16.0 /v:m &amp;&amp; Microsoft (R) Build Engine version 16.9.2+58c36d143 for .NET Framework<br>
Copyright (C) Microsoft Corporation. All rights reserved.</p>
<p>Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29924 for x64<br>
Copyright (C) Microsoft Corporation.  All rights reserved.<br>
src.cxx<br>
cl /c /Z7 /W1 /WX- /diagnostics:column /MP /Od /Ob0 /D WIN32 /D _WINDOWS /D COMPILER_SUPPORTS_HIDDEN_INLINE_VISIBILITY /D “CMAKE_INTDIR="Debug"” /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /std:c++14 /Fo"cmTC_c709d.dir\Debug\" /Fd"cmTC_c709d.dir\Debug\vc142.pdb" /Gd /TP /errorReport:queue  /w /bigobj /w /bigobj -fvisibility-inlines-hidden “C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\src.cxx”<br>
cl : command line warning D9025: overriding ‘/W1’ with ‘/w’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_c709d.vcxproj]<br>
cl : command line warning D9002: ignoring unknown option ‘-fvisibility-inlines-hidden’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_c709d.vcxproj]<br>
cmTC_c709d.vcxproj → C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\Debug\cmTC_c709d.exe</p>
<p>Source file was:<br>
int main() { return 0; }</p>
<p>I had made a mistake in “set CMAKE_INCLUDE_PATH" and “set LIB", instead of leading to path to mkl I pointed to magma, which I changed, but still getting the same issue.</p>
<p>I was only able to get to the build stage if I unset CMAKE_GENERATOR_TOOLSET_VERSION, this is a tip I got from <a href="https://github.com/pytorch/pytorch/issues/21893" class="inline-onebox" rel="noopener nofollow ugc">cmake error build failed · Issue #21893 · pytorch/pytorch · GitHub</a></p>

username: Kasirat_Kasfi
cooked: <p>– Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)<br>
– Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND)<br>
CMake Error at third_party/ideep/mkl-dnn/third_party/oneDNN/cmake/OpenMP.cmake:118 (message):<br>
OpenMP library could not be found.  Proceeding might lead to highly<br>
sub-optimal performance.<br>
Call Stack (most recent call first):<br>
third_party/ideep/mkl-dnn/third_party/oneDNN/CMakeLists.txt:117 (include)</p>
<p>This is the error message I am getting after my umpteenth try. Can anybody please offer some solution? Thankyou.</p>

username: ptrblck
cooked: <aside class="quote no-group" data-username="Kasirat_Kasfi" data-post="4" data-topic="155027">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/kasirat_kasfi/48/50830_2.png" class="avatar"> Kasirat_Kasfi:</div>
<blockquote>
<p>fatal error C1083: Cannot open include file: ‘glog/stl_logging.h’: No such file or directory</p>
</blockquote>
</aside>
<p>Apparently <code>glog</code> was not detected so you might need to update all submodules, clean the build, and rerun it.</p>
<aside class="quote no-group" data-username="Kasirat_Kasfi" data-post="6" data-topic="155027">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/kasirat_kasfi/48/50830_2.png" class="avatar"> Kasirat_Kasfi:</div>
<blockquote>
<p>OpenMP library could not be found.</p>
</blockquote>
</aside>
<p>If you don’t want to install OpenMP, you could disable it via <code>USE_OPENMP=0</code>.</p>

username: Kasirat_Kasfi
cooked: <p>Hi <a class="mention" href="/u/ptrblck">@ptrblck</a> thankyou again, I will try with what you are suggesting.</p>

username: Sungkwang_Mun
cooked: <p>You may want to try the following at your 46 step.</p>
<pre><code class="lang-auto"> set USE_MKLDNN=OFF

 python setup.py build --cmake
 python setup.py develop
</code></pre>
<p>I’ve compiled version 1.9 using similar steps as yours.</p>

username: Kasirat_Kasfi
cooked: <p>Hi <a class="mention" href="/u/sungkwang_mun">@Sungkwang_Mun</a>, thank you for taking an interest, really appreciate it. <img src="https://discuss.pytorch.org/images/emoji/apple/smiling_face.png?v=12" title=":smiling_face:" class="emoji" alt=":smiling_face:" loading="lazy" width="20" height="20"></p>

username: Leo_Choiselat
cooked: <p>Hi <a class="mention" href="/u/kasirat_kasfi">@Kasirat_Kasfi</a>, I had a very similar issue that I overcame by putting<br>
CUDACXX=path/to/cuda/bin/nvcc.exe</p>