| 1 |
|
|---|
| 2 | ====== old index for f2c, now "readme from f2c" ============
|
|---|
| 3 |
|
|---|
| 4 | FILES:
|
|---|
| 5 |
|
|---|
| 6 | f2c.h Include file necessary for compiling output of the converter.
|
|---|
| 7 | See the second NOTE below.
|
|---|
| 8 |
|
|---|
| 9 | f2c.1 Man page for f2c.
|
|---|
| 10 |
|
|---|
| 11 | f2c.1t Source for f2c.1 (to be processed by troff -man or nroff -man).
|
|---|
| 12 |
|
|---|
| 13 | libf77 Library of non I/O support routines the generated C may need.
|
|---|
| 14 | Fortran main programs result in a C function named MAIN__ that
|
|---|
| 15 | is meant to be invoked by the main() in libf77.
|
|---|
| 16 |
|
|---|
| 17 | libi77 Library of Fortran I/O routines the generated C may need.
|
|---|
| 18 | Note that some vendors (e.g., BSD, Sun and MIPS) provide a
|
|---|
| 19 | libF77 and libI77 that are incompatible with f2c -- they
|
|---|
| 20 | provide some differently named routines or routines with the
|
|---|
| 21 | names that f2c expects, but with different calling sequences.
|
|---|
| 22 | On such systems, the recommended procedure is to merge
|
|---|
| 23 | libf77 and libi77 into a single library, say libf2c, and to
|
|---|
| 24 | install it where you can access it by specifying -lf2c . The
|
|---|
| 25 | definition of link_msg in sysdep.c assumes this arrangement.
|
|---|
| 26 |
|
|---|
| 27 | Both libf77 and libi77 are bundles, meant to be unpacked by the
|
|---|
| 28 | Bourne (or Korn) shell. MS-DOS users can use the MKS Toolkit
|
|---|
| 29 | to unpack libf77 and libi77.
|
|---|
| 30 |
|
|---|
| 31 | libf2c.zip
|
|---|
| 32 | Only available by ftp: combination of libf77 and libi77, with
|
|---|
| 33 | Unix and PC makefiles.
|
|---|
| 34 |
|
|---|
| 35 | f2c.ps Postscript for a technical report on f2c. After you strip the
|
|---|
| 36 | mail header, the first line should be "%!PS".
|
|---|
| 37 |
|
|---|
| 38 | fixes The complete change log, reporting bug fixes and other changes.
|
|---|
| 39 | (Some recent change-log entries are given below).
|
|---|
| 40 |
|
|---|
| 41 | fc A shell script that uses f2c and imitates much of the behavior
|
|---|
| 42 | of commonly found f77 commands. You will almost certainly
|
|---|
| 43 | need to adjust some of the shell-variable assignments to make
|
|---|
| 44 | this script work on your system.
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 | SUBDIRECTORY:
|
|---|
| 48 |
|
|---|
| 49 | f2c/src Source for the converter itself, including a file of checksums
|
|---|
| 50 | and source for a program to compute the checksums (to verify
|
|---|
| 51 | correct transmission of the source), is available: ask netlib
|
|---|
| 52 | (e.g., [email protected]) to
|
|---|
| 53 | send all from f2c/src
|
|---|
| 54 | If the checksums show damage to just a few source files, or if
|
|---|
| 55 | the change log file (see "fixes" below) reports corrections to
|
|---|
| 56 | some source files, you can request those files individually
|
|---|
| 57 | "from f2c/src". For example, to get defs.h and xsum0.out, you
|
|---|
| 58 | would ask netlib to
|
|---|
| 59 | send defs.h xsum0.out from f2c/src
|
|---|
| 60 | "all from f2c/src" is about 640 kilobytes long; for convenience
|
|---|
| 61 | (and checksums), it includes copies of f2c.h, f2c.1, and f2c.1t.
|
|---|
| 62 |
|
|---|
| 63 | Tip: if asked to send over 99,000 bytes in one request, netlib
|
|---|
| 64 | breaks the shipment into 1000 line pieces and sends each piece
|
|---|
| 65 | separately (since otherwise some mailers might gag). To avoid
|
|---|
| 66 | the hassle of reassembling the pieces, try to keep each request
|
|---|
| 67 | under 99,000 bytes long. The final number in each line of
|
|---|
| 68 | xsum0.out gives the length of each file in f2c/src. For
|
|---|
| 69 | example,
|
|---|
| 70 | send exec.c expr.c from f2c/src
|
|---|
| 71 | send format.c format_data.c from f2c/src
|
|---|
| 72 | will give you slightly less hassle than
|
|---|
| 73 | send exec.c expr.c format.c format_data.c from f2c/src
|
|---|
| 74 | Alternatively, if all the mailers in your return path allow
|
|---|
| 75 | long messages, you can supply an appropriate mailsize line in
|
|---|
| 76 | your netlib request, e.g.
|
|---|
| 77 | mailsize 200k
|
|---|
| 78 | send exec.c expr.c format.c format_data.c from f2c/src
|
|---|
| 79 |
|
|---|
| 80 | The makefile used to generate gram.c; now we distribute a
|
|---|
| 81 | working gram.c, and you must say
|
|---|
| 82 | make gram1.c
|
|---|
| 83 | mv gram1.c gram.c
|
|---|
| 84 | if you want to generate your own gram.c -- there are just too
|
|---|
| 85 | many broken variants of yacc floating around nowadays for
|
|---|
| 86 | generation of gram.c to be the default.
|
|---|
| 87 |
|
|---|
| 88 | NOTE: You may exercise f2c by sending [email protected]
|
|---|
| 89 | a message whose first line is "execute f2c" and whose remaining
|
|---|
| 90 | lines are the Fortran 77 source that you wish to have converted.
|
|---|
| 91 | Return mail brings you the resulting C, with f2c's error
|
|---|
| 92 | messages between #ifdef uNdEfInEd and #endif at the end.
|
|---|
| 93 | (To understand line numbers in the error messages, regard
|
|---|
| 94 | the "execute f2c" line as line 0. It is stripped away by
|
|---|
| 95 | the netlib software before f2c sees your Fortran input.)
|
|---|
| 96 | Options described in the man page may be transmitted to
|
|---|
| 97 | netlib by having the first line of input be a comment
|
|---|
| 98 | whose first 6 characters are "c$f2c " and whose remaining
|
|---|
| 99 | characters are the desired options, e.g., "c$f2c -R -u".
|
|---|
| 100 |
|
|---|
| 101 | You may say "execute f2c" in the Subject line instead of (but
|
|---|
| 102 | *not* in addition to) in the first line of the message body.
|
|---|
| 103 |
|
|---|
| 104 | The incoming Fortran is saved, at least for a while. Don't
|
|---|
| 105 | send any secrets!
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 | BUGS: Please send bug reports (including the shortest example
|
|---|
| 109 | you can find that illustrates the bug) to research!dmg
|
|---|
| 110 | or [email protected] . You might first check whether
|
|---|
| 111 | the bug goes away when you turn optimization off.
|
|---|
| 112 |
|
|---|
| 113 |
|
|---|
| 114 | NOTE: f2c.h defines several types, e.g., real, integer, doublereal.
|
|---|
| 115 | The definitions in f2c.h are suitable for most machines, but if
|
|---|
| 116 | your machine has sizeof(double) > 2*sizeof(long), you may need
|
|---|
| 117 | to adjust f2c.h appropriately. f2c assumes
|
|---|
| 118 | sizeof(doublecomplex) = 2*sizeof(doublereal)
|
|---|
| 119 | sizeof(doublereal) = sizeof(complex)
|
|---|
| 120 | sizeof(doublereal) = 2*sizeof(real)
|
|---|
| 121 | sizeof(real) = sizeof(integer)
|
|---|
| 122 | sizeof(real) = sizeof(logical)
|
|---|
| 123 | sizeof(real) = 2*sizeof(shortint)
|
|---|
| 124 | EQUIVALENCEs may not be translated correctly if these
|
|---|
| 125 | assumptions are violated.
|
|---|
| 126 |
|
|---|
| 127 | On machines, such as those using a DEC Alpha processor, on
|
|---|
| 128 | which sizeof(short) == 2, sizeof(int) == sizeof(float) == 4,
|
|---|
| 129 | and sizeof(long) == sizeof(double) == 8, it suffices to
|
|---|
| 130 | modify f2c.h by removing the first occurrence of "long "
|
|---|
| 131 | on each line containing "long ", e.g., by issuing the
|
|---|
| 132 | commands
|
|---|
| 133 | mv f2c.h f2c.h0
|
|---|
| 134 | sed 's/long //' f2c.h0 >f2c.h
|
|---|
| 135 | On such machines, one can enable INTEGER*8 by uncommenting
|
|---|
| 136 | the typedef of longint in f2c.h, so it reads
|
|---|
| 137 | typedef long longint;
|
|---|
| 138 | by compiling libI77 with -DAllow_TYQUAD, and by adjusting
|
|---|
| 139 | libF77/makefile as described in libF77/README.
|
|---|
| 140 |
|
|---|
| 141 | Some machines may have sizeof(int) == 4, sizeof(float) == 8,
|
|---|
| 142 | and sizeof(long long) == 8. On such machines, adjust f2c.h
|
|---|
| 143 | by changing "long int " to "long long ", e.g., by saying
|
|---|
| 144 | mv f2c.h f2c.h0
|
|---|
| 145 | sed 's/long int /long long /' f2c.h0 >f2c.h
|
|---|
| 146 | One can enable INTEGER*8 on such machines as described
|
|---|
| 147 | above, but with
|
|---|
| 148 | typedef long long longint;
|
|---|
| 149 |
|
|---|
| 150 | There exists a C compiler that objects to the lines
|
|---|
| 151 | typedef VOID C_f; /* complex function */
|
|---|
| 152 | typedef VOID H_f; /* character function */
|
|---|
| 153 | typedef VOID Z_f; /* double complex function */
|
|---|
| 154 | in f2c.h . If yours is such a compiler, do two things:
|
|---|
| 155 | 1. Complain to your vendor about this compiler bug.
|
|---|
| 156 | 2. Find the line
|
|---|
| 157 | #define VOID void
|
|---|
| 158 | in f2c.h and change it to
|
|---|
| 159 | #define VOID int
|
|---|
| 160 | (For readability, the f2c.h lines shown above have had two
|
|---|
| 161 | tabs inserted before their first character.)
|
|---|
| 162 |
|
|---|
| 163 | FTP: All the material described above is now available by anonymous
|
|---|
| 164 | ftp from netlib.bell-labs.com (login: anonymous; Password: your
|
|---|
| 165 | E-mail address; cd netlib/f2c). Note that you can say, e.g.,
|
|---|
| 166 |
|
|---|
| 167 | cd /netlib/f2c/src
|
|---|
| 168 | binary
|
|---|
|
|---|