[GRASS-dev] odd configure error on MacOS X

With this morning's SVN from GRASS 6.5 and 7, I am getting a strange
error on the configure step:

export NAD2BIN=/Library/Frameworks/PROJ.framework/Programs/nad2bin

./configure \
--without-motif --without-glw --without-odbc --without-cairo \
--with-opengl=aqua --enable-sysv --with-x --with-cxx \
--with-freetype --enable-largefile --with-wxwidgets \
--prefix=/Applications --enable-macosx-app --with-macosx-archs=i386 \
--with-includes=/usr/include \
--with-libs=/usr/lib \
--with-proj-includes=/Library/Frameworks/PROJ.framework/unix/include \
--with-proj-libs=/Library/Frameworks/PROJ.framework/unix/lib \
--with-proj-share=/Library/Frameworks/PROJ.framework/Versions/4/Resources/proj \
--with-tiff-includes=/Library/Frameworks/UnixImageIO.framework/Versions/C/unix/include
\
--with-tiff-libs=/Library/Frameworks/UnixImageIO.framework/Versions/C/unix/lib \
--with-png-includes=/Library/Frameworks/UnixImageIO.framework/Versions/C/unix/include
\
--with-png-libs=/Library/Frameworks/UnixImageIO.framework/Versions/C/unix/lib \
--with-postgres \
--with-postgres-includes=/usr/local/pgsql/include \
--with-postgres-libs=/usr/local/pgsql/lib \
--with-sqlite \
--with-sqlite-includes=/Library/Frameworks/SQLite3.framework/Versions/3/unix/include
\
--with-sqlite-libs=/Library/Frameworks/SQLite3.framework/Versions/3/unix/lib \
--with-readline \
--with-readline-includes=/sw/include/readline \
--with-readline-libs=/sw/lib \
#
# these cause errors :
#
--with-cairo \
--with-cairo-includes=/sw/include/cairo \
--with-cairo-libs=/sw/lib \
--with-cairo-ldflags=-lfontconfig

[output truncated ...]

checking whether to use Cairo... yes
checking for location of cairo includes... /sw/include/cairo
checking for cairo.h... yes
checking for location of cairo library... /sw/lib
checking for cairo linking flags... -lfontconfig
checking for cairo_create... no
configure: error: *** Unable to locate .
                                                  ^^^^^ <- this is a
strange error!

Any ideas?

Cheers,
Dylan

Dylan Beaudette wrote:

With this morning's SVN from GRASS 6.5 and 7, I am getting a strange
error on the configure step:

checking for cairo_create... no
configure: error: *** Unable to locate .
                                                  ^^^^^ <- this is a
strange error!

Any ideas?

The error message should have been "Unable to locate cairo_create";
this has been fixed for 7.0 with r47301.

This doesn't affect the fact that you're getting the error, just the
message. Check the bottom of config.log for clues as to why the test
failed.

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

On Thu, Jul 28, 2011 at 9:00 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:

Dylan Beaudette wrote:

With this morning's SVN from GRASS 6.5 and 7, I am getting a strange
error on the configure step:

checking for cairo_create... no
configure: error: *** Unable to locate .
^^^^^ <- this is a
strange error!

Any ideas?

The error message should have been "Unable to locate cairo_create";
this has been fixed for 7.0 with r47301.

This doesn't affect the fact that you're getting the error, just the
message. Check the bottom of config.log for clues as to why the test
failed.

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

Thanks Glynn.
Here is the relevant section from config.log:

------------------------------------------------------------------------------------------------
configure:12938: checking for cairo_create
configure:12964: gcc -o conftest -g -O2 -arch i386 -I/usr/include
   -arch i386 -L/usr/lib conftest.c -L/sw/lib -
lcairo -L/sw/lib -lfontconfig 1>&5
ld: library not found for -lfontconfig
collect2: ld returned 1 exit status
configure: failed program was:
#line 12941 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char cairo_create(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply. */
char cairo_create();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS. Some functions are actually named
    something starting with __ and the normal name is an alias. */
#if defined (__stub_cairo_create) || defined (__stub___cairo_create)
choke me
#else
cairo_create();
#endif

; return 0; }
------------------------------------------------------------------------------------------------

... updated to latest SVN, and now configure outputs a more useful
error message:

configure: error: *** Unable to locate cairo_create.

... removing '--with-cairo-ldflags=-lfontconfig' allows configure to
complete, and running make results in:

