Did you install a gcc via conda? (conda list | grep gcc) That one takes precedence over your system gcc for building pytorch.
If not, then could I see a larger chunk of the output? You could dump it into a pastebin or gist.