Specifying Output Directories

When compiling one or more files, the argument of the -o and -S options can specify a directory name. To distinguish from file name, the argument must end in a dash or backslash (-) or (\) character, and it must specify an existing directory. In this case, the compiler will use the default convention in naming the executable, assembly, or object files produced, but the files will be placed in the directory specified by file.

In the example below, assume that obj_dir is an existing directory. The -o option causes the compiler to create the object files a.o, b.o, and c.o and place them in the directory obj_dir.

IA-32 applications:

prompt>ifc -oobj_dir- a.f90 b.f90 c.f90

Itanium-based applications:

prompt>efc -oobj_dir- a.f90 b.f90 c.f90

Do not enter a space between the option and the argument. You can specify different name arguments for each of the -o and -S options. The compiler does not remove objects that it produces, even when the compilation proceeds to the link phase.

You can specify alternate directory name arguments for each of the -o and -S options.

Note

You cannot have -ofile and -odirname\ in the same command line: the last option in the command line is executed, and the other is disregarded.