summary refs log tree commit diff
path: root/pkgs/applications/science/math/gmsh/default.nix
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2020-03-27 14:50:45 -0400
committerMatthew Bauer <mjbauer95@gmail.com>2020-04-17 16:23:55 -0500
commit43873351ffed36b52170571839e26b57c9f15920 (patch)
treeb786ea2449e58fa8ccead15251bfbb187b7d94aa /pkgs/applications/science/math/gmsh/default.nix
parent90326ba624ddfbd3b7f9eb3995994644cee804fb (diff)
downloadnixpkgs-43873351ffed36b52170571839e26b57c9f15920.tar
nixpkgs-43873351ffed36b52170571839e26b57c9f15920.tar.gz
nixpkgs-43873351ffed36b52170571839e26b57c9f15920.tar.bz2
nixpkgs-43873351ffed36b52170571839e26b57c9f15920.tar.lz
nixpkgs-43873351ffed36b52170571839e26b57c9f15920.tar.xz
nixpkgs-43873351ffed36b52170571839e26b57c9f15920.tar.zst
nixpkgs-43873351ffed36b52170571839e26b57c9f15920.zip
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
Diffstat (limited to 'pkgs/applications/science/math/gmsh/default.nix')
0 files changed, 0 insertions, 0 deletions