• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

MakefileH A D03-May-20223.6 KiB11776

NoticeH A D24-Jul-19971.2 KiB2420

READMEH A D01-Aug-20117.8 KiB187151

cds.cH A D20-Aug-20014.1 KiB196158

changesH A D16-Sep-2020133.6 KiB3,5243,020

data.cH A D10-Sep-202010.4 KiB502420

defines.hH A D19-Jun-19968.5 KiB301204

defs.hH A D11-Feb-200333.7 KiB1,074786

equiv.cH A D02-Jul-20009.1 KiB413277

error.cH A D04-Jul-20004.9 KiB348283

exec.cH A D10-Sep-202020.7 KiB986753

expr.cH A D11-Feb-200370.6 KiB3,7393,054

f2c.1H A D21-Jun-20027.4 KiB223156

f2c.1tH A D21-Jun-20027.4 KiB392391

f2c.hH A D03-May-20225.5 KiB237180

format.cH A D16-Sep-202058.6 KiB2,6272,180

format.hH A D22-Feb-1994458 138

formatdata.cH A D11-Sep-202028.3 KiB1,2641,065

ftypes.hH A D11-Sep-20201.8 KiB7959

gram.cH A D11-Feb-200362.7 KiB1,9581,644

gram.dclH A D03-Apr-19988.3 KiB417370

gram.execH A D08-Feb-20023 KiB144125

gram.exprH A D11-Feb-20033.1 KiB147131

gram.headH A D18-Jan-20007.2 KiB294256

gram.ioH A D18-Jan-20003.3 KiB176155

init.cH A D23-Feb-200111.6 KiB527427

intr.cH A D21-Aug-200124.4 KiB1,088873

io.cH A D04-Jul-200029.9 KiB1,5101,298

iob.hH A D23-Feb-1994548 2723

lex.cH A D14-Mar-200233.9 KiB1,7501,501

machdefs.hH A D21-Jan-1990659 3219

main.cH A D11-Mar-201920.4 KiB793654

makefile.uH A D05-Mar-20053.6 KiB11778

makefile.vcH A D01-May-20052.6 KiB7755

malloc.cH A D14-Jan-20163.9 KiB185146

mem.cH A D16-Sep-20205.3 KiB273228

memset.cH A D03-Jul-20002.1 KiB7336

misc.cH A D02-May-200222.4 KiB1,3991,123

mkfile.plan9H A D21-Mar-20013.4 KiB10886

names.cH A D08-Oct-200421 KiB836625

names.hH A D22-Feb-1994569 2015

niceprintf.cH A D04-Jul-200010.7 KiB446343

niceprintf.hH A D03-Feb-1990412 173

output.cH A D16-Sep-202042.5 KiB1,7541,407

output.hH A D22-Feb-19942.1 KiB6531

p1defs.hH A D22-Feb-19945.6 KiB15954

p1output.cH A D16-Sep-202014.3 KiB744562

parse.hH A D25-Feb-19941.1 KiB4838

parse_args.cH A D24-Feb-200113.8 KiB559367

pccdefs.hH A D21-Jan-19901.2 KiB6556

pread.cH A D29-Nov-201917.4 KiB991904

proc.cH A D16-Sep-202038.3 KiB1,8351,457

put.cH A D01-Mar-200110.1 KiB459312

putpcc.cH A D08-Oct-200645 KiB2,1701,777

sysdep.cH A D16-Sep-202015.5 KiB698594

sysdep.hH A D02-May-20022.7 KiB10252

sysdeptest.cH A D25-Apr-2020428 2520

tokdefs.hH A D18-Jan-19941.8 KiB101100

tokensH A D18-Jan-1994733 101100

usignal.hH A D21-Jan-1990124 87

vax.cH A D07-Feb-200212.1 KiB586475

version.cH A D16-Sep-2020107 32

xsum.cH A D12-Sep-20076.5 KiB240207

xsum0.outH A D03-May-20221.3 KiB6059

README

