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 addOpenGLRunpath: only apply to ELF files 2019-05-23 16:52:45 -04:00
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 Revert "buildSetupcfg: Include unzip for zip sources." 2018-04-14 20:12:22 -04:00
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 [bot]: remove unreferenced code 2018-07-20 18:48:37 +00:00
emacs emacs: fix setup-hook 2020-04-02 23:04:08 +02:00
expand-response-params
fetchbitbucket all-packages: move fetch* to pkgs/build-support/ 2019-01-26 22:47:54 -05:00
fetchbower
fetchbzr
fetchcvs bsd: init netbsd & openbsd userland 2018-04-24 14:16:35 -05:00
fetchdarcs pkgs/*: remove unreferenced function arguments 2018-07-21 02:48:04 +00:00
fetchdocker treewide: remove redundant quotes 2019-08-26 21:40:19 +00:00
fetchfossil
fetchgit Revert "fetchzip, fetchgit: cleanup handling of optional features and whitespace" 2020-03-26 00:35:40 -04:00
fetchgithub all-packages: move fetch* to pkgs/build-support/ 2019-01-26 22:47:54 -05:00
fetchgitiles fetchFromGitiles: init 2019-12-02 22:44:33 +00:00
fetchgitlab fetchFromGitLab: improve readability 2019-12-09 01:33:16 +00:00
fetchgitlocal pkgs/*: remove unreferenced function arguments 2018-07-21 02:48:04 +00:00
fetchgx
fetchhg prefer-fetch-remote: an overlay to fetch on remote builders 2019-01-18 14:41:10 +00:00
fetchipfs prefer-fetch-remote: an overlay to fetch on remote builders 2019-01-18 14:41:10 +00:00
fetchmavenartifact treewide: Per RFC45, remove all unquoted URLs 2020-04-10 17:54:53 +01:00
fetchmtn
fetchnuget pkgs/*: remove unreferenced function arguments 2018-07-21 02:48:04 +00:00
fetchpatch fetchpatch: Allow using base64-encoded hash 2020-03-02 23:57:40 +01:00
fetchrepoorcz all-packages: move fetch* to pkgs/build-support/ 2019-01-26 22:47:54 -05:00
fetchrepoproject
fetchs3 pkgs/*: remove unreferenced function arguments 2018-07-21 02:48:04 +00:00
fetchsavannah all-packages: move fetch* to pkgs/build-support/ 2019-01-26 22:47:54 -05:00
fetchsvn fetchsvn: Fix for cross 2020-03-09 02:11:45 -04:00
fetchsvnrevision
fetchsvnssh fetchsvnssh: move defaults to package file 2019-02-03 15:30:27 +00:00
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 mkshell: improve mergeInputs 2019-06-23 22:20:10 +02:00
mono-dll-fixer
nix-gitignore nix-gitignore: init at v3.0.0 (#46112) 2019-02-18 09:57:30 +00:00
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 prefer-fetch-remote: an overlay to fetch on remote builders 2019-01-18 14:41:10 +00:00
references-by-popularity references-by-popularity: cache computation to avoid memory bloat 2019-03-05 16:37:52 -05:00
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 doc: fix after snaptools merge 2019-07-10 08:02:14 -07:00
src-only srcOnly: remove the ellipsis (#80903) 2020-02-24 23:12:37 +00:00
substitute substituteAll: allowSubstitutes = false; 2019-02-07 22:20:42 +00:00
substitute-files substituteAllFiles: allowSubstitutes = false 2019-02-08 00:22:51 +00:00
templaterpm treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
upstream-updater treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
vm treewide: Per RFC45, remove all unquoted URLs 2020-04-10 17:54:53 +01:00
wrapper-common utils.bash: allow response files in bootstrapping 2019-04-20 23:17:04 -04:00
writers pkgs/build-support/writers: use runCommandLocal for scripts 2020-02-18 19:53:18 +01:00
build-maven.nix buildMaven: Support metadata-only dependencies 2018-11-29 17:29:59 +00:00
build-pecl.nix php.packages.buildPecl: Introduce built-in extension dependencies 2020-04-05 16:44:13 +02:00
closure-info.nix treewide: remove unused variables (#63177) 2019-06-16 19:59:05 +00:00
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 treewide: Change URLs to HTTPS 2019-04-22 10:19:54 +02:00
trivial-builders.nix symlinkJoin: add more documentation 2020-02-18 16:35:28 +01:00