Undefined reference to system libraries when compiling OpenFOAM

Problem

When the system Open MPI library is used and the operating system is upgraded, there will be no change in the environmental variables and the wmake build system may instruct the dynamic linker to link against an old now non-existent library binary file .

The error could look like:

...
error while loading shared libraries: libgfortran.so.4: cannot open shared object file
...
undefined reference to 'MPI_Foo'

Solution

Re-build the Pstream library after system gcc and openmpi libraries have been upgraded

Steps

?> cd $FOAM_SRC
?> cd Pstream
?> ./Allwclean
?> ./Allwmake

See also