HP MLIB User's Guide Vol. 2 7th Ed.

Chapter 8 Introduction to LAPACK 631
Accessing LAPACK
Compiling and linking (LAPACK)
There are several ways to link your program with the version of LAPACK tuned
for the machine on which the program runs.By default, the
llapack option on
the f90, cc, or c89 command line that links your program selects the library that
corresponds to 32-bit addressing on the machine on which you link.
cc is the HP C compiler and c89 is the HP POSIX-conforming C compiler. The
remainder of this book refers to the cc and f90 compilers. cc or f90 examples
also apply to c89.
When you use the –aarchive_shared flag on the compiler command line for
HP-UX, it ensures that the compiler links with the archive library. If the
archive library is not available, then it links the shared library. Link with
–Bstatic on Linux systems.
If your program uses subprograms from VECLIB, LAPACK, ScaLAPACK,
Distributed SuperLU, SOLVERS, and VMATH, specify llapack, lveclib,
lscalapack, lsuperlu_dist, lsolvers, and lvmath or llapack8, lveclib8,
lscalapack8, lsuperlu_dist8, lsolvers8, and lvmath8 on the compiler
command line.
NOTE Do not mix subprograms from the two types of 64-bit address libraries
(those with 32-bit integers and those with 64-bit integers) in the same
program.
Each of the VECLIB and LAPACK library files is complete in itself, meaning
that you do not need to link one library because you have called subprograms
from another. This is because various subprograms are included in both
libraries. For example, VECLIB subroutine SGEMV is called by several
LAPACK subprograms, and therefore, is included in the LAPACK library. Thus,
in general, you have to link only the library or libraries you need.
For PA-Based Systems
1. To link a program that uses LAPACK for use on the same machine, use one
of the following commands:
f90 [options] file ... –Wl,–aarchive_shared llapack
cc
[options] file ... –Wl,–aarchive_shared llapack lcl lm
aCC
[options] file ... –Wl,–aarchive_shared llapack lcl lm
2. Specify the entire path of the library file on the compiler command line that
links your program. For example, to link your program with LAPACK for
use with 32- or 64-bit addressing on a PA-based system, use one of the
following:
f90 [options] file ... /opt/mlib/lib/[pa2.0|pa20_64]/liblapack.a