[GRASS-dev] [GRASS GIS] #419: cairo compilation error

#419: cairo compilation error
---------------------+------------------------------------------------------
Reporter: neteler | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: major | Milestone: 7.0.0
Component: default | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: x86-32 |
---------------------+------------------------------------------------------
Trying to compile GRASS trunk on grass.osgeo.org (FC4 with cairo 1.4.4), I
get

{{{
make[1]: Leaving directory
`/home/neteler/grass7_svn_head_bin_snapshot/trunk/lib/cairodriver'
gcc -I/home/neteler/grass7_svn_head_bin_snapshot/trunk/dist.i686-pc-linux-
gnu/include -I/home/neteler/binaries/include -g -Wall
-Werror-implicit-function-declaration -fno-common
-I/home/neteler/binaries/include -fPIC -I../driver -I/usr/include/cairo
-DUSE_X11=1 -DPACKAGE=\""grasslibs"\"
-I/home/neteler/grass7_svn_head_bin_snapshot/trunk/dist.i686-pc-linux-
gnu/include -o OBJ.i686-pc-linux-gnu/Draw_bitmap.o -c Draw_bitmap.c
Draw_bitmap.c: In function 'Cairo_Bitmap':
Draw_bitmap.c:36: error: implicit declaration of function
'cairo_format_stride_for_width'
}}}

What's the minimum version of cairo needed here?

Please update REQUIREMENTS.html:
{{{
grep -i cairo REQUIREMENTS.html
<li><B>Cairo</B> (Cairo graphics library, Version &gt;= XX)<BR>
}}}

Markus

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/419&gt;
GRASS GIS <http://grass.osgeo.org>

#419: cairo compilation error
----------------------+-----------------------------------------------------
  Reporter: neteler | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 7.0.0
Component: default | Version: svn-trunk
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by glynn):

Replying to [ticket:419 neteler]:

> Trying to compile GRASS trunk on grass.osgeo.org (FC4 with cairo 1.4.4),
I get

> Draw_bitmap.c:36: error: implicit declaration of function
'cairo_format_stride_for_width'

> What's the minimum version of cairo needed here?

That function needs 1.6.

> Please update REQUIREMENTS.html:

I'd rather work around the requirement.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/419#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#419: cairo compilation error
----------------------+-----------------------------------------------------
  Reporter: neteler | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 7.0.0
Component: default | Version: svn-trunk
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by neteler):

Replying to [comment:1 glynn]:
> Replying to [ticket:419 neteler]:
> > Draw_bitmap.c:36: error: implicit declaration of function
'cairo_format_stride_for_width'
...
> I'd rather work around the requirement.

That would be appreciated since I don't get Cairo 1.6 compiled on the
oldish FC4 (and no way to update that).

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/419#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#419: cairo compilation error
----------------------+-----------------------------------------------------
  Reporter: neteler | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 7.0.0
Component: default | Version: svn-trunk
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by mlennert):

Replying to [comment:1 glynn]:
> Replying to [ticket:419 neteler]:
>
> > Trying to compile GRASS trunk on grass.osgeo.org (FC4 with cairo
1.4.4), I get
>
> > Draw_bitmap.c:36: error: implicit declaration of function
'cairo_format_stride_for_width'
>
> > What's the minimum version of cairo needed here?
>
> That function needs 1.6.

Looks like 1.5.8 would be enough:
http://cairographics.org/news/cairo-1.5.8/

I have the same problem with

cairo_xlib_surface_get_xrender_format

Moritz

>
> > Please update REQUIREMENTS.html:
>
> I'd rather work around the requirement.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/419#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#419: cairo compilation error
----------------------+-----------------------------------------------------
  Reporter: neteler | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 7.0.0
Component: default | Version: svn-trunk
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by glynn):

Replying to [comment:3 mlennert]:

> > > What's the minimum version of cairo needed here?

> Looks like 1.5.8 would be enough:

I'll update the test accordingly.

> I have the same problem with
>
> cairo_xlib_surface_get_xrender_format

That should be conditionalised upon CAIRO_HAS_XLIB_XRENDER_SURFACE. The
function should be defined in cairo-xlib-xrender.h.

Can you provide more details?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/419#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#419: cairo compilation error
----------------------+-----------------------------------------------------
  Reporter: neteler | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 7.0.0
Component: default | Version: svn-trunk
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by mlennert):

Replying to [comment:4 glynn]:
> Replying to [comment:3 mlennert]:
>
> > > > What's the minimum version of cairo needed here?
>
> > Looks like 1.5.8 would be enough:
>
> I'll update the test accordingly.
>
> > I have the same problem with
> >
> > cairo_xlib_surface_get_xrender_format
>
> That should be conditionalised upon CAIRO_HAS_XLIB_XRENDER_SURFACE. The
function should be defined in cairo-xlib-xrender.h.
>
> Can you provide more details?

svn update and recompile now gives only one error:

{{{
mlennert@geog-pc40:~/SRC/GRASS/grass_trunk/general/g.cairocomp$ export
LANG=C; make
gcc -L/home/mlennert/SRC/GRASS/grass_trunk/dist.i486-pc-linux-gnu/lib -Wl,
--export-dynamic -Wl,-rpath-
link,/home/mlennert/SRC/GRASS/grass_trunk/dist.i486-pc-linux-gnu/lib -o
/home/mlennert/SRC/GRASS/grass_trunk/dist.i486-pc-linux-
gnu/bin/g.cairocomp OBJ.i486-pc-linux-gnu/main.o -lgrass_gis
-lgrass_datetime -lz -lXrender -lcairo -lX11 -lm -lz
OBJ.i486-pc-linux-gnu/main.o: In function `init_xlib':
/home/mlennert/SRC/GRASS/grass_trunk/general/g.cairocomp/main.c:118:
undefined reference to `cairo_xlib_surface_get_xrender_format'
collect2: ld returned 1 exit status
make: *** [/home/mlennert/SRC/GRASS/grass_trunk/dist.i486-pc-linux-
gnu/bin/g.cairocomp] Error 1
}}}

Using cairo 1.4.14 on Debian stable.

Moritz

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/419#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#419: cairo compilation error
----------------------+-----------------------------------------------------
  Reporter: neteler | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 7.0.0
Component: default | Version: svn-trunk
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by glynn):

Replying to [comment:5 mlennert]:

> svn update and recompile now gives only one error:
>
>
{{{
/home/mlennert/SRC/GRASS/grass_trunk/general/g.cairocomp/main.c:118:
undefined reference to `cairo_xlib_surface_get_xrender_format'

make: *** [/home/mlennert/SRC/GRASS/grass_trunk/dist.i486-pc-linux-
gnu/bin/g.cairocomp] Error 1
}}}
>
> Using cairo 1.4.14 on Debian stable.

