home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / f2c / readme next >
Text File  |  1998-08-05  |  2KB  |  63 lines

  1. f2c - a Fortran to C converter
  2.  
  3.  
  4.  
  5. This f2c is ported from the July 1992 version taken from
  6. research.att.com and targeted for SAS/C 6.2.  All the original
  7. code is included.  My modifications are #ifdefed into the source.  The
  8. parser code was generated with GNU bison so I've included the GNU
  9. alloca.c. 
  10.  
  11. Using SAS/C versions before 6.2 will not work because of compiler
  12. bugs.  This release of f2c has not been extensively tested.  The f2c
  13. program is most likely to be correct.  The I/O library I77.lib is
  14. probably full of bugs.  Known AmigaDOS problems make it a problem to
  15. write to the NIL: device and probably also to pipes. 
  16.  
  17. The source is organized into three directories:
  18.  
  19.     f2c/src        contains the source and executable for the f2c
  20.                 program.  Also has the f2c.h include file.
  21.     f2c/F77lib    contains the source and library F77.lib.
  22.     f2c/I77lib    contains the source and library I77.lib.
  23.  
  24. I've included my smakefile for making f2c, I77.lib and F77.lib.  I
  25. have not make a version for 68881.  If you want to do this, I suggest
  26. you change include:math.h to include m68881.h at the end, then recompile
  27. everything with the math=68881 option.  There is a formatted man page
  28. for f2c in src/f2c.1.
  29.  
  30. To compile and link a fortran program you run f2c on the .f file to
  31. make a .c file.  Recommended options are -A for ansi C.  Slink
  32. cannot deal with multiply defined global variables, even with the
  33. 'common' option (this problem has been reported to SAS).  If you use
  34. common blocks you should also compile your program with -E.  This
  35. makes all the declarations of the common blocks listed as 'extern'.
  36. You should then put all your common blocks into a BLOCK DATA somewhere
  37. which you compile without -E.  Then the linker will be happy.
  38.  
  39. Then you compile the .c files with sc.  The libraries that I've
  40. supplied have been compiled with data=far and math=ieee, so you should
  41. compile your programs this way.  The generated C code makes use of the
  42. file f2c.h which can be found in the f2c/src directory.  The C code
  43. calls support routines from the libraries F77.lib and I77.lib so you
  44. should link with them and also with scnb.lib.  A suitable SCOPTIONS
  45. file might look:
  46.  
  47. DATA=FAR
  48. MATH=IEEE
  49. LINK
  50. NOICONS
  51. LIBRARY=lib:f77.lib
  52. LIBRARY=lib:i77.lib
  53.  
  54. There is an example smakefile for a large project in
  55. f2c/smakefile-example.
  56.  
  57. Good luck.  Feel free to fix any problems you find.  I'll try to
  58. coordinate any improvements that people make.
  59.  
  60.                 Eric Stern
  61.                 egstern@fnpx19.fnal.gov
  62.  
  63.