Intel® Fortran Compiler 16.0 User and Reference Guide

About Creating Offload Libraries with xiar and xild

This topic only applies to Intel® Many Integrated Core Architecture (Intel® MIC Architecture).

Using xiar or the equivalent xild -lib to create a static archive library containing routines with offload code requires the following actions:

Example

The following xiar command creates or modifies the CPU library libsample.a and coprocessor library libsampleMIC.a:

xiar -qoffload-build rcs libsample.a obj1.o obj2.o

libsample.a contains the CPU object files obj1.o and obj2.o. libsampleMIC.a contains the coprocessor object files obj1MIC.o and obj2MIC.o.

Either of the following commands compiles and links myprogram.f90 with the static library:

ifort myprogram.f90 libsample.a
ifort myprogram.f90 -lsample