Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 6/24/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Linking Tools and Options

This topic describes how to use the Intel linking tools, xild (Linux*) and xilink (Windows*).

The Intel linking tools behave differently on different platforms. The following sections summarize the primary differences between linking behavior.

Linux* Linking Behavior

The linking tool invokes the Intel Fortran Compiler to perform IPO if objects containing IR (intermediate representation) are found. These are mock objects. The tool invokes GNU ld to link the application.

The command-line syntax for xild is the same as that of the GNU linker:

xild [<options>] <normal command-line>

where:

  • [<options>]: One or more options supported only by xild (optional).

  • <normal command-line>: Linker command line containing a set of valid arguments for ld.

To create the file app using IPO, use compiler option o[filename] as shown in the following example:

xild -qipo-fas -oapp a.o b.o c.o

The linking tool calls the compiler to perform IPO for objects containing IR and creates a new list of object(s) to be linked. The linker then calls ld to link the object files that are specified in the new list and produce the application with the name specified by the o option. The linker supports the ipo[n] option and ipo-separate option.

To display a list of the supported link options from xild, use the following command:

$ xild -qhelp

Windows* Linking Behavior

The linking tool invokes the Intel Fortran Compiler to perform multi-file IPO if objects containing IR (intermediate representation) is found. These are mock objects. It invokes the Microsoft linker link.exe to link the application.

The command-line syntax for the Intel linker is the same as that of the Microsoft linker:

xilink [<options>] <normal command-line>

where:

  • [<options>]: One or more options supported only by xilink (optional).

  • <normal command-line>: Linker command line containing a set of valid arguments for the Microsoft linker.

To place the multifile IPO executable in ipo_file.exe, use the linker option out:[filename] , for example:

xilink -qipo-fas /out:ipo_file.exe a.obj b.obj c.obj

The linker calls the compiler to perform IPO for objects containing IR and creates a new list of object(s) to be linked. The linker calls Microsoft link.exe to link the object files that are specified in the new list and to produce the application with the name specified by the out:[filename] linker option.

To display a list of support link options from xilink , use the following command:

>> xilink /qhelp

xilink.exe accepts all the options of link.exe and will pass them on to link.exe at the final linking stage.

Using the Linking Tools

You must use the Intel linking tools to link your application if the following conditions apply:

  • Your source files were compiled with multi-file IPO enabled. Enable Multi-file IPO by specifying compiler option [Q]ipo.

  • Linux: You normally invoke the GNU linker (ld) to link your application.

  • Windows: You normally invoke the Microsoft linker (link.exe) to link your application.

Linker Options

The following table provides information on linking options.

Linking Tools Option

Description

[Q]diag-[type]=[diag-list]

Controls the display of diagnostic information.

The type is an action to perform on diagnostics. Possible values are:

  • disable: Disables one or more warnings or remarks.

  • error: Tells the compiler to change warnings or remarks to errors

  • warning: Tells the compiler to change remarks to warnings.

The diag-list is a diagnostic group or ID value. Possible values are:

  • thread: Specifies diagnostic messages that help in thread-enabling a program.

  • vec (ifort only): Specifies diagnostic messages issued by the vectorizer.

  • par (ifort only): Specifies diagnostic messages issued by the auto-parallelizer (parallel optimizer).

  • openmp (ifort only): Specifies diagnostic messages issued by the OpenMP* parallelizer.

  • warn: Specifies diagnostic messages that have a "warning" severity level.

  • error: Specifies diagnostic messages that have an "error" severity level.

  • remark: Specifies diagnostic messages that are remarks or comments.

  • cpu-dispatch (ifort only): Specifies the CPU dispatch remarks for diagnostic messages. These remarks are enabled by default.

  • id[,id,...]: Specifies the ID number of one or more messages. If you specify more than one message number, they must be separated by commas. There can be no intervening white space between each "id".

  • tag[,tag,...]: Specifies the mnemonic name of one or more messages. If you specify more than one mnemonic name, they must be separated by commas. There can be no intervening white space between each "tag".

NOTE:

Diagnostic messages generated by this option can be affected by other options, such as /arch (Windows), -m (Linux), or [Q]x.

m64 (Linux)

Qm64 (Windows)

[Q]m64 generates code for Intel® 64 architecture.

For example, when your compilation environment is configured for Intel® 64 architecture, and you use [Q]m64 with the compiler, you also need to use qm64 on the linker command line to make sure the proper compilation target is set up for any IPO compilations or the final link.

See Also