Differences between revisions 19 and 20
Revision 19 as of 2010-04-09 10:33:29
Size: 4995
Editor: ?Sylvestre Ledru
Comment: +eigen
Revision 20 as of 2010-07-01 07:08:42
Size: 5305
Editor: ?VinceMcIntyre
Comment: try to make it clearer to the novice reader what the relations of blas/lapack/atlas are.
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
Many implementations of these API exist. Many implementations of these API exist. In Debian, we use by default the reference implementation of BLAS and LAPACK.
However these may not perform as well as other implementations. ATLAS is a popular alternate implementation of BLAS and (some of) LAPACK. Debian has several binary packages of ATLAS, optimised for different hardware architectures.

Handle different versions of BLAS and LAPACK

Description

Beside being implementations, BLAS and LAPACK are also API standard for basic linear algebra operations (such as vector and matrix multiplication).

Many implementations of these API exist. In Debian, we use by default the reference implementation of BLAS and LAPACK. However these may not perform as well as other implementations. ATLAS is a popular alternate implementation of BLAS and (some of) LAPACK. Debian has several binary packages of ATLAS, optimised for different hardware architectures.

For BLAS:

  • blas - BLAS or BLAS-reference

  • atlas - Automatically Tuned Linear Algebra Software

  • gsl - GNU Scientific Library

  • eigen2 - Eigen

  • Intel MKL - Non-free
  • AMD ACML - Non-free
  • Sun Performance Library - Non-free
  • ...

For LAPACK:

  • lapack - Reference LAPACK

  • LAPACK++
  • ATLAS provides an optimized subset of LAPACK + code from

Problems

For now, in Debian, it is not trivial to switch between the different implementations. In the past, it used to be handle through the ld.so.conf.d/ possibility and also some primitive update-alternatives. It makes switches between different implementations pretty hard. It causes also many problems for application based on BLAS or LAPACK to select the best implementation.

How to switch from an implementation to the other

It is just trivial. It can be used like any other software using update-alternative.

BLAS

update-alternatives --config libblas.so.3gf

Example

There are 3 choices for the alternative libblas.so.3gf (providing /usr/lib/libblas.so.3gf).

  Selection    Path                                           Priority   Status
------------------------------------------------------------
* 0            /usr/lib/atlas-core2sse3/atlas/libblas.so.3gf   55        auto mode
  1            /usr/lib/atlas-base/atlas/libblas.so.3gf        35        manual mode
  2            /usr/lib/atlas-core2sse3/atlas/libblas.so.3gf   55        manual mode
  3            /usr/lib/libblas/libblas.so.3gf                 10        manual mode

LAPACK

update-alternatives --config liblapack.so.3gf

Example:

There are 3 choices for the alternative liblapack.so.3gf (providing /usr/lib/liblapack.so.3gf).

  Selection    Path                                             Priority   Status
------------------------------------------------------------
* 0            /usr/lib/atlas-core2sse3/atlas/liblapack.so.3gf   55        auto mode
  1            /usr/lib/atlas-base/atlas/liblapack.so.3gf        35        manual mode
  2            /usr/lib/atlas-core2sse3/atlas/liblapack.so.3gf   55        manual mode
  3            /usr/lib/lapack/liblapack.so.3gf                  10        manual mode

Proposal

To simplify the usage, the proposal is to use the update-alternative mechanism. This transition should be perfectly smooth for all packages since it won't change anything in the ABI or rename files.

The Debian developer responsible for the transition is Sylvestre Ledru < sylvestre@debian.org >. For discussion, please use < debian-science@lists.debian.org > mailing list.

BLAS

The following files must be provided in the shared library package:

  • libblas.so.3gf[.0]

-dev package:

  • libblas.a
  • libblas.so
  • cblas.h

Priorities:

Package name

Priority

libblas3gf

10

libgsl0ldbl

20 (?)

libatlas3gf-base

35

libatlas3gf-sse

40

libatlas3gf-sse2

45

libatlas3gf-sse3

50

libatlas3gf-core2sse3

55

libatlas3gf-amd64sse3

60

libatlas3gf-corei7sse3

60

libatlas3gf-altivec

60

libatlas3gf-v9

60

libatlas3gf-ev6

60

libatlas3gf-2.0

60

LAPACK

The following files must be provided in the shared library package:

  • liblapack.so.3gf.[.0]

-dev package:

  • liblapack.a
  • liblapack.so

Priorities:

Package name

Priority

liblapack

10

libatlas3gf-base

30

libatlas3gf-sse

40

libatlas3gf-sse2

45

libatlas3gf-sse3

50

libatlas3gf-core2sse3

55

libatlas3gf-amd64sse3

60

libatlas3gf-corei7sse3

60

libatlas3gf-altivec

60

libatlas3gf-v9

60

libatlas3gf-ev6

60

libatlas3gf-2.0

60

TODO

  • Doing like gentoo: providing .pc files ?
  • Check for other implementations (CUBLAS, MKL in non-free, ACML in non-free)