Xref: utzoo comp.lang.c:39349 comp.lang.fortran:5402 comp.unix.questions:31424 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!haven.umd.edu!mimsy!dftsrv!amarna.gsfc.nasa.gov!packer From: packer@amarna.gsfc.nasa.gov (Charles Packer) Newsgroups: comp.lang.c,comp.lang.fortran,comp.unix.questions Subject: Re: Calling C from FORTRAN under Unix Message-ID: <5348@dftsrv.gsfc.nasa.gov> Date: 17 May 91 13:54:03 GMT References: <5343@dftsrv.gsfc.nasa.gov> <1991May17.023941.18053@zoo.toronto.edu> Sender: news@dftsrv.gsfc.nasa.gov Reply-To: packer@amarna.gsfc.nasa.gov Organization: Dept. of Independence Lines: 24 News-Software: VAX/VMS VNEWS 1.3-4 In article <1991May17.023941.18053@zoo.toronto.edu>, henry@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!