HP MLIB User's Guide Vol. 2 7th Ed.
Chapter 10 Introduction to ScaLAPACK 693
Accessing ScaLAPACK
Compiling and linking (ScaLAPACK)
There are several ways to link your program with the version of ScaLAPACK
tuned for the machine on which the program runs. By default, the −lscalapack
option on the mpif90 or mpicc command line that links your program selects
the library that corresponds to 32-bit addressing on the machine on which you
link.
NOTE Unlike other MLIB libraries, executable files using the ScaLAPACK
library must be linked using either mpif90 or mpicc, instead of f90 or
cc.
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. If you omit
–aarchive_shared and –ashared_archive, the linker defaults to linking the
shared library. Link with on –Bstatic 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.
For PA-Based Systems
1. To link a program that uses ScaLAPACK for use on the same machine, use
one of the following commands:
mpif90 [options] file ... –Wl,–aarchive_shared −lscalapack
mpicc
[options] file ... –Wl,–aarchive_shared −lscalapack −lcl −lm
mpiCC
[options] file ... –Wl,–aarchive_shared −lscalapack −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 ScaLAPACK for
use with 32- or 64-bit addressing on a PA-based system, use one of the
following:
mpif90 [options] file ... /opt/mlib/lib/[pa2.0|pa20_64]/libscalapack.a
mpicc
[options] file ... /opt/mlib/lib/[pa2.0|pa20_64]/libscalapack.a −lcl −lm