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

compiling firefoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 21, 2012, 18:21
Default
  #21
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
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 is offline   Reply With Quote

Old   July 21, 2012, 18:39
Default
  #22
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
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 is offline   Reply With Quote

Old   July 21, 2012, 19:32
Thumbs up
  #23
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
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
__________________
wyldckat is offline   Reply With Quote

Old   July 21, 2012, 19:38
Default
  #24
New Member
 
Yuri Almeida
Join Date: Jan 2012
Location: Rio de Janeiro, Brazil
Posts: 21
Rep Power: 14
Yuri Almeida is on a distinguished road
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 is offline   Reply With Quote

Old   July 22, 2012, 13:17
Default
  #25
New Member
 
Yuri Almeida
Join Date: Jan 2012
Location: Rio de Janeiro, Brazil
Posts: 21
Rep Power: 14
Yuri Almeida is on a distinguished road
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!
Yuri Almeida is offline   Reply With Quote

Old   December 18, 2012, 10:55
Default Hii
  #26
New Member
 
Mak
Join Date: Jul 2010
Location: United States
Posts: 10
Rep Power: 15
trinath2rao is on a distinguished road
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
trinath2rao is offline   Reply With Quote

Old   December 22, 2012, 18:06
Default
  #27
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 Trinath Rao,
Quote:
Originally Posted by trinath2rao View Post
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
__________________
wyldckat is offline   Reply With Quote

Old   December 24, 2012, 04:21
Default Compiled !!
  #28
New Member
 
Mak
Join Date: Jul 2010
Location: United States
Posts: 10
Rep Power: 15
trinath2rao is on a distinguished road
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
trinath2rao 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
fireFoam and basicThermo prapanj OpenFOAM Running, Solving & CFD 26 November 8, 2016 07:47
Help with KIVA4 source code compiling geothokar Main CFD Forum 0 September 3, 2010 05:40
DNS, FireFoam, adaptive mesh fgal OpenFOAM Running, Solving & CFD 3 July 5, 2010 13:09
Dissimilarity in compiling new BC in 32bit OpenSuSE 103 versus 64bit CentOS 50 versus 64bit SLED 100 sponiar OpenFOAM Running, Solving & CFD 3 February 26, 2008 06:31
Discussing UDF and C++ Compiling Big Stone FLUENT 9 April 12, 2004 15:07


All times are GMT -4. The time now is 08:51.