Intel® Fortran Compiler XE 13.1 User and Reference Guides

offload-option

Lets you explicitly specify options to be used for the specified target and tool. This option only applies to Intel® MIC Architecture.

IDE Equivalent

None

Architectures

Intel® 64 architecture, targeting Intel® MIC Architecture

Syntax

Linux:

-offload-option,target,tool,"option-list"

OS X:

None

Windows:

None

Arguments

target

Is the target architecture. The only supported value for this argument is mic.

tool

Is the tool that the option-list is associated with. It can be one of the following values: ld, as, or compiler.

option-list

Is one or more options that are specific to the tool. The quotation mark delimiters are required. Each option in the option-list must be separated by a space.

For tool compiler, use compiler-specific options; for tool ld, use linker-specific options; for tool as, use assembler-specific options.

Default

OFF

The compiler does not pass additional options to the separate tools on the target architecture.

Description

This option lets you explicitly specify options to be used for the specified target and tool. It can be specified multiple times on the command line.

When building a heterogeneous application, the driver passes all compiler options specified on the command-line to the host compilation and only certain options to the offload compilation. To see a list of options passed to the offload compilation, specify option –watch=mic-cmd.

If you want to pass additional options to the offload compilation, or you would like to override the command line options passed to offload compilation, you must use option -offload-option to specify the additional or overriding options.

Note

If you specify the options I, L, D, or U with the -offload-option option, they override any other I, L, D, and U options that are automatically passed from host to offload compilation.

To achieve the overriding effect, the I, L, D, and U options specified using -offload-option are placed ahead of the I, L, D, and U options automatically copied over from the host compilation. All other options specified using -offload-option are placed after the options copied over from host to offload compilation.

Alternate Options

None

Example

The following shows a valid example for the compiler tool:

-offload-option,mic,compiler, "-O3 -diag-disable 1234 –vec-report2"

The following shows a valid example for the ld tool:

-offload-option,mic,ld,"-lmylib -L/my/path"

The following shows a valid example for the as tool:

-offload-option,mic,as,"<assembler options>"

The following example causes the offload compilation to search -I/my_dir/mic/include first, and to use -DMY_DEFINE=20 because they override the previously mentioned -I/my_dir/include and -DMY_DEFINE=10. The compiler also passes -L/my_dir/mic/lib -L/my_dir/lib to the offload link step:

ifort -offload-option,mic,compiler, "-I/my_dir/include -L/my_dir/lib -DMY_DEFINE=10 -I/my_dir/mic/include -DMY_DEFINE=20" -offload-option,mic,ld, "-L/my_dir/mic/lib" hello.f

The following example demonstrates how options specified in -offload-option override options automatically passed from host compilation to offload compilation:

-offload-option,mic,compiler,”-O3 -DMY_DEFINE=MIC” -DMY_DEFINE=HOST -O2

-DMY_DEFINE=HOST -O2 will be used for the host compilation. However, -DMY_DEFINE=MIC -O3 will override -O2 and -DMY_DEFINE=HOST for the offload compilation.

See Also


Submit feedback on this help topic