[GRASS-dev] Re: [GRASS-user] problems with r.cost
woklist at kyngchaos.com
Wed May 23 23:44:05 EDT 2007
On May 23, 2007, at 10:09 PM, Glynn Clements wrote:
> William Kyngesburye wrote:
>> The need for FILE_OFFSET_BITS and its many variations should be
>> discovered by configure, and whatever is needed by a platform is set
>> in config.h, so this setting here is redundant and possibly
>> meaningless on some platforms.
> The settings in config.h are conditionalised upon USE_LARGEFILES,
> which is never defined automatically.
> If you want LFS, you have to add the relevant flags in the
> corresponding Makefile. But first you need to ensure that the code is
> actually safe for LFS (i.e. it doesn't use ANSI stdio functions or
> store offsets in variables smaller than an off_t) if you don't want
> corrupted files.
>> (OSX doesn't need any of the macros set, and supports large files by
> Unfortunately, much of GRASS doesn't support LFS (especially, but not
> exclusively, on platforms where sizeof(long) < sizeof(off_t)), so
> enabling it globally is dangerous. That's why you normally have to
> specifically enable it with _FILE_OFFSET_BITS etc.
> On platforms with a 64-bit "long", you only have to worry about "bad"
> code (storing or computing offsets using "int"); even so, GRASS isn't
> entirely free from bad code.
Hm, maybe I've been lucky. I used to manually add
_FILE_OFFSET_BITS=64 to my CFLAGS, but stopped doing that a while
back. I've been working with >4GB rasters successfully, but I
haven't used the more specialized commands like r.cost. I haven't
used --enable-largefile thinking it was enabled if the platform
supported it. hmmm.
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
[Trillian] What are you supposed to do WITH a maniacally depressed
[Marvin] You think you have problems? What are you supposed to do
if you ARE a maniacally depressed robot? No, don't try and answer,
I'm 50,000 times more intelligent than you and even I don't know the
- HitchHiker's Guide to the Galaxy
More information about the grass-dev