Pre-compile MPICH in PGI 10.1 can't find


I upgrade PGI from 8.0 to latest version(10.1) on CentOS 5.4 64bit.
8.0 works fine include Pre-compile MPICH on this machine.
10.1 also works fine except pre-compile MPICH.
I copy examples in /opt/pgi/linux86/2010/mpi/mpich and compile by makefile without any error messages.
However, when I try to mpirun, the error message shows like:

/home/danish/examples/cpi: error while loading shared libraries: cannot open shared object file: No such file or directory is in /opt/pgi/linux86/2010/mpi/mpich/lib and I also check path in mpirun script, the path is OK.

If I try to build with static binding by -Bstatic, mpirun goes well.

Any ideas how to fix this?

Hi danishyo,

You need to set your LD_LIBRARY_PATH environment variable to include the MPICH lib directory. For remote nodes, this may mean that you need to set it your default environment (i.e. in your .cshrc or .bashrc file), or create a wrapper script which first sets the environment before calling your applications and then use mpirun to run the script.

However, if you’re building and running on the same cluster and don’t need to use shared libraries, it would be easier to just compile statically and not have to worry about your environment.

Hope this helps,

Just an FYI, but I recently hit this problem and it confused the heck out of me. I had LD_LIBRARY_PATH in my .tcshrc file and I even re-enabled it in the csh script that was failing.

I solved it by adding an LD_LIBRARY_PATH to .bashrc as, I believe, though I’m probably wrong, the PGI mpirun script is a /bin/sh script. Thus, when mpirun was called, it didn’t look at my .tcshrc or import the current environment.

Though, there could be an mpirun flag that passes environment?