Commit | Line | Data |
---|---|---|
547779a8 WH |
1 | If your compiler does not recognize ANSI C headers, |
2 | compile with KR_headers defined: either add -DKR_headers | |
3 | to the definition of CFLAGS in the makefile, or insert | |
4 | ||
5 | #define KR_headers | |
6 | ||
7 | at the top of f2c.h , cabs.c , main.c , and sig_die.c . | |
8 | ||
9 | ||
10 | If you have a really ancient K&R C compiler that does not understand | |
11 | void, add -Dvoid=int to the definition of CFLAGS in the makefile. | |
12 | ||
13 | If you use a C++ compiler, first create a local f2c.h by appending | |
14 | f2ch.add to the usual f2c.h, e.g., by issuing the command | |
15 | make f2c.h | |
16 | which assumes f2c.h is installed in /usr/include . | |
17 | ||
18 | If your system lacks onexit() and you are not using an ANSI C | |
19 | compiler, then you should compile main.c with NO_ONEXIT defined. | |
20 | See the comments about onexit in the makefile. | |
21 | ||
22 | If your system has a double drem() function such that drem(a,b) | |
23 | is the IEEE remainder function (with double a, b), then you may | |
24 | wish to compile r_mod.c and d_mod.c with IEEE_drem defined. | |
25 | On some systems, you may also need to compile with -Ddrem=remainder . | |
26 | ||
27 | To check for transmission errors, issue the command | |
28 | make check | |
29 | This assumes you have the xsum program whose source, xsum.c, | |
30 | is distributed as part of "all from f2c/src". If you do not | |
31 | have xsum, you can obtain xsum.c by sending the following E-mail | |
32 | message to netlib@research.att.com | |
33 | send xsum.c from f2c/src | |
34 | ||
35 | The makefile assumes you have installed f2c.h in a standard | |
36 | place (and does not cause recompilation when f2c.h is changed); | |
37 | f2c.h comes with "all from f2c" (the source for f2c) and is | |
38 | available separately ("f2c.h from f2c"). | |
39 | ||
40 | Most of the routines in libF77 are support routines for Fortran | |
41 | intrinsic functions or for operations that f2c chooses not | |
42 | to do "in line". There are a few exceptions, summarized below -- | |
43 | functions and subroutines that appear to your program as ordinary | |
44 | external Fortran routines. | |
45 | ||
46 | 1. CALL ABORT prints a message and causes a core dump. | |
47 | ||
48 | 2. ERF(r) and DERF(d) and the REAL and DOUBLE PRECISION | |
49 | error functions (with x REAL and d DOUBLE PRECISION); | |
50 | DERF must be declared DOUBLE PRECISION in your program. | |
51 | Both ERF and DERF assume your C library provides the | |
52 | underlying erf() function (which not all systems do). | |
53 | ||
54 | 3. ERFC(r) and DERFC(d) are the complementary error functions: | |
55 | ERFC(r) = 1 - ERF(r) and DERFC(d) = 1.d0 - DERFC(d) | |
56 | (except that their results may be more accurate than | |
57 | explicitly evaluating the above formulae would give). | |
58 | Again, ERFC and r are REAL, and DERFC and d are DOUBLE | |
59 | PRECISION (and must be declared as such in your program), | |
60 | and ERFC and DERFC rely on your system's erfc(). | |
61 | ||
62 | 4. CALL GETARG(n,s), where n is an INTEGER and s is a CHARACTER | |
63 | variable, sets s to the n-th command-line argument (or to | |
64 | all blanks if there are fewer than n command-line arguments); | |
65 | CALL GETARG(0,s) sets s to the name of the program (on systems | |
66 | that support this feature). See IARGC below. | |
67 | ||
68 | 5. CALL GETENV(name, value), where name and value are of type | |
69 | CHARACTER, sets value to the environment value, $name, of | |
70 | name (or to blanks if $name has not been set). | |
71 | ||
72 | 6. NARGS = IARGC() sets NARGS to the number of command-line | |
73 | arguments (an INTEGER value). | |
74 | ||
75 | 7. CALL SIGNAL(n,func), where n is an INTEGER and func is an | |
76 | EXTERNAL procedure, arranges for func to be invoked when | |
77 | signal n occurs (on systems where this makes sense). | |
78 | ||
79 | 8. CALL SYSTEM(cmd), where cmd is of type CHARACTER, passes | |
80 | cmd to the system's command processor (on systems where | |
81 | this can be done). | |
82 | ||
83 | The makefile does not attempt to compile pow_qq.c, which is meant | |
84 | for use with INTEGER*8. To use it, you must modify f2c.h to | |
85 | declare longint appropriately; then add pow_qq.o to the POW = | |
86 | line in the makefile. |