At some point of time, PyTorch was compiled with g++ 4.8 or somesuch (before the C++ abi switch) and g++ 5,6,7 are all after (I don’t know whether you can use a switch for compatibility).
Personally, I’d hope that one could move to a newer gcc, but even the"manylinux 2010" seems to decree gcc 4 or something like that. 
Best regards
Thomas