[GRASS5] [bug #3974] (grass) r.mapcalc/libgis failure with LFS enabled

Markus Neteler neteler at itc.it
Thu Jan 12 10:39:10 EST 2006


On Wed, Jan 11, 2006 at 06:47:07PM +0000, Glynn Clements wrote:
> 
> Markus Neteler via RT wrote:
> 
> > As (indirectly) suggested, I have added
> > #include "config.h"
> > 
> > to:
> > 
> > ./raster3d/r3.in.v5d/v5d.c
> > ./raster3d/r3.out.v5d/v5d.c
> > ./raster/r.thin/io.c
> > ./lib/gis/opencell.c
> > ./lib/image/rdwr.c
> > ./lib/segment/seek.c
> > 
> > as 'off_t' is used in these files.
> > 
> > The problem seems to persist, though.
> 
> I note that gis.h includes config.h, but it does so after it includes
> stdio.h. That may have an impact.
> 
> Also, it's possible that some code is assuming that an off_t is the
> same size as a long.
> 
> I'd suggest that it's likely to be simpler to change the way that
> large file support is implemented so that it only applies to source
> files which specifically allow for it.
> 
> I.e. rather than setting _FILE_OFFSET_BITS in config.h, define a
> separate macro (e.g. GRASS_LARGEFILE) and modify specific source files
> to do:
> 
> 	#ifdef GRASS_LARGEFILE
> 	#define _FILE_OFFSET_BITS 64
> 	#endif
> 
> before including any headers.
> 
> The most obvious candidates are the files containing the core raster
> I/O code (opencell.c, get_row.c, put_row.c, format.c).
>

I will leave these fixes to the original author(s) of LFS
support in GRASS since I don't know enough about these details.

Markus




More information about the grass-dev mailing list