[GRASS-dev] 7.svn fails to build from source

Glynn Clements glynn at gclements.plus.com
Mon Jul 20 22:58:54 EDT 2009


Hamish wrote:

> > > many/most modules fail to build with:
> > > [...]
> > > main.c:45: undefined reference to `G_add_keyword'
> > > 
> > > it seems to be there in gisdefs.h ..... ??
> 
> Glynn: 
> > Defined in lib/gis/parser.c. This suggests that it's linking against
> > an old version of the library.
> 
> .... the Debian/stable grass package (v6.2.3) ships with a
> /etc/ld.so.conf.d/grass.conf file which adds /usr/lib/grass/lib
> to the library search path. Apparently it has been like that for years
> without conflict, I wonder why that becomes a problem only now?
> Or is that a red herring and something else is the problem?

I suspect that's a red herring; if it was linking against 6.2.3, you
would have many more such errors, e.g. missing G__gisinit.

> gcc -L/usr/local/src/grass/svn/trunk/dist.x86_64-unknown-linux-gnu/lib -L/usr/local/src/grass/svn/trunk/dist.x86_64-unknown-linux-gnu/lib -Wl,--export-dynamic -Wl,-rpath-link,/usr/local/src/grass/svn/trunk/dist.x86_64-unknown-linux-gnu/lib   -o /usr/local/src/grass/svn/trunk/dist.x86_64-unknown-linux-gnu/bin/db.drivers OBJ.x86_64-unknown-linux-gnu/main.o  -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime    -lgrass_gis -lgrass_datetime    -lgrass_dbmibase -lgrass_gis -lgrass_datetime     -lgrass_gis -lgrass_datetime   -lgrass_datetime  -lm  
> OBJ.x86_64-unknown-linux-gnu/main.o: In function `parse_command_line':
> /usr/local/src/grass/svn/trunk/db/db.drivers/main.c:74: undefined reference to `G_add_keyword'
> /usr/local/src/grass/svn/trunk/db/db.drivers/main.c:75: undefined reference to `G_add_keyword'
> collect2: ld returned 1 exit status
> make: *** [/usr/local/src/grass/svn/trunk/dist.x86_64-unknown-linux-gnu/bin/db.drivers] Error 1
> 
> 
> svn/trunk/dist.x86_64-unknown-linux-gnu/lib$ ldd libgrass_gis.so 

What about:

	nm -D libgrass_gis.so | fgrep G_add_keyword

?

>         linux-vdso.so.1 =>  (0x00007fffb79ff000)
> ! ->    libgrass_datetime.so => /usr/lib/grass/lib/libgrass_datetime.so (0x00007fdbaf4e5000)

That's not necessarily an issue. When you start GRASS, it adds
$GISBASE/lib to DYLD_LIBRARY_PATH. Outside of GRASS, you would expect
to see "=> not found" if you didn't have some other version of GRASS
installed.

> same for grass65 outside of GRASS, but from inside a GRASS 6.5 session
> ldd shows the correct library path. (because $LD_LIBRARY_PATH takes
> precedence over /etc/ld.so.conf?)

Yes.

> > Don't use --with-geos.
> 
> ok, builds then. Is there a minimum GEOS version it needs?
> REQUIREMENTS.html didn't mention it.

No idea.

> It does get past all the ./configure checks:

That is my experience.

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


More information about the grass-dev mailing list