* Large file suppport in g77?
@ 2000-07-31 6:57 Giacomo Mulas
2000-07-31 12:12 ` Toon Moene
0 siblings, 1 reply; 2+ messages in thread
From: Giacomo Mulas @ 2000-07-31 6:57 UTC (permalink / raw)
To: gcc
Hello, I have to handle files larger than 2Gbytes on an x86
computer running Linux. The current test kernels (v2.4.0-test) do support
the Large File Summit (LFS) on x86, as does the current 2.1.3 version of
glibc. To enable LFS support one has to compile the library on a computer
running such a kernel, and afterwards define some macro symbols in the C
program to be compiled (as documented in glibc docs). I have tested this
and it works well, apparently.
However, it seems to only work with C programs, and I also have to
compile some Fortran code. How can I get g77 to use the LFS
extensions? Would somebody even just point me to some document, HOWTO, FAQ
or web page in which this is explained?
Thanks
Giacomo Mulas
________________________________________________________________________
Giacomo Mulas <gmulas@ca.astro.it, gmulas@tiscalinet.it, gmulas@eso.org>
________________________________________________________________________
OSSERVATORIO ASTRONOMICO
Str. 54, Loc. Poggio dei Pini * 09012 Capoterra (CA)
Tel.: +39 070 71180 216 Fax : +39 070 71180 222
________________________________________________________________________
"When the storms are raging around you, stay right where you are"
(Freddy Mercury)
________________________________________________________________________
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Large file suppport in g77?
2000-07-31 6:57 Large file suppport in g77? Giacomo Mulas
@ 2000-07-31 12:12 ` Toon Moene
0 siblings, 0 replies; 2+ messages in thread
From: Toon Moene @ 2000-07-31 12:12 UTC (permalink / raw)
To: Giacomo Mulas; +Cc: gcc
Giacomo Mulas wrote:
> Hello, I have to handle files larger than 2Gbytes on an x86
> computer running Linux. The current test kernels (v2.4.0-test) do support
> the Large File Summit (LFS) on x86, as does the current 2.1.3 version of
> glibc. To enable LFS support one has to compile the library on a computer
> running such a kernel, and afterwards define some macro symbols in the C
> program to be compiled (as documented in glibc docs). I have tested this
> and it works well, apparently.
> However, it seems to only work with C programs, and I also have to
> compile some Fortran code. How can I get g77 to use the LFS
> extensions? Would somebody even just point me to some document, HOWTO, FAQ
> or web page in which this is explained?
A week ago I sent the following to gcc-bugs@gcc.gnu.org, which explains
it in enough detail, I think:
<QUOTE>
Yosuke Toh wrote:
> Do the g77(v0.5.24) support for reading from a over 2Gbyte file?
> (My program is run on FreeBSD(3.3).)
> This program can read under 2Gbyte.
> But over 2Gbyte, can't do it.
>
> open and read
>
> open(15,file=open_file,access='direct',recl=bufferdatasize*2,err=
> 9029,status='old',iostat=iosopen)
> read(15,rec=renum,err= 9029,iostat=iosread)(data(i),i=1,bufferdatasize)
>
> When 'rec=renum' is extend to 2Gbyte, 'iostat=iosread' return to -1.
Hmmm, when I tried to write over 2 Gbyte, using this program:
PARAMETER (NRECLN=250 000, NRECS=2 500)
REAL A(NRECLN)
DO I = 1, NRECLN
A(I) = I
ENDDO
OPEN(UNIT=1,ACCESS='DIRECT',RECL=4*NRECLN,STATUS='UNKNOWN')
DO I = 1, NRECS
WRITE(UNIT=1,REC=I,IOSTAT=IOS) A
IF (IOS .NE. 0) THEN
PRINT*,'WRITE FAILED, REC=',I,' IOSTAT=',IOS
GOTO 10
ENDIF
ENDDO
10 CONTINUE
CLOSE(UNIT=1)
END
on i686-pc-linux-gnu, it also failed to write more than 2 Gbyte:
$ ls -l /tmp/aap
-rw-rw-r-- 1 toon toon 2147483647 Jul 26 15:25 /tmp/aap
Unfortunately, it didn't give an error indication (it just completed
"normally" :-(). This was using the g77-0.5.25 that's in gcc-2.95.2.
On alphaev6-unknown-linux-gnu (a machine with 64-bit sizes and offsets)
the above program with NRECS=5 000 was able to create the correctly
sized file:
ls -l /tmp/aap
-rw-rw-r-- 1 toon toon 5000000000 Jul 26 16:10 /tmp/aap
So most probably the limitation is inside the libf2c run time library,
that uses `long' variables for I/O sizes and offsets - which is 32 bits
on an Intel PC and 64 bits on Alpha.
</QUOTE>
> "When the storms are raging around you, stay right where you are"
> (Freddy Mercury)
You can leave _that_ to us, meteorologists ...
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://g95.sourceforge.net/ (under construction)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-07-31 12:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-31 6:57 Large file suppport in g77? Giacomo Mulas
2000-07-31 12:12 ` Toon Moene
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).