Linking your compiled applications with XL Fortran

By default, you do not need to do anything special to link an XL Fortran program. The compiler invocation commands automatically call the linker to produce an executable output file.

For example, you can use the following command to compile file1.f and file3.f to produce the object files file1.o and file3.o. All object files, including file2.o, are submitted to the linker to produce one executable.
xlf file1.f file2.o file3.f

Compiling and linking in separate steps

To produce object files that can be linked later, use the -c option.

xlf -c file1.f                # Produce one object file (file1.o)
xlf -c file2.f file3.f        # Or multiple object files (file2.o, file3.o)
xlf file1.o file2.o file3.o   # Link object files with default libraries

For more information about compiling and linking your programs, see Linking XL Fortran programs.