Hello, I’m trying to compile Pytorch into C++14. I’m following the guideline on https://pytorch.org/tutorials/advanced/cpp_export.html to build a minimal c++ application. I’m using Pytorch 1.7.0. (cuda 10.2, cxx11ABI) from https://pytorch.org/.
When the compilation (with cmake) is almost done, the following error messages pop up:
Blockquote
Scanning dependencies of target tmp
[ 50%] Building CXX object CMakeFiles/tmp.dir/tmp.cpp.o
[100%] Linking CXX executable tmp
/project/dilkina_438/taoanhua/LNS/libtorch/lib/libtorch_cpu.so: undefined reference tolgammaf@GLIBC_2.23' /project/dilkina_438/taoanhua/LNS/libtorch/lib/libtorch_cpu.so: undefined reference to
lgamma@GLIBC_2.23’
collect2: error: ld returned 1 exit status
make[2]: *** [tmp] Error 1
make[1]: *** [CMakeFiles/tmp.dir/all] Error 2
make: *** [all] Error 2
I’m wondering if anyone has seen this before and know how to resolve it. Thanks!