CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Installation (
-   -   Compiling OF141dev with GCC430 (

matthias June 22, 2008 13:48

Hi all, I tried to compile
Hi all,

I tried to compile the newest SVN OF-1.4.1-dev version with the gcc-4.3.0. After some changes in the code, it worked well.

For all having the same problems, here are the errors, appeared during compilation and my fixes:

1. there are some error messages concerning "memset" , like "is not found" or "is not available"
-> in this case you have to add <cstdlib> to the header of the file

2. there are some error messages concerning "strcmp, strlen ..." , like "is not found" or "is not available"
-> in this case you have to add <cstring> to the header of the file

3. i got an error: Undefined reference to `yyFlexLexer::yywrap()'
So, I used the fix from "Elisabet Mas de les Valls" and I just substituted the line:
extern "C" int yywrap()
int yyFlexLexer::yywrap()

in 5 files:
1. $WM_PROJECT_DIR/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L
2. $WM_PROJECT_DIR/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam .L
3. $WM_PROJECT_DIR/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent MeshToFoam.L
4. $WM_PROJECT_DIR/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMe shToFoam.L
5. $WM_PROJECT_DIR/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L

4. furthermore:

error:»virtual const Foam::HashPtrTable<foam::sutherlandtransport<foam: :speciethermo<foam::janaftherm o<foam::perfectgas> > >, Foam::word, Foam::string::hash>& Foam::chemistryReader::specieThermo() const«
error: changes meaning of »specieThermo« from »class Foam::specieThermo<foam::janafthermo<foam::perfect gas> >«

->there are two possibilities to fix the error:

first, you can use the -fpermissive flag (but is only a temporary workaround)
second, you add a qualified namespace in the file OpenFOAM/OpenFOAM-1.4.1-dev/src/thermophysicalModels/combustion/chemistryReaders /chemistryReader/chemistryReader.H: line 120


// Public data types

typedef Foam::sutherlandTransport<foam::speciethermo<foam: :janafthermo<foam::perfectgas> > > reactionThermo;

typedef Reaction<reactionthermo> reaction;

__________________________________________________ _____

More information about the changes in gcc-4.3.0 you can find here:

I hope this info is useful for all having same or similar problems. Maybe there are better fixes as I mentioned above, but as a first workaround they are working.



olesen June 23, 2008 02:56

Matthias, You might conside

You might consider trying gcc-4.3.1 as well. There are a few useful bug-fixes in it.

matthias June 23, 2008 09:43

Hello Mark, I upgraded my s
Hello Mark,

I upgraded my system from Fedora 7 to Fedora 9. At the moment there is only gcc-4.3.0-8 RedHat available for Fedora 9 in the release update repository. If you want to use gcc-4.3.1, you must take other binaries or you have to compile the gcc4.3.1 from source.
If you have positive experience with gcc-4.3.1 then you can post it, maybe.

hjasak June 23, 2008 09:54

Hello All, I would be VERY
Hello All,

I would be VERY interested in including gcc-4.3.x porting changes into SVN - can someone give me the details or simply poste them here?


olesen June 23, 2008 10:30

Servus Matthias, I've been
Servus Matthias,

I've been fiddling about with a self-compiled gcc-4.3.1 and found that the compiler has gotten a fair bit smarter than the 4.2.X series in terms of catching "impossible to reach" bits of code and complaining about returning const primitives and other generally good pickiness that helps improve code quality.

In 4.3.0 there were many spurious warnings about out of bounds on enum. Sorry that I cannot remember the exact error message, but these got fixed in 4.3.1

I still haven't done any benchmarks to see if the generated code is any faster than 4.2.X and I don't enough time for a while either, so someone else will need to do it.

As to including the gcc-4.3.X porting changes into the SVN: I would personally rather wait a bit for the 1.5 version to be released - on the assumption that the OpenCFD guys will have already addressed the issue anyhow.


philippose June 23, 2008 13:39

Hello Hrv, I guess you did
Hello Hrv,

I guess you did not get the mail I sent to your ID about a month or so ago.... the mail contained a fairly detailed list of points with names of files and locations where changes have to be made, in order to obtain a successful compile with gcc-4.3.0

I have been running the SVN version of OpenFOAM-1.4.1-dev compiled with gcc-4.3.0 without any problems for quite a while now :-)!

Basically, I thought I would hold back from posting on the forum till I got a reply from Hrv... since I was not sure if I had made all the corrections the "legally correct way" .... well.... :-)! And so it stayed!

Have a nice day... :-)!


All times are GMT -4. The time now is 17:23.