Managing Libraries

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

The LD_LIBRARY_PATH environment variable contains a semicolon-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:

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

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 compiler driver passes files to the linker in the following order:

1. The object file.

2. Any objects or libraries specified on the command line, in a response file, or in a configuration file.

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

If you specified the -mt option, the compiler passes the libmMT.a, libF90MT.a, libIEPCF90MT.a, and the libintrinsMT.a libraries.

4. The libc.a libraries.