home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / sgi / 11321 < prev    next >
Encoding:
Text File  |  1992-07-24  |  1.6 KB  |  36 lines

  1. Newsgroups: comp.sys.sgi
  2. Path: sparky!uunet!utcsri!helios.physics.utoronto.ca!grindley
  3. From: grindley@helios.physics.utoronto.ca (Robin Grindley)
  4. Subject: Re: C call FORTRAN reference needed
  5. Message-ID: <BrwBFE.1IJ@helios.physics.utoronto.ca>
  6. Sender: news@helios.physics.utoronto.ca (News Administrator)
  7. Organization: University of Toronto Physics/Astronomy/CITA
  8. References: <1992Jul23.185200.22147@nsisrv.gsfc.nasa.gov>
  9. Distribution: na
  10. Date: Fri, 24 Jul 1992 13:42:50 GMT
  11. Lines: 23
  12.  
  13. Actually, i found the section on C <--> Fortran pretty useful. We are
  14. in the unenviable position of supporting the same code on both SGI
  15. and IBM RS6000. If ever you wanted to find two machines that don't play
  16. nice together, these are them. So far it seems that if you stick to
  17. what is described in the Fortran guide, it is pretty much portable. One
  18. thing that is not made clear in the guide is return values from functions.
  19. After hacking around with dbx a bit, it turns out that there is one
  20. specific register that is always used for returning values, and this
  21. IS machine dependent of course, but it SHOULD be the same for all compilers
  22. on a platform, so C and Fortran will understand each other. Just return
  23. the value from C, pick it up as normal in Fortran.
  24.  
  25. (By the way, one of the people working on IBM asked me about some C/Fortran 
  26. interfacing, saying that there was absolutely NO information to be found
  27. on the RS6000. Kudos to SGI for providing the guide, and also for the
  28. wrapper routines to the standard C library - IBM leaves its Fortran users
  29. in the dark.)
  30.  
  31. -- 
  32. robin
  33.  
  34.          iNSANITY - It's only a state of mind
  35.  
  36.