On Wed, 23 Feb 2005, Norman Gray wrote:
> Peter,
>
> On 2005 Feb 23 , at 17.30, Peter W. Draper wrote:
>
> > On Sat, 19 Feb 2005, Tim Jenness wrote:
> >
> >> On Sat, 19 Feb 2005, Starlink Software wrote:
> >>
> >>> Module: icl
> >>> Status: failed
> >>> Build Log:
> >>> http://dev.starlink.ac.uk/build/TRU64-ALPHA/logs/icl.1108790525.log
> >>>
> >>
> >> This is caused by two MAIN__ symbols being defined somewhere. Must be
> >> some
> >> defined in a library that is being linked in.
> >
> > The problem is that f77 is being used to link a C-main program, so I've
> > forced the use of the C-compiler instead (the other way would be to use
> > the -nofor_main flag).
>
> The other way to do this is to use the AC_FC_MAIN macro in
> configure.ac, and name the C main FC_MAIN:
>
> #include <config.h>
>
> int FC_MAIN (int argc, char **argv)
> {
> ...
> }
>
> If you link that with the Fortran compiler all should be OK -- the
> Fortran main ends up being _the_ main, but it ends up being just a
> wrapper for this C main function, called after it's finished doing its
> initialisations. Also, using the Fortran compiler to do the link gets
> all the Fortan RTL libraries correct, painlessly (as you know).
>
> This is what I did with ccdpack's ccdwish.c, and with Dipso's
> run_dipso.c, which already did something like this, by hand. They've
> both been pretty trouble-free (at least in this respect) on other
> platforms.
Thought I'd seen another way flash past sometime. If ICL shows any further
problems I'll switch to your way (although I'm a little wary of
introducing a Fortran main where one was not previously used). Oddly ICL
used the Fortran compiler for linking, but also included FLIBS. Expect
this was a hangover from the mk days.
Cheers,
Peter.
|