Sun Studio 12 Update 1: Fortran User's Guide

3.4.49 –Lpath

Add path to list of directory paths to search for libraries.

Adds path to the front of the list of object–library search directories. A space between -L and path is optional. This option is passed to the linker. See also 3.4.50 –lx.

While building the executable file, ld(1) searches path for archive libraries (.a files) and shared libraries (.so files). ld searches path before searching the default directories. (See the Fortran Programming Guide chapter “Libraries” for information on library search order.) For the relative order between LD_LIBRARY_PATH and -Lpath, see ld(1).

Note –

Specifying /usr/lib or /usr/ccs/lib with -L path may prevent linking the unbundled libm. These directories are searched by default.

Example: Use -Lpath to specify library search directories:

demo% f95 -L./dir1 -L./dir2 any.f