[GRASS-dev] problem building grass trunk

Glynn Clements glynn at gclements.plus.com
Tue Oct 20 10:37:07 EDT 2009

Stefano Salvador wrote:

> I'm trying to compile revision 39598 of grass trunk but I get a list
> of undefined symbol for almost all modules, the output of make is:

> if I run make in the first library with errors I get:

> -lgrass_ -lgrass_ -lgrass_ -lgrass_

Well, that's where it's going wrong.

I suspect that it's related to r38871, which uses $(eval $(call ...)) 
to define the *_LIBNAME, *LIB and *DEP variables:

	libs = \
		ARRAYSTATS:arraystats \
		BASIC:basic \
		BITMAP:bitmap \
	define lib_rules
	$(1)_LIBNAME = grass_$(2)
	ifneq ($(NEED_DEPS),)
	$(1)LIB = -l$$($(1)_LIBNAME) $$($(1)DEPS)
	$(1)LIB = -l$$($(1)_LIBNAME)
	ifneq ($(1),IOSTREAM)
	$(foreach lib,$(libs),$(eval $(call lib_rules,$(firstword $(subst :, ,$(lib))),$(lastword $(subst :, ,$(lib))))))

It looks as if $(1) is set okay, but $(2) is empty, so all of the
*_LIBNAME variables are being set to "grass_". You can confirm this by
using the -p switch (e.g. "make -p -C lib/form"), which will print all
of the variable definitions.

> the system is SUSE 10 with gcc 4.1, I have removed each previous
> installation of grass.

FWIW, it works for me with make 3.81 (and presumably for everyone else
who has compiled it in the last month). My first guess would be an
issue with your version of make; which version are you using?

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list