I note from specx (run_specx.c) and
http://www.delorie.com/gnu/docs/gcc/g77_527.html that C programs linking
against fortran libraries are meant to initialise the fortran runtime and
also close down fortran properly (so that files are closed properly etc).
We don't seem to do any of this. Specx does make a stab (including special
ifdefs for alpha and sun fortran) but it seems that this is something
that could usefully go into CNF as, eg, cnfInit and cnfExit (or
something).
These could be no-ops if a compiler doesn't require it (eg g77 really
doesn't mind about f_init being called unless GETARG is called, but
would quite like f_exit to be called).
The main problems I can see is that CNF currently doesn't need a fortran
compiler whereas adding this would require one (or I suppose it wouldn't
if no fortran libraries could be found then then cnfInit would be a noop
anyway...).
I'm willing to have a stab at this (since I have an outline in specx)
unless anyone thinks this is a crazy idea.
--
Tim Jenness
JAC software
http://www.jach.hawaii.edu/~timj
|