nixpkgs-suyu/pkgs
Matthew Bauer 43873351ff blas/lapack: add wrapper for “alternative”s of BLAS/LAPACK provider
This is based on previous work for switching between BLAS and LAPACK
implementation in Debian[1] and Gentoo[2]. The goal is to have one way
to depend on the BLAS/LAPACK libraries that all packages must use. The
attrs “blas” and “lapack” are used to represent a wrapped BLAS/LAPACK
provider. Derivations that don’t care how BLAS and LAPACK are
implemented can just use blas and lapack directly. If you do care what
you get (perhaps for some CPP), you should verify that blas and lapack
match what you expect with an assertion.

The “blas” package collides with the old “blas” reference
implementation. This has been renamed to “blas-reference”. In
addition, “lapack-reference” is also included, corresponding to
“liblapack” from Netlib.org.

Currently, there are 3 providers of the BLAS and LAPACK interfaces:

- lapack-reference: the BLAS/LAPACK implementation maintained by netlib.org
- OpenBLAS: an optimized version of BLAS and LAPACK
- MKL: Intel’s unfree but highly optimized BLAS/LAPACK implementation

By default, the above implementations all use the “LP64” BLAS and
LAPACK ABI. This corresponds to “openblasCompat” and is the safest way
to use BLAS/LAPACK. You may received some benefits from “ILP64” or
8-byte integer BLAS at the expense of breaking compatibility with some
packages.

This can be switched at build time with an override like:

    import <nixpkgs> {
        config.allowUnfree = true;
        overlays = [(self: super: {
          lapack = super.lapack.override {
            lapackProvider = super.lapack-reference;
          };
          blas = super.blas.override {
            blasProvider = super.lapack-reference;
          };
        })];
      }

or, switched at runtime via LD_LIBRARY_PATH like:

    $ LD_LIBRARY_PATH=$(nix-build -E '(with import <nixpkgs> {}).lapack.override { lapackProvider = pkgs.mkl; is64bit = true; })')/lib:$(nix-build -E '(with import <nixpkgs> {}).blas.override { blasProvider = pkgs.mkl; is64bit = true; })')/lib ./your-blas-linked-binary

By default, we use OpenBLAS LP64 also known in Nixpkgs as
openblasCompat.

[1]: https://wiki.debian.org/DebianScience/LinearAlgebraLibraries
[2]: https://wiki.gentoo.org/wiki/Blas-lapack-switch
2020-04-17 16:23:55 -05:00
..
applications termpdf.py: init at 2019-09-30 2020-04-17 21:01:17 +02:00
build-support blas/lapack: add wrapper for “alternative”s of BLAS/LAPACK provider 2020-04-17 16:23:55 -05:00
common-updater common-updater: add update script to all-packages 2020-04-15 23:02:33 -03:00
data all-cabal-hashes: update to Hackage at 2020-04-17T17:47:53Z 2020-04-17 20:56:52 +02:00
desktops Merge pull request #85304 from romildo/common-updater 2020-04-16 08:05:18 -03:00
development blas/lapack: add wrapper for “alternative”s of BLAS/LAPACK provider 2020-04-17 16:23:55 -05:00
games Merge pull request #85284 from andersk/system-syzygy 2020-04-16 02:23:33 -04:00
misc
os-specific linux: 5.4.32 -> 5.4.33 2020-04-17 08:34:01 -04:00
servers grocy: 2.7.0 -> 2.7.1 2020-04-17 22:02:28 +02:00
shells
stdenv
test
tools mesa-demos: init at 8.4.0 (#74310) 2020-04-17 14:00:48 -05:00
top-level blas/lapack: add wrapper for “alternative”s of BLAS/LAPACK provider 2020-04-17 16:23:55 -05:00