Merge pull request #95083 from danieldk/manual-amd-blis

manual: add AMD BLIS/LIBFLAME to the BLAS/LAPACK list
This commit is contained in:
Daniël de Kok 2020-08-11 08:56:31 +02:00 committed by GitHub
commit f9eba87bf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -178,26 +178,40 @@ self: super:
<para> <para>
<link <link
xlink:href="https://software.intel.com/en-us/mkl">Intel xlink:href="https://software.intel.com/en-us/mkl">Intel
MKL</link> (only works on x86 architecture, unfree) MKL</link> (only works on the x86_64 architecture, unfree)
</para> </para>
<para> <para>
The Nixpkgs attribute is <literal>mkl</literal>. The Nixpkgs attribute is <literal>mkl</literal>.
</para> </para>
</listitem> </listitem>
<listitem>
<para>
<link
xlink:href="https://developer.amd.com/amd-aocl/blas-library/">AMD
BLIS/LIBFLAME</link> (optimized for modern AMD x86_64 CPUs)
</para>
<para>
The AMD BLIS library, with attribute <literal>amd-blis</literal>,
provides a BLAS implementation. The complementary AMD LIBFLAME
library, with attribute <literal>amd-libflame</literal>, provides
a LAPACK implementation.
</para>
</listitem>
</itemizedlist> </itemizedlist>
<para> <para>
Introduced in <link Introduced in <link
xlink:href="https://github.com/NixOS/nixpkgs/pull/83888">PR xlink:href="https://github.com/NixOS/nixpkgs/pull/83888">PR
#83888</link>, we are able to override the blas and lapack #83888</link>, we are able to override the <literal>blas</literal>
packages to use different implementations, through the and <literal>lapack</literal> packages to use different implementations,
blasProvider and lapackProvider argument. This can be used through the <literal>blasProvider</literal> and
<literal>lapackProvider</literal> argument. This can be used
to select a different provider. BLAS providers will have to select a different provider. BLAS providers will have
symlinks in <literal>$out/lib/libblas.so.3</literal> and symlinks in <literal>$out/lib/libblas.so.3</literal> and
<literal>$out/lib/libcblas.so.3</literal> to their respective <literal>$out/lib/libcblas.so.3</literal> to their respective
BLAS libraries. Likewise, LAPACK providers will have symlinks BLAS libraries. Likewise, LAPACK providers will have symlinks
in <literal>$out/lib/liblapack.so.3</literal> and in <literal>$out/lib/liblapack.so.3</literal> and
<literal>$out/lib/liblapacke.so.3</literal> to their respective <literal>$out/lib/liblapacke.so.3</literal> to their respective
LAPCK libraries. For example, Intel MKL is both a BLAS and LAPACK libraries. For example, Intel MKL is both a BLAS and
LAPACK provider. An overlay can be created to use Intel MKL LAPACK provider. An overlay can be created to use Intel MKL
that looks like: that looks like:
</para> </para>
@ -216,8 +230,9 @@ 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_LIBRARY_PATH</literal> of libblas.so.3 and using <literal>LD_LIBRARY_PATH</literal> of
liblapack.so.3. For instance: <literal>libblas.so.3</literal> and
<literal>liblapack.so.3</literal>. For instance:
</para> </para>
<programlisting> <programlisting>
$ LD_LIBRARY_PATH=$(nix-build -A mkl)/lib:$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