gcc -I/usr/include -g -O2 -arch i386 -fno-common -I/usr/include
-I/Users/dylan/src/grass_trunk/dist.i386-apple-darwin9.8.0/include
-I/Users/dylan/src/grass_trunk/dist.i386-apple-darwin9.8.0/include
-D_FILE_OFFSET_BITS=64 -I../driver -I/usr/X11/include/libpng12
-I/usr/X11/include -I/usr/X11/include/freetype2 -I/sw/include
-I/sw/include/cairo -I/sw/include/cairo -I/usr/X11/include
-DUSE_X11=1 -DPACKAGE=\""grasslibs"\"
-I/Users/dylan/src/grass_trunk/dist.i386-apple-darwin9.8.0/include
-I/Users/dylan/src/grass_trunk/dist.i386-apple-darwin9.8.0/include -o
OBJ.i386-apple-darwin9.8.0/Graph.o -c Graph.c
Graph.c:19:23: error: cairo-svg.h: No such file or directory

... look like I need to do some more homework.

Thanks,
Dylan

On Fri, Jul 29, 2011 at 8:34 AM, Dylan Beaudette
<dylan.beaudette@gmail.com> wrote:

On Thu, Jul 28, 2011 at 9:00 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:

Dylan Beaudette wrote:

With this morning's SVN from GRASS 6.5 and 7, I am getting a strange
error on the configure step:

checking for cairo_create... no
configure: error: *** Unable to locate .
^^^^^ <- this is a
strange error!

Any ideas?

The error message should have been "Unable to locate cairo_create";
this has been fixed for 7.0 with r47301.

This doesn't affect the fact that you're getting the error, just the
message. Check the bottom of config.log for clues as to why the test
failed.

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

Thanks Glynn.
Here is the relevant section from config.log:

------------------------------------------------------------------------------------------------
configure:12938: checking for cairo_create
configure:12964: gcc -o conftest -g -O2 -arch i386 -I/usr/include
-arch i386 -L/usr/lib conftest.c -L/sw/lib -
lcairo -L/sw/lib -lfontconfig 1>&5
ld: library not found for -lfontconfig
collect2: ld returned 1 exit status
configure: failed program was:
#line 12941 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char cairo_create(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char cairo_create();

int main() {

/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_cairo_create) || defined (__stub___cairo_create)
choke me
#else
cairo_create();
#endif

; return 0; }
------------------------------------------------------------------------------------------------

... updated to latest SVN, and now configure outputs a more useful
error message:

configure: error: *** Unable to locate cairo_create.

... removing '--with-cairo-ldflags=-lfontconfig' allows configure to
complete, and running make results in:

gcc -I/usr/include -g -O2 -arch i386 -fno-common -I/usr/include
-I/Users/dylan/src/grass_trunk/dist.i386-apple-darwin9.8.0/include
-I/Users/dylan/src/grass_trunk/dist.i386-apple-darwin9.8.0/include
-D_FILE_OFFSET_BITS=64 -I../driver -I/usr/X11/include/libpng12
-I/usr/X11/include -I/usr/X11/include/freetype2 -I/sw/include
-I/sw/include/cairo -I/sw/include/cairo -I/usr/X11/include
-DUSE_X11=1 -DPACKAGE=\""grasslibs"\"
-I/Users/dylan/src/grass_trunk/dist.i386-apple-darwin9.8.0/include
-I/Users/dylan/src/grass_trunk/dist.i386-apple-darwin9.8.0/include -o
OBJ.i386-apple-darwin9.8.0/Graph.o -c Graph.c
Graph.c:19:23: error: cairo-svg.h: No such file or directory

... look like I need to do some more homework.

Thanks,
Dylan

It seems more complicated that I thought. After fixing the includes,
to use the KingChaos Frameworks, recompiling results in:

In file included from Graph.c:19:
/Library/Frameworks/cairo.framework/unix/include/cairo/cairo-svg.h:79:3:
error: #error Cairo was not compiled with support for the svg backend
make: *** [OBJ.i386-apple-darwin9.8.0/Graph.o] Error 1

Can SVG be disabled somehow?

Dylan

On Thu, Jul 28, 2011 at 11:00 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:

Dylan Beaudette wrote:

With this morning's SVN from GRASS 6.5 and 7, I am getting a strange
error on the configure step:

