Reputation: 463
I create a Conda environment (myenv), and build a Python extension (using distutils
) in this env.
My library uses some libraries which exist on both /usr/local/lib
and /home/user/miniconda3/envs/myenv/lib
.
In myenv, LD_LIBRARY_PATH
is empty, but ldd mylib.so
shows that my library links to libraries in /home/user/miniconda3/envs/myenv/lib
.
This makes sense but I wonder why it doesn't link to libraries in /usr/local/lib
?
Upvotes: 6
Views: 6424
Reputation: 463
I found that path
$ORIGIN/../lib
was set in RPATH of python in myenv.
Upvotes: 2
Reputation: 3675
Most likely, you're using the compiler and related toolchain from your conda environment. This toolchain is set up to use the libraries from your conda environment automatically.
Upvotes: 0