Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make f2c buildable via vulcan

  • Loading branch information...
commit d66a44f3c1d8f5dc7e881097559aca10749c7086 0 parents
@martinrehfeld authored
Showing with 48,335 additions and 0 deletions.
  1. +2 −0  .gitignore
  2. +8 −0 Gemfile
  3. +4 −0 Rakefile
  4. +4 −0 bin/compile
  5. +5 −0 bin/detect
  6. +3 −0  bin/release
  7. +1 −0  f2c/.list
  8. +7 −0 f2c/.master
  9. +2 −0  f2c/00lastchange
  10. +35 −0 f2c/build.sh
  11. +3,482 −0 f2c/changes
  12. +16 −0 f2c/disclaimer
  13. +222 −0 f2c/f2c.1
  14. +391 −0 f2c/f2c.1t
  15. +223 −0 f2c/f2c.h
  16. BIN  f2c/f2c.pdf
  17. BIN  f2c/f2c.ps
  18. +366 −0 f2c/fc
  19. +4 −0 f2c/fixlog
  20. +23 −0 f2c/libf2c/Notice
  21. +374 −0 f2c/libf2c/README
  22. +22 −0 f2c/libf2c/abort_.c
  23. +248 −0 f2c/libf2c/arithchk.c
  24. +76 −0 f2c/libf2c/backspac.c
  25. +20 −0 f2c/libf2c/c_abs.c
  26. +23 −0 f2c/libf2c/c_cos.c
  27. +53 −0 f2c/libf2c/c_div.c
  28. +25 −0 f2c/libf2c/c_exp.c
  29. +23 −0 f2c/libf2c/c_log.c
  30. +23 −0 f2c/libf2c/c_sin.c
  31. +41 −0 f2c/libf2c/c_sqrt.c
  32. +33 −0 f2c/libf2c/cabs.c
  33. +101 −0 f2c/libf2c/close.c
  34. +5 −0 f2c/libf2c/comptry.bat
  35. +2 −0  f2c/libf2c/ctype.c
  36. +47 −0 f2c/libf2c/ctype.h
  37. +18 −0 f2c/libf2c/d_abs.c
  38. +19 −0 f2c/libf2c/d_acos.c
  39. +19 −0 f2c/libf2c/d_asin.c
  40. +19 −0 f2c/libf2c/d_atan.c
  41. +19 −0 f2c/libf2c/d_atn2.c
  42. +19 −0 f2c/libf2c/d_cnjg.c
  43. +19 −0 f2c/libf2c/d_cos.c
  44. +19 −0 f2c/libf2c/d_cosh.c
  45. +16 −0 f2c/libf2c/d_dim.c
  46. +19 −0 f2c/libf2c/d_exp.c
  47. +16 −0 f2c/libf2c/d_imag.c
  48. +19 −0 f2c/libf2c/d_int.c
  49. +21 −0 f2c/libf2c/d_lg10.c
  50. +19 −0 f2c/libf2c/d_log.c
  51. +46 −0 f2c/libf2c/d_mod.c
  52. +20 −0 f2c/libf2c/d_nint.c
  53. +16 −0 f2c/libf2c/d_prod.c
  54. +18 −0 f2c/libf2c/d_sign.c
  55. +19 −0 f2c/libf2c/d_sin.c
  56. +19 −0 f2c/libf2c/d_sinh.c
  57. +19 −0 f2c/libf2c/d_sqrt.c
  58. +19 −0 f2c/libf2c/d_tan.c
  59. +19 −0 f2c/libf2c/d_tanh.c
  60. +18 −0 f2c/libf2c/derf_.c
  61. +20 −0 f2c/libf2c/derfc_.c
  62. +151 −0 f2c/libf2c/dfe.c
  63. +26 −0 f2c/libf2c/dolio.c
  64. +63 −0 f2c/libf2c/dtime_.c
  65. +77 −0 f2c/libf2c/due.c
  66. +25 −0 f2c/libf2c/ef1asc_.c
  67. +20 −0 f2c/libf2c/ef1cmc_.c
  68. +160 −0 f2c/libf2c/endfile.c
  69. +22 −0 f2c/libf2c/erf_.c
  70. +22 −0 f2c/libf2c/erfc_.c
  71. +293 −0 f2c/libf2c/err.c
  72. +57 −0 f2c/libf2c/etime_.c
  73. +43 −0 f2c/libf2c/exit_.c
  74. +223 −0 f2c/libf2c/f2c.h
  75. +223 −0 f2c/libf2c/f2c.h0
  76. +162 −0 f2c/libf2c/f2ch.add
  77. +44 −0 f2c/libf2c/f77_aloc.c
  78. +97 −0 f2c/libf2c/f77vers.c
  79. +141 −0 f2c/libf2c/fio.h
  80. +530 −0 f2c/libf2c/fmt.c
  81. +105 −0 f2c/libf2c/fmt.h
  82. +51 −0 f2c/libf2c/fmtlib.c
  83. +28 −0 f2c/libf2c/fp.h
  84. +52 −0 f2c/libf2c/ftell64_.c
  85. +52 −0 f2c/libf2c/ftell_.c
  86. +36 −0 f2c/libf2c/getarg_.c
  87. +62 −0 f2c/libf2c/getenv_.c
  88. +18 −0 f2c/libf2c/h_abs.c
  89. +16 −0 f2c/libf2c/h_dim.c
  90. +19 −0 f2c/libf2c/h_dnnt.c
  91. +32 −0 f2c/libf2c/h_indx.c
  92. +16 −0 f2c/libf2c/h_len.c
  93. +16 −0 f2c/libf2c/h_mod.c
  94. +19 −0 f2c/libf2c/h_nint.c
  95. +18 −0 f2c/libf2c/h_sign.c
  96. +18 −0 f2c/libf2c/hl_ge.c
  97. +18 −0 f2c/libf2c/hl_gt.c
  98. +18 −0 f2c/libf2c/hl_le.c
  99. +18 −0 f2c/libf2c/hl_lt.c
  100. +343 −0 f2c/libf2c/i77vers.c
  101. +18 −0 f2c/libf2c/i_abs.c
  102. +16 −0 f2c/libf2c/i_dim.c
  103. +19 −0 f2c/libf2c/i_dnnt.c
  104. +32 −0 f2c/libf2c/i_indx.c
  105. +16 −0 f2c/libf2c/i_len.c
  106. +16 −0 f2c/libf2c/i_mod.c
  107. +19 −0 f2c/libf2c/i_nint.c
  108. +18 −0 f2c/libf2c/i_sign.c
  109. +17 −0 f2c/libf2c/iargc_.c
  110. +159 −0 f2c/libf2c/iio.c
  111. +83 −0 f2c/libf2c/ilnw.c
  112. +117 −0 f2c/libf2c/inquire.c
  113. +18 −0 f2c/libf2c/l_ge.c
  114. +18 −0 f2c/libf2c/l_gt.c
  115. +18 −0 f2c/libf2c/l_le.c
  116. +18 −0 f2c/libf2c/l_lt.c
  117. +68 −0 f2c/libf2c/lbitbits.c
  118. +17 −0 f2c/libf2c/lbitshft.c
  119. +153 −0 f2c/libf2c/libf2c.lbc
  120. +153 −0 f2c/libf2c/libf2c.sy
  121. +74 −0 f2c/libf2c/lio.h
  122. +806 −0 f2c/libf2c/lread.c
  123. +314 −0 f2c/libf2c/lwrite.c
  124. +148 −0 f2c/libf2c/main.c
  125. +219 −0 f2c/libf2c/makefile
  126. +190 −0 f2c/libf2c/makefile.sy
  127. +219 −0 f2c/libf2c/makefile.u
  128. +195 −0 f2c/libf2c/makefile.vc
  129. +189 −0 f2c/libf2c/makefile.wat
  130. +3 −0  f2c/libf2c/math.hvc
  131. +162 −0 f2c/libf2c/mkfile.plan9
  132. +301 −0 f2c/libf2c/open.c
  133. +26 −0 f2c/libf2c/pow_ci.c
  134. +19 −0 f2c/libf2c/pow_dd.c
  135. +41 −0 f2c/libf2c/pow_di.c
  136. +39 −0 f2c/libf2c/pow_hh.c
  137. +39 −0 f2c/libf2c/pow_ii.c
  138. +39 −0 f2c/libf2c/pow_qq.c
  139. +41 −0 f2c/libf2c/pow_ri.c
  140. +60 −0 f2c/libf2c/pow_zi.c
  141. +29 −0 f2c/libf2c/pow_zz.c
  142. +72 −0 f2c/libf2c/qbitbits.c
  143. +17 −0 f2c/libf2c/qbitshft.c
  144. +18 −0 f2c/libf2c/r_abs.c
  145. +19 −0 f2c/libf2c/r_acos.c
  146. +19 −0 f2c/libf2c/r_asin.c
  147. +19 −0 f2c/libf2c/r_atan.c
  148. +19 −0 f2c/libf2c/r_atn2.c
  149. +18 −0 f2c/libf2c/r_cnjg.c
  150. +19 −0 f2c/libf2c/r_cos.c
  151. +19 −0 f2c/libf2c/r_cosh.c
  152. +16 −0 f2c/libf2c/r_dim.c
  153. +19 −0 f2c/libf2c/r_exp.c
  154. +16 −0 f2c/libf2c/r_imag.c
  155. +19 −0 f2c/libf2c/r_int.c
  156. +21 −0 f2c/libf2c/r_lg10.c
  157. +19 −0 f2c/libf2c/r_log.c
  158. +46 −0 f2c/libf2c/r_mod.c
  159. +20 −0 f2c/libf2c/r_nint.c
  160. +18 −0 f2c/libf2c/r_sign.c
  161. +19 −0 f2c/libf2c/r_sin.c
  162. +19 −0 f2c/libf2c/r_sinh.c
  163. +19 −0 f2c/libf2c/r_sqrt.c
  164. +19 −0 f2c/libf2c/r_tan.c
  165. +19 −0 f2c/libf2c/r_tanh.c
  166. +41 −0 f2c/libf2c/rawio.h
  167. +553 −0 f2c/libf2c/rdfmt.c
  168. +30 −0 f2c/libf2c/rewind.c
  169. +91 −0 f2c/libf2c/rsfe.c
  170. +109 −0 f2c/libf2c/rsli.c
  171. +618 −0 f2c/libf2c/rsne.c
  172. +86 −0 f2c/libf2c/s_cat.c
  173. +50 −0 f2c/libf2c/s_cmp.c
  174. +57 −0 f2c/libf2c/s_copy.c
  175. +96 −0 f2c/libf2c/s_paus.c
  176. +32 −0 f2c/libf2c/s_rnge.c
  177. +48 −0 f2c/libf2c/s_stop.c
  178. +5 −0 f2c/libf2c/scomptry.bat
  179. +47 −0 f2c/libf2c/sfe.c
  180. +51 −0 f2c/libf2c/sig_die.c
  181. +35 −0 f2c/libf2c/signal1.h0
  182. +21 −0 f2c/libf2c/signal_.c
  183. +24 −0 f2c/libf2c/signbit.c
  184. +90 −0 f2c/libf2c/sue.c
  185. +66 −0 f2c/libf2c/sysdep1.h0
  186. +42 −0 f2c/libf2c/system_.c
  187. +18 −0 f2c/libf2c/typesize.c
  188. +75 −0 f2c/libf2c/uio.c
  189. +377 −0 f2c/libf2c/uninit.c
  190. +57 −0 f2c/libf2c/util.c
  191. +294 −0 f2c/libf2c/wref.c
  192. +377 −0 f2c/libf2c/wrtfmt.c
  193. +78 −0 f2c/libf2c/wsfe.c
  194. +42 −0 f2c/libf2c/wsle.c
  195. +32 −0 f2c/libf2c/wsne.c
  196. +182 −0 f2c/libf2c/xsum0.out
  197. +77 −0 f2c/libf2c/xwsne.c
  198. +18 −0 f2c/libf2c/z_abs.c
  199. +21 −0 f2c/libf2c/z_cos.c
  200. +50 −0 f2c/libf2c/z_div.c
  201. +23 −0 f2c/libf2c/z_exp.c
  202. +121 −0 f2c/libf2c/z_log.c
  203. +21 −0 f2c/libf2c/z_sin.c
  204. +35 −0 f2c/libf2c/z_sqrt.c
  205. +23 −0 f2c/permission
  206. +1 −0  f2c/readme
  207. +64 −0 f2c/src/.depend
  208. +160 −0 f2c/src/MD5
  209. +23 −0 f2c/src/Notice
  210. +195 −0 f2c/src/cds.c
  211. +502 −0 f2c/src/data.c
  212. +300 −0 f2c/src/defines.h
  213. +1,073 −0 f2c/src/defs.h
  214. +64 −0 f2c/src/directory
  215. +412 −0 f2c/src/equiv.c
  216. +347 −0 f2c/src/error.c
  217. +984 −0 f2c/src/exec.c
  218. +3,738 −0 f2c/src/expr.c
  219. +222 −0 f2c/src/f2c.1
  220. +391 −0 f2c/src/f2c.1t
  221. +223 −0 f2c/src/f2c.h
  222. +2,613 −0 f2c/src/format.c
  223. +12 −0 f2c/src/format.h
  224. +1,263 −0 f2c/src/formatdata.c
  225. +64 −0 f2c/src/ftypes.h
  226. +1,957 −0 f2c/src/gram.c
  227. +416 −0 f2c/src/gram.dcl
  228. +143 −0 f2c/src/gram.exec
  229. +146 −0 f2c/src/gram.expr
  230. +293 −0 f2c/src/gram.head
  231. +175 −0 f2c/src/gram.io
  232. +138 −0 f2c/src/index
  233. +150 −0 f2c/src/index.html
  234. +526 −0 f2c/src/init.c
  235. +1,087 −0 f2c/src/intr.c
  236. +1,509 −0 f2c/src/io.c
  237. +26 −0 f2c/src/iob.h
  238. +1,749 −0 f2c/src/lex.c
  239. +31 −0 f2c/src/machdefs.h
  240. +792 −0 f2c/src/main.c
  241. +116 −0 f2c/src/makefile
  242. +116 −0 f2c/src/makefile.u
  243. +76 −0 f2c/src/makefile.vc
  244. +183 −0 f2c/src/malloc.c
  245. +272 −0 f2c/src/mem.c
  246. +72 −0 f2c/src/memset.c
  247. +1,398 −0 f2c/src/misc.c
  248. +107 −0 f2c/src/mkfile.plan9
  249. +835 −0 f2c/src/names.c
  250. +19 −0 f2c/src/names.h
  251. +445 −0 f2c/src/niceprintf.c
  252. +16 −0 f2c/src/niceprintf.h
  253. +1,753 −0 f2c/src/output.c
  254. +64 −0 f2c/src/output.h
  255. +158 −0 f2c/src/p1defs.h
  256. +728 −0 f2c/src/p1output.c
  257. +47 −0 f2c/src/parse.h
  258. +558 −0 f2c/src/parse_args.c
  259. +64 −0 f2c/src/pccdefs.h
  260. +990 −0 f2c/src/pread.c