Right; I can only fix this in the sense of adding a configure check for
cairo_xlib_surface_get_xrender_format() and not building g.cairocomp if
it's missing. g.cairocomp can't work without that function, but the cairo
driver can.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/419#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#419: cairo compilation error
----------------------+-----------------------------------------------------
  Reporter: neteler | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 7.0.0
Component: default | Version: svn-trunk
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by mlennert):

Replying to [comment:6 glynn]:
> Replying to [comment:5 mlennert]:
>
> > svn update and recompile now gives only one error:
> >
> >
> {{{
> /home/mlennert/SRC/GRASS/grass_trunk/general/g.cairocomp/main.c:118:
undefined reference to `cairo_xlib_surface_get_xrender_format'
>
> make: *** [/home/mlennert/SRC/GRASS/grass_trunk/dist.i486-pc-linux-
gnu/bin/g.cairocomp] Error 1
> }}}
> >
> > Using cairo 1.4.14 on Debian stable.
>
> Right; I can only fix this in the sense of adding a configure check for
cairo_xlib_surface_get_xrender_format() and not building g.cairocomp if
it's missing. g.cairocomp can't work without that function, but the cairo
driver can.

And do I understand correctly that g.cairocomp is need to use the GUI, at
least when using the default cairo driver ?

I guess it's time to compile a more recent version of cairo, then...

Moritz

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/419#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#419: cairo compilation error
----------------------+-----------------------------------------------------
  Reporter: neteler | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 7.0.0
Component: default | Version: svn-trunk
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by glynn):

Replying to [comment:7 mlennert]:

> And do I understand correctly that g.cairocomp is need to use the GUI,
at least when using the default cairo driver ?

No. At present, g.cairocomp isn't used.

Using the cairo driver to generate X pixmaps which can be composited by
g.cairocomp offers a faster alternative to using PNM files, but it
requires X, the XRender extension, and a recent version of cairo built
with X and XRender support. Even if/when the GUI does use g.cairocomp, the
use of PNM files will still need to be retained as a fallback.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/419#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#419: cairo compilation error
----------------------+-----------------------------------------------------
  Reporter: neteler | Owner: martinl
      Type: defect | Status: assigned
  Priority: major | Milestone: 7.0.0
Component: default | Version: svn-trunk
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Changes (by martinl):

  * status: new => assigned
  * owner: grass-dev@lists.osgeo.org => martinl
* cc: grass-dev@lists.osgeo.org (added)

Comment:

Replying to [comment:4 glynn]:
> That should be conditionalised upon CAIRO_HAS_XLIB_XRENDER_SURFACE. The
function should be defined in cairo-xlib-xrender.h.

Done in r36922.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/419#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>

#419: cairo compilation error
----------------------+-----------------------------------------------------
  Reporter: neteler | Owner: martinl
      Type: defect | Status: closed
  Priority: major | Milestone: 7.0.0
Component: default | Version: svn-trunk
Resolution: fixed | Keywords:
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Changes (by neteler):

  * status: assigned => closed
  * resolution: => fixed

Comment:

Great, finally it causes no more errors on FC4 with cairo 1.4.4. Hence I
can activate a GRASS 7 Linux binaries weekly cronjob.

Markus

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/419#comment:10&gt;
GRASS GIS <http://grass.osgeo.org>