[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re[2]: A Fortran 77 compiler for Red Hat Linux platforms
Evgeny Stambulchik writes:
> "Ortal Alpert" <ortal@fh.huji.ac.il> wrote:
> > f2c appear to run as a fortran compiler but can't mix code when main is not
> > in
> > fortran (try C)
>
> All you need is
>
> void MAIN__(){}
>
> (or link against libf2c.a instead of .so)
I guess you're right! I had thought that the main() in libf2c did
some initialization before and cleanup after calling MAIN__ - work
that is be needed for certain Fortran constructs. And it does (I
just checked the libf2c source code). *But*, it also sets a flag when
the initialization has been done, and it seems that all other routines
which need the initialization will do the initialization if the flag
isn't set.
So, Evgeny is correct. There's no problem with calling Fortran code
from a C main.
--
Harvey J. Stein
Berger Financial Research
abel@netvision.net.il
References: