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

OpenFoam-1.5 on Solaris -- compilation problem calling octreeDataPoint(.) constructor

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   June 2, 2009, 04:09
Default OpenFoam-1.5 on Solaris -- compilation problem calling octreeDataPoint(.) constructor
  #1
New Member
 
Verdi March
Join Date: Jun 2009
Posts: 2
Rep Power: 0
cincaipatron is on a distinguished road
Hi,

Using gcc-4.4, there's a compilation error with the following errors:

Code:
triSurface/surfaceFeatures/surfaceFeatures.C:770: error: conflicting declaration 'Foam::octreeDataPoint samples'
triSurface/surfaceFeatures/surfaceFeatures.C:769: error: 'samples' has a previous declaration as 'Foam::treeBoundBox samples'
triSurface/surfaceFeatures/surfaceFeatures.C: In member function 'Foam::Map<int> Foam::surfaceFeatures::nearestSamples(const
Foam::labelList&, const Foam::pointField&, const Foam::scalarField&, const Foam::scalarField&, Foam::scalar) const':
triSurface/surfaceFeatures/surfaceFeatures.C:871: error: conflicting declaration 'Foam::octreeDataPoint samples'
triSurface/surfaceFeatures/surfaceFeatures.C:870: error: 'samples' has a previous declaration as 'Foam::treeBoundBox samples'
Any clue what's going on and the possible remedy?
cincaipatron is offline   Reply With Quote

Old   June 3, 2009, 06:32
Default
  #2
New Member
 
Verdi March
Join Date: Jun 2009
Posts: 2
Rep Power: 0
cincaipatron is on a distinguished road
I found the problem.

Basically, the compiler picks the wrong treeBoundBox's constructor.

The triSurface/surfaceFeatures/surfaceFeatures.C calls a 1-parameter constructor treeBoundBox(UList<...>). However, due to some reason, gcc-4.4 resolves this to the inlined treeBoundBox(boundBox) -- also a 1-parameter constructor.

My quick-n-dirty solution is to dynamic cast the PointField samples into its ancestor (UList). That is, from

Code:
octree<octreeDataPoint> ppTree (
    treeBoundBox(samples),
    ...
);
to

Code:
octree<octreeDataPoint> ppTree (
    treeBoundBox(dynamic_cast<const UList<point>&>(samples)),
    ...
);
cincaipatron is offline   Reply With Quote

Old   June 26, 2009, 18:04
Default OpenFOAM-1.5-dev on Fedora 11
  #3
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 647
Rep Power: 11
dmoroian is on a distinguished road
Hello everybody,
I just want to say that the 'dirty work around' suggested by Verdi helped me to compile OpenFOAM-1.5-dev on a newly installed Fedora 11.
Due to the fact that it comes with gcc 4.4.0 I ended up with the same problem, but of course with the same solution.
One extra problem was that I had to add
Code:
#include "stdint.h"
in /home/dragos/OpenFOAM/OpenFOAM-1.5-dev/src/OSspecific/Unix/signals/sigFpe.C because the type uint64_t was undefined, which in turn generated a compiler error.

I hope this is helpful,
Dragos
dmoroian is offline   Reply With Quote

Old   August 26, 2009, 06:59
Thumbs up
  #4
b_k
New Member
 
Join Date: Aug 2009
Posts: 3
Rep Power: 8
b_k is on a distinguished road
Hi, I was able to get OF-1.6 compiled on Ubuntu and gcc-4.4 using your solution. I was able to find out meshTools had some problem but your post really helped fixing the issue. Thanks .
b_k is offline   Reply With Quote

Old   September 4, 2009, 21:41
Default
  #5
lin
Senior Member
 
Hua Zen
Join Date: Mar 2009
Posts: 114
Rep Power: 8
lin is on a distinguished road
I have both problems mentioned above with OF 1.5.x on Fedora 11,gcc 4.4.1. I suggest the developers check those and commit it if it is necessary.
lin is offline   Reply With Quote

Old   September 18, 2009, 15:45
Default OpenFOAM-1.6_gcc4.4.patch
  #6
Member
 
Oliver Borm
Join Date: Mar 2009
Posts: 59
Rep Power: 8
deepblue17 is on a distinguished road
On gentoo linux with gcc-4.4.1 you will need also to include
Code:
#include <stdio.h>
into chemkinLexer.L, ansysToFoam.L and gambitToFoam.L for OpenFOAM-1.6

