CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Bugs (
-   -   OpenFOAM-1.5-dev SVN15xx with gcc-4.4.2 (

philippose January 6, 2010 18:26

OpenFOAM-1.5-dev SVN15xx with gcc-4.4.2

A Good Evening to everyone :-)!

I was compiling OpenFOAM-1.5-dev SVN 1570 when I realised that there was one issue which I had faced earlier when I was compiling OpenFOAM-1.5-dev SVN 1563, which again popped up this time....

It looks like gcc-4.4.2 has an issue with the C Pre-processor (cpp) which causes the script MakeFileOptions to corrupt the options file which it creates in the $WM_OPTIONS folder.

As has been reported earlier in this forum, the resulting options file is stripped off all the backslash-newlines (\) but does not join the respective lines together..... for example, the options file for the OpenFOAM library looks like:


# 1 "options"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "options"

    -L$(FOAM_LIBBIN)/dummy -lPstream

$(OBJECTS_DIR)/global.o: FORCE


instead of looking like:


EXE_INC = -I$(WM_THIRD_PARTY_DIR)/zlib-1.2.3

LIB_LIBS = $(FOAM_LIBBIN)/libOSspecific.o -L$(FOAM_LIBBIN)/dummy -lPstream -lz

$(OBJECTS_DIR)/global.o: FORCE


which causes the build to fail with errors of *** missing separator.

After reading through some bug reports submitted to RedHat (I use Fedora 12), it looks like the issue is not limited to the version of gcc available on Fedora, but a general problem with gcc-4.4.2

The current solution to the problem is, to use the -P directive when invoking cpp.

I modified the file: OpenFOAM-1.5-dev/wmake/rules/linuxGcc/general to incorporate this change, and the compile went through fine....


CPP        = /lib/cpp $(GFLAGS) -P  <-- Changed line
LD        = ld -melf_i386


include $(GENERAL_RULES)/standard

include $(RULES)/X
include $(RULES)/c
include $(RULES)/c++

I tried making this change to the GFLAGS variable, but this breaks the build because GFLAGS is used elsewhere too.

The other option would be to make the addition directly in the MakeFileOptions script, but that would effect all the architecture variants.

Could someone confirm if this issue is also present in other distributions of Linux which use gcc-4.4.2?

I havent seen any bug reports submitted to the gcc developers yet regarding this issue.

Have a nice day!


lin January 6, 2010 21:15

I could also confirm this issue with Fedora 12.

My workaround is to compile gcc433 and let OpenFOAM use the cpp coming with it.

philippose January 7, 2010 01:38

Hello again,

A Very Good Morning to everyone!

A quick line before running off to my first day of work this year :-)!

OpenFOAM-1.5-dev SVN 1570 compiled without any further problems overnight after making the change mentioned above.

Hence, I can confirm that the other porting changes for gcc-4.4.x compatibility made recently by Hrvoje on the SVN repository worked fine on my system (Fedora 12 / 32-bit / gcc-4.4.2 / ParaView-3.7.0 CVS ) without having to tweak any part of the source code.

Have a great day ahead!!


johannes January 9, 2010 07:19


I can also confirm a trouble-free compilation of 1.5-dev rev. 1570 on OpenSUSE 11.2 x64 using the system gcc-4.4.1.
I had to rerun Allwmake to have everything properly compiled, so nothing special so far...

However, one issue remained: I'm still getting immediate segmentation faults when trying to run chtMultiRegionFoam in parallel, regardless which OpenMPI version I choose, while all the other solvers run flawlessly. Well, I think I'll set up a new thread on this topic...

Best regards,

terrybarnaby January 12, 2010 06:55

I just had this reply in the Fedora forums from Jakub Jelinek:

Yes, the tokens are separated by whitespace, so it is sufficient if they are
again separated by whitespace after preprocessing. See for details why this changed, in short
without the change the tokens have incorrect location and cause unintended
differences in debug info between direct compilation and compilation where
preprocessing happens separately from compilation.
You can use cpp -P to avoid this (then the output won't be cluttered with
# <line> <filename>

So it looks like this is now a bug in OpenFOAM...

mmahdinia January 13, 2010 14:58

Urgent help needed
Dear Philippose,

I really need to install OpenFOAM 1.5 on Fedora 12. I have the original OF1.5 downlaoded from its site. Where can I find rev 1570 version?

It would be very great, if you could post the details of your work (I am not familiar with changing the compiler or ...).

Thank you

Yours sincerely

elvis January 13, 2010 16:07


Originally Posted by mmahdinia (Post 242469)
Dear Philippose,

I really need to install OpenFOAM 1.5 on Fedora 12. I have the original OF1.5 downlaoded from its site. Where can I find rev 1570 version?

rev 1570 means that he uses the DEV-version FROM THE SUBVERSION REPOSITORY

install the nescessary pakages for subversion for your distribution

>cd $HOME/OpenFOAM

>svn co http://openfoam-extend.svn.sourcefor...nFOAM-1.5-dev/

and then comple after sucessful checking out the subversion repository
right now you will get openfoam-extend - Revision "1581" if you not explizitly check out earlier version!

hope this helps a bit


mhsn November 17, 2012 17:18

Hi Elvis,
I'm actually using fedora 16 and have already OpenFoam2.1.1 installed. For some reason I have to go back to the version 1.5.I checked out 1.5-dev from the svn that you had provided. But I cannot start installing that.
Here is what I did:
fist I added this line to my .bashrc file:
source $HOME/OpenFOAM-1.5-dev/etc/bashrc
then I typed source $HOME/.bshrc in the terminal and I get these:
bash: /opt/OpenFOAM-1.5-dev/bin/foamCleanPath: No such file or directory
bash: /opt/OpenFOAM-1.5-dev/bin/foamCleanPath: No such file or directory
bash: /opt/OpenFOAM-1.5-dev/bin/foamCleanPath: No such file or directory
bash: /opt/OpenFOAM-1.5-dev/etc/ No such file or directory
bash: /opt/OpenFOAM-1.5-dev/etc/ No such file or directory
bash: /opt/OpenFOAM-1.5-dev/etc/apps/paraview3/bashrc: No such file or directory
bash: /opt/OpenFOAM-1.5-dev/etc/apps/ensightFoam/bashrc: No such file or directory
bash: /opt/OpenFOAM-1.5-dev/bin/foamCleanPath: No such file or directory
bash: /opt/OpenFOAM-1.5-dev/bin/foamCleanPath: No such file or directory
bash: /opt/OpenFOAM-1.5-dev/bin/foamCleanPath: No such file or directory

I don't understand why it looking for those file in opt while I have OpenFOAM-1.5-dev downloaded in my home directory and have sourced that there!

I think I'm missing something (maybe very simple) but I can't figure out what it is!
Can you let me know how I can resolve that and start installing of1.5? Or can you link me to somewhere giving step by step installation guide for openfoam1.5?
Thank in advance

nimasam November 18, 2012 15:23

you should differ OpenFOAM2.1.1 from OpenFOAM1.5-dev with command "alias" in .bashrc
then whenever you Open terminal, you should define your version first ;)

Lieven November 18, 2012 18:21

You should check if the location of the OpenFOAM installation is set correctly in the OpenFOAM-1.5-dev/etc/bashrc script. If it is the same as in version 2.0, this is defined as variable 'foamInstall'.
I guess is it set to /opt while it should be set to $HOME.



mhsn November 18, 2012 18:39

Thank you guys,
I used aliases to differ of2.1 and of1.5 and also changed the $FOAM_INS_DIR to be my home directory and the problem resolved :)

All times are GMT -4. The time now is 12:46.