RE: [GRASS-user] r.in.xyz: Could open text file ~ 2.5GB

Glynn:

To enable LFS elsewhere, you need to manually add
-D_FILE_OFFSET_BITS=64 to the compilation flags. The simplest approach
is to add:
ifneq ($(USE_LARGEFILES),)
EXTRA_CFLAGS = -D_FILE_OFFSET_BITS=64
endif

to raster/r.in.xyz/Makefile, then repeat the "make" and "make install"
steps.
--
Glynn Clements <glynn@gclements.plus.com>

I tried both adding the test above to r.in.xyz/Makefile, then make and make
install with the same error. I then tried adding -D_FILE_OFFSET_BITS=64 to
the compilation flags:

CFLAGS="-D_FILE_OFFSET_BITS=64"
./configure \
--with-tcltk-includes=/usr/include/tcl8.4 \
--without-postgres \
--with-odbc \
--with-sqlite \
--with-sqlite-includes=/usr/include \
--with-freetype \
--with-freetype-includes=/usr/include/freetype2 \
--with-readline \
--with-cxx \
--with-gdal \
--with-gdal-includes=/usr/local/include \
--enable-largefile \
--with-proj-share=/usr/local/share/proj \
--with-fftw \
--with-opengl \
--with-opengl-includes=/usr/include/GL \
--prefix=/opt --bindir=/opt/bin

Configure meassages related to LFS:
...
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for _LARGE_FILES value needed for large files... no
checking for _LARGEFILE_SOURCE value needed for large files... 1
checking if system supports Large Files at all... yes
...

GRASS is now configured for: i686-pc-linux-gnu

Source directory: /opt/grass6
Build directory: /opt/grass6
Installation directory: /opt/grass-6.3.cvs
Startup script in directory: /opt/bin
C compiler: gcc -g -O2
C++ compiler: c++ -g -O2
FORTRAN compiler:
Building shared libraries: yes
64bit support: no
OpenGL platform: X11

  NVIZ: yes

  BLAS support: no
  C++ support: yes
  DWG support: no
  FFMPEG support: no
  FFTW support: yes
  FreeType support: yes
  GDAL support: yes
  GLw support: no
  JPEG support: yes
  LAPACK support: no
  Large File Support (LFS): yes
  Motif support: no
  MySQL support: no
  NLS support: no
  ODBC support: yes
  OGR support: yes
  OpenGL support: yes
  PNG support: yes
  PostgreSQL support: no
  Python support: no
  Readline support: yes
  SQLite support: yes
  Tcl/Tk support: yes
  TIFF support: yes
  X11 support: yes

No luck here either. r.in.xyz still complains that it can't open the input
file. I checked just in case permissions were an issue, but it's 755, so no
worries there.

~ Eric.

Patton, Eric wrote:

>To enable LFS elsewhere, you need to manually add
>-D_FILE_OFFSET_BITS=64 to the compilation flags. The simplest approach
>is to add:
>ifneq ($(USE_LARGEFILES),)
> EXTRA_CFLAGS = -D_FILE_OFFSET_BITS=64
>endif

>to raster/r.in.xyz/Makefile, then repeat the "make" and "make install"
>steps.

I tried both adding the test above to r.in.xyz/Makefile, then make and make
install with the same error. I then tried adding -D_FILE_OFFSET_BITS=64 to
the compilation flags:

Does the switch show up in the "make" output?

No luck here either. r.in.xyz still complains that it can't open the input
file. I checked just in case permissions were an issue, but it's 755, so no
worries there.

Er, the file *is* in the current directory, right? Not the mapset
directory or some other directory?

Could you make the following change to r.in.xyz:

     /* open input file */
     if((in_fd = fopen(infile, "r" )) == NULL )
+ {
+ perror("fopen error");
   G_fatal_error(_("Could not open input file <%s>."), infile);
+ }

     if(scan_flag->answer) {
   if( zrange_opt->answer )

and provide the error message which is printed?

--
Glynn Clements <glynn@gclements.plus.com>