Syntax for the ifort Command
Use the syntax below to invoke the Intel® Fortran
Compiler from the command line:
ifort [options] input_file(s)
An option
is specified by one or more letters preceded by a hyphen (-) for Linux
and Mac OS* and a slash (/) for Windows*. (You
can use a hyphen (-) instead of a slash for Windows, but this is not the
preferred method.)
The following rules apply:
- Some options take arguments in the form of filenames,
strings, letters, or numbers. Except where otherwise noted, you can enter
a space between the option and its argument(s) or you can combine them.
For a complete listing of compiler options, see the Compiler Options
reference.
- You can specify more than one input_file,
using a space as a delimiter. When a file is not in your path or working
directory, specify the directory path before the file name. The filename
extension specifies the type of file.
Note
Options on the command line apply to all
files. For example, in the following command line, the -c
and -nowarn options
apply to both files x.f
and y.f:
ifort -c x.f -nowarn y.f
- You cannot combine options with a single slash or
hyphen, but must specify the slash or hyphen for each option specified.
For example, this is correct: /1 /c
But this is not: /1c
- Some compiler options are case-sensitive. For example,
c and C are two different options.
- Options can take arguments in the form of filenames,
strings, letters, and numbers. If a string includes spaces, it must be
enclosed in quotation marks.
- All compiler options must precede the -Xlinker
(Linux and Mac OS) or /link (Windows) options.
Options that appear following -Xlinker or /link are passed directly to
the linker.
- Unless you specify certain options, the command line
will both compile and link the files you specify. To compile without linking,
specify the -c (Linux and Mac OS) or /c
(Windows) option.
- You can abbreviate some option names, entering as
many characters as are needed to uniquely identify the option.
- Compiler options remain in effect for the whole compilation
unless overridden by a compiler directive.
- On Windows, certain options accept one or more keyword
arguments following the option name. To specify multiple keywords, you
typically specify the option multiple times. However, some options allow
you to use comma-separated keywords. For example:
ifort
/warn:usage,declarations test.f90
You can use an equals sign (=) instead of
the colon:
ifort
/warn=usage,declarations test.f90