checking for cairo_create... no
configure: error: *** Unable to locate .
^^^^^ <- this is a
strange error!

Any ideas?

The error message should have been "Unable to locate cairo_create";
this has been fixed for 7.0 with r47301.

Backported to 6.4.svn and 6.5.svn

Markus

Dylan Beaudette wrote:

On Fri, Jul 29, 2011 at 8:34 AM, Dylan Beaudette
<dylan.beaudette@gmail.com> wrote:

On Thu, Jul 28, 2011 at 9:00 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:

Dylan Beaudette wrote:

With this morning's SVN from GRASS 6.5 and 7, I am getting a strange
error on the configure step:

checking for cairo_create... no
configure: error: *** Unable to locate .
^^^^^ <- this is a
strange error!

Any ideas?

The error message should have been "Unable to locate cairo_create";
this has been fixed for 7.0 with r47301.

This doesn't affect the fact that you're getting the error, just the
message. Check the bottom of config.log for clues as to why the test
failed.

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

Thanks Glynn.
Here is the relevant section from config.log:

------------------------------------------------------------------------------------------------
configure:12938: checking for cairo_create
configure:12964: gcc -o conftest -g -O2 -arch i386 -I/usr/include
-arch i386 -L/usr/lib conftest.c -L/sw/lib -
lcairo -L/sw/lib -lfontconfig 1>&5
ld: library not found for -lfontconfig
collect2: ld returned 1 exit status
configure: failed program was:
#line 12941 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char cairo_create(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char cairo_create();

int main() {

/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_cairo_create) || defined (__stub___cairo_create)
choke me
#else
cairo_create();
#endif

; return 0; }
------------------------------------------------------------------------------------------------

... updated to latest SVN, and now configure outputs a more useful
error message:

configure: error: *** Unable to locate cairo_create.

... removing '--with-cairo-ldflags=-lfontconfig' allows configure to
complete, and running make results in:

gcc -I/usr/include -g -O2 -arch i386 -fno-common -I/usr/include
-I/Users/dylan/src/grass_trunk/dist.i386-apple-darwin9.8.0/include
-I/Users/dylan/src/grass_trunk/dist.i386-apple-darwin9.8.0/include
-D_FILE_OFFSET_BITS=64 -I../driver -I/usr/X11/include/libpng12
-I/usr/X11/include -I/usr/X11/include/freetype2 -I/sw/include
-I/sw/include/cairo -I/sw/include/cairo -I/usr/X11/include
-DUSE_X11=1 -DPACKAGE=\""grasslibs"\"
-I/Users/dylan/src/grass_trunk/dist.i386-apple-darwin9.8.0/include
-I/Users/dylan/src/grass_trunk/dist.i386-apple-darwin9.8.0/include -o
OBJ.i386-apple-darwin9.8.0/Graph.o -c Graph.c
Graph.c:19:23: error: cairo-svg.h: No such file or directory

... look like I need to do some more homework.

Thanks,
Dylan

It seems more complicated that I thought. After fixing the includes,
to use the KingChaos Frameworks, recompiling results in:

In file included from Graph.c:19:
/Library/Frameworks/cairo.framework/unix/include/cairo/cairo-svg.h:79:3:
error: #error Cairo was not compiled with support for the svg backend
make: *** [OBJ.i386-apple-darwin9.8.0/Graph.o] Error 1

Can SVG be disabled somehow?

There may be a solution using CAIRO_HAS_SVG_SURFACE from cairo-features.h

#if CAIRO_HAS_SVG_SURFACE
#include <cairo-svg.h>
#endif

CAIRO_HAS_SVG_SURFACE is already used elsewhere in Graph.c

Markus M

On Jul 29, 2011, at 3:41 AM, Dylan Beaudette wrote:

It seems more complicated that I thought. After fixing the includes,
to use the KingChaos Frameworks, recompiling results in:

In file included from Graph.c:19:
/Library/Frameworks/cairo.framework/unix/include/cairo/cairo-svg.h:79:3:
error: #error Cairo was not compiled with support for the svg backend
make: *** [OBJ.i386-apple-darwin9.8.0/Graph.o] Error 1

Can SVG be disabled somehow?

Dylan

Odd, my cairo framework svg support. cairo-features.h has:

#define CAIRO_HAS_SVG_SURFACE 1

FYI, I configure GRASS for my cairo framework with (note the *2* include dirs):

