home *** CD-ROM | disk | FTP | other *** search
- 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
- Newsgroups: comp.os.vms
- Subject: Re: Mixed Fortran/C porting Unix -> VMS headache
- Message-ID: <1993Jan26.155925@mccall.com>
- From: tp@mccall.com (Terry Poot)
- Date: Tue, 26 Jan 1993 15:59:25 CST
- Reply-To: tp@mccall.com (Terry Poot)
- References: <26JAN199311174075@reg.triumf.ca>
- Distribution: world
- Organization: The McCall Pattern Co., Manhattan, KS, USA
- Nntp-Posting-Host: mis1
- Nntp-Posting-User: tp
- Lines: 46
-
-
- In article <26JAN199311174075@reg.triumf.ca>, fwj@reg.triumf.ca (JONES,FRED_W.)
- writes:
- >I have a large mixed Fortran/C application that has to run on
- >both Unix systems and VMS. On all the Unix systems I have used,
- >the Fortran compiler adds an underscore (_) to the end of all
- >global symbol names. Thus the declarations look like, e.g.:
- >...
- >Unfortunately, VMS does not add the underscore suffix to the references,
- >rendering this type of application fundamentally non-source-code-portable
- >to VMS systems.
-
- This type of application is fundametally non-portable, period. It just happens
- that lots of unix machines do this. There is no portable way to interface 2
- languages. There is no standadization at all on this, nor any attempt to provide
- any.
-
- As to suggestions: Read up on the Linker. I wouldn't be at all surprised if it
- could map the names for you. Alternatively, you might be able to do something
- with macro.
-
- Does anyone know if you can set up a transfer vector in a program that has
- nothing to do with shareable images? Seems like it should work, unless it causes
- the linker headaches. [Fred, I'll explain that if someone tells me it'll work.
- If so, it'll solve your problem.]
-
- You may have other problems. If any of your code passes character strings across
- the language boundary, you _do_ have problems. That's another area where most
- unix systems do something very different from VMS.
-
- >One could make jackets for all the C routines, but that still leaves
- >the common blocks.
-
- Fortran common blocks map to C externs. I was under the impression that this was
- the same as on unix. Check the information on psects and implementation notes in
- the C compiler documentation.
-
- >Any DEC/VMS gurus know of a more elegant solution?
-
- Elegance is asking for a lot. You are doing something inherently non-portable.
- You should be overjoyed if it can be done relatively simply, even if it turns
- out to be a _major_ kludge!
- --
- Terry Poot <tp@mccall.com> The McCall Pattern Company
- (uucp: ...!rutgers!depot!mccall!tp) 615 McCall Road
- (800)255-2762, in KS (913)776-4041 Manhattan, KS 66502, USA
-