📄 readme
字号:
As shipped, "makefile" is a copy of "makefile.u", a Unix makefile.
Variants for other systems have names of the form makefile.* and
have initial comments saying how to invoke them. You may wish to
copy one of the other makefile.* files to makefile.
If you use a C++ compiler, first say
make hadd
to create a suitable f2c.h from f2c.h0 and f2ch.add. Otherwise,
make f2c.h
will just copy f2c.h0 to f2c.h .
If your compiler does not recognize ANSI C headers,
compile with KR_headers defined: either add -DKR_headers
to the definition of CFLAGS in the makefile, or insert
#define KR_headers
at the top of f2c.h .
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 makefile.u.
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
or
make -f makefile.u check
This assumes you have the xsum program whose source, xsum.c,
is distributed as part of "all from f2c/src", and that it
is installed somewhere in your search path. If you do not
have xsum, you can obtain xsum.c by sending the following E-mail
message to netlib@netlib.bell-labs.com
send xsum.c from f2c/src
For convenience, the f2c.h0 in this directory is a copy of netlib's
"f2c.h from f2c". It is best to install f2c.h in a standard place,
so "include f2c.h" will work in any directory without further ado.
Beware that the makefiles do not cause recompilation when f2c.h is
changed.
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 ". On Unix systems, you can do this by issuing the commands
mv f2c.h f2c.h0
sed 's/long int /int /' f2c.h0 >f2c.h
On such machines, one can enable INTEGER*8 by uncommenting the typedefs
of longint and ulongint in f2c.h and adjusting them, so they read
typedef long longint;
typedef unsigned long ulongint;
and by compiling libf2c with -DAllow_TYQUAD, as discussed below.
Most of the routines in libf2c are support routines for Fortran
intrinsic functions or for operations that f2c chooses not
to do "in line". There are a few exceptions, summarized below --
functions and subroutines that appear to your program as ordinary
external Fortran routines.
If you use the REAL valued functions listed below (ERF, ERFC,
DTIME, and ETIME) with "f2c -R", then you need to compile the
corresponding source files with -DREAL=float. To do this, it is
perhaps simplest to add "-DREAL=float" to CFLAGS in the makefile.
1. CALL ABORT prints a message and causes a core dump.
2. ERF(r) and DERF(d) and the REAL and DOUBLE PRECISION
error functions (with x REAL and d DOUBLE PRECISION);
DERF must be declared DOUBLE PRECISION in your program.
Both ERF and DERF assume your C library provides the
underlying erf() function (which not all systems do).
3. ERFC(r) and DERFC(d) are the complementary error functions:
ERFC(r) = 1 - ERF(r) and DERFC(d) = 1.d0 - DERFC(d)
(except that their results may be more accurate than
explicitly evaluating the above formulae would give).
Again, ERFC and r are REAL, and DERFC and d are DOUBLE
PRECISION (and must be declared as such in your program),
and ERFC and DERFC rely on your system's erfc().
4. CALL GETARG(n,s), where n is an INTEGER and s is a CHARACTER
variable, sets s to the n-th command-line argument (or to
all blanks if there are fewer than n command-line arguments);
CALL GETARG(0,s) sets s to the name of the program (on systems
that support this feature). See IARGC below.
5. CALL GETENV(name, value), where name and value are of type
CHARACTER, sets value to the environment value, $name, of
name (or to blanks if $name has not been set).
6. NARGS = IARGC() sets NARGS to the number of command-line
arguments (an INTEGER value).
7. CALL SIGNAL(n,func), where n is an INTEGER and func is an
EXTERNAL procedure, arranges for func to be invoked when n
occurs (on systems where this makes sense).
If your compiler complains about the signal calls in main.c, s_paus.c,
and signal_.c, you may need to adjust signal1.h suitably. See the
comments in signal1.h.
8. ETIME(ARR) and DTIME(ARR) are REAL functions that return
execution times. ARR is declared REAL ARR(2). The elapsed
user and system CPU times are stored in ARR(1) and ARR(2),
respectively. ETIME returns the total elapsed CPU time,
i.e., ARR(1) + ARR(2). DTIME returns total elapsed CPU
time since the previous call on DTIME.
9. CALL SYSTEM(cmd), where cmd is of type CHARACTER, passes
cmd to the system's command processor (on systems where
this can be done).
10. CALL FLUSH flushes all buffers.
11. FTELL(i) is an INTEGER function that returns the current
offset of Fortran unit i (or -1 if unit i is not open).
12. CALL FSEEK(i, offset, whence, *errlab) attemps to move
Fortran unit i to the specified offset: absolute offset
if whence = 0; relative to the current offset if whence = 1;
relative to the end of the file if whence = 2. It branches
to label errlab if unit i is not open or if the call
otherwise fails.
The routines whose objects are makefile.u's $(I77) are for I/O.
The following comments apply to them.
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 compiler then complains about creat and open not
having a prototype, compile with OPEN_DECL defined.
On many systems, open and creat are declared in fcntl.h .
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.
In particular, if you get a warning about an improper
pointer/integer combination in compiling wref.c, then
you need to compile with -DUSE_STRLEN .
If your system's fopen does not like the ANSI binary
reading and writing modes "rb" and "wb", then you should
compile open.c with NON_ANSI_RW_MODES #defined.
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 everything (or
at least those modules that contain NON_UNIX_STDIO).
Unformatted sequential records consist of a length of record
contents, the record contents themselves, and the length of
record contents again (for backspace). Prior to 17 Oct. 1991,
the length was of type int; now it is of type long, but you
can change it back to int by inserting
#define UIOLEN_int
at the beginning of fio.h. This affects only sue.c and uio.c .
If you have a really ancient K&R C compiler that does not understand
void, add -Dvoid=int to the definition of CFLAGS in the makefile.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -