Managing Libraries

You can determine the libraries for your applications by controlling the linker or by using the options described in this section. See library options summary.

The LD_LIBRARY_PATH environment variable contains a colon-separated list of directories that the linker will search for library (.a) files. If you want the linker to search additional libraries, you can add their names to the command line, to a response file, or to the configuration (.cfg) file. In each case, the names of these libraries are passed to the linker before these libraries:

libimf.a *
libm.a
libirc.a
*
libcxa.a
*
libcprts.a
*
libunwind.a
*
libc.a

The ones marked with an "*" are provided by Intel.

For more information on response and configuration files, see Response Files and Configuration Files.

The linker uses the LD_LIBRARY_PATH variable to search for libraries. If you are compiling with a linker option that forces static libraries, it will look for those at compile time. Otherwise, it will look for shared libraries at runtime.

To specify a library name on the command line, you must first add the library's path to the LD_LIBRARY_PATH environment variable. Then, to compile file.f and link it with the library libmine.a, for example, enter the following command:

IA-32 applications:

prompt>ifc file.f -lmine

Itanium(TM)-based applications:

prompt>efc file.f -lmine

The example above implies that the library resides in your path.

The Order of Passing the Files to Linker

The compiler passes files to the linker in the following order:

1. Object files and libraries are passed to the linker in the order specified on the command line.

2. Object files and libraries in the .cfg file will be processed before those on the command line. This means that putting library names in the .cfg file does not make much sense because the libraries will be processed before most object files are seen.

3. The libimf.a, libF90.a, libintrins.a, and libIEPCF90.a libraries.

4. The libm.a libary is linked in just before libc.a,  then libc.a libraries.

See the list of libraries that are installed with the Intel® Fortran Compiler for IA-32 applications and for Itanium(TM)-based applications.