Category : C Source Code
Archive   : F2CSRC.ZIP
Filename : README

 
Output of file : README contained in archive : F2CSRC.ZIP
If your system lacks onexit() and you are not using an ANSI C
compiler, then you should compile main.c with NO_ONEXIT defined.
See the comments about onexit in the makefile.

If your system has a double drem() function such that drem(a,b)
is the IEEE remainder function (with double a, b), then you may
wish to compile r_mod.c and d_mod.c with IEEE_drem defined.

To check for transmission errors, issue the command
make check
This assumes you have the xsum program whose source, xsum.c,
is distributed as part of "all from f2c/src". If you do not
have xsum, you can obtain xsum.c by sending the following E-mail
message to [email protected]
send xsum.c from f2c/src

The makefile assumes you have installed f2c.h in a standard
place (and does not cause recompilation when f2c.h is changed);
f2c.h comes with "all from f2c" (the source for f2c) and is
available separately ("f2c.h from f2c").
If your system lacks /usr/include/local.h ,
then you should create an appropriate local.h in
this directory. An appropriate local.h may simply
be empty, or it may #define VAX or #define CRAY
(or whatever else you must do to make fp.h work right).
Alternatively, edit fp.h to suite your machine.

If your system lacks /usr/include/fcntl.h , then you
should simply create an empty fcntl.h in this directory.

If your system's sprintf does not work the way ANSI C
specifies -- specifically, if it does not return the
number of characters transmitted -- then insert the line

#define USE_STRLEN

at the end of fmt.h . This is necessary with
at least some versions of Sun software.

If you get error messages about references to cf->_ptr
and cf->_base when compiling wrtfmt.c and wsfe.c or to
stderr->_flag when compiling err.c, then insert the line

#define NON_UNIX_STDIO

at the beginning of fio.h, and recompile these modules.

You may need to supply the following non-ANSI routines:

fstat(int fileds, struct stat *buf) is similar
to stat(char *name, struct stat *buf), except that
the first argument, fileds, is the file descriptor
returned by open rather than the name of the file.
fstat is used in the system-dependent routine
canseek (in the libI77 source file err.c), which
is supposed to return 1 if it's possible to issue
seeks on the file in question, 0 if it's not; you may
need to suitably modify err.c . On non-UNIX systems,
you can avoid references to fstat and stat by compiling
err.c, inquire.c, open.c, and util.c with MSDOS defined;
in that case, you may need to supply access(char *Name,0),
which is supposed to return 0 if file Name exists,
nonzero otherwise.

char * mktemp(char *buf) is supposed to replace the
6 trailing X's in buf with a unique number and then
return buf. The idea is to get a unique name for
a temporary file.

On non-UNIX systems, you may need to change a few other,
e.g.: the form of name computed by mktemp() in endfile.c and
open.c; the use of the open(), close(), and creat() system
calls in endfile.c, err.c, open.c; and the modes in calls on
fopen() and fdopen() (and perhaps the use of fdopen() itself
-- it's supposed to return a FILE* corresponding to a given
an integer file descriptor) in err.c and open.c (component ufmt
of struct unit is 1 for formatted I/O -- text mode on some systems
-- and 0 for unformatted I/O -- binary mode on some systems).

For Turbo C++, in particular, you need to adjust the mktemp
invocations and should compile all of libI77 with -DMSDOS .
You also need to #undef ungetc in lread.c and rsne.c .
Don't use -mh -- it is horribly broken.

If you want to be able to load against libI77 but not libF77,
then you will need to add sig_die.o (from libF77) to libI77.

If you wish to use translated Fortran that has funny notions
of record length for direct unformatted I/O (i.e., that assumes
RECL= values in OPEN statements are not bytes but rather counts
of some other units -- e.g., 4-character words for VMS), then you
should insert an appropriate #define for url_Adjust at the
beginning of open.c . For VMS Fortran, for example,
#define url_Adjust(x) x *= 4
would suffice.

To check for transmission errors, issue the command
make check
This assumes you have the xsum program whose source, xsum.c,
is distributed as part of "all from f2c/src". If you do not
have xsum, you can obtain xsum.c by sending the following E-mail
message to [email protected]
send xsum.c from f2c/src

The makefile assumes you have installed f2c.h in a standard
place (and does not cause recompilation when f2c.h is changed);
f2c.h comes with "all from f2c" (the source for f2c) and is
available separately ("f2c.h from f2c").
Type "make" to check the validity of the f2c source and compile f2c.

If (in accordance with what follows) you need to modify the makefile
or any of the source files, first issue a "make xsum.out" to check
the validity of the f2c source, then make your changes, then type
"make f2c".

The file usignal.h is for the benefit of strictly ANSI include files
on a UNIX system -- the ANSI signal.h does not define SIGHUP or SIGQUIT.
You may need to modify usignal.h if you are not running f2c on a UNIX
system.

Should you get the message "xsum0.out xsum1.out differ", see what lines
are different (`diff xsum0.out xsum1.out`) and ask netlib to send you
the files in question "from f2c/src". For example, if exec.c and
expr.c have incorrect check sums, you would send netlib the message
send exec.c expr.c from f2c/src

On some systems, the malloc and free in malloc.c let f2c run faster
than do the standard malloc and free. Other systems cannot tolerate
redefinition of malloc and free. If yours is such a system, you may
either modify the makefile appropriately, or simply execute
cc -c -DCRAY malloc.c
before typing "make". Still other systems have a -lmalloc that
provides performance competitive with that from malloc.c; you may
wish to compare the two on your system.

On some BSD systems, you may need to create a file named "string.h"
whose single line is
#include
you may need to add " -Dstrchr=index" to the "CFLAGS =" assignment
in the makefile, and you may need to add " memset.o" to the "OBJECTS ="
assignment in the makefile -- see the comments in memset.c .

For non-UNIX systems, you may need to change some things in sysdep.c,
such as the choice of intermediate file names.

On some systems, you may need to modify parts of sysdep.h (which is
included by defs.h). In particular, for Sun 4.1 systems and perhaps
some others, you need to comment out the typedef of size_t.

For some non-ANSI versions of stdio, you must change the values given
to binread and binwrite in sysdep.c from "rb" and "wb" to "r" and "w".
You may need to make this change if you run f2c and get an error
message of the form
Compiler error ... cannot open intermediate file ...

On many systems, it is best to combine libF77 and libI77 into a single
library, say libf2c, as suggested in "index from f2c". If you do this,
then you should adjust the definition of link_msg in sysdep.c
appropriately (e.g., replacing "-lF77 -lI77" by "-lf2c").

Some older C compilers object to
typedef void (*foo)();
or to
typedef void zap;
zap (*foo)();
If yours is such a compiler, change the definition of VOID in
f2c.h from void to int.

Please send bug reports to [email protected] . The index file
("send index from f2c") will report recent changes in the recent-change
log at its end; all changes will be shown in the "fixes" file
("send fixes from f2c"). To keep current source, you will need to
request xsum0.out and version.c, in addition to the changed source
files.


  3 Responses to “Category : C Source Code
Archive   : F2CSRC.ZIP
Filename : README

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/