[GRASS5] compiling code

Paul Kelly paul-grass at stjohnspoint.co.uk
Tue May 6 14:28:19 EDT 2003


On Tue, 6 May 2003, John Gillette wrote:

> When I try to compile outside of grass, fseek, fopen
> printf, etc need stdio.h.
>
> gcc -g -Wall -D__USE_FIXED_PROTOTYPES__ -ansi test.c
>
> How is that being included in Grass code?

stdio.h is included in gis.h. But in my experience lots of GRASS programs
are missing header files. It is usually more recent additions however, not the
older ones.

> Also, the coordinate conversion library "CC.h", has
> this usage changed now that we are going to use the standard
> proj4 library?  Do you call proj4 routines directly?

In my opinion any module that uses the CC_ functions is seriously
out-of-date and a candidate for updating, possibly in other ways as well.
You may look at d.where in the CVS for an example of upgrading a module
from coorcnv to proj usage, which I did recently. The programmers'
manual is currently a little out-of-date on proj usage. It is suspicious
also that an import module should use coorcnv as it should really import
the data into a location that matches the projection of the original data
and then v.proj can be used to re-project it if needed.

If we have a list of which modules that currently use coorcnv are going to be
kept in GRASS 5.1 (i.e. it is worthwhile updating them) I could maybe work
at changing them over to using proj instead, although it may take a while
to get round to them all.

Paul




More information about the grass-dev mailing list