Error in Pytorch build from source on Windows

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!

GPU : GeForce RTX 3060
Driver version : 516.4
Windows 11

Steps:

  1. Installed Anaconda
  2. Installed Cmake, downloaded from Download | CMake
  3. Added to PATH, C:\Program Files\CMake\bin
  4. Installed git, which includes mingw64 which also delivers curl: Git - Downloading Package
  5. Add to PATH environmental variable: C:\Program Files\Git\cmd
  6. Add to PATH environmental variable: C:\Program Files\Git\mingw64\bin for curl
  7. Created a conda environment : conda create –name sg –clone base
  8. Activated the new environment
  9. Installed these packages : conda install astunparse numpy ninja pyyaml mkl mkl-include setuptools cmake cffi typing_extensions future six requests dataclasses
  10. Then installed, conda install -c conda-forge libuv
  11. Downloaded Visual Studio Build Tools from : Azure DevOps Services | Sign In --version 16.9.22
  12. Installed Visual Studio 2019 Community from Visual Studio Installer
  13. NVIDIA driver installed version 516.4
  14. Downloaded Cuda toolkit from CUDA Toolkit Archive | NVIDIA Developer
  15. Downloded Download cuDNN v8.2.1 (June 7th, 2021), for CUDA 11.x from cuDNN Archive | NVIDIA Developer
  16. 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
  17. set PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin;%PATH%
  18. set PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\extras\CUPTI\lib64;%PATH%
  19. set PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\include;%PATH%
  20. 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
  21. Installed 7-Zip File Manager
  22. Clicked this link to download magma : https://s3.amazonaws.com/ossci-windows/magma_2.5.4_cuda113_release.7z
  23. Clicked this link to download mkl : https://s3.amazonaws.com/ossci-windows/mkl_2020.2.254.7z
  24. 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.
  25. In anaconda cmd from env, “set MAGMA_HOME=C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\magma”
  26. In anaconda cmd from env, “set CMAKE_INCLUDE_PATH=C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\magma\include”
  27. In anaconda cmd from env, “set LIB=C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\magma\lib;%LIB%”
  28. Opened PowerShell from Start, then, to download scoop
  29. Opened the new conda environment, and install git by, “conda install -c anaconda git”
  30. Then, “scoop install sccache”
  31. In anaconda cmd fromenv, “set SCCACHE_IDLE_TIMEOUT=0”
  32. GeForce RTX 3060 has compute capability = 8.6
  33. In anaconda cmd from env, “set TORCH_CUDA_ARCH_LIST=8.6”

  1. set USE_NINJA=OFF
  2. set CMAKE_GENERATOR=Visual Studio 16 2019
  3. set CMAKE_GENERATOR_TOOLSET_VERSION=16.9.22
  4. set USE_MKLDNN=ON
  5. set CUDAHOSTCXX= C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe

  1. In the new conda environment, went to folder where I wanted Pytorch to be cloned, then cloned the pytorch github repo with :
    “git clone --recursive https://github.com/pytorch/pytorch”
  2. cd pytorch
  3. git checkout v1.11.0
  4. git submodule sync
  5. git submodule update --init --recursive --jobs 0
  6. sccache --stop-server
  7. sccache --start-server
  8. python setup.py install --cmake

>>>Getting this error:
CMake Error at C:/Users/Kasirat/anaconda3/envs/softgroup/Library/share/cmake-3.19/Modules/CMakeDetermineCUDACompiler.cmake:46 (message):
Could not find compiler set in environment variable CUDAHOSTCXX:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe.

Call Stack (most recent call first):
cmake/public/cuda.cmake:41 (enable_language)
cmake/Dependencies.cmake:43 (include)
CMakeLists.txt:669 (include)

– Configuring incomplete, errors occurred!
See also “C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeOutput.log”.
See also “C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeError.log”.

Where am I going wrong?

I would recommend to check the CMakeOutput.log and CMakeError.log to see why cmake is failing.

Hi @ptrblck 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 CMAKE_GENERATOR_TOOLSET_VERSION, 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.

This is the output from the CMakeOutput,log

The system is: Windows - 10.0.22000 - AMD64
Compiling the CXX compiler identification source file “CMakeCXXCompilerId.cpp” succeeded.
Compiler:
Build flags:
Id flags:

The output was:
0

And this is the output from the CMakeError.log
Performing C++ SOURCE FILE Test CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING failed with the following output:
Change Dir: C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeTmp

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 && Microsoft (R)
Build Engine version 16.9.2+58c36d143 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29924 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
src.cxx
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_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
CMakeTmp\src.cxx”
cl : command line warning D9025: overriding ‘/W1’ with ‘/w’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_8973d.vcxproj]
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]
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_8973d.vcxproj]

