[GRASS5] 5.7/Mdk10.1: r.terraflow compilation problem

Hi,

we just compiled GRASS 5.7 on Mandrake 10.1 successfully
exept for r.terraflow: The error below doesn't tell me much,
does anyone have a suggestion?

Mkd10.1 comes with gcc 3.4.1.

Thanks

Markus

--------

[michal@wfpovo163 r.terraflow]$ make
Make78: warning: overriding commands for target `clean'
../../include/Make/Rules.make:30: warning: ignoring old commands for target `cle
an'
mkdir -p OBJ.i686-pc-linux-gnu/FLOAT ; true
mkdir -p OBJ.i686-pc-linux-gnu/SHORT ; true
c++ -c -g -O2 -I./IOStream/include -DUSER=\"michal\" -DNODATA_FIX -D_FILE_OFFSET
_BITS=64 -I/home/michal/grass51/include -DELEV_FLOAT main.cc -o OBJ.i686-pc-linu
x-gnu/FLOAT/main.o
In file included from ./IOStream/include/ami.h:59,
                 from common.h:49,
                 from main.cc:59:
./IOStream/include/pqheap.h: In constructor `pqheap_t1<T>::pqheap_t1(unsigned in
t)':
./IOStream/include/pqheap.h:218: error: `MMmanager' undeclared (first use this f
unction)
./IOStream/include/pqheap.h:218: error: (Each undeclared identifier is reported
only once for each function it appears in.)
In file included from /usr/lib/gcc/i586-mandrake-linux-gnu/3.4.1/../../../../inc
lude/c++/3.4.1/backward/ostream.h:31,
                 from ./IOStream/include/empq_impl.h:43,
                 from ./IOStream/include/ami.h:61,
                 from common.h:49,
                 from main.cc:59:
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.1/../../../../include/c++/3.4.1/backwar
d/backward_warning.h:32:2: warning: #warning This file includes at least one dep
recated or antiquated header. Please consider using one of the 32 headers found
in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> h
eader for the <X.h> header for C++ includes, or <iostream> instead of the deprec
ated header <iostream.h>. To disable this warning use -Wno-deprecated.
In file included from ./IOStream/include/empq.h:53,
                 from ./IOStream/include/empq_impl.h:46,
                 from ./IOStream/include/ami.h:61,
                 from common.h:49,
                 from main.cc:59:
./IOStream/include/embuffer.h: In member function `long unsigned int em_buffer<T
, Key>::get_stream_maxlen() const':
./IOStream/include/embuffer.h:317: error: there are no arguments to `pow' that d
epend on a template parameter, so a declaration of `pow' must be available
./IOStream/include/embuffer.h:317: error: (if you use `-fpermissive', G++ will a
ccept your code, but allowing the use of an undeclared name is deprecated)
./IOStream/include/embuffer.h: In constructor `em_buffer<T, Key>::em_buffer(shor
t unsigned int, long unsigned int, unsigned int)':
./IOStream/include/embuffer.h:465: error: array bound forbidden after parenthesi
zed type-id
./IOStream/include/embuffer.h:465: note: try removing the parentheses around the
type-id
./IOStream/include/embuffer.h:484: error: array bound forbidden after parenthesi
zed type-id
./IOStream/include/embuffer.h:484: note: try removing the parentheses around the
type-id
In file included from ./IOStream/include/empq.h:55,
                 from ./IOStream/include/empq_impl.h:46,
                 from ./IOStream/include/ami.h:61,
                 from common.h:49,
                 from main.cc:59:
./IOStream/include/minmaxheap.h: In member function `bool MinMaxHeap<T>::full()
const':
./IOStream/include/minmaxheap.h:737: error: there are no arguments to `size' tha
t depend on a template parameter, so a declaration of `size' must be available
./IOStream/include/minmaxheap.h:737: error: `maxsize' undeclared (first use this
function)
./IOStream/include/minmaxheap.h: In member function `HeapIndex MinMaxHeap<T>::ge
t_maxsize() const':
./IOStream/include/minmaxheap.h:738: error: `maxsize' undeclared (first use this
function)
./IOStream/include/minmaxheap.h: In member function `HeapIndex MinMaxHeap<T>::fi
ll(T*, HeapIndex)':
./IOStream/include/minmaxheap.h:753: error: there are no arguments to `size' tha
t depend on a template parameter, so a declaration of `size' must be available
./IOStream/include/minmaxheap.h:758: error: `maxsize' undeclared (first use this
function)
./IOStream/include/minmaxheap.h: In member function `virtual void UnboundedMinMa
xHeap<T>::grow()':
./IOStream/include/minmaxheap.h:780: error: `A' undeclared (first use this funct
ion)
./IOStream/include/minmaxheap.h:781: error: `maxsize' undeclared (first use this
function)
./IOStream/include/minmaxheap.h:784: error: there are no arguments to `allocateH
eap' that depend on a template parameter, so a declaration of `allocateHeap' mus
t be available
./IOStream/include/minmaxheap.h:786: error: there are no arguments to `size' tha
t depend on a template parameter, so a declaration of `size' must be available
In file included from ./IOStream/include/ami.h:61,
                 from common.h:49,
                 from main.cc:59:
