[GRASS-dev] Re: [GRASS-SVN] r51583 - grass/trunk/vector/v.buffer

Hi,

On Tue, May 1, 2012 at 10:37 AM, <svn_grass@osgeo.org> wrote:

Author: mmetz
Date: 2012-05-01 01:37:26 -0700 (Tue, 01 May 2012)
New Revision: 51583

Modified:
grass/trunk/vector/v.buffer/Makefile
Log:
add again GEOSLIBS ??? should be included by VECTORLIB

I have this:

[neteler@north grass70]$ grep geos include/Make/*
include/Make/Platform.make:GEOSLIBS = -L/usr/lib64 -lgeos -lgeos_c

but without GEOSLIBS in the Makefile of v.buffer I get this error:

gcc -g -Wall -fno-common -fexceptions -mtune=nocona -m64
-minline-all-stringops
-I/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include
-I/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include
-D_FILE_OFFSET_BITS=64 -I/usr/include/gdal -I/usr/include
-DPACKAGE=\""grassmods"\"
-I/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include
-I/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/include -o
OBJ.x86_64-unknown-linux-gnu/geos.o -c geos.c
: && gcc -L/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/lib
-L/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/lib
-Wl,--no-undefined -Wl,--export-dynamic -L/usr/lib64
-Wl,-rpath-link,/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/lib
-o /home/neteler/grass70/dist.x86_64-unknown-linux-gnu/bin/v.buffer
OBJ.x86_64-unknown-linux-gnu/main.o
OBJ.x86_64-unknown-linux-gnu/geos.o -lgrass_vector.7.0.svn
-lgrass_dbmiclient.7.0.svn -lgrass_dbmibase.7.0.svn
-lgrass_gis.7.0.svn -lm -lm
/usr/bin/ld: OBJ.x86_64-unknown-linux-gnu/main.o: undefined reference
to symbol 'GEOSBufferParams_create'
/usr/bin/ld: note: 'GEOSBufferParams_create' is defined in DSO
/usr/lib64/libgeos_c.so.1 so try adding it to the linker command line
/usr/lib64/libgeos_c.so.1: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make: *** [/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/bin/v.buffer]
Error 1

Using Fedora 16, 64bit with geos from their RPM.

A related page:
http://fedoraproject.org/wiki/UnderstandingDSOLinkChange

Since you also have Fedora16, I wonder why it compiles for you and not for me
without GEOSLIBS in the Makefile of v.buffer.

Markus

Markus Neteler wrote:

> Author: mmetz
> Date: 2012-05-01 01:37:26 -0700 (Tue, 01 May 2012)
> New Revision: 51583
>
> Modified:
> grass/trunk/vector/v.buffer/Makefile
> Log:
> add again GEOSLIBS ??? should be included by VECTORLIB

I have this:

[neteler@north grass70]$ grep geos include/Make/*
include/Make/Platform.make:GEOSLIBS = -L/usr/lib64 -lgeos -lgeos_c

If you add the -i flag (ignore case), you would get many more matches,
including:

include/Make/Grass.make:VECT_CFLAGS = $(GDALCFLAGS) $(GEOSCFLAGS)
include/Make/Grass.make:VECTORDEPS = $(DBMILIB) $(GRAPHLIB) $(DIG2LIB) $(LINKMLIB) $(RTREELIB) $(GISLIB) $(GEOSLIBS) $(GDALLIBS) $(MATHLIB) $(BTREE2LIB) $(GPROJLIB) $(RASTERLIB) $(PQLIBPATH) $(PQLIB)

but without GEOSLIBS in the Makefile of v.buffer I get this error:

/usr/bin/ld: OBJ.x86_64-unknown-linux-gnu/main.o: undefined reference
to symbol 'GEOSBufferParams_create'

If GRASS was configured --with-geos, GEOS should be pulled in by
libgrass_vector.so. It's possible that you're linking against a
version of libgrass_vector which was built without GEOS support, or
which was linked against a different major version of the GEOS
library.

OTOH, as v.buffer is now using GEOS directly, $(GEOSLIBS) and
$(GEOSCFLAGS) should be used in v.buffer/Makefile. While this
shouldn't be necessary on Linux, I suspect that it is necessary on
Windows.

For me, the current v.buffer doesn't even compile, due to
GEOSBufferParams not being defined in any GEOS header (presumably it
needs a more recent version of GEOS).

Since you also have Fedora16, I wonder why it compiles for you and not for me
without GEOSLIBS in the Makefile of v.buffer.

Probably because either:

1. If shared libraries are used, GEOS should get pulled in
automatically as a dependency of libgrass_vector.so.

2. If static libraries are used, $(VECTORDEPS) (which includes
$(GEOSLIBS)) will be added to the definition of VECTORLIB.

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

On Tue, May 1, 2012 at 5:01 PM, Glynn Clements <glynn@gclements.plus.com> wrote:

Markus Neteler wrote:

> Author: mmetz
> Date: 2012-05-01 01:37:26 -0700 (Tue, 01 May 2012)
> New Revision: 51583
>
> Modified:
> grass/trunk/vector/v.buffer/Makefile
> Log:
> add again GEOSLIBS ??? should be included by VECTORLIB

I have this:

[neteler@north grass70]$ grep geos include/Make/*
include/Make/Platform.make:GEOSLIBS = -L/usr/lib64 -lgeos -lgeos_c

If you add the -i flag (ignore case), you would get many more matches,
including:

include/Make/Grass.make:VECT_CFLAGS = $(GDALCFLAGS) $(GEOSCFLAGS)
include/Make/Grass.make:VECTORDEPS = $(DBMILIB) $(GRAPHLIB) $(DIG2LIB) $(LINKMLIB) $(RTREELIB) $(GISLIB) $(GEOSLIBS) $(GDALLIBS) $(MATHLIB) $(BTREE2LIB) $(GPROJLIB) $(RASTERLIB) $(PQLIBPATH) $(PQLIB)

but without GEOSLIBS in the Makefile of v.buffer I get this error:

/usr/bin/ld: OBJ.x86_64-unknown-linux-gnu/main.o: undefined reference
to symbol 'GEOSBufferParams_create'

make distclean
svn up
./configure
make

...should help

OTOH, as v.buffer is now using GEOS directly, $(GEOSLIBS) and
$(GEOSCFLAGS) should be used in v.buffer/Makefile. While this
shouldn't be necessary on Linux, I suspect that it is necessary on
Windows.

Added to Makefile, just to be safe.

For me, the current v.buffer doesn't even compile, due to
GEOSBufferParams not being defined in any GEOS header (presumably it
needs a more recent version of GEOS).

GEOSBufferParams has been introduced with GEOS version 3.3.0 which has
been released in 2008, not exactly brand new... Anyway, I have removed
GEOSBufferParams from v.buffer and made v.buffer use another buffer
function that is also present in older versions of GEOS.

Markus M

On Tue, May 1, 2012 at 8:19 PM, Markus Metz
<markus.metz.giswork@googlemail.com> wrote:

On Tue, May 1, 2012 at 5:01 PM, Glynn Clements <glynn@gclements.plus.com> wrote:

...

but without GEOSLIBS in the Makefile of v.buffer I get this error:

/usr/bin/ld: OBJ.x86_64-unknown-linux-gnu/main.o: undefined reference
to symbol 'GEOSBufferParams_create'

make distclean
svn up
./configure
make

...should help

Of course I did that :slight_smile: It doesn't on my F16 box unless GEOSLIBS is
defined in the Makefile. Since it is there now, solved.

Markus