Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

libmpi_cxx.so.40: cannot open shared object file

Upon running a command that requires mpi, it fails with

error while loading shared libraries: libmpi_cxx.so.40: cannot open shared object file: No such file or directory

I'm running it in a conda environment pytorch_p36. However, I checked that libmpi_cxx.so.40 is present in that same conda environment. Command

locate libmpi_cxx

Output

/home/ubuntu/anaconda3/envs/pytorch_p36/lib/libmpi_cxx.so
/home/ubuntu/anaconda3/envs/pytorch_p36/lib/libmpi_cxx.so.40
/home/ubuntu/anaconda3/envs/pytorch_p36/lib/libmpi_cxx.so.40.20.1

Is there some issue with PATH or LD_LIBRARY_PATH? If so what? How can I make sure anaconda environment libs are picked up by the 2 environment vars?

like image 712
Chaitanya Bapat Avatar asked Mar 21 '26 18:03

Chaitanya Bapat


1 Answers

On ubuntu

sudo apt install libopenmpi3

Haha, I googled the name of the file and found this:

https://packages.ubuntu.com/en/focal/amd64/libopenmpi3/filelist

After installing, seemed to work! I was using a special build of pytorch that didn't have it included.

like image 118
user3413723 Avatar answered Mar 23 '26 10:03

user3413723



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!