home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / vms / 22218 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  2.6 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!elroy.jpl.nasa.gov!usc!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!mccall!mccall!tp
  2. Newsgroups: comp.os.vms
  3. Subject: Re: Mixed Fortran/C porting Unix -> VMS headache
  4. Message-ID: <1993Jan26.155925@mccall.com>
  5. From: tp@mccall.com (Terry Poot)
  6. Date: Tue, 26 Jan 1993 15:59:25 CST
  7. Reply-To: tp@mccall.com (Terry Poot)
  8. References: <26JAN199311174075@reg.triumf.ca>
  9. Distribution: world
  10. Organization: The McCall Pattern Co., Manhattan, KS, USA
  11. Nntp-Posting-Host: mis1
  12. Nntp-Posting-User: tp
  13. Lines: 46
  14.  
  15.  
  16. In article <26JAN199311174075@reg.triumf.ca>, fwj@reg.triumf.ca (JONES,FRED_W.)
  17. writes:
  18. >I have a large mixed Fortran/C application that has to run on
  19. >both Unix systems and VMS.  On all the Unix systems I have used,
  20. >the Fortran compiler adds an underscore (_) to the end of all
  21. >global symbol names.  Thus the declarations look like, e.g.:
  22. >...
  23. >Unfortunately, VMS does not add the underscore suffix to the references,
  24. >rendering this type of application fundamentally non-source-code-portable
  25. >to VMS systems.
  26.  
  27. This type of application is fundametally non-portable, period. It just happens
  28. that lots of unix machines do this. There is no portable way to interface 2
  29. languages. There is no standadization at all on this, nor any attempt to provide
  30. any.
  31.  
  32. As to suggestions: Read up on the Linker. I wouldn't be at all surprised if it
  33. could map the names for you. Alternatively, you might be able to do something
  34. with macro. 
  35.  
  36. Does anyone know if you can set up a transfer vector in a program that has
  37. nothing to do with shareable images? Seems like it should work, unless it causes
  38. the linker headaches. [Fred, I'll explain that if someone tells me it'll work.
  39. If so, it'll solve your problem.]
  40.  
  41. You may have other problems. If any of your code passes character strings across
  42. the language boundary, you _do_ have problems. That's another area where most
  43. unix systems do something very different from VMS.
  44.  
  45. >One could make jackets for all the C routines, but that still leaves
  46. >the common blocks.
  47.  
  48. Fortran common blocks map to C externs. I was under the impression that this was
  49. the same as on unix. Check the information on psects and implementation notes in
  50. the C compiler documentation.
  51.  
  52. >Any DEC/VMS gurus know of a more elegant solution?
  53.  
  54. Elegance is asking for a lot. You are doing something inherently non-portable.
  55. You should be overjoyed if it can be done relatively simply, even if it turns
  56. out to be a _major_ kludge!
  57. --
  58. Terry Poot <tp@mccall.com>                   The McCall Pattern Company
  59. (uucp: ...!rutgers!depot!mccall!tp)          615 McCall Road
  60. (800)255-2762, in KS (913)776-4041           Manhattan, KS 66502, USA
  61.