HP MLIB User's Guide Vol. 1 7th Ed.
6 HP MLIB User’s Guide
Accessing VECLIB
When you use the –aarchive_shared flag on your compiler command line for
HP-UX, it ensures that the compiler links the archive library. If the archive
library is not available, then it links the shared library. If you omit
–aarchive_shared and –ashared_archive, the linker defaults to linking 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 VECLIB for use on the same machine, use one
of the following commands:
f90 [options] file ... –Wl,–aarchive_shared −lveclib
cc
[options] file ... –Wl,–aarchive_shared −lveclib −lcl −lm
aCC
[options] file ... –Wl,–aarchive_shared −lveclib −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 VECLIB 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]/libveclib.a
cc
[options] file ... /opt/mlib/lib/[pa2.0|pa20_64]/libveclib.a −lcl −lm
aCC
[options] file ... /opt/mlib/lib/[pa2.0|pa20_64]/libveclib.a −lcl −lm
Replace libveclib.a with libveclib.sl on your compiler command line if you
want to link the shared library on a PA-based system.
3. Use the −lveclib option on the compiler command line that links your
program, preceded by:
−Wl,–aarchive_shared,−L/opt/mlib/lib/[pa2.0|pa20_64]