CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Installation (
-   -   mpicc link doesn't update when moving OF 2.2.1 installation (

GRAUPS October 17, 2013 17:43

mpicc link doesn't update when moving OF 2.2.1 installation
Hey guys, I've got a bit of a problem. I'm compiling OF 2.2.1 from the source on a cluster inside my home directory. The compilation goes without a hitch. I'm using the OpenMPI included with OF. After testing in my home directory, I decided to move it to another location so that other users can access it. These are the steps I followed to move the install...

1.) Copied OpenFOAM-2.2.1 and ThirdParty-2.2.1 folders to new location
2.) Updated the new install directory inside OpenFOAM-2.2.1/etc/bashrc
3.) Changed my .bashrc file to source the shared OpenFOAM install instead of the one I had in my home directory.

At this point I closed down the terminal and re-opened a fresh one and once again did some testing. Everything was working great until I deleted my local home directory install. At that point OpenMPI started to fail on parallel runs. After some investigation, I found that the link to mpicc was still referring to the old location. The command...


mpicc --showme:link
... yields the old location.

So my questions are...
1.) How do I fix this?
2.) Is there a way to fix this at compile time?

In previous OF installs I never had this issue. But it seems like there are multiple library files that get hard linked to the original install location in this implementation.


wyldckat October 19, 2013 07:45

Greetings Brock,

Apparently there is a glitch somewhere in Open-MPI 1.6.3 that requires to have the following two variables defined manually:

export OPAL_PREFIX=/cluster/opt/OpenFOAM/openmpi-1.6.3
export OPAL_LIBDIR=/cluster/opt/OpenFOAM/openmpi-1.6.3/lib64

The paths are just an example.

It's possible that the problem is that it's thinking about "$OPAL_PREFIX/lib" instead of "$OPAL_PREFIX/lib64", when it uses the variable "OPAL_PREFIX" defined by OpenFOAM's environment scripts.

You can simply add the following line after the environment is ready:

For more information:

Best regards,

PS: Feel free to report this to OpenFOAM's bug tracker:

All times are GMT -4. The time now is 10:54.