Execution Error


I’m a newbie with fortran so hopefully this is an easy problem to fix.
I’m compiling an MPI (MPICH) CFD code from NASA which compiles fine but has the following error when executed: “Error while loading shared libraries : libpgc.so : cannot open shared object file”.

I am attempting to run the program on a dual opteron cluster with 16 dual processor nodes running RedHat 3.5 WS. The code is compiled using pgf/pgcc and using the following switches: -mp -fastsse -tp k8-64 -byteswapio -Ktrap=fp
Also I have set “libs = -Bstatic -L/usr/pgi/linux86-64/6.0/libso -lpgc.so” in the makefile.

Anyone seen this behavior before?

Thanks in advance!

Hi tleighton,

The problem is the shared object ‘libpgc.so’ can not be found when the executable is loaded. The path the loader uses to find the shared object is either embedded in the executable (use the ‘ldd ’ command to see these paths) or from the environment variable ‘LD_LIBRARY_PATH’. With clusters, the shared object must be accessable from each node so make sure its available locally (or via NFS) on the node. If it’s in a different path, then you’ll need add this path to "LD_LIBRARY_PATH’ variable, typically in your shell rc file (i.e. .cshrc, .shrc, .bashrc, etc.).

Also, so long as your compiling on a homogenous system, you can compile statically by setting ‘libs = -Bstatic’ and removing libpgc.so from the link line.

Hope this helps,

Thanks for the help Mat!

I moved the libpgc.so file to /usr/local/libs, a place all the nodes can reach, and changed the Makefile accordingly. That did the trick and I now have a working MPI code!

Thanks again!