Lahey/GNU Fortran

Specifying Options (or Switches)

The driver recognizes one or more letters preceded by a hyphen (-) as a command-line option. You may not combine options after a hyphen: for example, -x and -y may not be entered as -xy.

Many options can be specified or negated, a negated option consists of the option preceded by the letter "n". For example, the option -g would mean compile for debug, while the option -ng would mean do not compile for debug.

Some options take arguments in the form of filenames, strings, letters, or numbers. You must enter a space between the option and its argument(s).


-i incdir

Options are case-sensitive and should always be lowercase.

Command line options are processed from left to right. If conflicting options are specified, the last one specified takes precedence. For example, if the command line contained -g -ng, the -ng option would be used.

If an unknown option is detected, the entire text from the beginning of the unknown option to the beginning of the next option or end of the command line is passed to GFortran verbatim.

Some linker options require a number as an argument. By default, all numbers are assumed to be decimal numbers. A different radix can be specified by appending a radix specifier to the number. The following table lists the bases and their radix specifiers:

Radix Specifiers


Radix Specifier

Example of 32 in base


B or b



Q or q






H or h


See Also

Compiler and Linker Options