I am building pytorch from source and got a error below.
../../lib/libc10.so: error: undefined reference to 'std::thread::_State::~_State()', version 'GLIBCXX_3.4.22'
../../lib/libc10.so: error: undefined reference to 'typeinfo for std::thread::_State', version 'GLIBCXX_3.4.22'
../../lib/libc10.so: error: undefined reference to 'std::runtime_error::runtime_error(char const*)', version 'GLIBCXX_3.4.21'
../../lib/libc10.so: error: undefined reference to 'std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())', version 'GLIBCXX_3.4.22'
../../lib/libgtest.a(gtest-all.cc.o):gtest-all.cc:function testing::internal::GoogleTestFailureException::GoogleTestFailureException(testing::TestPartResult const&): error: undefined reference to 'std::runtime_error::runtime_error(char const*)'

To see a full build log, you can refer to: https://gist.github.com/YingleiZhang/fc98c94d493ac39506daacefa0298b38#file-build-with-gcc-7-5-L2-L86 3.
Any help is appreciated.