1To compile f2c on Linux or Unix systems, copy makefile.u to makefile,
2edit makefile if necessary (see the comments in it and below) and
3type "make" (or maybe "nmake", depending on your system).
4
5To compile f2c.exe on MS Windows systems with Microsoft Visual C++,
6
7	copy makefile.vc makefile
8	nmake
9
10With other PC compilers, you may need to compile xsum.c with -DMSDOS
11(i.e., with MSDOS #defined).
12
13If your compiler does not understand ANSI/ISO C syntax (i.e., if
14you have a K&R C compiler), compile with -DKR_headers .
15
16On non-Unix systems where files have separate binary and text modes,
17you may need to "make xsumr.out" rather than "make xsum.out".
18
19If (in accordance with what follows) you need to any of the source
20files (excluding the makefile), first issue a "make xsum.out" (or, if
21appropriate, "make xsumr.out") to check the validity of the f2c source,
22then make your changes, then type "make f2c".
23
24The file usignal.h is for the benefit of strictly ANSI include files
25on a UNIX system -- the ANSI signal.h does not define SIGHUP or SIGQUIT.
26You may need to modify usignal.h if you are not running f2c on a UNIX
27system.
28
29Should you get the message "xsum0.out xsum1.out differ", see what lines
30are different (`diff xsum0.out xsum1.out`) and ask netlib
31(e.g., netlib@netlib.org) to send you the files in question,
32plus the current xsum0.out (which may have changed) "from f2c/src".
33For example, if exec.c and expr.c have incorrect check sums, you would
34send netlib the message
35	send exec.c expr.c xsum0.out from f2c/src
36You can also ftp these files from netlib.bell-labs.com; for more
37details, ask netlib@netlib.org to "send readme from f2c".
38
39On some systems, the malloc and free in malloc.c let f2c run faster
40than do the standard malloc and free.  Other systems may not tolerate
41redefinition of malloc and free (though changes of 8 Nov. 1994 may
42render this less of a problem than hitherto).  If your system permits
43use of a user-supplied malloc, you may wish to change the MALLOC =
44line in the makefile to "MALLOC = malloc.o", or to type
45	make MALLOC=malloc.o
46instead of
47	make
48Still other systems have a -lmalloc that provides performance
49competitive with that from malloc.c; you may wish to compare the two
50on your system.  If your system does not permit user-supplied malloc
51routines, then f2c may fault with "MALLOC=malloc.o", or may display
52other untoward behavior.
53
54On some BSD systems, you may need to create a file named "string.h"
55whose single line is
56#include <strings.h>
57you may need to add " -Dstrchr=index" to the "CFLAGS =" assignment
58in the makefile, and you may need to add " memset.o" to the "OBJECTS ="
59assignment in the makefile -- see the comments in memset.c .
60
61For non-UNIX systems, you may need to change some things in sysdep.c,
62such as the choice of intermediate file names.
63
64On some systems, you may need to modify parts of sysdep.h (which is
65included by defs.h).  In particular, for Sun 4.1 systems and perhaps
66some others, you need to comment out the typedef of size_t.  For some
67systems (e.g., IRIX 4.0.1 and AIX) it is better to add
68#define ANSI_Libraries
69to the beginning of sysdep.h (or to supply -DANSI_Libraries in the
70makefile).
71
72Alas, some systems #define __STDC__ but do not provide a true standard
73(ANSI or ISO) C environment, e.g. do not provide stdlib.h .  If yours
74is such a system, then (a) you should complain loudly to your vendor
75about __STDC__ being erroneously defined, and (b) you should insert
76#undef __STDC__
77at the beginning of sysdep.h .  You may need to make other adjustments.
78
79For some non-ANSI versions of stdio, you must change the values given
80to binread and binwrite in sysdep.c from "rb" and "wb" to "r" and "w".
81You may need to make this change if you run f2c and get an error
82message of the form
83	Compiler error ... cannot open intermediate file ...
84
85In the days of yore, two libraries, libF77 and libI77, were used with
86f77 (the Fortran compiler on which f2c is based).  Separate source for
87these libraries is still available from netlib, but it is more
88convenient to combine them into a single library, libf2c.  Source for
89this combined library is also available from netlib in f2c/libf2c.zip,
90e.g.,
91	http://netlib.bell-labs.com/netlib/f2c/libf2c.zip
92or
93	http://www.netlib.org/f2c/libf2c.zip
94
95(and similarly for other netlib mirrors).  After unzipping libf2c.zip,
96copy the relevant makefile.* to makefile, edit makefile if necessary
97(see the comments in it and in libf2c/README) and invoke "make" or
98"nmake".  The resulting library is called *f2c.lib on MS Windows
99systems and libf2c.a or libf2c.so on Linux and Unix systems;
100makefile.u just shows how to make libf2c.a.  Details on creating the
101shared-library variant, libf2c.so, are system-dependent; some that
102have worked under Linux appear below.  For some other systems, you can
103glean the details from the system-dependent makefile variants in
104directory http://www.netlib.org/ampl/solvers/funclink or
105http://netlib.bell-labs.com/netlib/ampl/solvers/funclink, etc.
106
107In general, under Linux it is necessary to compile libf2c (or libI77)
108with -DNON_UNIX_STDIO .  Under at least one variant of Linux, you can
109make and install a shared-library version of libf2c by compiling
110libI77 with -DNON_UNIX_STDIO, creating libf2c.a as above, and then
111executing
112
113	mkdir t
114	ln lib?77/*.o t
115	cd t; cc -shared -o ../libf2c.so -Wl,-soname,libf2c.so.1 *.o
116	cd ..
117	rm -r t
118	rm /usr/lib/libf2c*
119	mv libf2c.a libf2c.so /usr/lib
120	cd /usr/lib
121	ln libf2c.so libf2c.so.1
122	ln libf2c.so libf2c.so.1.0.0
123
124On some other systems, /usr/local/lib is the appropriate installation
125directory.
126
127
128Some older C compilers object to
129	typedef void (*foo)();
130or to
131	typedef void zap;
132	zap (*foo)();
133If yours is such a compiler, change the definition of VOID in
134f2c.h from void to int.
135
136For convenience with systems that use control-Z to denote end-of-file,
137f2c treats control-Z characters (ASCII 26, '\x1a') that appear at the
138beginning of a line as an end-of-file indicator.  You can disable this
139test by compiling lex.c with NO_EOF_CHAR_CHECK #defined, or can
140change control-Z to some other character by #defining EOF_CHAR to
141be the desired value.
142
143
144If your machine has IEEE, VAX, or IBM-mainframe arithmetic, but your
145printf is inaccurate (e.g., with Symantec C++ version 6.0,
146printf("%.17g",12.) prints 12.000000000000001), you can make f2c print
147correctly rounded numbers by compiling with -DUSE_DTOA and adding
148dtoa.o g_fmt.o to the makefile's OBJECTS = line, so it becomes
149
150	OBJECTS = $(OBJECTSd) malloc.o dtoa.o g_fmt.o
151
152Also add the rule
153
154	dtoa.o: dtoa.c
155		$(CC) -c $(CFLAGS) -DMALLOC=ckalloc -DIEEE... dtoa.c
156
157(without the initial tab) to the makefile, where IEEE... is one of
158IEEE_MC68k, IEEE_8087, VAX, or IBM, depending on your machine's
159arithmetic.  See the comments near the start of dtoa.c.
160
161The relevant source files, dtoa.c and g_fmt.c, are available
162separately from netlib's fp directory.  For example, you could
163send the E-mail message
164
165	send dtoa.c g_fmt.c from fp
166
167to netlib@netlib.netlib.org (or use anonymous ftp from
168ftp.netlib.org and look in directory /netlib/fp).
169
170The makefile has a rule for creating tokdefs.h.  If you cannot use the
171makefile, an alternative is to extract tokdefs.h from the beginning of
172gram.c: it's the first 100 lines.
173
174File mem.c has #ifdef CRAY lines that are appropriate for machines
175with the conventional CRAY architecture, but not for "Cray" machines
176based on DEC Alpha chips, such as the T3E; on such machines, you may
177need to make a suitable adjustment, e.g., add #undef CRAY to sysdep.h.
178
179
180Please send bug reports to dmg at acm.org (with " at " changed to "@").
181The old index file (now called "readme" due to unfortunate changes in
182netlib conventions:  "send readme from f2c") will report recent
183changes in the recent-change log at its end; all changes will be shown
184in the "changes" file ("send changes from f2c").  To keep current
185source, you will need to request xsum0.out and version.c, in addition
186to the changed source files.
187