I'm having a little experiment in adding Fortran run time library
initialisation and shut down to CNF. It seemed to be the obvious place
(that's what CNF is for) rather than relying on STAR_INITIALISE_FORTRAN
macro in every package (which is strangely Starlink specific and not an
AC_FC_INITIALISE_FORTRAN macro).
To prevent issues with linking I've created a separate library libcnfrtl.
cnfInitRTL is already working and I'll look into adding cnfStopRTL.
cnf_link will probably get a '-rtl' command line option (else I'll either
have to write cnf_rtl_link or simply add -lcnfrtl to the link options).
Comments and opinions (on naming and usefulness) welcome.
g95 seems to require that all C programs that go through C main initialise
the RTL, else I get core dumps everywhere. (maybe that's a bug in g95 but
it cores in memory allocation routines and in Fortran I/O. g77 only seems
to need argument lists initalised)
I'd also like to sort out the AC_FC_MAIN issue since g95 requires this
symbol to be present even if it is just a stub. Maybe something along the
lines of
#if AC_FC_MAIN != main
void AC_FC_MAIN () {}
#endif
would do the trick?
--
Tim Jenness
JAC software
http://www.jach.hawaii.edu/~timj
|