[GRASS-dev] Re: [GRASS-SVN] r38872 - grass/trunk
glynn at gclements.plus.com
Wed Aug 26 16:33:24 EDT 2009
Martin Landa wrote:
> > Author: glynn
> > Date: 2009-08-26 08:41:06 -0400 (Wed, 26 Aug 2009)
> > New Revision: 38872
> > Modified:
> > grass/trunk/configure
> > grass/trunk/configure.in
> > Log:
> > Revert r38867 (bogus GEOM check)
> can you explain why it's bogus. Now configuration fails with
> checking for geos-config... /usr/local/bin/geos-config
> checking for geos_c.h... yes
> checking for GEOSGeom_createLinearRing in -lgeos... no
> configure: error: *** Unable to locate GEOS library.
It's bogus insofar as the check succeeds but GRASS fails to compile
due to GEOS-related errors. Checks are, well, checks; they're supposed
to fail if everything isn't in order.
[However I have just discovered that the problems aren't related to
the libraries, only the headers. IOW, the check wasn't specifically
wrong, just insufficient; but it turns out to be easier to make GEOS
2.x work than to detect and avoid it.]
Although, my errors weren't those in Markus' original post; instead:
make: Entering directory `/usr/local/src/grass/svn/lib/vector/diglib'
test -d OBJ.i686-pc-linux-gnu || mkdir -p OBJ.i686-pc-linux-gnu
gcc -I/usr/local/src/grass/svn/dist.i686-pc-linux-gnu/include -I/usr/local/src/grass/svn/dist.i686-pc-linux-gnu/include -g -Wall -Wno-parentheses -Wno-format-zero-length -fPIC -I/usr/local/include -I/usr/include -D_FILE_OFFSET_BITS=64 -DPACKAGE=\""grasslibs"\" -I/usr/local/src/grass/svn/dist.i686-pc-linux-gnu/include -I/usr/local/src/grass/svn/dist.i686-pc-linux-gnu/include -o OBJ.i686-pc-linux-gnu/allocation.o -c allocation.c
In file included from allocation.c:21:
/usr/local/src/grass/svn/dist.i686-pc-linux-gnu/include/grass/vector.h:479: error: syntax error before '*' token
/usr/local/src/grass/svn/dist.i686-pc-linux-gnu/include/grass/vector.h:479: warning: type defaults to `int' in declaration of `Vect_read_line_geos'
/usr/local/src/grass/svn/dist.i686-pc-linux-gnu/include/grass/vector.h:479: warning: data definition has no type or storage class
/usr/local/src/grass/svn/dist.i686-pc-linux-gnu/include/grass/vector.h:483: error: syntax error before '*' token
/usr/local/src/grass/svn/dist.i686-pc-linux-gnu/include/grass/vector.h:483: warning: type defaults to `int' in declaration of `Vect_get_isle_points_geos'
/usr/local/src/grass/svn/dist.i686-pc-linux-gnu/include/grass/vector.h:483: warning: data definition has no type or storage class
Lines 479-483 of vector.h are:
GEOSGeometry *Vect_read_line_geos(struct Map_info *, int, int*);
GEOSGeometry *Vect_line_to_geos(struct Map_info *, const struct line_pnts*, int);
GEOSGeometry *Vect_read_area_geos(struct Map_info *, int);
GEOSCoordSequence *Vect_get_area_points_geos(struct Map_info *, int);
GEOSCoordSequence *Vect_get_isle_points_geos(struct Map_info *, int);
The error indicates that it doesn't understand the types. No surprise
there, as neither GEOSGeometry nor GEOSCoordSequence appear in my
version of geos_c.h (GEOS 2.2.3). However, it does have:
typedef struct GEOSGeom_t *GEOSGeom;
typedef struct GEOSCoordSeq_t *GEOSCoordSeq;
If I add typedefs for GEOSGeometry and GEOSCoordSeq, everything
[I have no idea whether it works, but it compiles, and doesn't appear
to break anything.]
I've committed r38878, which restores the configure checks, and adds
adds workarounds for the issues with GEOS 2.x. Someone needs to check
that these don't break 3.x.
> initGEOS or GEOSGeom_createLinearRing are defined in GEOS C API (geos_c)...
Right; those are there. I had the impression that this was a
3.x-specific symbol; and much confusion ensued.
 Mainly from:
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev