I have the same error and I guess that it may be caused by glibc v2.12, since I have built libtorch with glibc v2.17 successfully.
For this error:
Try adding:
#include <signal.h>

for example, in the file
pytorch/third_party/protobuf/src/google/protobuf/inlined_string_field.h

which works out for me.