Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fish shell seems to be ignoring LD_LIBRARY_PATH?

Tags:

shell

ubuntu

fish

I need to set LD_LIBRARY_PATH for CUDA prior to launching darknet. Looks like this:

echo $LD_LIBRARY_PATH
/usr/local/cuda/lib64

When the application launches, it fails to load a library it should have found in that directory:

./darknet 
./darknet: error while loading shared libraries: libcudart.so.10.0:
cannot open shared object file: No such file or directory

But the library is definitely in that directory:

ldd /usr/local/cuda/lib64/libcudart.so.10.0
    linux-vdso.so.1 =>  (0x00007ffe7bf2d000)
    ...etc...

I assume I'm not correctly setting up LD_LIBRARY_PATH in fish. This is how I originally did it in fish:

set -U LD_LIBRARY_PATH /usr/local/cuda/lib64
echo $LD_LIBRARY_PATH
/usr/local/cuda/lib64

When I try the exact same thing in bash, it works fine:

bash
export LD_LIBRARY_PATH=/usr/local/cuda/lib64
./darknet 
usage: ./darknet <function>

All of this is on 64-bit Ubuntu 16.04.6 running fish 2.2.0 and bash 4.3.48.

like image 883
Stéphane Avatar asked Dec 22 '22 21:12

Stéphane


1 Answers

You’re not exporting your variable. Instead, do:

set -Ux LD_LIBRARY_PATH /usr/local/cuda/lib64
./darknet 
like image 86
Austin Ziegler Avatar answered Dec 25 '22 11:12

Austin Ziegler