How do you update this environment variable at runtime so that ctypes can load a library wherever? I\'ve tried the following and neither seem to work.
from c
Compile your binary with a rpath relative to the current working directory like:
gcc -shared -o yourbinary.so yoursource.c otherbinary.so \
-Wl,-rpath='.',-rpath='./another/relative/rpath' -fpic
Then, you are able to change the working directory in python at runtime with:
import os
os.chdir('/path/to/your/binaries')
Like this, the loader also finds other dynamic libraries like otherbinary.so