Yesterday, I found that libtorch 1.9.0 had been released, so I downloaded and installed it on my computer. When I compiled my code, there were some
ld messages that I was confused at the moment, does anyone can tell me why or how to solve it?
Xubuntu 20.04, x86_64, gcc version 9.3.0
As far as I understand, it is an inconsistency in the shared libraries information, but it should be mostly harmless (but yeah, it’s annoying…). One thing to know here is that (as far as I know, I didn’t check recently), the PyTorch distributables are built with a rather old toolchain (gcc, libc etc.) because the condition for them working are “the run-time environment must be at least as new as build-time environment”. Maybe that old toolchain produces these inconsistent bits of information.
If you are very determined, you could try building PyTorch yourself and see if the warning disappears.
Thank you very much for your experience and advice. Since that time, I have been using libtorch 1.9.0. And after searching some information on internet, I have found that if I add
CMakeLists.txt, the warning message disappeared. So in my opinion , I guess the libtorch 1.9.0 was build with
ld.gold linker for large project or application. Maybe I am wrong about that, but compiling code successfully without warning message makes me happy.