Error during compilation on Linux

Hello,

I am trying to build PyTorch from source because I need to install it with ROCm 4.5 on my system. I already installed ROCm successfully, and I successfully used PyTorch on the latest ROCm docker image. I am now trying to install it to my computer (without docker).

However I am unable to compile the source code, I have build errors. I tried different versions of PyTorch, the main branch, and release 1.10.1.

I downloaded the source code from Release PyTorch 1.10.1 Release, small bug fix release · pytorch/pytorch · GitHub
Steps to reproduce:

cd ~/Download/pytorch-v1.10.1
python3 tools/amd_build/build_amd.py
PYTORCH_ROCM_ARCH="gfx900" python3 setup.py install

Here is the full output: -- The CXX compiler identification is Clang 13.0.0-- The C compiler identifica - Pastebin.com
I tried compiling using both gcc 11.2 and clang 13.0, resulting in the same error.
My system is a fresh install Pop!_OS 21.10 with ROCm 4.5.0 installed.

Many thanks if anyone can point out what I’m doing wrong.