The output produced by the ifort command includes:
An object file (such as test.o), if you specify the -c option on the command line. An object file is created for each source file.
An executable file (such as a.out), if you omit the -c option.
One or more module files (such as datadef.mod), if the source file contains one or more MODULE statements.
A shareable library (such as mylib.so), if you use the -shared option.
You control the production of these files by specifying the appropriate options on the command line.
The compiler generates a temporary object file for each source file, unless you specify the -c option. The linker is then invoked to link the object files into one executable program file and the temporary object files are deleted.
If you specify the -c option, the object files are created and retained in the current working directory. You must link the object files later by using a separate ifort command. This allows incremental compilation of a large application, perhaps by means of a makefile processed by the make command.
If fatal errors are encountered during compilation, or if you specify certain options such as -c, linking does not occur.
To compile all objects over the entire program, use the -ipo option.
To specify a file name for the executable program file (other than a.out), use the -o output option, where output specifies the file name. The following command requests a file name of prog1.out for the source file test1.f:
ifort -o prog1.out test1.f
If you specify the -c option with the -o output option, you rename the object file (not the executable program file). If you specify -c and omit the -o output option, the compiler names the object files with a .o suffix substituted for the source file suffix.
You cannot use -c and -o together with multiple source files.
The default optimization level is -O2 (unless you specify -g).