[comp.lang.fortran] RFC: Driver actions

jbc@hpcllmv.HP.COM (Jeff Caldwell) (10/14/89)

  In the Unix world of Fortran compiler, almost all f77 drivers have the 
following two options:

  -c          Suppress loading and produce `.o' files for each source file.
  -o outfile  Name the output file from the linker outfile instead of a.out

   I am interested in any opinions concerning people's feelings on what the
result should be when the two options are combined.
e.g.	
	f77 -c -o outfile prog.f

   Should this create an unlinked file named outfile or prog.o?  If you feel 
that the output file should be named outfile, then what do you feel would be
the proper way to handle multiple source files?
e.g.
	f77 -c -o outfile prog1.f prog2.f prog3.f

   I have looked into this and found that Sun Fortran drivers will rename the
unlinked object file outfile instead of prog.o.  Most BSD Unix systems such
as those on VAX and Apollo/HP will ignore the -o flag when the two options
are combined and issue an error message like the one below.
   "-c prevents loading, -o outfile ignored"

   This may seem like a small issue but it can have a pretty large impact 
on users with huge makefiles and other automation when they try to migrate 
between systems.  This question applies, of course, to all other Unix compiler 
drivers as well.

		Jeff Caldwell | HP Data and Languages

jaxon@uicsrd.csrd.uiuc.edu (10/17/89)

/* jbc@hpcllmv.HP.COM writes: */

>  In the Unix world of Fortran compiler, almost all f77 drivers have the 
>following two options:

>  -c          Suppress loading and produce `.o' files for each source file.
>  -o outfile  Name the output file from the linker outfile instead of a.out

> [What if you use both?]
> If you feel that the output file should be named outfile, then what [about]
> multiple source files?

>	f77 -c -o outfile prog1.f prog2.f prog3.f

I'd expect the driver to produce one file of relocatable object code, called
"outfile", containing the code for prog1.o, prog2.o, and prog3.o.  The "-r"
option of ld(1) would be used here.  

Greg Jaxon  Univ. of Ill. Center for Supercomputing R&D