home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / octa21fs.zip / octave / f2c / libi77 / README < prev    next >
Text File  |  2000-01-15  |  7KB  |  167 lines

  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 and fmtlib.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 /usr/include/local.h ,
  19. then you should create an appropriate local.h in
  20. this directory.  An appropriate local.h may simply
  21. be empty, or it may #define VAX or #define CRAY
  22. (or whatever else you must do to make fp.h work right).
  23. Alternatively, edit fp.h to suite your machine.
  24.  
  25. If your system lacks /usr/include/fcntl.h , then you
  26. should simply create an empty fcntl.h in this directory.
  27. If your compiler then complains about creat and open not
  28. having a prototype, compile with OPEN_DECL defined.
  29. On many systems, open and creat are declared in fcntl.h .
  30.  
  31. If your system has /usr/include/fcntl.h, you may need to add
  32. -D_POSIX_SOURCE to the makefile's definition of CFLAGS.
  33.  
  34. If your system's sprintf does not work the way ANSI C
  35. specifies -- specifically, if it does not return the
  36. number of characters transmitted -- then insert the line
  37.  
  38. #define USE_STRLEN
  39.  
  40. at the end of fmt.h .  This is necessary with
  41. at least some versions of Sun software.
  42.  
  43. If your system's fopen does not like the ANSI binary
  44. reading and writing modes "rb" and "wb", then you should
  45. compile open.c with NON_ANSI_RW_MODES #defined.
  46.  
  47. If you get error messages about references to cf->_ptr
  48. and cf->_base when compiling wrtfmt.c and wsfe.c or to
  49. stderr->_flag when compiling err.c, then insert the line
  50.  
  51. #define NON_UNIX_STDIO
  52.  
  53. at the beginning of fio.h, and recompile everything (or
  54. at least those modules that contain NON_UNIX_STDIO).
  55.  
  56. Unformatted sequential records consist of a length of record
  57. contents, the record contents themselves, and the length of
  58. record contents again (for backspace).  Prior to 17 Oct. 1991,
  59. the length was of type int; now it is of type long, but you
  60. can change it back to int by inserting
  61.  
  62. #define UIOLEN_int
  63.  
  64. at the beginning of fio.h.  This affects only sue.c and uio.c .
  65.  
  66. You may need to supply the following non-ANSI routines:
  67.  
  68.   fstat(int fileds, struct stat *buf) is similar
  69. to stat(char *name, struct stat *buf), except that
  70. the first argument, fileds, is the file descriptor
  71. returned by open rather than the name of the file.
  72. fstat is used in the system-dependent routine
  73. canseek (in the libI77 source file err.c), which
  74. is supposed to return 1 if it's possible to issue
  75. seeks on the file in question, 0 if it's not; you may
  76. need to suitably modify err.c .  On non-UNIX systems,
  77. you can avoid references to fstat and stat by compiling
  78. with NON_UNIX_STDIO defined; in that case, you may need
  79. to supply access(char *Name,0), which is supposed to
  80. return 0 if file Name exists, nonzero otherwise.
  81.  
  82.   char * mktemp(char *buf) is supposed to replace the
  83. 6 trailing X's in buf with a unique number and then
  84. return buf.  The idea is to get a unique name for
  85. a temporary file.
  86.  
  87. On non-UNIX systems, you may need to change a few other,
  88. e.g.: the form of name computed by mktemp() in endfile.c and
  89. open.c; the use of the open(), close(), and creat() system
  90. calls in endfile.c, err.c, open.c; and the modes in calls on
  91. fopen() and fdopen() (and perhaps the use of fdopen() itself
  92. -- it's supposed to return a FILE* corresponding to a given
  93. an integer file descriptor) in err.c and open.c (component ufmt
  94. of struct unit is 1 for formatted I/O -- text mode on some systems
  95. -- and 0 for unformatted I/O -- binary mode on some systems).
  96. Compiling with -DNON_UNIX_STDIO omits all references to creat()
  97. and almost all references to open() and close(), the exception
  98. being in the function f__isdev() (in open.c).
  99.  
  100. For Turbo C++, in particular, you need to adjust the mktemp
  101. invocations and should compile all of libI77 with -DMSDOS .
  102. You also need to #undef ungetc in lread.c and rsne.c .
  103.  
  104. If you want to be able to load against libI77 but not libF77,
  105. then you will need to add sig_die.o (from libF77) to libI77.
  106.  
  107. If you wish to use translated Fortran that has funny notions
  108. of record length for direct unformatted I/O (i.e., that assumes
  109. RECL= values in OPEN statements are not bytes but rather counts
  110. of some other units -- e.g., 4-character words for VMS), then you
  111. should insert an appropriate #define for url_Adjust at the
  112. beginning of open.c .  For VMS Fortran, for example,
  113. #define url_Adjust(x) x *= 4
  114. would suffice.
  115.  
  116. To check for transmission errors, issue the command
  117.     make check
  118. This assumes you have the xsum program whose source, xsum.c,
  119. is distributed as part of "all from f2c/src".  If you do not
  120. have xsum, you can obtain xsum.c by sending the following E-mail
  121. message to netlib@research.att.com
  122.     send xsum.c from f2c/src
  123.  
  124. The makefile assumes you have installed f2c.h in a standard
  125. place (and does not cause recompilation when f2c.h is changed);
  126. f2c.h comes with "all from f2c" (the source for f2c) and is
  127. available separately ("f2c.h from f2c").
  128.  
  129. By default, Fortran I/O units 5, 6, and 0 are pre-connected to
  130. stdin, stdout, and stderr, respectively.  You can change this
  131. behavior by changing f_init() in err.c to suit your needs.
  132. Note that f2c assumes READ(*... means READ(5... and WRITE(*...
  133. means WRITE(6... .  Moreover, an OPEN(n,... statement that does
  134. not specify a file name (and does not specify STATUS='SCRATCH')
  135. assumes FILE='fort.n' .  You can change this by editing open.c
  136. and endfile.c suitably.
  137.  
  138. Lines protected from compilation by #ifdef Allow_TYQUAD
  139. are for a possible extension to 64-bit integers in which
  140. integer = int = 32 bits and longint = long = 64 bits.
  141.  
  142. Extensions (Feb. 1993) to NAMELIST processing:
  143.  1. Reading a ? instead of &name (the start of a namelist) causes
  144. the namelist being sought to be written to stdout (unit 6);
  145. to omit this feature, compile rsne.c with -DNo_Namelist_Questions.
  146.  2. Reading the wrong namelist name now leads to an error message
  147. and an attempt to skip input until the right namelist name is found;
  148. to omit this feature, compile rsne.c with -DNo_Bad_Namelist_Skip.
  149.  3. Namelist writes now insert newlines before each variable; to omit
  150. this feature, compile xwsne.c with -DNo_Extra_Namelist_Newlines.
  151.  
  152. Nonstandard extension (Feb. 1993) to open: for sequential files,
  153. ACCESS='APPEND' (or access='anything else starting with "A" or "a"')
  154. causes the file to be positioned at end-of-file, so a write will
  155. append to the file.
  156.  
  157. Some buggy Fortran programs use unformatted direct I/O to write
  158. an incomplete record and later read more from that record than
  159. they have written.  For records other than the last, the unwritten
  160. portion of the record reads as binary zeros.  The last record is
  161. a special case: attempting to read more from it than was written
  162. gives end-of-file -- which may help one find a bug.  Some other
  163. Fortran I/O libraries treat the last record no differently than
  164. others and thus give no help in finding the bug of reading more
  165. than was written.  If you wish to have this behavior, compile
  166. uio.c with -DPad_UDread .
  167.