CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   OpenFoam-1.5 on Solaris -- compilation problem calling octreeDataPoint(.) constructor (http://www.cfd-online.com/Forums/openfoam-installation/65039-openfoam-1-5-solaris-compilation-problem-calling-octreedatapoint-constructor.html)

cincaipatron June 2, 2009 04:09

OpenFoam-1.5 on Solaris -- compilation problem calling octreeDataPoint(.) constructor
 
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 June 3, 2009 06:32

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)),
    ...
);


dmoroian June 26, 2009 18:04

OpenFOAM-1.5-dev on Fedora 11
 
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

b_k August 26, 2009 06:59

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

lin September 4, 2009 21:41

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.

deepblue17 September 18, 2009 15:45

OpenFOAM-1.6_gcc4.4.patch
 
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

louisgag December 22, 2009 16:21

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)),
    ...
);



bookie56 January 11, 2010 06:24

Hi guys and girls:)

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

http://www.cfd-online.com/Forums/ope...tml#post242123

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

wyldckat January 11, 2010 07:21

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

bookie56 January 11, 2010 07:37

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


All times are GMT -4. The time now is 21:55.