Opened 15 years ago

Closed 15 years ago

#419 closed defect (fixed)

cairo compilation error

Reported by: neteler Owned by: martinl
Priority: major Milestone: 7.0.0
Component: Default Version: svn-trunk
Keywords: Cc: grass-dev@…
CPU: x86-32 Platform: Linux

Description

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

Change History (10)

in reply to:  description ; comment:1 by glynn, 15 years ago

Replying to 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.

in reply to:  1 comment:2 by neteler, 15 years ago

Replying to glynn:

Replying to 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).

in reply to:  1 ; comment:3 by mlennert, 15 years ago

Replying to glynn:

Replying to 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.

in reply to:  3 ; comment:4 by glynn, 15 years ago

Replying to 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?

in reply to:  4 ; comment:5 by mlennert, 15 years ago

Replying to glynn:

Replying to 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

in reply to:  5 ; comment:6 by glynn, 15 years ago

Replying to 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.

in reply to:  6 ; comment:7 by mlennert, 15 years ago

Replying to glynn:

Replying to 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

in reply to:  7 comment:8 by glynn, 15 years ago

Replying to 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.

in reply to:  4 comment:9 by martinl, 15 years ago

Cc: grass-dev@… added
Owner: changed from grass-dev@… to martinl
Status: newassigned

Replying to glynn:

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

Done in r36922.

comment:10 by neteler, 15 years ago

Resolution: fixed
Status: assignedclosed

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

Note: See TracTickets for help on using tickets.