Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Not pointing to correct libraries
From: Gus Correa (gus_at_[hidden])
Date: 2011-04-05 12:53:03

Warnett, Jason wrote:
> Hello
> I am running on Linux, latest version of mpi built but I've run into a
> few issues with a program which I am trying to run. It is a widely used
> open source application called LIGGGHTS so I know the code works and
> should compile, so I obviously have a setting wrong with MPI. I saw a
> similar problem in a previous post (2007), but couldn't see how to
> resolve it as I am quite new to the terminal environment in Unix (always
> been windows... until now).
> So the issue I am getting is the following error...
> [Jay_at_Jay chute_wear]$ mpirun -np 1 lmp_fedora < in.chute_wear
> lmp_fedora: error while loading shared libraries:
> cannot open shared object file: No such file or directory
> So I checked where stuff was pointing using the ldd command as in that
> post and found the following:
> => (0x00d10000)
> => not found
> => not found
> => not found
> => not found
> => /lib/ (0x00cbe000)
> => /lib/ (0x007e6000)
> => /lib/ (0x009fa000)
> => /usr/lib/ (0x04a02000)
> => /lib/ (0x008a4000)
> => /lib/ (0x00110000)
> => /lib/ (0x00550000)
> => /lib/ (0x003b3000)
> /lib/ (0x00bfa000)
> so it is the open mpi files it isn't linking to. How can i sort this? I
> shouldn't need to edit code of the executable of LIGGGHTS I've compiled
> as I know other people are using the same thing so I guess it is to do
> with the way I installed openMPI. I did a system search and couldn't
> find a file called libmpi* anywhere... so my guess is that I've
> incorrectly installed. I have tried several ways, but could you tell me
> how to fix it/ install correctly? (embaressing if it is to do with a
> correct install...)
> Thanks
> Jay

Hi Jay

You must set the LD_LIBRARY_PATH (in your .bashrc/.cshrc file)
to include the OpenMPI 'lib' directory. Something like

(for csh)
setenv LD_LIBRARY_PATH /path/to/openmpi/lib:$LD_LIBRARY_PATH

(for bash)
export LD_LIBRARY_PATH=/path/to/openmpi/lib:$LD_LIBRARY_PATH

Likewise, PATH should include the OpenMPI 'bin' directory.
See the OpenMPI FAQ for details:

Also, before trying more complex codes, I suggest that you test
your OpenMPI functionality with the simple example programs
that come in the OpenMPI 'examples' directory: hello_c.c, ring_c.c,
and connectivity_c.c.
It will save you many headaches.
mpicc -o hello_c hello_c.c
mpirun -np 4 hello_c

How did you compile LIGGGHTS?
Did you use the OpenMPI compiler wrappers?

You say 'latest version of mpi built'.
Did you build OpenMPI from source?
Got it via yum perhaps?
Did you use the mpi compiler wrappers (mpicc,mpif90,etc)
*from OpenMPI* to build the application (LIGGGHTS)?

Is this a single machine or a cluster?

Are you sure LIGGGHTS runs in parallel mode with a single process?
You said 'mpirun -np 1 lmp_fedora < in.chute_wear'.
Wouldn't it need at least two processes, perhaps?
'mpirun -np 2 lmp_fedora < in.chute_wear'

I hope this helps,
Gus Correa