HP Fortran Programmer's Guide (B3908-90031; September 2011)

Compiling and linking
Linking HP Fortran programs
Chapter 284
Library search rules
When you use the -l option to specify the name of a library, the linker searches for the library in the
directories specified by the LPATH environment variable. The f90 command sets this variable so that the
linker looks first in /opt/fortran90/lib, then in /usr/lib. You can specify another directory to
search by setting LPATH yourself; see “LPATH environment variable” on page 98.
Alternatively, you can use the -Ldirectory option to direct the linker to search directory before it
looks anywhere else to resolve references. For example, the following command line:
$ f90 -L/my_libs prog.f90 -lstuff
causes the linker to search for libraries (including libstuff.sl and libstuff.a), starting with the
directory /my_libs and then looking in /opt/fortran90/lib and /usr/lib.