📄 readme
字号:
====== old index for f2c, now "readme from f2c" ============FILES:f2c.h Include file necessary for compiling output of the converter. See the second NOTE below.f2c.1 Man page for f2c.f2c.1t Source for f2c.1 (to be processed by troff -man or nroff -man).libf77 Library of non I/O support routines the generated C may need. Fortran main programs result in a C function named MAIN__ that is meant to be invoked by the main() in libf77.libi77 Library of Fortran I/O routines the generated C may need. Note that some vendors (e.g., BSD, Sun and MIPS) provide a libF77 and libI77 that are incompatible with f2c -- they provide some differently named routines or routines with the names that f2c expects, but with different calling sequences. On such systems, the recommended procedure is to merge libf77 and libi77 into a single library, say libf2c, and to install it where you can access it by specifying -lf2c . The definition of link_msg in sysdep.c assumes this arrangement.f2c.ps Postscript for a technical report on f2c. After you strip the mail header, the first line should be "%!PS".fixes The complete change log, reporting bug fixes and other changes. (Some recent change-log entries are given below).fc A shell script that uses f2c and imitates much of the behavior of commonly found f77 commands. You will almost certainly need to adjust some of the shell-variable assignments to make this script work on your system.SUBDIRECTORY:f2c/src Source for the converter itself, including a file of checksums and source for a program to compute the checksums (to verify correct transmission of the source), is available: ask netlib (e.g., netlib@research.att.com) to send all from f2c/src If the checksums show damage to just a few source files, or if the change log file (see "fixes" below) reports corrections to some source files, you can request those files individually "from f2c/src". For example, to get defs.h and xsum0.out, you would ask netlib to send defs.h xsum0.out from f2c/src "all from f2c/src" is about 640 kilobytes long; for convenience (and checksums), it includes copies of f2c.h, f2c.1, and f2c.1t. Tip: if asked to send over 99,000 bytes in one request, netlib breaks the shipment into 1000 line pieces and sends each piece separately (since otherwise some mailers might gag). To avoid the hassle of reassembling the pieces, try to keep each request under 99,000 bytes long. The final number in each line of xsum0.out gives the length of each file in f2c/src. For example, send exec.c expr.c from f2c/src send format.c format_data.c from f2c/src will give you slightly less hassle than send exec.c expr.c format.c format_data.c from f2c/src Alternatively, if all the mailers in your return path allow long messages, you can supply an appropriate mailsize line in your netlib request, e.g. mailsize 200k send exec.c expr.c format.c format_data.c from f2c/src If you have trouble generating gram.c, you can ask netlib to send gram.c from f2c/src Then `xsum gram.c` should report gram.c 1814e302 57355NOTE: For now, you may exercise f2c by sending netlib a message whose first line is "execute f2c" and whose remaining lines are the Fortran 77 source that you wish to have converted. Return mail brings you the resulting C, with f2c's error messages between #ifdef uNdEfInEd and #endif at the end. (To understand line numbers in the error messages, regard the "execute f2c" line as line 0. It is stripped away by the netlib software before f2c sees your Fortran input.) Options described in the man page may be transmitted to netlib by having the first line of input be a comment whose first 6 characters are "c$f2c " and whose remaining characters are the desired options, e.g., "c$f2c -R -u". This scheme may change -- ask netlib to send index from f2c if you do not get the behavior you expect. During the initial experimental period, incoming Fortran will be saved in a file. Don't send any secrets!BUGS: Please send bug reports (including the shortest example you can find that illustrates the bug) to research!dmg or dmg@research.att.com . You might first check whether the bug goes away when you turn optimization off.NOTE: f2c.h defines several types, e.g., real, integer, doublereal. The definitions in f2c.h are suitable for most machines, but if your machine has sizeof(double) > 2*sizeof(long), you may need to adjust f2c.h appropriately. f2c assumes sizeof(doublecomplex) = 2*sizeof(doublereal) sizeof(doublereal) = sizeof(complex) sizeof(doublereal) = 2*sizeof(real) sizeof(real) = sizeof(integer) sizeof(real) = sizeof(logical) sizeof(real) = 2*sizeof(shortint) EQUIVALENCEs may not be translated correctly if these assumptions are violated. On machines, such as those using a DEC Alpha processor, on which sizeof(short) == 2, sizeof(int) == sizeof(float) == 4, and sizeof(long) == sizeof(double) == 8, it suffices to modify f2c.h by removing the first occurrence of "long " on each line containing "long ", e.g., by issuing the commands mv f2c.h f2c.h0 sed 's/long //' f2c.h0 >f2c.h On such machines, one can enable INTEGER*8 by uncommenting the typedef of longint in f2c.h, so it reads typedef long longint; by compiling libI77 with -DAllow_TYQUAD, and by adjusting libF77/makefile as described in libF77/README. Some machines may have sizeof(int) == 4 and sizeof(long long) == 8. On such machines, adjust f2c.h by changing "long int " to "long long ", e.g., by saying mv f2c.h f2c.h0 sed 's/long int /long long /' f2c.h0 >f2c.h One can enable INTEGER*8 on such machines as described above, but with typedef long long longint; There exists a C compiler that objects to the lines typedef VOID C_f; /* complex function */ typedef VOID H_f; /* character function */ typedef VOID Z_f; /* double complex function */ in f2c.h . If yours is such a compiler, do two things: 1. Complain to your vendor about this compiler bug. 2. Find the line #define VOID void in f2c.h and change it to #define VOID int (For readability, the f2c.h lines shown above have had two tabs inserted before their first character.)FTP: All the material described above is now available by anonymous ftp from netlib.att.com (login: anonymous; Password: your E-mail address; cd netlib/f2c). Note that you can say, e.g., cd /netlib/f2c/src binary prompt mget *.Z to get all the .Z files in src. You must uncompress the .Z files once you have a copy of them, e.g., by uncompress *.Z Subdirectory msdos contains two PC versions of f2c, f2c.exe.Z and f2cx.exe.Z; the latter uses extended memory. The README in that directory provides more details. Changes appear first in the f2c files available by E-mail from netlib@research.att.com. If the deamons work right, changed files are available the next day by ftp from netlib.att.com. In due course, they reach other netlib servers.-----------------Recent change log (partial)-----------------Tue May 10 07:55:12 EDT 1994 Trivial changes to exec.c, p1output.c, parse_args.c, proc.c,and putpcc.c: change arguments from type foo[]to type *foofor consistency with defs.h. For most compilers, this makes nodifference.Thu Jun 2 12:18:18 EDT 1994 Fix bug in handling FORMAT statements that have adjacent character(or Hollerith) strings: an extraneous \002 appeared between thestrings. libf77: under -DNO_ONEXIT, arrange for f_exit to be called justonce; previously, upon abnormal termination (including stop statements),it was called twice.Mon Jun 6 15:52:57 EDT 1994 libf77: Avoid references to SIGABRT and SIGIOT if neither is defined;Version.c not changed. libi77: Add cast to definition of errfl() in fio.h; this only matterson systems with sizeof(int) < sizeof(long). Under -DNON_UNIX_STDIO,use binary mode for direct formatted files (to avoid any confusionconnected with \n characters).Fri Jun 10 16:47:31 EDT 1994 Fix bug under -A in handling unreferenced (and undeclared)external arguments in subroutines with multiple entry points. Example: subroutine m(fcn,futil) external fcn,futil call fcn entry mintio(i1) ! (D_fp)0 rather than (U_fp)0 for futil endWed Jun 15 10:38:14 EDT 1994 Allow char(constant expression) function in parameter declarations.(This was probably broken in the changes of 29 March 1994.)Fri Jul 1 23:54:00 EDT 1994 Minor adjustments to makefile (rule for f2c.1 commented out) andsysdep.h (#undef KR_headers if __STDC__ is #defined, and base testfor ANSI_Libraries and ANSI_Prototypes on KR_headers rather than__STDC__); version.c touched but not changed. libi77: adjust fp.h so local.h is only needed under -DV10.Tue Jul 5 03:05:46 EDT 1994 Fix segmentation fault in subroutine foo(a,b,k) data i/1/ double precision a(k,1) ! sequence error: must precede data b = a(i,1) end libi77: Fix bug (introduced 6 June 1994?) in reopening files underNON_UNIX_STDIO. Fix some error messages caused by illegal Fortran. Examples:* 1. x(i) = 0 !Missing declaration for array x call f(x) !Said Impossible storage class 8 in routine mkaddr end !Now says invalid use of statement function x* 2. f = g !No declaration for g; by default it's a real variable call g !Said invalid class code 2 for function g end !Now says g cannot be called* 3. intrinsic foo !Invalid intrinsic name a = foo(b) !Said intrcall: bad intrgroup 0 end !Now just complains about line 1Tue Jul 5 11:14:26 EDT 1994 Fix glitch in handling erroneous statement function declarations.Example: a(j(i) - i) = a(j(i) - i) + 1 ! bad statement function call foo(a(3)) ! Said Impossible type 0 in routine mktmpn end ! Now warns that i and j are not usedWed Jul 6 17:31:25 EDT 1994 Tweak test for statement functions that (illegally) call themselves;f2c will now proceed to check for other errors, rather than bailingout at the first recursive statement function reference. Warn about but retain divisions by 0 (instead of calling them"compiler errors" and quiting). On IEEE machines, this permits double precision nan, ninf, pinf nan = 0.d0/0.d0 pinf = 1.d0/0.d0 ninf = -1.d0/0.d0 write(*,*) 'nan, pinf, ninf = ', nan, pinf, ninf endto print nan, pinf, ninf = NaN Infinity -Infinity libi77: wref.c: protect with #ifdef GOOD_SPRINTF_EXPONENT anoptimization that requires exponents to have 2 digits when 2 digitssuffice. lwrite.c wsfe.c (list and formatted external output):omit ' ' carriage-control when compiled with -DOMIT_BLANK_CC .Off-by-one bug fixed in character count for list output of characterstrings. Omit '.' in list-directed printing of Nan, Infinity.Mon Jul 11 13:05:33 EDT 1994 src/gram.c updated.Tue Jul 12 10:24:42 EDT 1994 libi77: wrtfmt.c: under G11.4, write 0. as " .0000 " rather
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -