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 integrated development environment for Windows OS and Mac OS X.

For instance, if you do not specify the -c or /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 or /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 OS and Mac OS X or link for Windows OS) directly to link in objects. On Linux OS and Mac OS X systems, you can also call xild or use the archiver (ar) and xiar to create a library. For Mac OS X, you would use libtool to generate a library.

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

The output files include the following:

Output File

Extension

How Created on the Command Line

Object file

.o (Linux OS and Mac OS X)

.obj (Windows OS)

Created automatically.

Executable file

.out (Linux OS and Mac OS X)

.exe (Windows OS)

Do not specify -c or /c.

Shareable library file

.so (Linux OS)

.dylib (Mac OS X)

.dll (Windows OS)

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

Module file

.mod

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

Assembly file

.s (Linux OS and Mac OS* X)

.asm (Windows OS)

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/Qipo option.

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

Note iconNote

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