Example Programs for LAPACK

LAPACK_EXAMPLES is a FORTRAN90 program which shows some examples of calling the LAPACK library, which can solve linear systems and compute eigevalues.

Many vendors supply a compiled copy of LAPACK, optimized for their hardware, and easily available as a library.

LAPACK includes routines to

The source code and documentation for LAPACK is available through the NETLIB web site.


The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.


LAPACK_EXAMPLES is available in a FORTRAN77 version and a FORTRAN90 version.

Related Data and Programs:

BLAS, a FORTRAN90 library which contains the Basic Linear Algebra Subprograms (BLAS) for level 1 (vector-vector operations), level 2 (matrix-vector operations) and level 3 (matrix-matrix operations), for single precision real arithmetic, double precision real arithmetic, single precision complex arithmetic, and double precision complex arithmetic.

EISPACK, a FORTRAN90 library which carries out eigenvalue computations; superseded by LAPACK;

LAPACK_EXAMPLES_OSX, a FORTRAN90 program which demonstrates the use of the LAPACK linear algebra library available on Macintosh OSX systems, using the "-framework veclib" compiler option.

LINPACK_D, a FORTRAN90 library which solves linear systems using double precision real arithmetic;

LINPLUS, a FORTRAN90 library which carries out simple manipulations of matrices in a variety of formats.

QR_SOLVE, a FORTRAN90 library which computes the least squares solution of a linear system A*x=b.

TEST_EIGEN, a FORTRAN90 library which defines various eigenvalue test cases.

TEST_MAT, a FORTRAN90 library which defines test matrices, some of which have known determinants, eigenvalues and eigenvectors, inverses, and so on.


  1. Edward Anderson, Zhaojun Bai, Christian Bischof, Susan Blackford, James Demmel, Jack Dongarra, Jeremy DuCroz, Anne Greenbaum, Sven Hammarling, Alan McKenney, Danny Sorensen,
    LAPACK User's Guide,
    Third Edition,
    SIAM, 1999,
    ISBN: 0898714478,
    LC: QA76.73.F25L36
  2. Vincent Barker, Susan Blackford, Jack Dongarra, Jeremy Du Croz, Sven Hammarling, Minka Marinova, Jerzy Wasniewski, Plamen Yalamov,
    LAPACK95 User's Guide,
    SIAM, 2001,
    ISBN13: 978-0-898715-04-0,
    LC: QA76.73.F25.L36.

Examples and Tests:

On the Macintosh, an optimized version of LAPACK is available as vecLib.

LAPACK_TEST is a test program that demonstrates the use of the LAPACK_D drivers DSYEV and DSYEVD on a real symmetric matrix. Random problems of size 4, 16, 64, 256 and 1024 are generated and solved, and the setup and solution times are reported. The TEST_EIGEN package is called to generate the random test matrices.

You can go up one level to the FORTRAN90 source codes.

Last revised on 02 March 2010.