home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / amiga / programm / 12370 < prev    next >
Encoding:
Internet Message Format  |  1992-08-16  |  2.1 KB

  1. Path: sparky!uunet!gumby!wupost!cs.utexas.edu!ut-emx!ccwf.cc.utexas.edu
  2. From: mjl@ccwf.cc.utexas.edu (Maurice J. LeBrun)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: C Libraries (PLPlot) and Fortran code
  5. Message-ID: <77796@ut-emx.uucp>
  6. Date: 16 Aug 92 08:19:59 GMT
  7. References: <1992Aug14.032053.1639@newshost.anu.edu.au>
  8. Sender: news@ut-emx.uucp
  9. Organization: The University of Texas at Austin, Austin TX
  10. Lines: 38
  11.  
  12. In article <1992Aug14.032053.1639@newshost.anu.edu.au> markus@msokcf.anu.edu.au (Markus Buchhorn) writes:
  13. >
  14. >[Posting for a friend sans net.access]
  15. >
  16. >Question: How does one use C Libraries (compiled C code) from within
  17. >a Fortran program ? 
  18.  
  19. You can't at present, at least not without considerable difficulty.  Both
  20. Fortran compilers that I know of for the Amiga (Absoft and BCF) have their
  21. own object formats, incompatible with the standard linker format.
  22.  
  23. >According to the Fortran manual, there are
  24. >a variety of ways to go: use the amiga(OpenLibrary) call, which yields
  25. >a pointer to the jump table,
  26.  
  27. I'm not sure, but wouldn't this require making the C object code (Plplot in
  28. this case) into a shared library?
  29.  
  30. > use the F77L linker to link it in, 
  31.  
  32. Won't work, as stated above.  Nor can you link fortran objects with BLink.
  33.  
  34. >or 
  35. >(briefly discussed in the manual) generate assembly code, and use
  36. >some other linker to combine this with the C library.
  37.  
  38. I've looked at this briefly, as it seems the only remaining good
  39. alternative.  Unfortunately the Absoft compiler generates assembly output
  40. with illegal instructions in it (!?).  Or at least the assemblers I've
  41. tried on it (Lattice's asm, A68k) fail.  It is possible to change these
  42. iffy instructions (can't remember offhand) into ones that work, so you
  43. could possibly automate the process using sed or some such.  Even if you
  44. succeed you have given up the ability to use a source level debugger.  I
  45. was sufficiently disgusted by the situation that I gave up, and never did
  46. get a fortran code linked to plplot on the Amiga (sigh).
  47.  
  48. Maurice LeBrun    mjl@fusion.ph.utexas.edu
  49. Institute for Fusion Studies, University of Texas at Austin
  50.