Utilice chrpath en ubuntu16.
instalación:
sudo apt install chrpath
Ver opciones disponibles:
wmz@ubuntu:~$ chrpath --help
Usage: chrpath [-v|-d|-c|-r <path>] <program> [<program> ...]
-v|--version Display program version number
-d|--delete Delete current rpath/runpath setting
-c|--convert Convert rpath to runpath
-r <path>|--replace <path> Replace current rpath/runpath setting
with the path given
-l|--list List the current rpath/runpath (default)
-k|--keepgoing Do not fail on first error
-h|--help Show this usage information.
Ver versión:
wmz@ubuntu:~$ chrpath -v
chrpath version 0.16
Ver la ruta de dependencia del programa compilado:
build$ chrpath -l demo
demo: RPATH=/mnt/hgfs/vmsharefolders/libtorch/lib:/home/wmz/Desktop/mypractice/pytorch-demo/../libs
Modifique la ruta de la biblioteca dependiente:
build$ chrpath -r ../../libs demo
demo: RPATH=../../libs
demo: new RPATH: ../../libs
Tenga en cuenta que la línea media es la ruta anterior y la última línea es la ruta nueva. Originalmente, estas dos líneas deberían ser diferentes, porque ya las he ejecutado antes, y las ejecutaré nuevamente aquí solo para notas.
Consejo final: en general, no utilice esta herramienta, de lo contrario no sabe cómo solucionar el problema.