Calling Fortarn from C and I/O

Craig Burley burley@gnu.org
Tue Aug 4 09:35:00 GMT 1998


>Is there a nice (easy) way to include the various fortran library calls for
>a fortran subroutine called from with a C program.  ie print, open, write?

Those are not yet available as "canned" routines as such in egcs-g77,
but rolling your own should not be too hard, in C, or even in Fortran.
Just make sure you try hard to make the interface code into a distinct,
portable layer -- that is, with a portable, Fortran-style interface,
even though the interface code itself would be nonportable (e.g. depend
on g77-specific features, though some of them, like %VAL, are pretty
widely supported in other compilers).

See the g77 docs for more information, including the information on
intrinsics that already *are* supported (like FGETC and FPUTC, IIRC)
and on "Debugging and Interfacing".

        tq vm, (burley)



More information about the Gcc mailing list