--with-cairo --with-cairo-includes="/Library/Frameworks/cairo.framework/unix/include/cairo /Library/Frameworks/cairo.framework/unix/include" --with-cairo-libs=/Library/Frameworks/cairo.framework/unix/lib --with-cairo-ldflags="-lcairo" \

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

Earth: "Mostly harmless"

- revised entry in the HitchHiker's Guide to the Galaxy

Dylan Beaudette wrote:

... removing '--with-cairo-ldflags=-lfontconfig' allows configure to
complete, and running make results in:

Graph.c:19:23: error: cairo-svg.h: No such file or directory

... look like I need to do some more homework.

That header was never conditionalised, as the SVG back-end was assumed
to always be available. Likewise for PostScript and PDF.

In r47311, all of the back-end-specific headers are conditionalised
upon the appropriate feature macros; also, configure explicitly checks
for the various packages (cairo-ps, cairo-pdf, cairo-svg are treated
as separate packages by pkg-config).

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

On Fri, Jul 29, 2011 at 9:11 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:

Dylan Beaudette wrote:

... removing '--with-cairo-ldflags=-lfontconfig' allows configure to
complete, and running make results in:

Graph.c:19:23: error: cairo-svg.h: No such file or directory

... look like I need to do some more homework.

That header was never conditionalised, as the SVG back-end was assumed
to always be available. Likewise for PostScript and PDF.

In r47311, all of the back-end-specific headers are conditionalised
upon the appropriate feature macros; also, configure explicitly checks
for the various packages (cairo-ps, cairo-pdf, cairo-svg are treated
as separate packages by pkg-config).

Should I backport this? I suppose yes.

An observation:
grass70/configure.in" line 1632
[CAIRO_HAS_XRENDER_SURFACE=1],[CAIRO_HAS_XRENDER_SURFACE=])
AC_SUBST(CAIRO_HAS_XRENDER)
LOC_CHECK_FUNC(cairo_xlib_surface_get_xrender_format,$CAIROLIB,
[CAIRO_HAS_XRENDER_SURFACE=1],[CAIRO_HAS_XRENDER_SURFACE=])

while
grass64/configure.in" line 1670
[CAIRO_HAS_XRENDER=1],[CAIRO_HAS_XRENDER=0])
AC_SUBST(CAIRO_HAS_XRENDER)

-> note the =0 in 6.4 while in 7 there is only = for the 0 case.

This looks inconsistent to me.

Markus

Markus Neteler wrote:

An observation:
grass70/configure.in" line 1632
[CAIRO_HAS_XRENDER_SURFACE=1],[CAIRO_HAS_XRENDER_SURFACE=])
AC_SUBST(CAIRO_HAS_XRENDER)
LOC_CHECK_FUNC(cairo_xlib_surface_get_xrender_format,$CAIROLIB,
[CAIRO_HAS_XRENDER_SURFACE=1],[CAIRO_HAS_XRENDER_SURFACE=])

while
grass64/configure.in" line 1670
[CAIRO_HAS_XRENDER=1],[CAIRO_HAS_XRENDER=0])
AC_SUBST(CAIRO_HAS_XRENDER)

-> note the =0 in 6.4 while in 7 there is only = for the 0 case.

This looks inconsistent to me.

This is only used for g.cairocomp, which isn't in 6.x. Makefile
variables are normally empty/non-empty rather than 0/1.

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

On Sun, Jul 31, 2011 at 8:11 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:

Markus Neteler wrote:

An observation:
grass70/configure.in" line 1632
[CAIRO_HAS_XRENDER_SURFACE=1],[CAIRO_HAS_XRENDER_SURFACE=])
AC_SUBST(CAIRO_HAS_XRENDER)
LOC_CHECK_FUNC(cairo_xlib_surface_get_xrender_format,$CAIROLIB,
[CAIRO_HAS_XRENDER_SURFACE=1],[CAIRO_HAS_XRENDER_SURFACE=])

while
grass64/configure.in" line 1670
[CAIRO_HAS_XRENDER=1],[CAIRO_HAS_XRENDER=0])
AC_SUBST(CAIRO_HAS_XRENDER)

-> note the =0 in 6.4 while in 7 there is only = for the 0 case.

This looks inconsistent to me.

This is only used for g.cairocomp, which isn't in 6.x. Makefile
variables are normally empty/non-empty rather than 0/1.

OK, backport done for 6.4 and 6.5.

Markus