HP Fortran Programmer's Guide (B3908-90031; September 2011)

Compiling and linking
Compiling with the f90 command
Chapter 2 23
Compiling with the f90 command
The default behavior of the f90 command is to compile source files listed on the command line and, if the
compilation is successful, to pass the resulting object files to the linker. If the link stage is successful, the
linker produces an executable program with the default name a.out.
Consider, for example, the program hello.f90:
Example 2-1 hello.f90
PROGRAM main
CALL hello()
END PROGRAM main
SUBROUTINE hello()
PRINT *, 'Hello, I must be going.'
END SUBROUTINE hello
When compiled with the command line:
$ f90 hello.f90
f90 produces two files, hello.o (object code) and a.out (the executable program).
If the command line contains only an object file, as in the following:
$ f90 hello.o
f90 passes the object file to the linker, which (if successful produces the executable program a.out.
Here is a sample run of the executable program:
$ a.out
Hello, I must be going.
This section provides more detailed information about using the f90 command, including:
Command-line syntax
Command-line options
Filenames recognized by f90
f90 command syntax
The syntax for using the f90 command is:
f90 [options] [files]