You will find the complete patch at: http://sources.gentoo.org/viewcvs.py...ch?view=markup
deepblue17 is offline   Reply With Quote

Old   December 22, 2009, 16:21
Default
  #7
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Québec, QC, Canada
Posts: 208
Rep Power: 9
louisgag is on a distinguished road
Send a message via ICQ to louisgag
On Ubuntu 9.10 with OpenFOAM-1.5-dev svn 1562 I managed to compile using the system compile (4.4.x) after making two changes proposed above.

Namely,

Quote:

Code:
  #include "stdint.h"
in /home/dragos/OpenFOAM/OpenFOAM-1.5-dev/src/OSspecific/Unix/signals/sigFpe.C because the type uint64_t was undefined, which in turn generated a compiler error.

and, in meshTools, replacing the two occurances of

Quote:

The triSurface/surfaceFeatures/surfaceFeatures.C calls a 1-parameter constructor treeBoundBox(UList<...>). However, due to some reason, gcc-4.4 resolves this to the inlined treeBoundBox(boundBox) -- also a 1-parameter constructor.

My quick-n-dirty solution is to dynamic cast the PointField samples into its ancestor (UList). That is, from

Code:
    octree<octreeDataPoint> ppTree (
    treeBoundBox(samples),
    ...
);
to

Code:
octree<octreeDataPoint> ppTree (
    treeBoundBox(dynamic_cast<const UList<point>&>(samples)),
    ...
);
louisgag is offline   Reply With Quote

Old   January 11, 2010, 06:24
Default
  #8
New Member
 
Join Date: Jan 2010
Posts: 28
Rep Power: 7
bookie56 is on a distinguished road
Hi guys and girls

I have just replied to this thread and the comments by wyldckat:

Problem Installing OF 1.6 Ubuntu 9.10 (64 bit) - How to use GCC 4.4.1

He guides us here and I see that b_k has got openfoam 1.6 installed and working on Ubuntu..although, what version isn't mentioned. I am on Ubuntu Karmic!

Can someone give some help with this ....PLEASE!

i have also started this thread at the Ubuntu Forum explaining what I have done so far:
http://ubuntuforums.org/showthread.p...60#post8645960

Thanks a bunch folks!

bookie56
bookie56 is offline   Reply With Quote

Old   January 11, 2010, 07:21
Default
  #9
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,516
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings bookie56,

Well, by what I remember you'll be needing posts number 2, 3 and 6.
I used (K)Ubuntu 9.04 32 and 64 bit. Haven't tried in Ubuntu 9.10, but there is a thread (this one) that is giving some support on how to build OpenFOAM 1.6.x in Ubuntu 9.04 and 9.10 (32 ad 64bit).

I would suggest that you follow that thread and use Mads script, because the other choice I see for you is taking a step back to Ubuntu 9.04 and use the pre-built binaries of OpenFOAM

In case you still want to be with the recent Ubuntu and older OpenFOAM, and can't figure out how to implement post 2,3 and 6, than I suggest you follow the chapter 5 (here), only points 1 and 2, of the wiki page I posted a while back (for cross-compiling OpenFOAM in Linux for Windows). Than you should be able to follow the user manual. Those patches shouldn't disable the capability of building the Linux version of OpenFOAM.

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   January 11, 2010, 07:37
Default
  #10
New Member
 
Join Date: Jan 2010
Posts: 28
Rep Power: 7
bookie56 is on a distinguished road
Hi wyldckat

I really appreciate your prompt reply and I will have a look at your info and let you know how I get on a bit later....

Thanks again!

bookie56
bookie56 is offline   Reply With Quote

Reply

Tags
solaris

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
!!! UDF - Compilation problem !!! Everest FLUENT 1 January 12, 2009 18:56
Can I use OpenFOAM to solve unsteady diffusion problem yongshenglian OpenFOAM Running, Solving & CFD 1 September 17, 2008 12:03
Problem importing mesh in openfoam from fluent alessandr0 OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 3 September 4, 2008 13:41
OpenFOAM 14 compilation problem zaferleylek OpenFOAM Installation 4 May 8, 2007 14:52
OpenFOAM installation problem on Linux 32bit kumar OpenFOAM Installation 0 April 27, 2007 05:41


All times are GMT -4. The time now is 10:42.