Sun Studio 12: Fortran Programming Guide

4.3.1 Search Order for Standard Library Paths

The standard library search paths used by the linker are determined by the installation path, and they differ for static and dynamic loading. A standard install puts the Sun Studio compiler software under /opt/SUNWspro/.

4.3.1.1 Static Linking

While building the executable file, the static linker searches for any libraries in the following paths (among others), in the specified order:

/opt/SUNWspro/lib

Sun Studio shared libraries 

/usr/ccs/lib/

Standard location for SVr4 software 

/usr/lib

Standard location for UNIX software 

These are the default paths used by the linker.

4.3.1.2 Dynamic Linking

The dynamic linker searches for shared libraries at runtime, in the specified order:

The search paths are built into the executable.