Repository: pytorch
Issue: I have just wasted 3 solid days trying to build PyTorch, without success
Labels: module: build,triaged

## ❓ Questions and Help

### Please note that this issue tracker is not a help form and this issue will be closed.

We have a set of [listed resources available on the website](https://pytorch.org/resources). Our primary means of support is our discussion forum:

The build process is a mess. Just looking at CMakeList.txt, basically spaghetti of flags will tell you how bad it is. Over the 3 days CMake and the build process have complained about avx512 instruction set (I have Ivy Bridge, why is it too stupid to figure it out?), openMP. It also failed at different parts of Caffe2, XNNPACK, etc...

Unlike Tensorflow, which actually has a table of versions of packages that are known t work, PyTorch only gives a few lines of instructions which simply don't work. 

s]
  pthreadpool_function_4d_tiled_t function,
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mnt/tmp/ccmNrtzI.s: Assembler messages:
/mnt/tmp/ccmNrtzI.s:49: Error: operand size mismatch for `vmovdqa64'
/mnt/tmp/ccmNrtzI.s:53: Error: no such instruction: `kmovd %ecx,%k3'
/mnt/tmp/ccmNrtzI.s:56: Error: invalid register operand for `vmovaps'
/mnt/tmp/ccmNrtzI.s:57: Error: no such instruction: `kmovd %ecx,%k2'
/mnt/tmp/ccmNrtzI.s:118: Error: operand type mismatch for `vpmovsxbw'
/mnt/tmp/ccmNrtzI.s:124: Error: operand type mismatch for `vpmaddwd'
/mnt/tmp/ccmNrtzI.s:130: Error: operand type mismatch for `vpmaddwd'
/mnt/tmp/ccmNrtzI.s:134: Error: operand type mismatch for `vpmaddwd'
/mnt/tmp/ccmNrtzI.s:135: Error: operand type mismatch for `vpmaddwd'
/mnt/tmp/ccmNrtzI.s:137: Error: operand type mismatch for `vpmovsxbw'
/mnt/tmp/ccmNrtzI.s:139: Error: operand type mismatch for `vpmaddwd'
/mnt/tmp/ccmNrtzI.s:141: Error: operand type mismatch for `vpmaddwd'
/mnt/tmp/ccmNrtzI.s:143: Error: operand type mismatch for `vpmaddwd'
/mnt/tmp/ccmNrtzI.s:144: Error: operand type mismatch for `vpmaddwd'
/mnt/tmp/ccmNrtzI.s:147: Error: operand type mismatch for `vpmovsxbw'
/mnt/tmp/ccmNrtzI.s:148: Error: operand type mismatch for `vpmaddwd'
/mnt/tmp/ccmNrtzI.s:150: Error: operand type mismatch for `vpmaddwd'
/mnt/tmp/ccmNrtzI.s:152: Error: operand type mismatch for `vpmaddwd'
/mnt/tmp/ccmNrtzI.s:153: Error: operand type mismatch for `vpmaddwd'
/mnt/tmp/ccmNrtzI.s:156: Error: operand type mismatch for `vpmovsxbw'
/mnt/tmp/ccmNrtzI.s:157: Error: operand type mismatch for `vpmaddwd'
/mnt/tmp/ccmNrtzI.s:158: Error: operand type mismatch for `vpmaddwd'
/mnt/tmp/ccmNrtzI.s:159: Error: operand type mismatch for `vpmaddwd'
/mnt/tmp/ccmNrtzI.s:160: Error: operand type mismatch for `vpmaddwd'
/mnt/tmp/ccmNrtzI.s:208: Error: operand size mismatch for `vmovdqa64'
/mnt/tmp/ccmNrtzI.s:259: Error: operand type mismatch for `vpackssdw'
/mnt/tmp/ccmNrtzI.s:260: Error: operand type mismatch for `vpaddsw'
/mnt/tmp/ccmNrtzI.s:264: Error: operand type mismatch for `vpmaxsw'
/mnt/tmp/ccmNrtzI.s:267: Error: operand type mismatch for `vpminsw'
/mnt/tmp/ccmNrtzI.s:269: Error: operand type mismatch for `vpackssdw'
/mnt/tmp/ccmNrtzI.s:270: Error: operand type mismatch for `vpaddsw'
/mnt/tmp/ccmNrtzI.s:271: Error: operand type mismatch for `vpmaxsw'
/mnt/tmp/ccmNrtzI.s:272: Error: operand type mismatch for `vpminsw'
/mnt/tmp/ccmNrtzI.s:273: Error: operand type mismatch for `vpacksswb'
/mnt/tmp/ccmNrtzI.s:275: Error: operand type mismatch for `vpshufb'
/mnt/tmp/ccmNrtzI.s:319: Error: no such instruction: `kmovq %rax,%k1'
/mnt/tmp/ccmNrtzI.s:321: Error: no such instruction: `kshiftrq $16,%k1,%k2'
/mnt/tmp/ccmNrtzI.s:322: Error: no such instruction: `vmovdqu8 %zmm0,-48(%rax){%k1}'
/mnt/tmp/ccmNrtzI.s:324: Error: no such instruction: `vmovdqu8 %zmm0,-32(%rax){%k2}'
/mnt/tmp/ccmNrtzI.s:325: Error: no such instruction: `kshiftrq $32,%k1,%k2'
/mnt/tmp/ccmNrtzI.s:326: Error: no such instruction: `kshiftrq $48,%k1,%k1'
/mnt/tmp/ccmNrtzI.s:327: Error: no such instruction: `vmovdqu8 %zmm0,-16(%r10){%k2}'
/mnt/tmp/ccmNrtzI.s:328: Error: no such instruction: `vmovdqu8 %zmm0,0(%r13){%k1}'
[1104/4283] Building CXX object caffe2/CMakeFiles/vec256_test_all_types_AVX2.dir/__/aten/src/ATen/test/vec256_test_all_types.cpp.o
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "setup.py", line 818, in <module>
    build_deps()
  File "setup.py", line 315, in build_deps
    build_caffe2(version=version,
  File "/home/developer/pytorch/tools/build_pytorch_libs.py", line 58, in build_caffe2
    cmake.build(my_env)
  File "/home/developer/pytorch/tools/setup_helpers/cmake.py", line 345, in build
    self.run(build_args, my_env)
  File "/home/developer/pytorch/tools/setup_helpers/cmake.py", line 140, in run
    check_call(command, cwd=self.build_dir, env=env)
  File "/home/developer/anaconda3/envs/pytorch/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'install', '--config', 'Release', '--', '-j', '32']' returned non-zero exit status 1.

- [Discussion Forum](https://discuss.pytorch.org/)


cc @malfet @seemethere @walterddr