tch-rs: Linking error tch 0.1.1 & Centos 7

When I try to run a binary using tch = 0.1.1 on centos 7, I get a linking error: /usr/bin/ld: warning: libgomp-8bba0e50.so.1, needed by /home/maxence/zezima/market-analytics/target/release/build/torch-sys-c846cc9c89b11e6f/out/libtorch/libtorch/lib/libc10.so, not found (try using -rpath or -rpath-link). Note that I’m not installing libtorch manually.

When I look at the content of the OUT_DIR of the build script, I can see libgomp-8bba0e50.so.1. So the lib is not missing, just not linked.

See the full error output https://gist.github.com/jean-airoldie/c908704722181f2d0dfc27bf64bcf668.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (14 by maintainers)

Commits related to this issue

Most upvoted comments

I wonder if it could be some gcc C++11 ABI incompatibility rather than the issue described earlier in this thread. To check this, maybe you could download the pre-cxx11 abi version of libtorch here. Once you’ve extracted the content of the zip file, adjust your environment variables via:

export LIBTORCH=/path/to/libtorch
export LD_LIBRARY_PATH=${LIBTORCH}/lib:$LD_LIBRARY_PATH
export LIBTORCH_CXX11_ABI=0

And try a cargo clean then to recompile.