CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   compiling firefoam (https://www.cfd-online.com/Forums/openfoam/82400-compiling-firefoam.html)

wyldckat July 21, 2012 18:21

OK, I had built mine with Gcc 4.6, so I apparently also had even more issues than your build has.

I've switched to Gcc 4.4.6 as well on my Ubuntu 11.10. For that, I've modified OpenFOAM's "etc/bash" to have these settings:
Code:

export WM_CC='gcc-4.4'
export WM_CXX='g++-4.4'

Additionally, I messed up on the previous diff. The proper lines for "wmake/rules/linux64Gcc/c++" and "wmake/rules/linuxGcc/c++" are:
Code:

LINKLIBSO  = $(CC) $(c++FLAGS) -shared -Xlinker --add-needed -Xlinker --no-as-needed
LINKEXE    = $(CC) $(c++FLAGS) -Xlinker --add-needed -Xlinker --no-as-needed

It's going to take a while to rebuild 1.7.x from scratch. I'll make another post when I have news, although I'm not sure if it will be in the next hour...

wyldckat July 21, 2012 18:39

:mad: If I hadn't inspected the "make.log" sooner, it would have been a wasted hour... here's the necessary patch, which without the settings from bashrc won't propagate to wmake (swap "linux64Gcc" to "linuxGcc" for 32bit):
Code:

diff --git a/wmake/rules/linux64Gcc/c b/wmake/rules/linux64Gcc/c
index f4114be..33e81aa 100644
--- a/wmake/rules/linux64Gcc/c
+++ b/wmake/rules/linux64Gcc/c
@@ -2,7 +2,7 @@
 
 cWARN        = -Wall
 
-cc          = gcc -m64
+cc          = $(WM_CC) -m64
 
 include $(RULES)/c$(WM_COMPILE_OPTION)
 
diff --git a/wmake/rules/linux64Gcc/c++ b/wmake/rules/linux64Gcc/c++
index b68f2f7..6fa973e 100644
--- a/wmake/rules/linux64Gcc/c++
+++ b/wmake/rules/linux64Gcc/c++
@@ -2,7 +2,7 @@
 
 c++WARN    = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor
 
-CC          = g++ -m64
+CC          = $(WM_CXX) -m64
 
 include $(RULES)/c++$(WM_COMPILE_OPTION)
 
@@ -17,5 +17,5 @@ cpptoo      = $(Ctoo)
 
 LINK_LIBS  = $(c++DBUG)
 
-LINKLIBSO  = $(CC) $(c++FLAGS) -shared
-LINKEXE    = $(CC) $(c++FLAGS) -Xlinker --add-needed
+LINKLIBSO  = $(CC) $(c++FLAGS) -shared -Xlinker --add-needed -Xlinker --no-as-needed
+LINKEXE    = $(CC) $(c++FLAGS) -Xlinker --add-needed -Xlinker --no-as-needed

I've made a clean up by running:
Code:

wclean all
rm -r lib/linux64GccDPOpt
rm -r applications/bin/linux64GccDPOpt

Yuri, in case you don't know, you can build with multi-core by running this command before Allwmake:
Code:

export WM_NCOMPPROCS=4
This is for 4 cores, i.e. 4 parallel threads for building OpenFOAM.

wyldckat July 21, 2012 19:32

Hi Yuri,

OK, I've finished confirming this. With the info from the last 2 posts, you should succeed in building everything.

Keep in mind:
  1. I've tested things with 64bit, but left instructions on what's different for the 32bit build.
  2. And later on don't forget to run Allwclean first in the "fireFoam.1.7.x_0.4" folder.
Best regards,
Bruno

Yuri Almeida July 21, 2012 19:38

That is a great news, Bruno! I'm trying to compiling the OF also, utilizing yours implementations, I rope that this time it will work.

I will post the results here soon.

Yuri Almeida July 22, 2012 13:17

Hi Bruno,

I really want to thank you so much for your support! The OF17x compilation worked. In addition to your corrections, I changed the variable WM_ARCH_OPTION, which was set by default 64, but my Ubuntu is 32 bits. Could be this one of the reasons for the previous failures?

After this, I finally compiled successfully the fireFoam.1.7.x_0.4! So, the big deal was really the OF17x compilation.

Thanks again for your help!

trinath2rao December 18, 2012 10:55

Hii
 
Hi,

I am getting error while compiling the OF 1.7.x.

I have followed till the previous step but unable to understand comment #22 .

Which files i have to swap as i am using ubuntu 32bit
If possible can you change in the git repository

It will be of great help ...

Thank You

Regards,
Trinath Rao

wyldckat December 22, 2012 18:06

Greetings Trinath Rao,
Quote:

Originally Posted by trinath2rao (Post 398103)
I have followed till the previous step but unable to understand comment #22 .

Which files i have to swap as i am using ubuntu 32bit
If possible can you change in the git repository

It's simple ;): in comment #22, whenever you find the text "linux64Gcc" in the instructions, change it to "linuxGcc".

If I'm not mistaken, this is what it should be like for "linuxGcc":
Quote:

Code:

diff --git a/wmake/rules/linuxGcc/c b/wmake/rules/linuxGcc/c
index f4114be..33e81aa 100644
--- a/wmake/rules/linuxGcc/c
+++ b/wmake/rules/linuxGcc/c
@@ -2,7 +2,7 @@
 
 cWARN        = -Wall
 
-cc          = gcc
+cc          = $(WM_CC)
 
 include $(RULES)/c$(WM_COMPILE_OPTION)
 
diff --git a/wmake/rules/linuxGcc/c++ b/wmake/rules/linuxGcc/c++
index b68f2f7..6fa973e 100644
--- a/wmake/rules/linuxGcc/c++
+++ b/wmake/rules/linuxGcc/c++
@@ -2,7 +2,7 @@
 
 c++WARN    = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor
 
-CC          = g++
+CC          = $(WM_CXX)
 
 include $(RULES)/c++$(WM_COMPILE_OPTION)
 
@@ -17,5 +17,5 @@ cpptoo      = $(Ctoo)
 
 LINK_LIBS  = $(c++DBUG)
 
-LINKLIBSO  = $(CC) $(c++FLAGS) -shared
-LINKEXE    = $(CC) $(c++FLAGS) -Xlinker --add-needed
+LINKLIBSO  = $(CC) $(c++FLAGS) -shared -Xlinker --add-needed -Xlinker --no-as-needed
+LINKEXE    = $(CC) $(c++FLAGS) -Xlinker --add-needed -Xlinker --no-as-needed

I've made a clean up by running:
Code:

wclean all
rm -r lib/linuxGccDPOpt
rm -r applications/bin/linuxGccDPOpt


Best regards,
Bruno

trinath2rao December 24, 2012 04:21

Compiled !!
 
Hi Bruno,

Thank you for replying my query.

I build openfoam 1.7.x successfully. and started working perfectly.

Merry Christmas and Very Happy New Year 2013 !!!

Thanks a lot...!!

Regards,
Trinath Rao :):)


All times are GMT -4. The time now is 19:40.