about summary refs log tree commit diff
path: root/nixpkgs/doc/using/overlays.chapter.md
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-03-19 09:13:54 +0000
committerAlyssa Ross <hi@alyssa.is>2022-03-19 09:13:54 +0000
commit220273ccc689041667ab5ff55fe5b1e93689227a (patch)
treed1c95664832920b476ab48ab5dd9ad09ec67d82d /nixpkgs/doc/using/overlays.chapter.md
parent68bab940e926ec7ae7380947a78c581e6aadcd18 (diff)
parent6e3ee8957637a60f5072e33d78e05c0f65c54366 (diff)
downloadnixlib-220273ccc689041667ab5ff55fe5b1e93689227a.tar
nixlib-220273ccc689041667ab5ff55fe5b1e93689227a.tar.gz
nixlib-220273ccc689041667ab5ff55fe5b1e93689227a.tar.bz2
nixlib-220273ccc689041667ab5ff55fe5b1e93689227a.tar.lz
nixlib-220273ccc689041667ab5ff55fe5b1e93689227a.tar.xz
nixlib-220273ccc689041667ab5ff55fe5b1e93689227a.tar.zst
nixlib-220273ccc689041667ab5ff55fe5b1e93689227a.zip
Merge commit '6e3ee8957637a60f5072e33d78e05c0f65c54366'
Conflicts:
	nixpkgs/pkgs/applications/networking/browsers/firefox/packages.nix
Diffstat (limited to 'nixpkgs/doc/using/overlays.chapter.md')
-rw-r--r--nixpkgs/doc/using/overlays.chapter.md20
1 files changed, 18 insertions, 2 deletions
diff --git a/nixpkgs/doc/using/overlays.chapter.md b/nixpkgs/doc/using/overlays.chapter.md
index df152bc14e7b..a51aa9ee8fc5 100644
--- a/nixpkgs/doc/using/overlays.chapter.md
+++ b/nixpkgs/doc/using/overlays.chapter.md
@@ -77,7 +77,7 @@ In Nixpkgs, we have multiple implementations of the BLAS/LAPACK numerical linear
 
     The Nixpkgs attribute is `openblas` for ILP64 (integer width = 64 bits) and `openblasCompat` for LP64 (integer width = 32 bits).  `openblasCompat` is the default.
 
--   [LAPACK reference](http://www.netlib.org/lapack/) (also provides BLAS)
+-   [LAPACK reference](http://www.netlib.org/lapack/) (also provides BLAS and CBLAS)
 
     The Nixpkgs attribute is `lapack-reference`.
 
@@ -117,7 +117,23 @@ $ LD_LIBRARY_PATH=$(nix-build -A mkl)/lib${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH n
 
 Intel MKL requires an `openmp` implementation when running with multiple processors. By default, `mkl` will use Intel's `iomp` implementation if no other is specified, but this is a runtime-only dependency and binary compatible with the LLVM implementation. To use that one instead, Intel recommends users set it with `LD_PRELOAD`. Note that `mkl` is only available on `x86_64-linux` and `x86_64-darwin`. Moreover, Hydra is not building and distributing pre-compiled binaries using it.
 
-For BLAS/LAPACK switching to work correctly, all packages must depend on `blas` or `lapack`. This ensures that only one BLAS/LAPACK library is used at one time. There are two versions of BLAS/LAPACK currently in the wild, `LP64` (integer size = 32 bits) and `ILP64` (integer size = 64 bits). Some software needs special flags or patches to work with `ILP64`. You can check if `ILP64` is used in Nixpkgs with `blas.isILP64` and `lapack.isILP64`. Some software does NOT work with `ILP64`, and derivations need to specify an assertion to prevent this. You can prevent `ILP64` from being used with the following:
+To override `blas` and `lapack` with its reference implementations (i.e. for development purposes), one can use the following overlay:
+
+```nix
+self: super:
+
+{
+  blas = super.blas.override {
+    blasProvider = self.lapack-reference;
+  };
+
+  lapack = super.lapack.override {
+    lapackProvider = self.lapack-reference;
+  };
+}
+```
+
+For BLAS/LAPACK switching to work correctly, all packages must depend on `blas` or `lapack`. This ensures that only one BLAS/LAPACK library is used at one time. There are two versions of BLAS/LAPACK currently in the wild, `LP64` (integer size = 32 bits) and `ILP64` (integer size = 64 bits). The attributes `blas` and `lapack` are `LP64` by default. Their `ILP64` version are provided through the attributes `blas-ilp64` and `lapack-ilp64`. Some software needs special flags or patches to work with `ILP64`. You can check if `ILP64` is used in Nixpkgs with `blas.isILP64` and `lapack.isILP64`. Some software does NOT work with `ILP64`, and derivations need to specify an assertion to prevent this. You can prevent `ILP64` from being used with the following:
 
 ```nix
 { stdenv, blas, lapack, ... }: