Runtime error when testing out torchvision C++ frontend

So I was following to test out the C++ frontend for torchvision. Compilation was successful with cmake.

But when I run ./hello-world I got a error while loading shared libraries: cannot open shared object file: No such file or directory, and I checked I do have under path/to/libtorch/lib. I’m on ubuntu 20.04 with torch 1.6, cuda 10.2 and gcc 9.3.

What would be a likely cause for this error?

solved by export LD_LIBRARY_PATH=absolute/path/to/libtorch/lib