I’m getting the following error while compiling PyTorch from source:
[1818/2610] Linking CXX shared library bin\caffe2.dll
FAILED: bin/caffe2.dll lib/caffe2.lib
cmd.exe /C "cd . && "C:\Program Files (x86)\CMake\bin\cmake.exe" -E vs_link_dll --intdir=caffe2\CMakeFiles\caffe2.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100177~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100177~1.0\x64\mt.exe --manifests  -- C:\PROGRA~2\MIB055~1\2017\COMMUN~1\VC\Tools\MSVC\1411~1.255\bin\HostX64\x64\link.exe /nologo @CMakeFiles\caffe2.rsp  /out:bin\caffe2.dll /implib:lib\caffe2.lib /pdb:bin\caffe2.pdb /dll /version:0.0 /INCREMENTAL:NO   && cd ."
LINK: command "C:\PROGRA~2\MIB055~1\2017\COMMUN~1\VC\Tools\MSVC\1411~1.255\bin\HostX64\x64\link.exe /nologo @CMakeFiles\caffe2.rsp /out:bin\caffe2.dll /implib:lib\caffe2.lib /pdb:bin\caffe2.pdb /dll /version:0.0 /INCREMENTAL:NO /MANIFEST /MANIFESTFILE:bin\caffe2.dll.manifest" failed (exit code 1181) with the following output:
LINK : fatal error LNK1181: cannot open input file 'Files/pytorch/build/lib/caffe2_protos.lib'
ninja: build stopped: subcommand failed.

Full-log:
ninja_build_full-log 2
This happened when I followed this solution:
pytorch_discussion 1
Previously I have tried to install it from source using VS as mentioned in the README, but I encountered a CMake error:
CMake Error at caffe2_gpu_generated_THCTensor.cu.obj.Release.cmake:219

And now when I tried to use the same process I get the following error:
-- Build files have been written to: C:/Program Files/pytorch/build
ninja: error: unknown target '/maxcpucount:8'

Full-log:
VS_full-log
Could you please help me with this issue?
My setup:
OS: Microsoft Windows 10
CMake version: 3.14.5
Python 3.6.1 :: Anaconda custom (64-bit)
nvcc: NVIDIA ® Cuda compiler driver
Copyright © 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:04_Central_Daylight_Time_2018
Cuda compilation tools, release 10.0, V10.0.130
cuDNN version: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin\cudnn64_7.dl
My env-var PATH: 1