Open MPI logo

PLPA Users' Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all PLPA Users mailing list

From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2006-03-05 09:23:07


On Mar 4, 2006, at 9:04 PM, Ming Kin Lai wrote:

> I think I must have missed something.
> I compiled successfully the plpa-test.c program as in README.
> mingl% pwd
> /home/mingl/PLPA
>
> mingl% ls
> bin/ include/ lib/ plpa-1.0.3/ plpa-test.c
>
> mingl% ls lib
> libplpa.la* libplpa.so@ libplpa.so.0@ libplpa.so.0.0.0*
>
> mingl% file lib/libplpa.so.0
> lib/libplpa.so.0: symbolic link to `libplpa.so.0.0.0'
>
> mingl% file lib/libplpa.so.0.0.0
> lib/libplpa.so.0.0.0: ELF 32-bit LSB shared object, Intel 80386,
> version 1
> (SYSV), not stripped
>
> mingl% gcc plpa-test.c -I/home/mingl/PLPA/include -L/home/mingl/
> PLPA/lib
> -lplpa -o plpa-test

Right -- this shows that you successfully compiled and linked it.

Sidenote: you might consider ./configuring PLPA with a --prefix
option (e.g., /usr/local?) and then running "make clean all
install". This will install the PLPA header and library into the
tree that you specified via --prefix (e.g., /usr/local/include and /
usr/local/lib, respectively). It is likely that your compiler and
run-time environments already includes these directories in the
various search paths, so you might not need to specify the -I and -L
options (or LD_LIBRARY_PATH, described below).

> mingl% plpa-test
> plpa-test: error while loading shared libraries: libplpa.so.0:
> cannot open
> shared object file: No such file or directory

The problem here is that the linker was unable to find the PLPA
library because it was not in the default search path for dynamic
libraries. Remember the difference between compiling/linking and
running -- just like you had to -L to find the PLPA library for the
compiler/linker, you also have to specify where the PLPA library is
at run-time (since you have it installed in a non-default location).

You can do this in a few different ways; the easiest is to set the
LD_LIBRARY_PATH to /home/mingl/PLPA/lib (or wherever you end up
installing the library). Be careful to check and see if
LD_LIBRARY_PATH is set first -- if it's already set, then you want to
extend its value -- not blindly overwrite it.

Once you do this, you should be able to:

shell$ ./plpa-test

successfully.

Alternatively, you could build PLPA as a static library (i.e.,
libplpa.a) and therefore wouldn't need to worry about this run-time
library location issue. You can do this by specifying the "--disable-
shared --enable-static" flags to ./configure (potentially in addition
to --prefix, etc.).

> By the way, there are a couple of typos in README:
> distors -> distros
> entites -> entities

Fixed -- thanks!

-- 
{+} Jeff Squyres
{+} The Open MPI Project
{+} http://www.open-mpi.org/