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.
This commit is contained in:
Matthew Bauer 2020-04-22 12:43:14 -05:00
parent 3d18975478
commit 4238b2b943
1 changed files with 21 additions and 10 deletions

View File

@ -140,8 +140,8 @@ self: super:
<section xml:id="sec-overlays-alternatives"> <section xml:id="sec-overlays-alternatives">
<title>Using overlays to configure alternatives</title> <title>Using overlays to configure alternatives</title>
<para> <para>
Certain software has different implementations of the same Certain software packages have different implementations of the
interface. Other distributions have functionality to switch same interface. Other distributions have functionality to switch
between these. For example, Debian provides <link between these. For example, Debian provides <link
xlink:href="https://wiki.debian.org/DebianAlternatives">DebianAlternatives</link>. xlink:href="https://wiki.debian.org/DebianAlternatives">DebianAlternatives</link>.
Nixpkgs has what we call <literal>alternatives</literal>, which Nixpkgs has what we call <literal>alternatives</literal>, which
@ -160,8 +160,9 @@ self: super:
</para> </para>
<para> <para>
The Nixpkgs attribute is <literal>openblas</literal> for The Nixpkgs attribute is <literal>openblas</literal> for
ILP64 and <literal>openblasCompat</literal> for LP64. This ILP64 (integer width = 64 bits) and
is the default. <literal>openblasCompat</literal> for LP64 (integer width =
32 bits). <literal>openblasCompat</literal> is the default.
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
@ -190,8 +191,15 @@ self: super:
#83888</link>, we are able to override the blas and lapack #83888</link>, we are able to override the blas and lapack
packages to use different implementations, through the packages to use different implementations, through the
blasProvider and lapackProvider argument. This can be used blasProvider and lapackProvider argument. This can be used
to select a different provider. For example, an overlay can be to select a different provider. BLAS providers will have
created that looks like: symlinks in <literal>$out/lib/libblas.so.3</literal> and
<literal>$out/lib/libcblas.so.3</literal> to their respective
BLAS libraries. Likewise, LAPACK providers will have symlinks
in <literal>$out/lib/liblapack.so.3</literal> and
<literal>$out/lib/liblapacke.so.3</literal> 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:
</para> </para>
<programlisting> <programlisting>
self: super: self: super:
@ -208,9 +216,12 @@ self: super:
<para> <para>
This overlay uses Intels MKL library for both BLAS and LAPACK This overlay uses Intels MKL library for both BLAS and LAPACK
interfaces. Note that the same can be accomplished at runtime interfaces. Note that the same can be accomplished at runtime
using <literal>LD_PRELOAD</literal> of libblas.so.3 and using <literal>LD_LIBRARY_PATH</literal> of libblas.so.3 and
liblapack.so.3. liblapack.so.3. For instance:
</para> </para>
<programlisting>
$ LD_LIBRARY_PATH=$(nix-build -A mkl):$LD_LIBRARY_PATH nix-shell -p octave --run octave
</programlisting>
<para> <para>
Intel MKL requires an <literal>openmp</literal> implementation Intel MKL requires an <literal>openmp</literal> implementation
when running with multiple processors. By default, when running with multiple processors. By default,
@ -221,8 +232,8 @@ self: super:
set it with <literal>LD_PRELOAD</literal>. Note that set it with <literal>LD_PRELOAD</literal>. Note that
<literal>mkl</literal> is only available on <literal>mkl</literal> is only available on
<literal>x86_64-linux</literal> and <literal>x86_64-linux</literal> and
<literal>x86_64-darwin</literal>. Moreover, Hydra is not build <literal>x86_64-darwin</literal>. Moreover, Hydra is not
and distributing pre-compiled binaries using it. building and distributing pre-compiled binaries using it.
</para> </para>
<para> <para>
For BLAS/LAPACK switching to work correctly, all packages must For BLAS/LAPACK switching to work correctly, all packages must