3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/build-support
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
..
add-opengl-runpath
agda treewide: fix *Flags 2019-12-30 04:50:37 +01:00
alternatives blas/lapack: add wrapper for “alternative”s of BLAS/LAPACK provider 2020-04-17 16:23:55 -05:00
appimage appimage-exec.sh: simplify and improve getopts options 2020-03-08 20:34:23 +01:00
bintools-wrapper Merge pull request #74090 from obsidiansystems/ghcjs-cross-without-cc 2019-12-30 16:40:43 -08:00
build-bazel-package build-bazel-package: fix linkopt flags 2020-04-10 15:41:39 -04:00
build-dotnet-package treewide: Make still dont* Variables are optional in most cases 2019-11-01 14:44:44 -04:00
build-fhs-userenv build-fhs-userenv: runCommand -> runCommandLocal (#77253) 2020-02-14 20:16:49 +02:00
build-setupcfg
buildenv buildEnv: check pathsToLink before checking collisions 2019-09-18 15:13:50 +02:00
cc-wrapper Merge pull request #82882 from obsidiansystems/armv6-embedded 2020-03-19 10:38:22 -04:00
docker buildLayeredImage: Allow empty store, no paths to add 2020-02-28 14:59:04 +01:00
dotnetbuildhelpers
dotnetenv
emacs emacs: fix setup-hook 2020-04-02 23:04:08 +02:00
expand-response-params
fetchbitbucket
fetchbower
fetchbzr
fetchcvs
fetchdarcs
fetchdocker
fetchfossil
fetchgit Revert "fetchzip, fetchgit: cleanup handling of optional features and whitespace" 2020-03-26 00:35:40 -04:00
fetchgithub
fetchgitiles fetchFromGitiles: init 2019-12-02 22:44:33 +00:00
fetchgitlab fetchFromGitLab: improve readability 2019-12-09 01:33:16 +00:00
fetchgitlocal
fetchgx
fetchhg
fetchipfs
fetchmavenartifact treewide: Per RFC45, remove all unquoted URLs 2020-04-10 17:54:53 +01:00
fetchmtn
fetchnuget
fetchpatch fetchpatch: Allow using base64-encoded hash 2020-03-02 23:57:40 +01:00
fetchrepoorcz
fetchrepoproject
fetchs3
fetchsavannah
fetchsvn fetchsvn: Fix for cross 2020-03-09 02:11:45 -04:00
fetchsvnrevision
fetchsvnssh
fetchurl treewide: Per RFC45, remove all unquoted URLs 2020-04-10 17:54:53 +01:00
fetchzip Revert "fetchzip, fetchgit: cleanup handling of optional features and whitespace" 2020-03-26 00:35:40 -04:00
icon-conv-tools
install-shell-files installShellFiles: init (#65211) 2019-09-04 23:19:17 +02:00
kernel modules-shrunk: preserve module priorities from build 2019-12-07 23:04:17 +01:00
libredirect libredirect: fix build on darwin 2020-01-23 20:20:20 -05:00
make-desktopitem makeDesktopItem: make categories optional 2020-03-31 04:10:58 +00:00
make-startupitem
make-symlinks
mkshell
mono-dll-fixer
nix-gitignore
nuke-references nukeReferences: Use stdenvNoCC 2019-10-11 17:12:09 +02:00
ocaml buildDunePackage: add a “useDune2” option 2020-03-23 09:12:50 +01:00
oci-tools ociTools: init 2019-09-04 22:46:42 +00:00
prefer-remote-fetch
references-by-popularity
release releaseTools: no-op expression cleanup 2020-03-21 21:15:33 -04:00
remove-references-to
rust Merge pull request #85172 from andir/buildRustCrate-proc-macro 2020-04-13 23:35:19 +02:00
setup-hooks patch-shebangs.sh: Fix error messages to go to stderr, not '0' file. 2020-03-20 17:08:10 -07:00
singularity-tools singularity-tools: fix buildImage 2020-02-02 09:18:39 +11:00
skaware skawarePackages: support static builds via pkgsStatic 2020-03-30 01:35:39 +02:00
snap
src-only srcOnly: remove the ellipsis (#80903) 2020-02-24 23:12:37 +00:00
substitute
substitute-files
templaterpm
upstream-updater
vm treewide: Per RFC45, remove all unquoted URLs 2020-04-10 17:54:53 +01:00
wrapper-common
writers pkgs/build-support/writers: use runCommandLocal for scripts 2020-02-18 19:53:18 +01:00
build-maven.nix
build-pecl.nix php.packages.buildPecl: Introduce built-in extension dependencies 2020-04-05 16:44:13 +02:00
closure-info.nix
dhall-to-nix.nix treewide: remove redundant quotes 2019-09-08 23:38:31 +00:00
plugins.nix
replace-dependency.nix
setup-systemd-units.nix
source-from-head-fun.nix
trivial-builders.nix symlinkJoin: add more documentation 2020-02-18 16:35:28 +01:00