I spent a few hours on this but stuck now. I’m getting these errors below when running make in my project:
/home/t/libtorch/lib/libgomp-753e6e92.so.1: undefined reference to `clock_gettime@GLIBC_2.17’
/home/t/libtorch/lib/libgomp-753e6e92.so.1: undefined reference to `clock_getres@GLIBC_2.17’
/home/t/libtorch/lib/libtorch.so: undefined reference to `memcpy@GLIBC_2.14’
/home/t/libtorch/lib/libtorch.so: undefined reference to `lgammaf@GLIBC_2.23’
/home/t/libtorch/lib/libtorch.so: undefined reference to `lgamma@GLIBC_2.23’
@tiger17 Could you provide us the output of
ldd --version and
g++ --version? And did you download the old-ABI version or new-ABI version of libtorch?
Answering your questions:
ldd (Ubuntu GLIBC 2.27-3ubuntu1) 2.27
g++ (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Wondering if there are any updates on this?
@tiger17 Do you mind trying to compile libtorch from source following the instructions at https://github.com/pytorch/pytorch#from-source? Then you can link to the compiled libtorch using
cmake -DCMAKE_PREFIX_PATH=/absolute/path/to/pytorch/folder ..
try add ‘-lrt’ to CMakeLists.txt
When compiling from source following the referenced page and in the new conda env,
“python setup.py install” fails.
Part of error message:
Makefile:25: recipe for target ‘src.build’ failed
I think I tried this already.
I got the same problem (@tiger17, @yf225). What could we do with it? g++ version is 6.3.0 and ldd version is 2.24.
@tiger17 @Oktai15, I am having the same issue with libtorch nightly build only (https://download.pytorch.org/libtorch/nightly/cu101/libtorch-cxx11-abi-shared-with-deps-latest.zip). What is the solution exactly? I checked issue 27834 and it seems like the solution is to change gcc compiler?
Yes, changing compiler actually worked for me.
@tiger17 May I ask your gcc version?