This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Calling Fortarn from C and I/O
- To: nlee011 at math dot auckland dot ac dot nz
- Subject: Re: Calling Fortarn from C and I/O
- From: Craig Burley <burley at gnu dot org>
- Date: Tue, 4 Aug 1998 11:39:56 -0400 (EDT)
- Cc: egcs at cygnus dot com
- Cc: burley at gnu dot org
>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)