Fortran User's Guide

Unrecognized Command-Line Arguments

Any arguments on the command-line that the compiler does not recognize are interpreted as being possibly linker options, object program file names, or library names.

The basic distinctions are:

For example:


demo% f77 -bit move.f           <- 
 -bit is not a recognized 
f77 option
f77: Warning: Option -bit passed to ld, if ld is invoked, ignored otherwise
move.f:
 MAIN move:
demo% f77 fast move.f           <-   The user meant to type 
-fast
move.f:
 MAIN move:
ld: fatal: file fast: cannot open file; errno=2
ld: fatal: File processing errors.  No output written to a.out

Note that in the first example, -bit is not recognized by f77 and the option is passed on to the linker (ld), who tries to interpret it. Because single letter ld options may be strung together, the linker sees -bit as -b -i -t, which are all legitimate ld options! This may (or may not) be what the user expects, or intended.

In the second example, the user intended to type the f77/f90 option -fast but neglected the leading dash. The compiler again passes the argument to the linker which, in turn, interprets it as a file name.

These examples indicate that extreme care should be observed when composing compiler command lines!