[GRASS5] Just some questions

Glynn Clements glynn.clements at virgin.net
Wed Nov 12 23:36:32 EST 2003


Jens Oberender wrote:

> > > Looks like I were pert and premature with my mail.
> > > I only compiled 5.0.3 and 5.3-snapshot. 5.7-snapshot didn't compile,
> > > but I
> > 
> > Why? Error (please post to the list)?
> 
> Here is the Error:
> 
> make[2]: Entering directory
> `/usr/src/packages/BUILD/grass57_exp_2003_11_08/lib/gis'
> gcc -I/usr/src/packages/BUILD/grass57_exp_2003_11_08/include
> -I/usr/src/packages/BUILD/grass57_exp_2003_11_08/dist.i686-pc-linux-gnu/i
> nclude -O2 -g -march=i586 -mcpu=i686 -fmessage-length=0  -Wall
> -Wconversion -Wno-implicit-int   -fPIC   
> -I/usr/src/packages/BUILD/grass57_exp_2003_11_08/include
> -I/usr/src/packages/BUILD/grass57_exp_2003_11_08/dist.i686-pc-linux-gnu/i
> nclude \
>         -o OBJ.i686-pc-linux-gnu/adj_cellhd.o -c adj_cellhd.c
> adj_cellhd.c: In function `G_adjust_Cell_head':
> adj_cellhd.c:44: error: `PACKAGE' undeclared (first use in this function)
> adj_cellhd.c:44: error: (Each undeclared identifier is reported only once
> adj_cellhd.c:44: error: for each function it appears in.)

This is related to the NLS support.

> And the configure I use:
> 
> ./configure --with-postgres-includes='/usr/include/pgsql
> /usr/include/pgsql/libpq /usr/include/pgsql/server' --with-freetype
> --with-lapack --with-blas --with-readline --with-dbm --with-cxx
> --with-freetype-includes=/usr/include/freetype2 --with-motif
> --with-motif-includes=/usr/X11R6/include --with-glw --with-nls --with-gdal
> --with-grass50=/usr/src/packages/BUILD/grass53_exp_2003_11_08

Don't use --with-nls; the 5.7 Makefiles don't define the PACKAGE macro
which that feature requires (see glocale.h).

> > > The problem with building shared (5.0) is, that some stuff isn't
> > > build, for example the man pages aren't created.
> > 
> > Are you sure?
> > Try
> >  grep html src/CMD/lists/GRASS
> > 
> > should print 'html'. If not, you are right (then post it to the list).
> 
> It prints html, but it isn't built!
> The error is here:
> 
> mk/Makefile.in:
> 
> binaries:
>         @echo "making binaries ..."
>         echo "Start of compilation: "`date` > ${ERROR_LOG}
>         -cat ${SRCDIR}/src/CMD/lists/GRASS ${DSTDIR}/src/CMD/lists/optional | \
>                 grep -v '^ *#' | grep -v '^ *$$' | grep -v '^html$$' | \
>                 while read dir ; do \
>                         mkdir -p $$dir ; \
>                         ${MAKE} -I${DSTDIR}/mk -I${SRCDIR}/mk -C ${SRCDIR}/$$dir -f makefile || \
>                                 echo "Compilation error in module: $$dir" >> ${ERROR_LOG} ; \
>                 done
>         echo "End of compilation:   "`date` >> ${ERROR_LOG}

The "binaries" target explicitly excludes the html directory from the
list of modules to build. The documentation is built by the
"documents" target using Makefile.docs:

documents:
	${MAKE} -I${DSTDIR}/mk -I${SRCDIR}/mk -f ${SRCDIR}/mk/Makefile.docs documents

Note that the "documents" target is included in the "all" target
("all" is the default target):

all: dirs gmake binaries links documents

The rationale behind this is twofold:

1. html/Gmakefile is highly bogus; specifically:

	    	F_MOD_TIME=`${GISBASE}/etc/getModTime $$f`; \
	    	H_MOD_TIME=`${GISBASE}/etc/getModTime $$h`; \
		if [ ! -f $$f -o $$H_MOD_TIME -gt $$F_MOD_TIME ]; then echo Generating: $$f; cp -p $$h $$f; fi; \
and:
	    	F_MOD_TIME=`${GISBASE}/etc/getModTime $$f`; \
	    	H_MOD_TIME=`${GISBASE}/etc/getModTime $$h`; \
		if [ ! -f $$f -o $$H_MOD_TIME -gt $$F_MOD_TIME ]; then echo Generating: $$f; cat $$h|sed 's at html/@@' > $$f; fi; \

Execute a program to get the last-modified time of the source file. Do
the same to get the last-modified time of the output file. Only
execute the command if either the output file doesn't exist or it's
older than the input file.

Isn't there a dedicated program to do this sort of thing? What's it
called? Oh, that's right; it's called "make".

Not only is the above (i.e. expressing the very essence of "make" as a
make rule) so ... well, for want of a better term, obscene, but on
Cygwin, it's incredibly slow (Cygwin's fork()/exec() are around a
hundred times slower than on a real Unix, so adding two additional
commands per file to do something which is meant to be done
internally by make results in a serious performance hit).

2. When I'm doing modify-build-test cycles, I don't really need to
build the documentation every time. By moving the documentation to a
separate target, I can skip it. And even if I do build the
documentation, it's built last, so I can start using the new build
while the documentation is still being built. OTOH, the html directory
is the second entry in src/CMD/list/GRASS (after src/libes/tools,
which is where getModTime lives).

> > > > > What about cleaning these things up and using GNU autotools for
> > > > > building.
> > > > 
> > > > See this comment:
> > > > http://grass.itc.it/pipermail/grass5/2002-April/009033.html
> > > 
> > > To fix that problem with building shared I worked my way through the
> > > Makefiles.
> > > And that was very complicating.
> > 
> > Yes, the Makefile system in 5.0/5.3 is a nightmare.

Which one? The gmake5 system, or the "mk" system, or both?

As far as the gmake5 system is concerned, we could abandon that now if
we were willing to require GNU make. Also, the "mk" system is
currently constrained by the need to coexist with the gmake5 system.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list