CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   [Solved] Compiling OF with clang (

BlueyTheDog June 24, 2012 12:45

[Solved] Compiling OF with clang
Hi all,
I have both OpenFOAM and clang on my linux box so I decided to see if I could compile OF. Lo & behold, there is an option in the build config file for clang, so I set it and kicked off the compile. Has anyone managed to get the build process to fully compile OF? I get the build failing after about an hour, in solidEquilibriumDisplacementFoam, and also get lots and lots of warnings, along the lines of:


/home/agl/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/GeometricBoundaryField.C:553:34: warning: equality comparison result unused
        this->operator[](patchI) == t;
/home/agl/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/GeometricField.C:1180:21: note: in instantiation of member function
      'Foam::GeometricField<Foam::Vector<double>, fvPatchField, Foam::volMesh>::GeometricBoundaryField::operator==' requested here
    boundaryField() == dt.value();
./kineticEnergyLimiter.H:17:15: note: in instantiation of member function 'Foam::GeometricField<Foam::Vector<double>, fvPatchField,
      Foam::volMesh>::operator==' requested here
        Dcorr == dimensionedVector("0", Dcorr.dimensions(), vector::zero);
/home/agl/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/GeometricBoundaryField.C:553:34: note: use '=' to turn this equality comparison into an
        this->operator[](patchI) == t;

On my first reading of this, this is an incorrect usage of ==, but, in my experience of the coding style/techniques of OF, there are a lot of different techniques used, so I'm going to have to do some reading to understand the above as to whether it's a bug/feature/technique. Anyone care to make a guess as to it's status? Has someone been too heavy on the ='s button or do I have some new stuff to learn?

Any thoughts greatly appreciated,

wyldckat June 24, 2012 14:32

Greetings Andrew,

This was asked/reported some time ago:

Best regards,

BlueyTheDog June 24, 2012 14:52

Thanks for that, didn't even think to look in the bugs db. Had a search in the forum and nothing came up hence the post.

I do agree with the comment in the bug about the error reporting in clang - it is spectacular in comparison to gcc/VC/etc. Even if clang is slower, and I have a feeling by the end of the year it will be as fast as gcc, it's worth keeping for the error reporting alone. My unscientific view at the moment is that it also compiles code much quicker than gcc.


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