Article View: comp.sys.dec
Article #4468Mixed Fortran/C porting UNIX -> VMS headache
From: JONES,FRED_W.
Date: Tue, 26 Jan 1993 19:16
Date: Tue, 26 Jan 1993 19:16
56 lines
1704 bytes
1704 bytes
[cross-posted to comp.os.vms]
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.:
COMMON/EDGR_MX/MX,XDIG,YDIG,CODE
LOGICAL MX
REAL XDIG,YDIG
BYTE CODE
...
CALL MXSHELL(I,A)
...
struct {Bool mx; float xdig, ydig; char code;} edgr_mx_;
...
void mxshell_(i, a)
int *i;
float *a;
{
[...etc.]
Unfortunately, VMS does not add the underscore suffix to the references,
rendering this type of application fundamentally non-source-code-portable
to VMS systems.
Thus the programmer is forced to use abominations like:
#ifdef VMS
struct {Bool mx; float xdig, ydig; char code;} edgr_mx;
#else
struct {Bool mx; float xdig, ydig; char code;} edgr_mx_;
#endif
...
#ifdef VMS
void mxshell(i, a)
#else
void mxshell_(i, a)
#endif
int *i;
float *a;
{
[...etc.]
One could make jackets for all the C routines, but that still leaves
the common blocks.
Any DEC/VMS gurus know of a more elegant solution?
Thanks
Frederick Jones
fwj@reg.triumf.ca
Technical Details
Message-ID:
<26JAN199311160883@reg.triumf.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!destroyer!cs.ubc.ca!unixg.ubc.ca!reg.triumf.ca!fwjShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!destroyer!cs.ubc.ca!unixg.ubc.ca!reg.triumf.ca!fwj From: fwj@reg.triumf.ca (JONES,FRED_W.) Newsgroups: comp.sys.dec Subject: Mixed Fortran/C porting UNIX -> VMS headache Date: 26 Jan 1993 11:16 PST Organization: TRIUMF: Tri-University Meson Facility Lines: 56 Distribution: world Message-ID: <26JAN199311160883@reg.triumf.ca> NNTP-Posting-Host: reg.triumf.ca News-Software: VAX/VMS VNEWS 1.41