Skip to content

Multiple paths pointing to the same main folder can lead to compilation problems

Essentially the following is a brief summary of this bug report: http://bugs.openfoam.org/view.php?id=2204

  1. Have two similar paths, but one of them is a symbolic link:

    /home/ofuser/OpenFOAM/OpenFOAM-4.x (symbolic link to OpenFOAM-dev)
    /home/ofuser/OpenFOAM/OpenFOAM-dev
  2. Source the environment for the OpenFOAM-4.x path.

  3. Then run the build commands from within the OpenFOAM-4.x path.

  4. Result: messy builds, where the first hit was in the folder src/Pstream, when building mpi.

The solution should be to use pwd -P in both Allwmake and wmake scripts, to enforce the correct paths to be used, after sorting through the symbolic link map.

The only problem with this solution that I can remember at the moment is mostly related to user confusion when inspecting the build output... nonetheless, I expect that there are some other weird corner cases, such as having the symbolic links switched around and the source paths enforced on the symbolic paths, resulting in a larger build stack confusion.


Tagging @mark, since he asked for it to be cross-referenced here as well ;)

## Reattaching the author to the issue ticket: @wyldckat ##

Edited by Kutalmış Berçin