Calling C from FORTRAN under Unix

Charles Packer packer at amarna.gsfc.nasa.gov
Fri May 17 23:54:03 AEST 1991


In article <1991May17.023941.18053 at zoo.toronto.edu>, henry at zoo.toronto.edu (Henry Spencer) writes...
>You don't give any indication of what kind of system this is, and that


That was accidently-on-purpose. The consensus at my site before
I posted was that the answer would apply to Unix generally. Not
the case, as most of the five e-mail respondents pointed out. 

In fact, everybody said that =their= systems' C compiler put an
underscore =following= the routine name, and therefore I should
write the calling Fortran code to CALL subr_.

But we have Ultrix 3.2, whose C compiler PRECEDES the subroutine
name with an underscore. But you can't have the Fortran program
call _subr because the compiler generates a fatal syntax error!

So I went into the Fortran Users Guide for Ultrix 3.2 more
thoroughly than I had yesterday and I find that they document an
extra step to achieve compatibility, something called JBL. In
section 7.4.1.1 they deal with the problem explicitly (though
not so explicitly that they announce it in the table of
contents!).

Thanks anyway!



More information about the Comp.lang.c mailing list