View Full Version : shared libraries

12-21-2006, 06:29 AM
Just downloaded and installed OPEN-MPI.
I am having some problem in linking the shared library file libmpi.so.0

# whereis libmpi
libmpi: /usr/local/lib/libmpi.la /usr/local/lib/libmpi.so
# mpicc sample2.c -L//usr/local/lib -lmpi
# mpirun -np 2 a.out
a.out : error while loading shared libraries : libmpi.so.0 :cannot open shared object file: No such file or directory

What is wrong here?

12-21-2006, 08:24 AM
Possibly libmpi.la is corrupted?

12-21-2006, 10:55 AM
try this:

cd /usr/local/lib/
ln -s libmpi.so{,.0}

jim mcnamara
12-21-2006, 03:54 PM
Be sure /usr/local/lib is in the /etc/ld.so.conf file. Perspecitve is on the right track. It looks as if your install procedure left loose ends....

It did complete with no errors?

12-25-2006, 06:11 AM
@CornedBee : I have downloaded the latest stable release.I dont think thats the case.
@Perspective : yeah, i tried that. it says the file already exists.
@ jim : yeah, it didnt give any errors. But that file doesnot contain /usr/local/lib. I added it manually. But, still i got the same when i tried running my program.
PS: Sorry for the delay

EDIT: what's even more confusing is that, the same verison is working well in SUSE 10.0. But, I get this error in CENTOS.

12-25-2006, 08:08 PM
Post the contents of the .la. It's a text file (shell script actually).