From 4238b2b943f0e49fb00588b7080bc848382db36f Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 22 Apr 2020 12:43:14 -0500 Subject: doc/overlays.xml: fix missing documentation for blas/lapack This adds some more information to the documentation as well as addressing review from https://github.com/NixOS/nixpkgs/pull/85636. --- doc/using/overlays.xml | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'doc') diff --git a/doc/using/overlays.xml b/doc/using/overlays.xml index 5f808839dd0d0..ada9ab3893284 100644 --- a/doc/using/overlays.xml +++ b/doc/using/overlays.xml @@ -140,8 +140,8 @@ self: super:
Using overlays to configure alternatives - Certain software has different implementations of the same - interface. Other distributions have functionality to switch + Certain software packages have different implementations of the + same interface. Other distributions have functionality to switch between these. For example, Debian provides DebianAlternatives. Nixpkgs has what we call alternatives, which @@ -160,8 +160,9 @@ self: super: The Nixpkgs attribute is openblas for - ILP64 and openblasCompat for LP64. This - is the default. + ILP64 (integer width = 64 bits) and + openblasCompat for LP64 (integer width = + 32 bits). openblasCompat is the default. @@ -190,8 +191,15 @@ self: super: #83888, we are able to override the ‘blas’ and ‘lapack’ packages to use different implementations, through the ‘blasProvider’ and ‘lapackProvider’ argument. This can be used - to select a different provider. For example, an overlay can be - created that looks like: + to select a different provider. BLAS providers will have + symlinks in $out/lib/libblas.so.3 and + $out/lib/libcblas.so.3 to their respective + BLAS libraries. Likewise, LAPACK providers will have symlinks + in $out/lib/liblapack.so.3 and + $out/lib/liblapacke.so.3 to their respective + LAPCK libraries. For example, Intel MKL is both a BLAS and + LAPACK provider. An overlay can be created to use Intel MKL + that looks like: self: super: @@ -208,9 +216,12 @@ self: super: This overlay uses Intel’s MKL library for both BLAS and LAPACK interfaces. Note that the same can be accomplished at runtime - using LD_PRELOAD of libblas.so.3 and - liblapack.so.3. + using LD_LIBRARY_PATH of libblas.so.3 and + liblapack.so.3. For instance: + +$ LD_LIBRARY_PATH=$(nix-build -A mkl):$LD_LIBRARY_PATH nix-shell -p octave --run octave + Intel MKL requires an openmp implementation when running with multiple processors. By default, @@ -221,8 +232,8 @@ self: super: set it with LD_PRELOAD. Note that mkl is only available on x86_64-linux and - x86_64-darwin. Moreover, Hydra is not build - and distributing pre-compiled binaries using it. + 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 -- cgit 1.4.1 From 480a55a6b695939a2e8b1cadc3205080a404c814 Mon Sep 17 00:00:00 2001 From: Benjamin Hipple Date: Wed, 22 Apr 2020 21:54:41 -0400 Subject: doc/using/overlays.xml: update LD_LIBRARY_PATH example --- doc/using/overlays.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/using/overlays.xml b/doc/using/overlays.xml index ada9ab3893284..3fa68e32a3c56 100644 --- a/doc/using/overlays.xml +++ b/doc/using/overlays.xml @@ -220,7 +220,7 @@ self: super: liblapack.so.3. For instance: -$ LD_LIBRARY_PATH=$(nix-build -A mkl):$LD_LIBRARY_PATH nix-shell -p octave --run octave +$ LD_LIBRARY_PATH=$(nix-build -A mkl)/lib:$LD_LIBRARY_PATH nix-shell -p octave --run octave Intel MKL requires an openmp implementation -- cgit 1.4.1