Sorry, we could not display the entire diff because it was too big.
2  .gitignore
@@ -0,0 +1,2 @@
+.rvmrc
+Gemfile.lock
8 Gemfile
@@ -0,0 +1,8 @@
+source 'http://rubygems.org'
+
+gem 'rake'
+
+group :development do
+ gem 'heroku'
+ gem 'vulcan'
+end
4 Rakefile
@@ -0,0 +1,4 @@
+desc 'build the f2c software on a vulcan build server'
+task :build do
+ sh "vulcan build -s ./f2c -p /tmp/f2c -c './build.sh' -v"
+end
4 bin/compile
@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+# bin/compile <build-dir> <cache-dir>
+
+echo "-----> Nothing to do."
5 bin/detect
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+# bin/detect <build-dir>
+
+echo "f77"
+exit 0
3  bin/release
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+echo "--- {}"
1  f2c/.list
@@ -0,0 +1 @@
+jcarbaut@myway.com
7 f2c/.master
@@ -0,0 +1,7 @@
+lib f2c
+for converting Fortran to C
+by Feldman, Gay, Maimone, and Schryer
+editor David Gay
+master ornl.gov
+gams s1
+
2  f2c/00lastchange
@@ -0,0 +1,2 @@
+Mon Aug 1 13:46:40 MDT 2011
+ README, README in libf2c.zip: update some netlib pointers.
35 f2c/build.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# set up target directory structure
+mkdir -p /tmp/f2c/bin
+mkdir -p /tmp/f2c/lib
+mkdir -p /tmp/f2c/include
+mkdir -p /tmp/f2c/share/man/man1
+
+# install header
+cp f2c.h /tmp/f2c/include/
+
+# build & install libf2c
+cd libf2c
+make
+cp libf2c.a /tmp/f2c/lib/
+ranlib /tmp/f2c/lib/libf2c.a
+cd ..
+
+# build & install f2c translator
+cd src
+make
+cp f2c /tmp/f2c/bin/
+cd ..
+
+# install fc script
+cp fc /tmp/f2c/bin/
+
+# install man page
+cp f2c.1t /tmp/f2c/share/man/man1/f2c.1
+
+# clean up
+cd src
+make clean
+cd ../libf2c
+make clean
3,482 f2c/changes
3,482 additions, 0 deletions not shown
16 f2c/disclaimer
@@ -0,0 +1,16 @@
+f2c is a Fortran to C converter under development since 1990 by
+ David M. Gay (then AT&T Bell Labs, soon Sandia Nat'l Labs)
+ Stu Feldman (then at Bellcore, now at IBM)
+ Mark Maimone (Carnegie-Mellon University)
+ Norm Schryer (then AT&T Bell Labs, now AT&T Labs)
+Please send bug reports to dmg at acm dot org (with " at "
+changed to "@" and " dot " to ".").
+
+AT&T, Bellcore and Lucent disclaim all warranties with regard to this
+software, including all implied warranties of merchantability
+and fitness. In no event shall AT&T, Bellcore or Lucent be liable for
+any special, indirect or consequential damages or any damages
+whatsoever resulting from loss of use, data or profits, whether
+in an action of contract, negligence or other tortious action,
+arising out of or in connection with the use or performance of
+this software.
222 f2c/f2c.1
@@ -0,0 +1,222 @@
+
+ F2C(1) UNIX System V F2C(1)
+
+ NAME
+ f2c - Convert Fortran 77 to C or C++
+
+ SYNOPSIS
+ f2c [ option ... ] file ...
+
+ DESCRIPTION
+ F2c converts Fortran 77 source code in files with names end-
+ ing in `.f' or `.F' to C (or C++) source files in the cur-
+ rent directory, with `.c' substituted for the final `.f' or
+ `.F'. If no Fortran files are named, f2c reads Fortran from
+ standard input and writes C on standard output. File names
+ that end with `.p' or `.P' are taken to be prototype files,
+ as produced by option `-P', and are read first.
+
+ The following options have the same meaning as in f77(1).
+
+ -C Compile code to check that subscripts are within
+ declared array bounds.
+
+ -I2 Render INTEGER and LOGICAL as short, INTEGER*4 as long
+ int. Assume the default libF77 and libI77: allow only
+ INTEGER*4 (and no LOGICAL) variables in INQUIREs.
+ Option `-I4' confirms the default rendering of INTEGER
+ as long int.
+
+ -Idir
+ Look for a non-absolute include file first in the
+ directory of the current input file, then in directo-
+ ries specified by -I options (one directory per
+ option). Options -I2 and -I4 have precedence, so,
+ e.g., a directory named 2 should be specified by -I./2
+ .
+
+ -onetrip
+ Compile DO loops that are performed at least once if
+ reached. (Fortran 77 DO loops are not performed at all
+ if the upper limit is smaller than the lower limit.)
+
+ -U Honor the case of variable and external names. Fortran
+ keywords must be in lower case.
+
+ -u Make the default type of a variable `undefined' rather
+ than using the default Fortran rules.
+
+ -w Suppress all warning messages, or, if the option is
+ `-w66', just Fortran 66 compatibility warnings.
+
+ The following options are peculiar to f2c.
+
+ -A Produce ANSI C (default, starting 20020621). For old-
+ style C, use option -K.
+
+ Page 1 (printed 6/21/02)
+
+ F2C(1) UNIX System V F2C(1)
+
+ -a Make local variables automatic rather than static
+ unless they appear in a DATA, EQUIVALENCE, NAMELIST, or
+ SAVE statement.
+
+ -C++ Output C++ code.
+
+ -c Include original Fortran source as comments.
+
+ -cd Do not recognize cdabs, cdcos, cdexp, cdlog, cdsin, and
+ cdsqrt as synonyms for the double complex intrinsics
+ zabs, zcos, zexp, zlog, zsin, and zsqrt, respectively,
+ nor dreal as a synonym for dble.
+
+ -ddir
+ Write `.c' files in directory dir instead of the cur-
+ rent directory.
+
+ -E Declare uninitialized COMMON to be Extern (overridably
+ defined in f2c.h as extern).
+
+ -ec Place uninitialized COMMON blocks in separate files:
+ COMMON /ABC/ appears in file abc_com.c. Option `-e1c'
+ bundles the separate files into the output file, with
+ comments that give an unbundling sed(1) script.
+
+ -ext Complain about f77(1) extensions.
+
+ -f Assume free-format input: accept text after column 72
+ and do not pad fixed-format lines shorter than 72 char-
+ acters with blanks.
+
+ -72 Treat text appearing after column 72 as an error.
+
+ -g Include original Fortran line numbers in #line lines.
+
+ -h Emulate Fortran 66's treatment of Hollerith: try to
+ align character strings on word (or, if the option is
+ `-hd', on double-word) boundaries.
+
+ -i2 Similar to -I2, but assume a modified libF77 and libI77
+ (compiled with -Df2c_i2), so INTEGER and LOGICAL vari-
+ ables may be assigned by INQUIRE and array lengths are
+ stored in short ints.
+
+ -i90 Do not recognize the Fortran 90 bit-manipulation
+ intrinsics btest, iand, ibclr, ibits, ibset, ieor, ior,
+ ishft, and ishftc.
+
+ -kr Use temporary values to enforce Fortran expression
+ evaluation where K&R (first edition) parenthesization
+ rules allow rearrangement. If the option is `-krd',
+ use double precision temporaries even for single-
+
+ Page 2 (printed 6/21/02)
+
+ F2C(1) UNIX System V F2C(1)
+
+ precision operands.
+
+ -P Write a file.P of ANSI (or C++) prototypes for defini-
+ tions in each input file.f or file.F. When reading
+ Fortran from standard input, write prototypes at the
+ beginning of standard output. Option -Ps implies -P
+ and gives exit status 4 if rerunning f2c may change
+ prototypes or declarations.
+
+ -p Supply preprocessor definitions to make common-block
+ members look like local variables.
+
+ -R Do not promote REAL functions and operations to DOUBLE
+ PRECISION. Option `-!R' confirms the default, which
+ imitates f77.
+
+ -r Cast REAL arguments of intrinsic functions and values
+ of REAL functions (including intrinsics) to REAL.
+
+ -r8 Promote REAL to DOUBLE PRECISION, COMPLEX to DOUBLE
+ COMPLEX.
+
+ -s Preserve multidimensional subscripts. Suppressed by
+ option `-C' .
+
+ -Tdir
+ Put temporary files in directory dir.
+
+ -trapuv
+ Dynamically initialize local variables, except those
+ appearing in SAVE or DATA statements, with values that
+ may help find references to uninitialized variables.
+ For example, with IEEE arithmetic, initialize local
+ floating-point variables to signaling NaNs.
+
+ -w8 Suppress warnings when COMMON or EQUIVALENCE forces
+ odd-word alignment of doubles.
+
+ -Wn Assume n characters/word (default 4) when initializing
+ numeric variables with character data.
+
+ -z Do not implicitly recognize DOUBLE COMPLEX.
+
+ -!bs Do not recognize backslash escapes (\", \', \0, \\, \b,
+ \f, \n, \r, \t, \v) in character strings.
+
+ -!c Inhibit C output, but produce -P output.
+
+ -!I Reject include statements.
+
+ -!i8 Disallow INTEGER*8 , or, if the option is `-!i8const',
+ permit INTEGER*8 but do not promote integer constants
+
+ Page 3 (printed 6/21/02)
+
+ F2C(1) UNIX System V F2C(1)
+
+ to INTEGER*8 when they involve more than 32 bits.
+
+ -!it Don't infer types of untyped EXTERNAL procedures from
+ use as parameters to previously defined or prototyped
+ procedures.
+
+ -!P Do not attempt to infer ANSI or C++ prototypes from
+ usage.
+
+ The resulting C invokes the support routines of f77; object
+ code should be loaded by f77 or with ld(1) or cc(1) options
+ -lF77 -lI77 -lm. Calling conventions are those of f77: see
+ the reference below.
+
+ FILES
+ file.[fF] input file
+
+ *.c output file
+
+ /usr/include/f2c.h
+ header file
+
+ /usr/lib/libF77.aintrinsic function library
+
+ /usr/lib/libI77.aFortran I/O library
+
+ /lib/libc.a C library, see section 3
+
+ SEE ALSO
+ S. I. Feldman and P. J. Weinberger, `A Portable Fortran 77
+ Compiler', UNIX Time Sharing System Programmer's Manual,
+ Tenth Edition, Volume 2, AT&T Bell Laboratories, 1990.
+
+ DIAGNOSTICS
+ The diagnostics produced by f2c are intended to be self-
+ explanatory.
+
+ BUGS
+ Floating-point constant expressions are simplified in the
+ floating-point arithmetic of the machine running f2c, so
+ they are typically accurate to at most 16 or 17 decimal
+ places.
+ Untypable EXTERNAL functions are declared int.
+ There is no notation for INTEGER*8 constants.
+ Some intrinsic functions do not yet work with INTEGER*8 .
+
+ Page 4 (printed 6/21/02)
+
391 f2c/f2c.1t
@@ -0,0 +1,391 @@
+. \" Definitions of F, L and LR for the benefit of systems
+. \" whose -man lacks them...
+.de F
+.nh
+.if n \%\&\\$1
+.if t \%\&\f(CW\\$1\fR
+.hy 14
+..
+.de L
+.nh
+.if n \%`\\$1'
+.if t \%\&\f(CW\\$1\fR
+.hy 14
+..
+.de LR
+.nh
+.if n \%`\\$1'\\$2
+.if t \%\&\f(CW\\$1\fR\\$2
+.hy 14
+..
+.TH F2C 1
+.CT 1 prog_other
+.SH NAME
+f2c \- Convert Fortran 77 to C or C++
+. \" f\^2c changed to f2c in the previous line for the benefit of
+. \" people on systems (e.g. Sun systems) whose makewhatis cannot
+. \" cope with troff formatting commands.
+.SH SYNOPSIS
+.B f\^2c
+[
+.I option ...
+]
+.I file ...
+.SH DESCRIPTION
+.I F2c
+converts Fortran 77 source code in
+.I files
+with names ending in
+.L .f
+or
+.L .F
+to C (or C++) source files in the
+current directory, with
+.L .c
+substituted
+for the final
+.L .f
+or
+.LR .F .
+If no Fortran files are named,
+.I f\^2c
+reads Fortran from standard input and
+writes C on standard output.
+.I File
+names that end with
+.L .p
+or
+.L .P
+are taken to be prototype
+files, as produced by option
+.LR -P ,
+and are read first.
+.PP
+The following options have the same meaning as in
+.IR f\^77 (1).
+.TP
+.B -C
+Compile code to check that subscripts are within declared array bounds.
+.TP
+.B -I2
+Render INTEGER and LOGICAL as short,
+INTEGER\(**4 as long int. Assume the default \fIlibF77\fR
+and \fIlibI77\fR: allow only INTEGER\(**4 (and no LOGICAL)
+variables in INQUIREs. Option
+.L -I4
+confirms the default rendering of INTEGER as long int.
+.TP
+.BI -I dir
+Look for a non-absolute include file first in the directory of the
+current input file, then in directories specified by \f(CW-I\fP
+options (one directory per option). Options
+\f(CW-I2\fP and \f(CW-I4\fP
+have precedence, so, e.g., a directory named \f(CW2\fP
+should be specified by \f(CW-I./2\fP .
+.TP
+.B -onetrip
+Compile DO loops that are performed at least once if reached.
+(Fortran 77 DO loops are not performed at all if the upper limit is smaller than the lower limit.)
+.TP
+.B -U
+Honor the case of variable and external names. Fortran keywords must be in
+.I
+lower
+case.
+.TP
+.B -u
+Make the default type of a variable `undefined' rather than using the default Fortran rules.
+.TP
+.B -w
+Suppress all warning messages, or, if the option is
+.LR -w66 ,
+just Fortran 66 compatibility warnings.
+.PP
+The following options are peculiar to
+.IR f\^2c .
+.TP
+.B -A
+Produce
+.SM ANSI
+C (default, starting 20020621).
+For old-style C, use option \f(CW-K\fP.
+.TP
+.B -a
+Make local variables automatic rather than static
+unless they appear in a
+.SM "DATA, EQUIVALENCE, NAMELIST,"
+or
+.SM SAVE
+statement.
+.TP
+.B -C++
+Output C++ code.
+.TP
+.B -c
+Include original Fortran source as comments.
+.TP
+.B -cd
+Do not recognize cdabs, cdcos, cdexp, cdlog, cdsin, and cdsqrt
+as synonyms for the double complex intrinsics
+zabs, zcos, zexp, zlog, zsin, and zsqrt, respectively,
+nor dreal as a synonym for dble.
+.TP
+.BI -d dir
+Write
+.L .c
+files in directory
+.I dir
+instead of the current directory.
+.TP
+.B -E
+Declare uninitialized
+.SM COMMON
+to be
+.B Extern
+(overridably defined in
+.F f2c.h
+as
+.B extern).
+.TP
+.B -ec
+Place uninitialized
+.SM COMMON
+blocks in separate files:
+.B COMMON /ABC/
+appears in file
+.BR abc_com.c .
+Option
+.LR -e1c
+bundles the separate files
+into the output file, with comments that give an unbundling
+.IR sed (1)
+script.
+.TP
+.B -ext
+Complain about
+.IR f\^77 (1)
+extensions.
+.TP
+.B -f
+Assume free-format input: accept text after column 72 and do not
+pad fixed-format lines shorter than 72 characters with blanks.
+.TP
+.B -72
+Treat text appearing after column 72 as an error.
+.TP
+.B -g
+Include original Fortran line numbers in \f(CW#line\fR lines.
+.TP
+.B -h
+Emulate Fortran 66's treatment of Hollerith: try to align character strings on
+word (or, if the option is
+.LR -hd ,
+on double-word) boundaries.
+.TP
+.B -i2
+Similar to
+.BR -I2 ,
+but assume a modified
+.I libF77
+and
+.I libI77
+(compiled with
+.BR -Df\^2c_i2 ),
+so
+.SM INTEGER
+and
+.SM LOGICAL
+variables may be assigned by
+.SM INQUIRE
+and array lengths are stored in short ints.
+.TP
+.B -i90
+Do not recognize the Fortran 90 bit-manipulation intrinsics
+btest, iand, ibclr, ibits, ibset, ieor, ior, ishft, and ishftc.
+.TP
+.B -kr
+Use temporary values to enforce Fortran expression evaluation
+where K&R (first edition) parenthesization rules allow rearrangement.
+If the option is
+.LR -krd ,
+use double precision temporaries even for single-precision operands.
+.TP
+.B -P
+Write a
+.IB file .P
+of ANSI (or C++) prototypes
+for definitions in each input
+.IB file .f
+or
+.IB file .F .
+When reading Fortran from standard input, write prototypes
+at the beginning of standard output. Option
+.B -Ps
+implies
+.B -P
+and gives exit status 4 if rerunning
+.I f\^2c
+may change prototypes or declarations.
+.TP
+.B -p
+Supply preprocessor definitions to make common-block members
+look like local variables.
+.TP
+.B -R
+Do not promote
+.SM REAL
+functions and operations to
+.SM DOUBLE PRECISION.
+Option
+.L -!R
+confirms the default, which imitates
+.IR f\^77 .
+.TP
+.B -r
+Cast REAL arguments of intrinsic functions and values of REAL
+functions (including intrinsics) to REAL.
+.TP
+.B -r8
+Promote
+.SM REAL
+to
+.SM DOUBLE PRECISION, COMPLEX
+to
+.SM DOUBLE COMPLEX.
+.TP
+.B -s
+Preserve multidimensional subscripts. Suppressed by option
+.L -C
+\&.
+.TP
+.BI -T dir
+Put temporary files in directory
+.I dir.
+.TP
+.B -trapuv
+Dynamically initialize local variables, except those appearing in
+.SM SAVE
+or
+.SM DATA
+statements, with values that may help find references to
+uninitialized variables. For example, with IEEE arithmetic,
+initialize local floating-point variables to signaling NaNs.
+.TP
+.B -w8
+Suppress warnings when
+.SM COMMON
+or
+.SM EQUIVALENCE
+forces odd-word alignment of doubles.
+.TP
+.BI -W n
+Assume
+.I n
+characters/word (default 4)
+when initializing numeric variables with character data.
+.TP
+.B -z
+Do not implicitly recognize
+.SM DOUBLE COMPLEX.
+.TP
+.B -!bs
+Do not recognize \fIb\fRack\fIs\fRlash escapes
+(\e", \e', \e0, \e\e, \eb, \ef, \en, \er, \et, \ev) in character strings.
+.TP
+.B -!c
+Inhibit C output, but produce
+.B -P
+output.
+.TP
+.B -!I
+Reject
+.B include
+statements.
+.TP
+.B -!i8
+Disallow
+.SM INTEGER*8 ,
+or, if the option is
+.LR -!i8const ,
+permit
+.SM INTEGER*8
+but do not promote integer
+constants to
+.SM INTEGER*8
+when they involve more than 32 bits.
+.TP
+.B -!it
+Don't infer types of untyped
+.SM EXTERNAL
+procedures from use as parameters to previously defined or prototyped
+procedures.
+.TP
+.B -!P
+Do not attempt to infer
+.SM ANSI
+or C++
+prototypes from usage.
+.PP
+The resulting C invokes the support routines of
+.IR f\^77 ;
+object code should be loaded by
+.I f\^77
+or with
+.IR ld (1)
+or
+.IR cc (1)
+options
+.BR "-lF77 -lI77 -lm" .
+Calling conventions
+are those of
+.IR f\&77 :
+see the reference below.
+.br
+.SH FILES
+.TP
+.nr )I 1.75i
+.IB file .[fF]
+input file
+.TP
+.B *.c
+output file
+.TP
+.F /usr/include/f2c.h
+header file
+.TP
+.F /usr/lib/libF77.a
+intrinsic function library
+.TP
+.F /usr/lib/libI77.a
+Fortran I/O library
+.TP
+.F /lib/libc.a
+C library, see section 3
+.SH "SEE ALSO"
+S. I. Feldman and
+P. J. Weinberger,
+`A Portable Fortran 77 Compiler',
+\fIUNIX Time Sharing System Programmer's Manual\fR,
+Tenth Edition, Volume 2, AT&T Bell Laboratories, 1990.
+.SH DIAGNOSTICS
+The diagnostics produced by
+.I f\^2c
+are intended to be
+self-explanatory.
+.SH BUGS
+Floating-point constant expressions are simplified in
+the floating-point arithmetic of the machine running
+.IR f\^2c ,
+so they are typically accurate to at most 16 or 17 decimal places.
+.br
+Untypable
+.SM EXTERNAL
+functions are declared
+.BR int .
+.br
+There is no notation for
+.SM INTEGER*8
+constants.
+.br
+Some intrinsic functions do not yet work with
+.SM INTEGER*8 .
223 f2c/f2c.h
@@ -0,0 +1,223 @@
+/* f2c.h -- Standard Fortran to C header file */
+
+/** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed."
+
+ - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
+
+#ifndef F2C_INCLUDE
+#define F2C_INCLUDE
+
+typedef long int integer;
+typedef unsigned long int uinteger;
+typedef char *address;
+typedef short int shortint;
+typedef float real;
+typedef double doublereal;
+typedef struct { real r, i; } complex;
+typedef struct { doublereal r, i; } doublecomplex;
+typedef long int logical;
+typedef short int shortlogical;
+typedef char logical1;
+typedef char integer1;
+#ifdef INTEGER_STAR_8 /* Adjust for integer*8. */
+typedef long long longint; /* system-dependent */
+typedef unsigned long long ulongint; /* system-dependent */
+#define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b)))
+#define qbit_set(a,b) ((a) | ((ulongint)1 << (b)))
+#endif
+
+#define TRUE_ (1)
+#define FALSE_ (0)
+
+/* Extern is for use with -E */
+#ifndef Extern
+#define Extern extern
+#endif
+
+/* I/O stuff */
+
+#ifdef f2c_i2
+/* for -i2 */
+typedef short flag;
+typedef short ftnlen;
+typedef short ftnint;
+#else
+typedef long int flag;
+typedef long int ftnlen;
+typedef long int ftnint;
+#endif
+
+/*external read, write*/
+typedef struct
+{ flag cierr;
+ ftnint ciunit;
+ flag ciend;
+ char *cifmt;
+ ftnint cirec;
+} cilist;
+
+/*internal read, write*/
+typedef struct
+{ flag icierr;
+ char *iciunit;
+ flag iciend;
+ char *icifmt;
+ ftnint icirlen;
+ ftnint icirnum;
+} icilist;
+
+/*open*/
+typedef struct
+{ flag oerr;
+ ftnint ounit;
+ char *ofnm;
+ ftnlen ofnmlen;
+ char *osta;
+ char *oacc;
+ char *ofm;
+ ftnint orl;
+ char *oblnk;
+} olist;
+
+/*close*/
+typedef struct
+{ flag cerr;
+ ftnint cunit;
+ char *csta;
+} cllist;
+
+/*rewind, backspace, endfile*/
+typedef struct
+{ flag aerr;
+ ftnint aunit;
+} alist;
+
+/* inquire */
+typedef struct
+{ flag inerr;
+ ftnint inunit;
+ char *infile;
+ ftnlen infilen;
+ ftnint *inex; /*parameters in standard's order*/
+ ftnint *inopen;
+ ftnint *innum;
+ ftnint *innamed;
+ char *inname;
+ ftnlen innamlen;
+ char *inacc;
+ ftnlen inacclen;
+ char *inseq;
+ ftnlen inseqlen;
+ char *indir;
+ ftnlen indirlen;
+ char *infmt;
+ ftnlen infmtlen;
+ char *inform;
+ ftnint informlen;
+ char *inunf;
+ ftnlen inunflen;
+ ftnint *inrecl;
+ ftnint *innrec;
+ char *inblank;
+ ftnlen inblanklen;
+} inlist;
+
+#define VOID void
+
+union Multitype { /* for multiple entry points */
+ integer1 g;
+ shortint h;
+ integer i;
+ /* longint j; */
+ real r;
+ doublereal d;
+ complex c;
+ doublecomplex z;
+ };
+
+typedef union Multitype Multitype;
+
+/*typedef long int Long;*/ /* No longer used; formerly in Namelist */
+
+struct Vardesc { /* for Namelist */
+ char *name;
+ char *addr;
+ ftnlen *dims;
+ int type;
+ };
+typedef struct Vardesc Vardesc;
+
+struct Namelist {
+ char *name;
+ Vardesc **vars;
+ int nvars;
+ };
+typedef struct Namelist Namelist;
+
+#define abs(x) ((x) >= 0 ? (x) : -(x))
+#define dabs(x) (doublereal)abs(x)
+#define min(a,b) ((a) <= (b) ? (a) : (b))
+#define max(a,b) ((a) >= (b) ? (a) : (b))
+#define dmin(a,b) (doublereal)min(a,b)
+#define dmax(a,b) (doublereal)max(a,b)
+#define bit_test(a,b) ((a) >> (b) & 1)
+#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
+#define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
+
+/* procedure parameter types for -A and -C++ */
+
+#define F2C_proc_par_types 1
+#ifdef __cplusplus
+typedef int /* Unknown procedure type */ (*U_fp)(...);
+typedef shortint (*J_fp)(...);
+typedef integer (*I_fp)(...);
+typedef real (*R_fp)(...);
+typedef doublereal (*D_fp)(...), (*E_fp)(...);
+typedef /* Complex */ VOID (*C_fp)(...);
+typedef /* Double Complex */ VOID (*Z_fp)(...);
+typedef logical (*L_fp)(...);
+typedef shortlogical (*K_fp)(...);
+typedef /* Character */ VOID (*H_fp)(...);
+typedef /* Subroutine */ int (*S_fp)(...);
+#else
+typedef int /* Unknown procedure type */ (*U_fp)();
+typedef shortint (*J_fp)();
+typedef integer (*I_fp)();
+typedef real (*R_fp)();
+typedef doublereal (*D_fp)(), (*E_fp)();
+typedef /* Complex */ VOID (*C_fp)();
+typedef /* Double Complex */ VOID (*Z_fp)();
+typedef logical (*L_fp)();
+typedef shortlogical (*K_fp)();
+typedef /* Character */ VOID (*H_fp)();
+typedef /* Subroutine */ int (*S_fp)();
+#endif
+/* E_fp is for real functions when -R is not specified */
+typedef VOID C_f; /* complex function */
+typedef VOID H_f; /* character function */
+typedef VOID Z_f; /* double complex function */
+typedef doublereal E_f; /* real function with -R not specified */
+
+/* undef any lower-case symbols that your C compiler predefines, e.g.: */
+
+#ifndef Skip_f2c_Undefs
+#undef cray
+#undef gcos
+#undef mc68010
+#undef mc68020
+#undef mips
+#undef pdp11
+#undef sgi
+#undef sparc
+#undef sun
+#undef sun2
+#undef sun3
+#undef sun4
+#undef u370
+#undef u3b
+#undef u3b2
+#undef u3b5
+#undef unix
+#undef vax
+#endif
+#endif
BIN  f2c/f2c.pdf
Binary file not shown
BIN  f2c/f2c.ps
Binary file not shown
366 f2c/fc
@@ -0,0 +1,366 @@
+#! /bin/sh
+
+# NOTE: you may need to adjust the references to /usr/local/... below
+# (or remove them if they're not needed on your system).
+# You may need to add something like "-Olimit 2000" to the -O
+# processing below or change it to something more suitable for your
+# system. See also the comments starting with ### below.
+
+# Note that with some shells, invocations of the form
+# CFLAGS='system-specific stuff' fc ...
+# may be useful as way to pass system-specific stuff to the C compiler.
+# The script below simply appends to the initial CFLAGS value.
+
+PATH=/usr/local/bin:/bin:/usr/bin
+
+# f77-style shell script to compile and load fortran, C, and assembly codes
+
+# usage: f77 [options] files [-l library]
+
+# Options:
+
+# -o objfile Override default executable name a.out.
+
+# -a use automatic variable storage (on the stack)
+# by default -- rather than static storage
+
+# -c Do not call linker, leave relocatables in *.o.
+
+# -C Check that subscripts are in bounds.
+
+# -S leave assembler output on file.s
+
+# -L libdir (passed to ld)
+
+# -l library (passed to ld)
+
+# -u complain about undeclared variables
+
+# -w omit all warning messages
+
+# -w66 omit Fortran 66 compatibility warning messages
+
+# files FORTRAN source files ending in .f .
+# FORTRAN with cpp preprocessor directives
+# ending in .F .
+# C source files ending in .c .
+# Assembly language files ending in .s .
+# efl source files ending in .e .
+# RATFOR files ending in .r .
+# Object files ending in .o .
+# Shared libraries ending in .so .
+
+# f2c prototype files ending in .P ; such
+# files only affect subsequent files.
+
+# -D def passed to C compiler (for .c files)
+# or to cpp (for .F files)
+
+# -I includepath passed to C compiler (for .c files)
+# or to cpp (for .F files), and to f2c
+
+# -m xxx passed to C compiler as -mxxx
+
+# -N tnnn allow nnn entries in table t
+
+# -P emit .P files
+
+# -r8 promote real to double precision and
+# complex to double complex
+
+# -s strip executable
+
+# -trapuv Initialize floating-point variables to
+# signaling NaNs (on machines with IEEE
+# arithmetic) unless they appear in save,
+# common, or data statements. Initialize
+# other kinds of variables to values that
+# may attract attention if used without
+# being assigned proper values.
+
+# -U def passed to C compiler (for .c files)
+# or to cpp (for .F files) to remove def
+
+# -v show current f2c version
+# --version same as -v
+
+s=/tmp/stderr_$$
+t=/tmp/f77_$$.o
+### On some systems (e.g., IRIX), -common prevents complaints
+### about multiple definitions of COMMON blocks.
+#CC=${CC_f2c:-'cc -common'}
+CC=${CC_f2c:-'cc'}
+EFL=${EFL:-efl}
+EFLFLAGS=${EFLFLAGS:-'system=portable deltastno=10'}
+RATFOR=${RATFOR:-ratfor}
+RFLAGS=${RFLAGS:-'-6&'}
+F2C=${F2C:-/usr/local/bin/f2c}
+show_fc_help=0
+case $1 in
+ --help) show_fc_help=1;;
+ --version) show_fc_help=2;;
+ '-?') show_fc_help=1;;
+ -h) show_fc_help=1;;
+ -v) show_fc_help=2;;
+ esac
+case $show_fc_help in
+ 1)
+ echo 'f77 script based on f2c'
+ echo 'For usage details, see comments at the beginning of' $0 .
+ echo 'For pointers to f2c documentation, invoke' $F2C --help
+ exit 0;;
+ 2)
+ echo $0 'script based on f2c:'; $F2C -v
+ exit 0;;
+ esac
+F2CFLAGS=${F2CFLAGS:='-ARw8 -Nn802 -Nq300 -Nx400'}
+CPP=${CPP:-/lib/cpp}
+rc=0
+trap "rm -f $s $t; exit \$rc" 0
+OUTF=a.out
+OUTO=
+cOPT=1
+set -- `getopt acCD:gI:L:m:N:O:U:o:r:sSt:uw6 "$@"`
+case $? in 0);; *) rc=$?; exit;; esac
+CPPFLAGS=${CPPFLAGS:-'-I/usr/local/include'}
+CFLAGSF2C=${CFLAGSF2C:-'-I/usr/local/include'}
+OFILES=
+trapuv=
+strip=
+LIBS="-lf2c"
+while
+ test X"$1" != X--
+do
+ case "$1"
+ in
+ -a) F2CFLAGS="$F2CFLAGS -a"
+ shift;;
+
+ -C) F2CFLAGS="$F2CFLAGS -C"
+ shift;;
+
+ -c) cOPT=0
+ shift
+ ;;
+
+ -D) CPPFLAGS="$CPPFLAGS -D$2"
+ shift 2
+ ;;
+
+ -g) CFLAGS="$CFLAGS -g"
+ F2CFLAGS="$F2CFLAGS -g"
+ shift;;
+
+ -I) CPPFLAGS="$CPPFLAGS -I$2"
+ F2CFLAGS="$F2CFLAGS -I$2"
+ shift 2
+ ;;
+
+ -m) CC="$CC -m$2"
+ shift 2
+ ;;
+
+ -U) CPPFLAGS="$CPPFLAGS -U$2"
+ shift 2
+ ;;
+
+ -o) OUTF=$2
+ OUTO=$2
+ shift 2
+ ;;
+
+ -O) case $2 in 1) O=-O1;; 2) O=-O2;; 3) O=-O3;; *) O=-O;; esac
+ case $O in -O);; *) shift;; esac
+ CFLAGS="$CFLAGS $O"
+# CFLAGS="$CFLAGS $O"
+ shift
+ ;;
+
+ -r) case $2 in 8) F2CFLAGS="$F2CFLAGS -r8";;
+ *) echo "Ignoring -r$2";; esac
+ shift; shift
+ ;;
+
+ -s) strip=1
+ shift
+ ;;
+
+ -u) F2CFLAGS="$F2CFLAGS -u"
+ shift
+ ;;
+
+ -w) F2CFLAGS="$F2CFLAGS -w"
+ case $2 in -6) F2CFLAGS="$F2CFLAGS"66; shift
+ case $2 in -6) shift;; esac;; esac
+ shift
+ ;;
+
+ -L) OFILES="$OFILES $1$2"
+ shift 2
+ case $cOPT in 1) cOPT=2;; esac
+ ;;
+
+ -L*) OFILES="$OFILES $1"
+ shift
+ case $cOPT in 1) cOPT=2;; esac
+ ;;
+
+ -N) F2CFLAGS="$F2CFLAGS $1""$2"
+ shift 2
+ ;;
+
+ -P) F2CFLAGS="$F2CFLAGS $1"
+ shift
+ ;;
+
+
+ -S) CFLAGS="$CFLAGS -S"
+ cOPT=0
+ shift
+ ;;
+
+ -t)
+ case $2 in
+ rapuv)
+ F2CFLAGS="$F2CFLAGS -trapuv"
+ trapuv=1
+# LIBS="$LIBS -lfpe"
+ shift 2;;
+ *)
+ echo "invalid parameter $1" 1>&2
+ shift;;
+ esac
+ ;;
+
+ '') echo $0: 'unexpected null argument'; exit 1;;
+
+ *)
+ echo "invalid parameter $1" 1>&2
+ shift
+ ;;
+ esac
+done
+shift
+case $cOPT in 0) case $OUTO in '');; *) CFLAGS="$CFLAGS -o $OUTO";; esac;; esac
+while
+ test -n "$1"
+do
+ case "$1"
+ in
+ *.[fF])
+ case "$1" in *.f) f=".f";; *.F) f=".F";; esac
+ case "$1" in
+ *.f) b=`basename $1 .f`
+ $F2C $F2CFLAGS $1
+ rc=$?
+ ;;
+ *.F) b=`basename $1 .F`
+ $CPP $CPPFLAGS $1 >$b.i
+ rc=$?
+ case $rc in 0)
+ $F2C $F2CFLAGS <$b.i >$b.c
+ rc=$?
+ ;;esac
+ rm $b.i
+ ;;
+ esac
+ case $rc in 0);; *) exit;; esac
+ $CC -c $CFLAGSF2C $CFLAGS $b.c 2>$s
+ rc=$?
+ sed '/parameter .* is not referenced/d;/warning: too many parameters/d' $s 1>&2
+ case $rc in 0);; *) exit;; esac
+ OFILES="$OFILES $b.o"
+ rm $b.c
+ case $cOPT in 1) cOPT=2;; esac
+ shift
+ ;;
+ *.e)
+ b=`basename $1 .e`
+ $EFL $EFLFLAGS $1 >$b.f
+ case $? in 0);; *) rc=$?; exit;; esac
+ $F2C $F2CFLAGS $b.f
+ case $? in 0);; *) rc=$?; exit;; esac
+ $CC -c $CFLAGSF2C $CFLAGS $b.c
+ case $? in 0);; *) rc=$?; exit;; esac
+ OFILES="$OFILES $b.o"
+ rm $b.[cf]
+ case $cOPT in 1) cOPT=2;; esac
+ shift
+ ;;
+ *.r)
+ b=`basename $1 .r`
+ $RATFOR $RFLAGS $1 >$b.f
+ case $? in 0);; *) rc=$?; exit;; esac
+ $F2C $F2CFLAGS $b.f
+ case $? in 0);; *) rc=$?; exit;; esac
+ $CC -c $CFLAGSF2C $CFLAGS $b.c
+ case $? in 0);; *) rc=$?; exit;; esac
+ OFILES="$OFILES $b.o"
+ rm $b.[cf]
+ case $cOPT in 1) cOPT=2;; esac
+ shift
+ ;;
+ *.s)
+ echo $1: 1>&2
+ OFILE=`basename $1 .s`.o
+ ${AS:-as} -o $OFILE $AFLAGS $1
+ case $? in 0);; *) rc=$?; exit;; esac
+ OFILES="$OFILES $OFILE"
+ case $cOPT in 1) cOPT=2;; esac
+ shift
+ ;;
+ *.c)
+ echo $1: 1>&2
+ OFILE=`basename $1 .c`.o
+ $CC -c $CFLAGSF2C $CPPFLAGS $CFLAGS $1
+ rc=$?; case $rc in 0);; *) rc=$?; exit;; esac
+ OFILES="$OFILES $OFILE"
+ case $cOPT in 1) cOPT=2;; esac
+ shift
+ ;;
+ *.o)
+ OFILES="$OFILES $1"
+ case $cOPT in 1) cOPT=2;; esac
+ shift
+ ;;
+ *.so)
+ OFILES="$OFILES $1"
+ case $cOPT in 1) cOPT=2;; esac
+ shift
+ ;;
+ -[lL])
+ OFILES="$OFILES $1$2"
+ shift 2
+ case $cOPT in 1) cOPT=2;; esac
+ ;;
+ -[lL]*)
+ OFILES="$OFILES $1"
+ shift
+ case $cOPT in 1) cOPT=2;; esac
+ ;;
+ -o)
+ case $cOPT in 0) CFLAGS="$CFLAGS -o $2";; *) OUTF=$2;; esac
+ shift 2;;
+ *.P)
+ F2CFLAGS="$F2CFLAGS $1"
+ shift
+ ;;
+ *)
+ OFILES="$OFILES $1"
+ shift
+ case $cOPT in 1) cOPT=2;; esac
+ ;;
+ esac
+done
+
+### On some (IRIX) systems, -Wl,-dont_warn_unused prevents complaints
+### about unnecessary -l options.
+
+case $cOPT in 2)
+# case $trapuv in 1) OFILES="$OFILES -lfpe";; esac
+# $CC -Wl,-dont_warn_unused -o $OUTF -L/usr/local/lib $OFILES $LIBS
+ $CC -o $OUTF -L/usr/local/lib $OFILES $LIBS
+ case $strip in 1) strip $OUTF;; esac
+ ;; esac
+rc=$?
+exit $rc
4 f2c/fixlog
@@ -0,0 +1,4 @@
+Sun Oct 8 02:45:04 MDT 2006
+ putpcc.c: fix glitch in subscripting complex variables: subscripts
+of type integer*8 were converted to integer*4, which causes trouble
+when 32-bit addressing does not suffice.
23 f2c/libf2c/Notice
@@ -0,0 +1,23 @@
+/****************************************************************
+Copyright 1990 - 1997 by AT&T, Lucent Technologies and Bellcore.
+
+Permission to use, copy, modify, and distribute this software
+and its documentation for any purpose and without fee is hereby
+granted, provided that the above copyright notice appear in all
+copies and that both that the copyright notice and this
+permission notice and warranty disclaimer appear in supporting
+documentation, and that the names of AT&T, Bell Laboratories,
+Lucent or Bellcore or any of their entities not be used in
+advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+AT&T, Lucent and Bellcore disclaim all warranties with regard to
+this software, including all implied warranties of
+merchantability and fitness. In no event shall AT&T, Lucent or
+Bellcore be liable for any special, indirect or consequential
+damages or any damages whatsoever resulting from loss of use,
+data or profits, whether in an action of contract, negligence or
+other tortious action, arising out of or in connection with the
+use or performance of this software.
+****************************************************************/
+
374 f2c/libf2c/README
@@ -0,0 +1,374 @@
+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.org
+ 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.
+
+On VAX, Cray, or Research Tenth-Edition Unix systems, you may
+need to add -DVAX, -DCRAY, or -DV10 (respectively) to CFLAGS
+to make fp.h work correctly. Alternatively, you may need to
+edit fp.h to suit your machine.
+
+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.
+
+You may need to supply the following non-ANSI routines:
+
+ fstat(int fileds, struct stat *buf) is similar
+to stat(char *name, struct stat *buf), except that
+the first argument, fileds, is the file descriptor
+returned by open rather than the name of the file.
+fstat is used in the system-dependent routine
+canseek (in the libf2c source file err.c), which
+is supposed to return 1 if it's possible to issue
+seeks on the file in question, 0 if it's not; you may
+need to suitably modify err.c . On non-UNIX systems,
+you can avoid references to fstat and stat by compiling
+with NON_UNIX_STDIO defined; in that case, you may need
+to supply access(char *Name,0), which is supposed to
+return 0 if file Name exists, nonzero otherwise.
+
+ char * mktemp(char *buf) is supposed to replace the
+6 trailing X's in buf with a unique number and then
+return buf. The idea is to get a unique name for
+a temporary file.
+
+On non-UNIX systems, you may need to change a few other,
+e.g.: the form of name computed by mktemp() in endfile.c and
+open.c; the use of the open(), close(), and creat() system
+calls in endfile.c, err.c, open.c; and the modes in calls on
+fopen() and fdopen() (and perhaps the use of fdopen() itself
+-- it's supposed to return a FILE* corresponding to a given
+an integer file descriptor) in err.c and open.c (component ufmt
+of struct unit is 1 for formatted I/O -- text mode on some systems
+-- and 0 for unformatted I/O -- binary mode on some systems).
+Compiling with -DNON_UNIX_STDIO omits all references to creat()
+and almost all references to open() and close(), the exception
+being in the function f__isdev() (in open.c).
+
+If you wish to use translated Fortran that has funny notions
+of record length for direct unformatted I/O (i.e., that assumes
+RECL= values in OPEN statements are not bytes but rather counts
+of some other units -- e.g., 4-character words for VMS), then you
+should insert an appropriate #define for url_Adjust at the
+beginning of open.c . For VMS Fortran, for example,
+#define url_Adjust(x) x *= 4
+would suffice.
+
+By default, Fortran I/O units 5, 6, and 0 are pre-connected to
+stdin, stdout, and stderr, respectively. You can change this
+behavior by changing f_init() in err.c to suit your needs.
+Note that f2c assumes READ(*... means READ(5... and WRITE(*...
+means WRITE(6... . Moreover, an OPEN(n,... statement that does
+not specify a file name (and does not specify STATUS='SCRATCH')
+assumes FILE='fort.n' . You can change this by editing open.c
+and endfile.c suitably.
+
+Unless you adjust the "#define MXUNIT" line in fio.h, Fortran units
+0, 1, ..., 99 are available, i.e., the highest allowed unit number
+is MXUNIT - 1.
+
+Lines protected from compilation by #ifdef Allow_TYQUAD
+are for a possible extension to 64-bit integers in which
+integer = int = 32 bits and longint = long = 64 bits.
+
+The makefile does not attempt to compile pow_qq.c, qbitbits.c,
+and qbitshft.c, which are meant for use with INTEGER*8. To use
+INTEGER*8, you must modify f2c.h to declare longint and ulongint
+appropriately; then add $(QINT) to the end of the makefile's
+dependency list for libf2c.a (if makefile is a copy of makefile.u;
+for the PC makefiles, add pow_qq.obj qbitbits.obj qbitshft.obj
+to the library's dependency list and adjust libf2c.lbc or libf2c.sy
+accordingly). Also add -DAllow_TYQUAD to the makefile's CFLAGS
+assignment. To make longint and ulongint available, it may suffice
+to add -DINTEGER_STAR_8 to the CFLAGS assignment.
+
+Following Fortran 90, s_cat.c and s_copy.c allow the target of a
+(character string) assignment to be appear on its right-hand, at
+the cost of some extra overhead for all run-time concatenations.
+If you prefer the extra efficiency that comes with the Fortran 77
+requirement that the left-hand side of a character assignment not
+be involved in the right-hand side, compile s_cat.c and s_copy.c
+with -DNO_OVERWRITE .
+
+Extensions (Feb. 1993) to NAMELIST processing:
+ 1. Reading a ? instead of &name (the start of a namelist) causes
+the namelist being sought to be written to stdout (unit 6);
+to omit this feature, compile rsne.c with -DNo_Namelist_Questions.
+ 2. Reading the wrong namelist name now leads to an error message
+and an attempt to skip input until the right namelist name is found;
+to omit this feature, compile rsne.c with -DNo_Bad_Namelist_Skip.
+ 3. Namelist writes now insert newlines before each variable; to omit
+this feature, compile xwsne.c with -DNo_Extra_Namelist_Newlines.
+ 4. (Sept. 1995) When looking for the &name that starts namelist
+input, lines whose first non-blank character is something other
+than &, $, or ? are treated as comment lines and ignored, unless
+rsne.c is compiled with -DNo_Namelist_Comments.
+
+Nonstandard extension (Feb. 1993) to open: for sequential files,
+ACCESS='APPEND' (or access='anything else starting with "A" or "a"')
+causes the file to be positioned at end-of-file, so a write will
+append to the file.
+
+Some buggy Fortran programs use unformatted direct I/O to write
+an incomplete record and later read more from that record than
+they have written. For records other than the last, the unwritten
+portion of the record reads as binary zeros. The last record is
+a special case: attempting to read more from it than was written
+gives end-of-file -- which may help one find a bug. Some other
+Fortran I/O libraries treat the last record no differently than
+others and thus give no help in finding the bug of reading more
+than was written. If you wish to have this behavior, compile
+uio.c with -DPad_UDread .
+
+If you want to be able to catch write failures (e.g., due to a
+disk being full) with an ERR= specifier, compile dfe.c, due.c,
+sfe.c, sue.c, and wsle.c with -DALWAYS_FLUSH. This will lead to
+slower execution and more I/O, but should make ERR= work as
+expected, provided fflush returns an error return when its
+physical write fails.
+
+Carriage controls are meant to be interpreted by the UNIX col
+program (or a similar program). Sometimes it's convenient to use
+only ' ' as the carriage control character (normal single spacing).
+If you compile lwrite.c and wsfe.c with -DOMIT_BLANK_CC, formatted
+external output lines will have an initial ' ' quietly omitted,
+making use of the col program unnecessary with output that only
+has ' ' for carriage control.
+
+The Fortran 77 Standard leaves it up to the implementation whether
+formatted writes of floating-point numbers of absolute value < 1 have
+a zero before the decimal point. By default, libI77 omits such
+superfluous zeros, but you can cause them to appear by compiling
+lwrite.c, wref.c, and wrtfmt.c with -DWANT_LEAD_0 .
+
+If your (Unix) system lacks a ranlib command, you don't need it.
+Either comment out the makefile's ranlib invocation, or install
+a harmless "ranlib" command somewhere in your PATH, such as the
+one-line shell script
+
+ exit 0
+
+or (on some systems)
+
+ exec /usr/bin/ar lts $1 >/dev/null
+
+By default, the routines that implement complex and double complex
+division, c_div.c and z_div.c, call sig_die to print an error message
+and exit if they see a divisor of 0, as this is sometimes helpful for
+debugging. On systems with IEEE arithmetic, compiling c_div.c and
+z_div.c with -DIEEE_COMPLEX_DIVIDE causes them instead to set both
+the real and imaginary parts of the result to +INFINITY if the
+numerator is nonzero, or to NaN if it vanishes.
+
+Nowadays most Unix and Linux systems have function
+ int ftruncate(int fildes, off_t len);
+defined in system header file unistd.h that adjusts the length of file
+descriptor fildes to length len. Unless endfile.c is compiled with
+-DNO_TRUNCATE, endfile.c #includes "unistd.h" and calls ftruncate() if
+necessary to shorten files. If your system lacks ftruncate(), compile
+endfile.c with -DNO_TRUNCATE to make endfile.c use the older and more
+portable scheme of shortening a file by copying to a temporary file
+and back again.
+
+The initializations for "f2c -trapuv" are done by _uninit_f2c(),
+whose source is uninit.c, introduced June 2001. On IEEE-arithmetic
+systems, _uninit_f2c should initialize floating-point variables to
+signaling NaNs and, at its first invocation, should enable the
+invalid operation exception. Alas, the rules for distinguishing
+signaling from quiet NaNs were not specified in the IEEE P754 standard,
+nor were the precise means of enabling and disabling IEEE-arithmetic
+exceptions, and these details are thus system dependent. There are
+#ifdef's in uninit.c that specify them for some popular systems. If
+yours is not one of these systems, it may take some detective work to
+discover the appropriate details for your system. Sometimes it helps
+to look in the standard include directories for header files with
+relevant-sounding names, such as ieeefp.h, nan.h, or trap.h, and
+it may be simplest to run experiments to see what distinguishes a
+signaling from a quiet NaN. (If x is initialized to a signaling
+NaN and the invalid operation exception is masked off, as it should
+be by default on IEEE-arithmetic systems, then computing, say,
+y = x + 1 will yield a quiet NaN.)
22 f2c/libf2c/abort_.c
@@ -0,0 +1,22 @@
+#include "stdio.h"
+#include "f2c.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef KR_headers
+extern VOID sig_die();
+
+int abort_()
+#else
+extern void sig_die(const char*,int);
+
+int abort_(void)
+#endif
+{
+sig_die("Fortran abort routine called", 1);
+return 0; /* not reached */
+}
+#ifdef __cplusplus
+}
+#endif
248 f2c/libf2c/arithchk.c
@@ -0,0 +1,248 @@
+/****************************************************************
+Copyright (C) 1997, 1998, 2000 Lucent Technologies
+All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and
+its documentation for any purpose and without fee is hereby
+granted, provided that the above copyright notice appear in all
+copies and that both that the copyright notice and this
+permission notice and warranty disclaimer appear in supporting
+documentation, and that the name of Lucent or any of its entities
+not be used in advertising or publicity pertaining to
+distribution of the software without specific, written prior
+permission.
+
+LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
+IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
+SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
+IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+THIS SOFTWARE.
+****************************************************************/
+
+/* Try to deduce arith.h from arithmetic properties. */
+
+#include <stdio.h>
+#include <math.h>
+#include <errno.h>
+
+#ifdef NO_FPINIT
+#define fpinit_ASL()
+#else
+#ifndef KR_headers
+extern
+#ifdef __cplusplus
+ "C"
+#endif
+ void fpinit_ASL(void);
+#endif /*KR_headers*/
+#endif /*NO_FPINIT*/
+
+ static int dalign;
+ typedef struct
+Akind {
+ char *name;
+ int kind;
+ } Akind;
+
+ static Akind
+IEEE_8087 = { "IEEE_8087", 1 },
+IEEE_MC68k = { "IEEE_MC68k", 2 },
+IBM = { "IBM", 3 },
+VAX = { "VAX", 4 },
+CRAY = { "CRAY", 5};
+
+ static double t_nan;
+
+ static Akind *
+Lcheck(void)
+{
+ union {
+ double d;
+ long L[2];
+ } u;
+ struct {
+ double d;
+ long L;
+ } x[2];
+
+ if (sizeof(x) > 2*(sizeof(double) + sizeof(long)))
+ dalign = 1;
+ u.L[0] = u.L[1] = 0;
+ u.d = 1e13;
+ if (u.L[0] == 1117925532 && u.L[1] == -448790528)
+ return &IEEE_MC68k;
+ if (u.L[1] == 1117925532 && u.L[0] == -448790528)
+ return &IEEE_8087;
+ if (u.L[0] == -2065213935 && u.L[1] == 10752)
+ return &VAX;
+ if (u.L[0] == 1267827943 && u.L[1] == 704643072)
+ return &IBM;
+ return 0;
+ }
+
+ static Akind *
+icheck(void)
+{
+ union {
+ double d;
+ int L[2];
+ } u;
+ struct {
+ double d;
+ int L;
+ } x[2];
+
+ if (sizeof(x) > 2*(sizeof(double) + sizeof(int)))
+ dalign = 1;
+ u.L[0] = u.L[1] = 0;
+ u.d = 1e13;
+ if (u.L[0] == 1117925532 && u.L[1] == -448790528)
+ return &IEEE_MC68k;
+ if (u.L[1] == 1117925532 && u.L[0] == -448790528)
+ return &IEEE_8087;
+ if (u.L[0] == -2065213935 && u.L[1] == 10752)
+ return &VAX;
+ if (u.L[0] == 1267827943 && u.L[1] == 704643072)
+ return &IBM;
+ return 0;
+ }
+
+char *emptyfmt = ""; /* avoid possible warning message with printf("") */
+
+ static Akind *
+ccheck(void)
+{
+ union {
+ double d;
+ long L;
+ } u;
+ long Cray1;
+
+ /* Cray1 = 4617762693716115456 -- without overflow on non-Crays */
+ Cray1 = printf(emptyfmt) < 0 ? 0 : 4617762;
+ if (printf(emptyfmt, Cray1) >= 0)
+ Cray1 = 1000000*Cray1 + 693716;
+ if (printf(emptyfmt, Cray1) >= 0)
+ Cray1 = 1000000*Cray1 + 115456;
+ u.d = 1e13;
+ if (u.L == Cray1)
+ return &CRAY;
+ return 0;
+ }
+
+ static int
+fzcheck(void)
+{
+ double a, b;
+ int i;
+
+ a = 1.;
+ b = .1;
+ for(i = 155;; b *= b, i >>= 1) {
+ if (i & 1) {
+ a *= b;
+ if (i == 1)
+ break;
+ }
+ }
+ b = a * a;
+ return b == 0.;
+ }
+
+ static int
+need_nancheck(void)
+{
+ double t;
+
+ errno = 0;
+ t = log(t_nan);
+ if (errno == 0)
+ return 1;
+ errno = 0;
+ t = sqrt(t_nan);
+ return errno == 0;
+ }
+
+ void
+get_nanbits(unsigned int *b, int k)
+{
+ union { double d; unsigned int z[2]; } u, u1, u2;
+
+ k = 2 - k;
+ u1.z[k] = u2.z[k] = 0x7ff00000;
+ u1.z[1-k] = u2.z[1-k] = 0;
+ u.d = u1.d - u2.d; /* Infinity - Infinity */
+ b[0] = u.z[0];
+ b[1] = u.z[1];
+ }
+
+ int
+main(void)
+{
+ FILE *f;
+ Akind *a = 0;
+ int Ldef = 0;
+ unsigned int nanbits[2];
+
+ fpinit_ASL();
+#ifdef WRITE_ARITH_H /* for Symantec's buggy "make" */
+ f = fopen("arith.h", "w");
+ if (!f) {
+ printf("Cannot open arith.h\n");
+ return 1;
+ }
+#else
+ f = stdout;
+#endif
+
+ if (sizeof(double) == 2*sizeof(long))
+ a = Lcheck();
+ else if (sizeof(double) == 2*sizeof(int)) {
+ Ldef = 1;
+ a = icheck();
+ }
+ else if (sizeof(double) == sizeof(long))
+ a = ccheck();
+ if (a) {
+ fprintf(f, "#define %s\n#define Arith_Kind_ASL %d\n",
+ a->name, a->kind);
+ if (Ldef)
+ fprintf(f, "#define Long int\n#define Intcast (int)(long)\n");
+ if (dalign)
+ fprintf(f, "#define Double_Align\n");
+ if (sizeof(char*) == 8)
+ fprintf(f, "#define X64_bit_pointers\n");
+#ifndef NO_LONG_LONG
+ if (sizeof(long long) > sizeof(long)
+ && sizeof(long long) == sizeof(void*))
+ fprintf(f, "#define LONG_LONG_POINTERS\n");
+ if (sizeof(long long) < 8)
+#endif
+ fprintf(f, "#define NO_LONG_LONG\n");
+ if (a->kind <= 2) {
+ if (fzcheck())
+ fprintf(f, "#define Sudden_Underflow\n");
+ t_nan = -a->kind;
+ if (need_nancheck())
+ fprintf(f, "#define NANCHECK\n");
+ if (sizeof(double) == 2*sizeof(unsigned int)) {
+ get_nanbits(nanbits, a->kind);
+ fprintf(f, "#define QNaN0 0x%x\n", nanbits[0]);
+ fprintf(f, "#define QNaN1 0x%x\n", nanbits[1]);
+ }
+ }
+ return 0;
+ }
+ fprintf(f, "/* Unknown arithmetic */\n");
+ return 1;
+ }
+
+#ifdef __sun
+#ifdef __i386
+/* kludge for Intel Solaris */
+void fpsetprec(int x) { }
+#endif
+#endif
76 f2c/libf2c/backspac.c
@@ -0,0 +1,76 @@
+#include "f2c.h"
+#include "fio.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef KR_headers
+integer f_back(a) alist *a;
+#else
+integer f_back(alist *a)
+#endif
+{ unit *b;
+ OFF_T v, w, x, y, z;
+ uiolen n;
+ FILE *f;
+
+ f__curunit = b = &f__units[a->aunit]; /* curunit for error messages */
+ if(a->aunit >= MXUNIT || a->aunit < 0)
+ err(a->aerr,101,"backspace")
+ if(b->useek==0) err(a->aerr,106,"backspace")
+ if(b->ufd == NULL) {
+ fk_open(1, 1, a->aunit);
+ return(0);
+ }
+ if(b->uend==1)
+ { b->uend=0;
+ return(0);
+ }
+ if(b->uwrt) {
+ t_runc(a);
+ if (f__nowreading(b))
+ err(a->aerr,errno,"backspace")
+ }
+ f = b->ufd; /* may have changed in t_runc() */
+ if(b->url>0)
+ {
+ x=FTELL(f);
+ y = x % b->url;
+ if(y == 0) x--;
+ x /= b->url;
+ x *= b->url;
+ (void) FSEEK(f,x,SEEK_SET);
+ return(0);
+ }
+
+ if(b->ufmt==0)
+ { FSEEK(f,-(OFF_T)sizeof(uiolen),SEEK_CUR);
+ fread((char *)&n,sizeof(uiolen),1,f);
+ FSEEK(f,-(OFF_T)n-2*sizeof(uiolen),SEEK_CUR);
+ return(0);
+ }
+ w = x = FTELL(f);
+ z = 0;
+ loop:
+ while(x) {
+ x -= x < 64 ? x : 64;
+ FSEEK(f,x,SEEK_SET);
+ for(y = x; y < w; y++) {
+ if (getc(f) != '\n')
+ continue;
+ v = FTELL(f);
+ if (v == w) {
+ if (z)
+ goto break2;
+ goto loop;
+ }
+ z = v;
+ }
+ err(a->aerr,(EOF),"backspace")
+ }
+ break2:
+ FSEEK(f, z, SEEK_SET);
+ return 0;
+}
+#ifdef __cplusplus
+}
+#endif
20 f2c/libf2c/c_abs.c
@@ -0,0 +1,20 @@
+#include "f2c.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef KR_headers
+extern double f__cabs();
+
+double c_abs(z) complex *z;
+#else
+extern double f__cabs(double, double);
+
+double c_abs(complex *z)
+#endif
+{
+return( f__cabs( z->r, z->i ) );
+}
+#ifdef __cplusplus
+}
+#endif
23 f2c/libf2c/c_cos.c
@@ -0,0 +1,23 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+extern double sin(), cos(), sinh(), cosh();
+
+VOID c_cos(r, z) complex *r, *z;
+#else