./IOStream/include/empq_impl.h: In constructor `em_pqueue<T, Key>::em_pqueue(lon g int, long int, short unsigned int, unsigned int)':
./IOStream/include/empq_impl.h:154: error: there are no arguments to `form' that depend on a template parameter, so a declaration of `form' must be available
./IOStream/include/empq_impl.h:156: error: there are no arguments to `form' that depend on a template parameter, so a declaration of `form' must be available
./IOStream/include/empq_impl.h:191: error: there are no arguments to `form' that depend on a template parameter, so a declaration of `form' must be available
./IOStream/include/empq_impl.h: In constructor `em_pqueue<T, Key>::em_pqueue()':
./IOStream/include/empq_impl.h:246: error: there are no arguments to `form' that depend on a template parameter, so a declaration of `form' must be available
./IOStream/include/empq_impl.h:353: error: there are no arguments to `form' that depend on a template parameter, so a declaration of `form' must be available
./IOStream/include/empq_impl.h: In member function `bool em_pqueue<T, Key>::fill pq()':
./IOStream/include/empq_impl.h:599: error: array bound forbidden after parenthes ized type-id
./IOStream/include/empq_impl.h:599: note: try removing the parentheses around th e type-id
make: *** [OBJ.i686-pc-linux-gnu/FLOAT/main.o] Error 1

Markus Neteler wrote:

we just compiled GRASS 5.7 on Mandrake 10.1 successfully
exept for r.terraflow: The error below doesn't tell me much,
does anyone have a suggestion?

./IOStream/include/pqheap.h:218: error: `MMmanager' undeclared (first use this function)

I suspect that this should be MM_manager, which is declared in mm.h.

--
Glynn Clements <glynn@gclements.plus.com>

On Wed, Oct 27, 2004 at 02:33:11AM +0100, Glynn Clements wrote:

Markus Neteler wrote:

> we just compiled GRASS 5.7 on Mandrake 10.1 successfully
> exept for r.terraflow: The error below doesn't tell me much,
> does anyone have a suggestion?

> ./IOStream/include/pqheap.h:218: error: `MMmanager' undeclared (first use this function)

I suspect that this should be MM_manager, which is declared in mm.h.

I have submitted patches from the authors to CVS. Now our guest having
Mandrake 10.1/gcc 3.41 is no longer here, so I cannot confirm if it works.
Still works for gcc3.2 :slight_smile:

Markus

> > we just compiled GRASS 5.7 on Mandrake 10.1 successfully
> > exept for r.terraflow: The error below doesn't tell me much,
> > does anyone have a suggestion?
>
> > ./IOStream/include/pqheap.h:218: error: `MMmanager' undeclared
> > (first use this function)
>
> I suspect that this should be MM_manager, which is declared in mm.h.

I have submitted patches from the authors to CVS. Now our guest having
Mandrake 10.1/gcc 3.41 is no longer here, so I cannot confirm if it
works. Still works for gcc3.2 :slight_smile:

It will now be broken for gcc <= 2.95. Unfortunately gcc 2.95 includes
most of the new (sans .h) headers but not all. In particular <ostream>
is missing. gcc 3.3 would complain but still compile with <ostream.h>.
I don't know if gcc 3.4 maintains backwards compatability. If it
doesn't, we'd need to do something like this:

http://grass.itc.it/pipermail/grass5/2004-January/013555.html
http://grass.itc.it/pipermail/grass5/2004-January/013566.html

but that leads to other headaches with non-gcc C++ compilers.. (anyone?)

fairly obvious example from this history:
http://freegis.org/cgi-bin/viewcvs.cgi/grass/src.contrib/DUKE/r.terraflow/common.cc

Hamish

(cc Andrew Danner from Duke)

On Wed, Nov 03, 2004 at 02:23:41PM +1300, Hamish wrote:

> > > we just compiled GRASS 5.7 on Mandrake 10.1 successfully
> > > exept for r.terraflow: The error below doesn't tell me much,
> > > does anyone have a suggestion?
> >
> > > ./IOStream/include/pqheap.h:218: error: `MMmanager' undeclared
> > > (first use this function)
> >
> > I suspect that this should be MM_manager, which is declared in mm.h.
>
> I have submitted patches from the authors to CVS. Now our guest having
> Mandrake 10.1/gcc 3.41 is no longer here, so I cannot confirm if it
> works. Still works for gcc3.2 :slight_smile:

It will now be broken for gcc <= 2.95. Unfortunately gcc 2.95 includes
most of the new (sans .h) headers but not all. In particular <ostream>
is missing. gcc 3.3 would complain but still compile with <ostream.h>.
I don't know if gcc 3.4 maintains backwards compatability. If it
doesn't, we'd need to do something like this:

http://grass.itc.it/pipermail/grass5/2004-January/013555.html
http://grass.itc.it/pipermail/grass5/2004-January/013566.html

but that leads to other headaches with non-gcc C++ compilers.. (anyone?)

At least it would be fixed for the 'gcc' family. Once someone
complains we can add further #if ... magic.

fairly obvious example from this history:
http://freegis.org/cgi-bin/viewcvs.cgi/grass/src.contrib/DUKE/r.terraflow/common.cc

Hamish

Markus