tch-rs
tch-rs copied to clipboard
clion and pycharm debuggers can't find libtorch_cpu.so
I would like to be able to debug a crate using tch-rs in pycharm or clion, but I'm hitting:
"error while loading shared libraries: libtorch_cpu.so"
More details at: https://youtrack.jetbrains.com/issue/CPP-26265
I'm not sure if this is purely an IDE issue, or if tch-rs's doing something ~really non-standard in its build, but as the crate author you might have some insight.
The build binary ~does run fine with "cargo run".
Thanks!
Sorry I wouldn't really know on this as I'm not using clion, the libraries are found via some rpath set up, maybe just setting your LD_LIBRARY_PATH (if on linux) to include the directory that contains libtorch_cpu.so would help.
I ran into the same issue with CLion, but was able to fix it by adding LIBTORCH and LD_LIBRARY_PATH as environment variables in my run/debug configurations. See the following image.

Closing this as it has been a while, feel free to re-open if there are still some issues.