As you can see the ld cannot find lmpi. The problem is mpi libraries are not in the folder where ld looks for it (/usr/lib64/gcc/x86_64-suse-linux/4.5/). I found that mpi libraries are in other folder (usr/lib64/mpi/gcc/openmpi/lib64), so I made symlink to it:

ln -s usr/lib64/mpi/gcc/openmpi/lib64 lmpi

But it doesn't work again. I don't know what the problem is, and if I have correctly made symlink.I would appreciate any kind of help.Thanks in advance.