[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking C and Fortran code: problems with Compaq compilers

From: Steven G. Johnson
Subject: Re: Linking C and Fortran code: problems with Compaq compilers
Date: Sat, 18 Aug 2001 20:20:07 -0400 (EDT)

On 18 Aug 2001, Tom Tromey wrote:
> Steven> What is the right thing to do?
> Of course I'd prefer the code in automake to remain simple :-).
> I think if Fortran compilers differ, then we must test to see what the
> actual Fortran compiler in use does.  This means autoconf must decide.

autoconf must decide what?  The point is that there are several different
routes that one could go.

Autoconf already detects $(FLIBS), so if you wanted you could use the C
compiler to link (as you probably already have to do with C++).

Or, you could link mixed-language programs with f77 by default, but
switch to the C linker if a (to be written) autoconf macro says that f77 
linking C code fails.

Alternatively, we could tell everyone to use AC_F77_MAIN and rename their
'main' routine...this goes somewhat against popular usage, however.

Autoconf could try to detect the -nofor_main flag of the Compaq compiler
to allow linking from either C or Fortran.  But where would you put
it?  Not in $(FLIBS), because it may not be a valid C compiler flag.  Not
in $(FFLAGS) because then linking ordinary Fortran programs would fail...



reply via email to

[Prev in Thread] Current Thread [Next in Thread]