CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

[Solved] Compiling OF with clang

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 24, 2012, 12:45
Default [Solved] Compiling OF with clang
  #1
New Member
 
Andrew Lowe
Join Date: Mar 2010
Location: Perth, Australia
Posts: 8
Rep Power: 16
BlueyTheDog is on a distinguished road
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:

Code:
/home/agl/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/GeometricBoundaryField.C:553:34: warning: equality comparison result unused
      [-Wunused-comparison]
        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
      assignment
        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,
Andrew

Last edited by BlueyTheDog; June 24, 2012 at 14:53. Reason: It's solved
BlueyTheDog is offline   Reply With Quote

Old   June 24, 2012, 14:32
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Andrew,

This was asked/reported some time ago: http://www.openfoam.org/mantisbt/view.php?id=510

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   June 24, 2012, 14:52
Default
  #3
New Member
 
Andrew Lowe
Join Date: Mar 2010
Location: Perth, Australia
Posts: 8
Rep Power: 16
BlueyTheDog is on a distinguished road
Bruno,
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.


Andrew
BlueyTheDog is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
compiling icoStructFoam error using OF1.7 mhassani OpenFOAM Installation 7 June 11, 2012 09:22
Linux vs PC Compiling Rhyno466 Fluent UDF and Scheme Programming 10 May 11, 2012 17:01
Help with KIVA4 source code compiling geothokar Main CFD Forum 0 September 3, 2010 05:40
error msg when compiling user fortran Ollimarc CFX 0 March 13, 2008 18:16
Discussing UDF and C++ Compiling Big Stone FLUENT 9 April 12, 2004 15:07


All times are GMT -4. The time now is 00:37.