Source file was:
#include <glog/stl_logging.h>
int main(int argc, char** argv) {
return 0;
}
Performing C++ SOURCE FILE Test COMPILER_SUPPORTS_HIDDEN_VISIBILITY failed with the following output:
Change Dir: C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeTmp

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 && Microsoft (R) Build
Engine version 16.9.2+58c36d143 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29924 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
src.cxx
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_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
CMakeFiles\CMakeTmp\src.cxx”
cl : command line warning D9025: overriding ‘/W1’ with ‘/w’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_ddffd.vcxproj]
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]
cmTC_ddffd.vcxproj → C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\Debug\cmTC_ddffd.exe

Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test COMPILER_SUPPORTS_HIDDEN_INLINE_VISIBILITY failed with the following output:
Change Dir: C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeTmp

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 && Microsoft (R) Build
Engine version 16.9.2+58c36d143 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29924 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
src.cxx
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_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
build\CMakeFiles\CMakeTmp\src.cxx”
cl : command line warning D9025: overriding ‘/W1’ with ‘/w’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_9f73f.vcxproj]
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]
cmTC_9f73f.vcxproj → C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\Debug\cmTC_9f73f.exe

Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING failed with the following output:
Change Dir: C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeTmp

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 && Microsoft (R) Build Engine version 16.9.2+58c36d143 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29924 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
src.cxx
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”
cl : command line warning D9025: overriding ‘/W1’ with ‘/w’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_8dca0.vcxproj]
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]
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]

Source file was:
#include <glog/stl_logging.h>
int main(int argc, char** argv) {
return 0;
}
Performing C++ SOURCE FILE Test COMPILER_SUPPORTS_HIDDEN_VISIBILITY failed with the following output:
Change Dir: C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeTmp

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 && Microsoft (R) Build Engine version 16.9.2+58c36d143 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29924 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
src.cxx
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”
cl : command line warning D9025: overriding ‘/W1’ with ‘/w’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_2533c.vcxproj]
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]
cmTC_2533c.vcxproj → C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\Debug\cmTC_2533c.exe

Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test COMPILER_SUPPORTS_HIDDEN_INLINE_VISIBILITY failed with the following output:
Change Dir: C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeTmp

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 && Microsoft (R) Build Engine version 16.9.2+58c36d143 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29924 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
src.cxx
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”
cl : command line warning D9025: overriding ‘/W1’ with ‘/w’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_f388e.vcxproj]
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]
cmTC_f388e.vcxproj → C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\Debug\cmTC_f388e.exe

Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING failed with the following output:
Change Dir: C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeTmp

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 && Microsoft (R) Build Engine version 16.9.2+58c36d143 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29924 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
src.cxx
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”
cl : command line warning D9025: overriding ‘/W1’ with ‘/w’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_d40c1.vcxproj]
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]
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]

Source file was:
#include <glog/stl_logging.h>
int main(int argc, char** argv) {
return 0;
}
Performing C++ SOURCE FILE Test COMPILER_SUPPORTS_HIDDEN_VISIBILITY failed with the following output:
Change Dir: C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeTmp

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 && Microsoft (R) Build Engine version 16.9.2+58c36d143 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29924 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
src.cxx
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”
cl : command line warning D9025: overriding ‘/W1’ with ‘/w’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_12978.vcxproj]
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]
cmTC_12978.vcxproj → C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\Debug\cmTC_12978.exe

Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test COMPILER_SUPPORTS_HIDDEN_INLINE_VISIBILITY failed with the following output:
Change Dir: C:/Users/Kasirat/Documents/Python Scripts/Pytorch_requirements/pytorch/build/CMakeFiles/CMakeTmp

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 && Microsoft (R) Build Engine version 16.9.2+58c36d143 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29924 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
src.cxx
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”
cl : command line warning D9025: overriding ‘/W1’ with ‘/w’ [C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\cmTC_c709d.vcxproj]
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]
cmTC_c709d.vcxproj → C:\Users\Kasirat\Documents\Python Scripts\Pytorch_requirements\pytorch\build\CMakeFiles\CMakeTmp\Debug\cmTC_c709d.exe

Source file was:
int main() { return 0; }

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.

I was only able to get to the build stage if I unset CMAKE_GENERATOR_TOOLSET_VERSION, this is a tip I got from cmake error build failed · Issue #21893 · pytorch/pytorch · GitHub

– Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)
– Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND)
CMake Error at third_party/ideep/mkl-dnn/third_party/oneDNN/cmake/OpenMP.cmake:118 (message):
OpenMP library could not be found. Proceeding might lead to highly
sub-optimal performance.
Call Stack (most recent call first):
third_party/ideep/mkl-dnn/third_party/oneDNN/CMakeLists.txt:117 (include)

This is the error message I am getting after my umpteenth try. Can anybody please offer some solution? Thankyou.

Apparently glog was not detected so you might need to update all submodules, clean the build, and rerun it.

If you don’t want to install OpenMP, you could disable it via USE_OPENMP=0.

1 Like

Hi @ptrblck thankyou again, I will try with what you are suggesting.

You may want to try the following at your 46 step.

 set USE_MKLDNN=OFF

 python setup.py build --cmake
 python setup.py develop

I’ve compiled version 1.9 using similar steps as yours.

1 Like

Hi @Sungkwang_Mun, thank you for taking an interest, really appreciate it. :smiling_face: