beautypg.com

4 modulefiles and mlib, 5 using intel compilers with hp mlib, 6 compiling and linking – HP XC System 2.x Software User Manual

Page 127: 1 linking veclib, 2 linking lapack, 3 linking scalapack

background image

9.2.4 Modulefiles and MLIB

When building or running an application built against MLIB, it is crucial that the environment is
consistent.

Modulefiles can make it easier to access a package. Therefore if modulefiles are used, it is
necessary to use a consistent set of modulefiles.

In particular, modulefiles can be used to select a compiler, both making its command available
in

$PATH

as well as making its shared objects available in

$LD_LIBRARY_PATH

.

MLIB has a modulefile corresponding to each supported compiler, making its shared objects
available in

$LD_LIBRARY_PATH

. If modulefiles are used to facilitate the user environment,

failure to use companion modulefiles will result in build and/or run-time errors.

If HP-MPI is used as well, it is important to make sure the

mpi**

compiler scripts use the

intended compiler. Do this by setting environment variables such as,

MPI_CC

and

MPI_F90

.

Failure to do so may cause the compiler scripts to discover a compiler that is not the intended
compiler, and thus introduce an unintended inconsistency. It is important to note that the MLIB
modulefiles do not set any MPI environment variables.

For more information, refer to the MLIB User’s Guide.

9.2.5 Using Intel Compilers with HP MLIB

HP MLIB requires Intel compilers. When using

/opt/mlib/intel_7.1/hpmpi_2.1

,

use the Intel V7 compilers. When using

/opt/mlib/intel_8.0/hpmpi_2.1

, use the

Intel V8 compilers. Note that Intel compilers are not supplied with the HP XC system. Refer to
Section 3.7.1 for further information.

9.2.6 Compiling and Linking

This section outlines compiling and linking information for HP XC MLIB libraries.

9.2.6.1 Linking VECLIB

For programs that link VECLIB, you can specify the entire path of the library file on the
compiler command line. You can use the following commands to link VECLIB:

$ ifort [options] file ...

/opt/mlib/[intel_7.1\intel_8.0]/hpmpi_2.1/lib/64/libveclib.a \

-openmp

$ icc [options] file ...

/opt/mlib/[intel_7.1\intel_8.0]/hpmpi_2.1/lib/64/libveclib.a \

-openmp

9.2.6.2 Linking LAPACK

For programs that link LAPACK, you can specify the entire path of the library file on the
compiler command line. You can use the following commands to link LAPACK:

$ mpi90 [options] file ...

/opt/mlib/[intel_7.1\intel_8.0]/hpmpi_2.1/lib/64/liblapack.a \

-openmp

$ mpicc [options] file ...

/opt/mlib/[intel_7.1\intel_8.0]/hpmpi_2.1/lib/64/liblapack.a \

-openmp

9.2.6.3 Linking ScaLAPACK

For programs that link ScaLAPACK, you can specify the entire path of the library file on the
compiler command line. You can use the following commands to link ScaLAPACK:

Using HP MLIB

9-3