Producing Output Files

The output produced by the ifort command includes:

You control the production of output files by specifying the appropriate compiler options on the command line or using the appropriate properties in the Windows or Mac OS integrated development environment (IDE).

For instance, if you do not specify the c option, the compiler generates a temporary object file for each source file. It then invokes the linker to link the object files into one executable program file and causes the temporary object files to be deleted.

If you specify the c option, object files are created and retained in the current working directory. You must link the object files later. You can do this by using a separate ifort command; alternatively, you can call the linker (ld for Linux and Mac OS or link for Windows) directly to link in objects. On Linux and Mac OS systems, you can also call xild or use the archiver (ar) and xiar to create a library. For Mac OS, you would use libtool to generate a library.

If fatal errors are encountered during compilation, or if you specify certain options such as c, linking does not occur.

The output files include the following:

Output File Extension How Created on the Command Line

Object file

.o (Linux and Mac OS)
.obj (Windows)

Created automatically.

Executable file

.out (Linux and Mac OS)
.exe (Windows)

Do not specify c.

Shareable library file

.so (Linux)
.dylib (Mac OS)
.dll (Windows)

Specify-shared (Linux), -dynamiclib (Mac OS) or /libs:dll (Windows) and do not specify c.

Module file

.mod

Created if a source file being compiled defines a Fortran module (MODULE statement).

Assembly file

.s (Linux and Mac OS*)
.asm (Windows*)

Created if you specify the S option. An assembly file for each source file is created.

To allow optimization across all objects in the program, use the -ipo option.

To specify a file name for the executable program file (other than the default) use the -o output (Linux and Mac OS) or /exe:output (Windows) option, where output specifies the file name.

Note

You cannot use the  c and o options together with multiple source files.