On Tue, 30 Aug 2005, Tim Jenness wrote:
> Anyway, do you have any thoughts on standardising on cnfInitRTL or would
> you prefer each C routine to use STAR_INITIALISE_FORTRAN? Similarly for
> the cnfStopRTL equivalent.
Since the STAR_INITIALISE_FORTRAN macros need re-thinking anyway (g95
defines a shutdown routine that we should also be calling, and that seems
to make sense for a generalised system), why not do it in CNF. I've no
strong opinions about where and everything uses CNF already.
> >> 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?
> >
> > I wondered if it would be better to say define the default function
> > returned by FC_MAIN:
> >
> > FC_MAIN([pkg_dummy_main])
> >
> > the default being as now (main).
> >
>
> That would work but you would still need to compare the result with what
> you put in.
Not with a "void AC_FC_MAIN() {}" declaration. That's the complete
function. In fact doesn't that explain why you are not getting g95
initialised, this isn't a call to AC_FC_MAIN, it's some duplicate.
> The best idea is to undef FC_MAIN completely but that is seriously bad
> for backwards compatibility (although it's not clear how useful it is at
> the moment).
For backwards compatibility, my way would work automatically, or you could
use FC_MAIN([main]), and try to make the default result undefined.
> g95 forces me to do something though since I have to decide whether I'm
> using a Fortran main (so don't need cnfInitRTL) or whether I'm using a C
> main (and so I do need cnfInitRTL) but all whilst making sure that even if
> I'm using a C main I still need to define MAIN_ for g95...
So what is that extra definition of MAIN_ for? Is it an unresolved
reference in the g95 shareable library?
Cheers,
Peter.
|