Some Fortran programs require output
(writes) to be flushed to the operating system (under UNIX,
via the fflush()
library call) so that errors,
such as disk full, are immediately flagged via the relevant
ERR=
and IOSTAT=
mechanism, instead of such
errors being flagged later as subsequent writes occur, forcing
the previously written data to disk, or when the file is
closed.
Essentially, the difference can be viewed as synchronous error reporting (immediate flagging of errors during writes) versus asynchronous, or, more precisely, buffered error reporting (detection of errors might be delayed).
libf2c
supports flagging write errors immediately when
it is built with the `ALWAYS_FLUSH' macro defined.
This results in a libf2c
that runs slower, sometimes
quite a bit slower, under certain circumstances--for example,
accessing files via the networked file system NFS--but the
effect can be more reliable, robust file I/O.
If you know that Fortran programs requiring this level of precision
of error reporting are to be compiled using the
version of g77
you are building, you might wish to
modify the g77
source tree so that the version of
libf2c
is built with the `ALWAYS_FLUSH' macro
defined, enabling this behavior.
To do this, find this line in `f/runtime/configure.in' in
your g77
source tree:
dnl AC_DEFINE(ALWAYS_FLUSH)
Remove the leading `dnl ', so the line begins with
`AC_DEFINE(', and run autoconf
in that file's directory.
(Or, if you don't have autoconf
, you can modify `f2c.h.in'
in the same directory to include the line `#define ALWAYS_FLUSH'
after `#define F2C_INCLUDE'.)
Then build or rebuild g77
as appropriate.
Go to the first, previous, next, last section, table of contents.