CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   OpenFOAM-1.5-dev SVN15xx with gcc-4.4.2 (https://www.cfd-online.com/Forums/openfoam-bugs/71540-openfoam-1-5-dev-svn15xx-gcc-4-4-2-a.html)

philippose January 6, 2010 17:26

OpenFOAM-1.5-dev SVN15xx with gcc-4.4.2
 
Hello,

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:

Code:

# 1 "options"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "options"
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

FORCE:

instead of looking like:

Code:

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

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....

Code:

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

PROJECT_LIBS = -l$(WM_PROJECT) -ldl

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!

Philippose

lin January 6, 2010 20: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 00: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!!

Philippose

johannes January 9, 2010 06:19

Hi,

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,
Johannes

terrybarnaby January 12, 2010 05: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
http://gcc.gnu.org/PR41445 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>
either).
----------------------

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

mmahdinia January 13, 2010 13: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
Mani

elvis January 13, 2010 15:07

Quote:

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

elvis

mhsn November 17, 2012 16: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/settings.sh: No such file or directory
bash: /opt/OpenFOAM-1.5-dev/etc/aliases.sh: 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 14:23

hi
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 17: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.

Cheers,

L

mhsn November 18, 2012 17: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 05:49.