Print

Print


On Wed, 31 Aug 2005, Tim Jenness wrote:

> > So what is that extra definition of MAIN_ for? Is it an unresolved
> > reference in the g95 shareable library?
> >
> 
> YES :-)
>
> g95 libf95 has a main() for the C main and a MAIN_ that is not defined but 
> is used to call the fortran PROGRAM. If you try to link a C program 
> against a fortran library there is no MAIN_ defined so you can't link it 
> unless you create a dummy MAIN_ (since you are in general using a C main 
> when linking against the fortran library that overrides the main() in 
> libf95).
> 

OK, that explains my confusion. I assumed that the g95 shareable setup
would work like that of g77 (when it has one). This doesn't include the
libf2c main module in the shareable library, this is kept in an archive
that is linked against by the g77 command as needed (libfrtbegin.a), so
MAIN__ is also kept away. It would solve all these problems if that 
arrangement could be adopted for g95.

Cheers,

Peter.