Mixing C & Fortran I/O ctd

craig@jcb-sc.com craig@jcb-sc.com
Mon May 31 21:06:00 GMT 1999


>> By the way, are you saying this combination works on other systems,
>> using the exact same versions of gcc and g77?  If that's the case,
>> it suggests the difference is in the C library on the Linux system
>> you're using -- perhaps it's more sensitive to incorrect usage of it
>> by application code (which includes libg2c at this level) than the
>> other systems.
>
>No when I do say this. It is for some HP, SGI, IBM machines running with
>native compilers.

Not *quite* sure I understand that first sentence, but I think you're
saying you aren't seeing your code work on other gcc/g77 combinations,
but you *are* seeing it work using entirely different C/Fortran compiler
combinations.

That makes sense.  Various vendors (e.g. Digital) go to varying degrees
of trouble to ensure reasonable inter-language compatibility within
programs.  g77 could definitely do a lot better, though probably not
while using libf2c as the base for its run-time library.

>But for debugging purpose I was expecting both Fortran output on unit 6
>(print* & write(6,.. )) and C output on stdout to work simultaneously.
>So there is no real mix (except for *stdout*).

Ah, too bad.  Again, perhaps you could get this working without much
trouble for your application, but we're not prepared to guarantee
it for general use, yet.

>Do you know which files of libI77 are dealing with direct unformatted write
>so that I can investigate the I/O performance because if I can have all the code
>in C ... no more problem.

A good way to learn this is to use f2c to convert sample Fortran code
(doing the kind of I/O you do) to C, then read that.  Note that it
calls routines with names like s_wdue and e_wdue, paired around
calls to other routines to do the actual reading/writing of individual
I/O items.  Look up the definitions of those routines in
egcs/libf2c/libI77/*.c, and you'll have begun your quest.  :)

        tq vm, (burley)



More information about the Gcc-bugs mailing list