Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 834a49e0d4a9
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 21be830522cc
Choose a head ref
  • 5 commits
  • 6 files changed
  • 2 contributors

Commits on Apr 22, 2020

  1. blas,lapack: use correct name for library

    To match the soname, we need to use libblas.so.3, liblapack.so.3.
    matthewbauer committed Apr 22, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    vbgl Vincent Laporte
    Copy the full SHA
    5a500ff View commit details
  2. python.pkgs.scipy: set SCIPY_USE_G77_ABI_WRAPPER=1

    To avoid segmentation fault on MKL, we need to use the CBLAS ABI.
    Normally, scipy will autodetect this, but here we don’t link using the
    ‘libmkl_rt.so’ name. So we need to manually set this.
    
    See https://github.com/scipy/scipy/blob/50012918db47f0ec3418dd53f0277daa589f82e3/doc/source/building/linux.rst#fortran-abi-mismatch
    matthewbauer committed Apr 22, 2020
    Copy the full SHA
    3d18975 View commit details
  3. doc/overlays.xml: fix missing documentation for blas/lapack

    This adds some more information to the documentation as well as
    addressing review from #85636.
    matthewbauer committed Apr 22, 2020
    Copy the full SHA
    4238b2b View commit details

Commits on Apr 23, 2020

  1. Copy the full SHA
    480a55a View commit details
  2. Merge pull request #85799 from matthewbauer/blas-lapack-expand-docs

    BLAS/LAPACK fixup and expand docs
    bhipple authored Apr 23, 2020
    Copy the full SHA
    21be830 View commit details
31 changes: 21 additions & 10 deletions doc/using/overlays.xml
Original file line number Diff line number Diff line change
@@ -140,8 +140,8 @@ self: super:
<section xml:id="sec-overlays-alternatives">
<title>Using overlays to configure alternatives</title>
<para>
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 <link
xlink:href="https://wiki.debian.org/DebianAlternatives">DebianAlternatives</link>.
Nixpkgs has what we call <literal>alternatives</literal>, which
@@ -160,8 +160,9 @@ self: super:
</para>
<para>
The Nixpkgs attribute is <literal>openblas</literal> for
ILP64 and <literal>openblasCompat</literal> for LP64. This
is the default.
ILP64 (integer width = 64 bits) and
<literal>openblasCompat</literal> for LP64 (integer width =
32 bits). <literal>openblasCompat</literal> is the default.
</para>
</listitem>
<listitem>
@@ -190,8 +191,15 @@ self: super:
#83888</link>, 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 <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>
<programlisting>
self: super:
@@ -208,9 +216,12 @@ self: super:
<para>
This overlay uses Intel’s MKL library for both BLAS and LAPACK
interfaces. Note that the same can be accomplished at runtime
using <literal>LD_PRELOAD</literal> of libblas.so.3 and
liblapack.so.3.
using <literal>LD_LIBRARY_PATH</literal> of libblas.so.3 and
liblapack.so.3. For instance:
</para>
<programlisting>
$ LD_LIBRARY_PATH=$(nix-build -A mkl)/lib:$LD_LIBRARY_PATH nix-shell -p octave --run octave
</programlisting>
<para>
Intel MKL requires an <literal>openmp</literal> implementation
when running with multiple processors. By default,
@@ -221,8 +232,8 @@ self: super:
set it with <literal>LD_PRELOAD</literal>. Note that
<literal>mkl</literal> is only available on
<literal>x86_64-linux</literal> and
<literal>x86_64-darwin</literal>. Moreover, Hydra is not build
and distributing pre-compiled binaries using it.
<literal>x86_64-darwin</literal>. Moreover, Hydra is not
building and distributing pre-compiled binaries using it.
</para>
<para>
For BLAS/LAPACK switching to work correctly, all packages must
4 changes: 2 additions & 2 deletions pkgs/build-support/alternatives/blas/default.nix
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ stdenv.mkDerivation {
installPhase = (''
mkdir -p $out/lib $dev/include $dev/lib/pkgconfig
libblas="${lib.getLib blasProvider}/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}"
libblas="${lib.getLib blasProvider}/lib/libblas${canonicalExtension}"
if ! [ -e "$libblas" ]; then
echo "$libblas does not exist, ${blasProvider.name} does not provide libblas."
@@ -100,7 +100,7 @@ Libs: -L$out/lib -lblas
Cflags: -I$dev/include
EOF
libcblas="${lib.getLib blasProvider}/lib/libcblas${stdenv.hostPlatform.extensions.sharedLibrary}"
libcblas="${lib.getLib blasProvider}/lib/libcblas${canonicalExtension}"
if ! [ -e "$libcblas" ]; then
echo "$libcblas does not exist, ${blasProvider.name} does not provide libcblas."
4 changes: 2 additions & 2 deletions pkgs/build-support/alternatives/lapack/default.nix
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ stdenv.mkDerivation {
installPhase = (''
mkdir -p $out/lib $dev/include $dev/lib/pkgconfig
liblapack="${lib.getLib lapackProvider}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}"
liblapack="${lib.getLib lapackProvider}/lib/liblapack${canonicalExtension}"
if ! [ -e "$liblapack" ]; then
echo "$liblapack does not exist, ${lapackProvider.name} does not provide liblapack."
@@ -74,7 +74,7 @@ Cflags: -I$dev/include
Libs: -L$out/lib -llapack
EOF
liblapacke="${lib.getLib lapackProvider}/lib/liblapacke${stdenv.hostPlatform.extensions.sharedLibrary}"
liblapacke="${lib.getLib lapackProvider}/lib/liblapacke${canonicalExtension}"
if ! [ -e "$liblapacke" ]; then
echo "$liblapacke does not exist, ${lapackProvider.name} does not provide liblapacke."
8 changes: 4 additions & 4 deletions pkgs/development/libraries/science/math/mkl/default.nix
Original file line number Diff line number Diff line change
@@ -114,10 +114,10 @@ in stdenvNoCC.mkDerivation {
'') + ''
# Setup symlinks for blas / lapack
ln -s $out/lib/libmkl_rt${stdenvNoCC.hostPlatform.extensions.sharedLibrary} $out/lib/libblas${stdenvNoCC.hostPlatform.extensions.sharedLibrary}
ln -s $out/lib/libmkl_rt${stdenvNoCC.hostPlatform.extensions.sharedLibrary} $out/lib/libcblas${stdenvNoCC.hostPlatform.extensions.sharedLibrary}
ln -s $out/lib/libmkl_rt${stdenvNoCC.hostPlatform.extensions.sharedLibrary} $out/lib/liblapack${stdenvNoCC.hostPlatform.extensions.sharedLibrary}
ln -s $out/lib/libmkl_rt${stdenvNoCC.hostPlatform.extensions.sharedLibrary} $out/lib/liblapacke${stdenvNoCC.hostPlatform.extensions.sharedLibrary}
ln -s $out/lib/libmkl_rt${stdenvNoCC.hostPlatform.extensions.sharedLibrary} $out/lib/libblas${stdenvNoCC.hostPlatform.extensions.sharedLibrary}${stdenvNoCC.lib.optionalString stdenvNoCC.hostPlatform.isLinux ".3"}
ln -s $out/lib/libmkl_rt${stdenvNoCC.hostPlatform.extensions.sharedLibrary} $out/lib/libcblas${stdenvNoCC.hostPlatform.extensions.sharedLibrary}${stdenvNoCC.lib.optionalString stdenvNoCC.hostPlatform.isLinux ".3"}
ln -s $out/lib/libmkl_rt${stdenvNoCC.hostPlatform.extensions.sharedLibrary} $out/lib/liblapack${stdenvNoCC.hostPlatform.extensions.sharedLibrary}${stdenvNoCC.lib.optionalString stdenvNoCC.hostPlatform.isLinux ".3"}
ln -s $out/lib/libmkl_rt${stdenvNoCC.hostPlatform.extensions.sharedLibrary} $out/lib/liblapacke${stdenvNoCC.hostPlatform.extensions.sharedLibrary}${stdenvNoCC.lib.optionalString stdenvNoCC.hostPlatform.isLinux ".3"}
'';

# fixDarwinDylibName fails for libmkl_cdft_core.dylib because the
8 changes: 4 additions & 4 deletions pkgs/development/libraries/science/math/openblas/default.nix
Original file line number Diff line number Diff line change
@@ -178,10 +178,10 @@ EOF
done
# Setup symlinks for blas / lapack
ln -s $out/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}
ln -s $out/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libcblas${stdenv.hostPlatform.extensions.sharedLibrary}
ln -s $out/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}
ln -s $out/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/liblapacke${stdenv.hostPlatform.extensions.sharedLibrary}
ln -s $out/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}${stdenv.lib.optionalString stdenv.hostPlatform.isLinux ".3"}
ln -s $out/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libcblas${stdenv.hostPlatform.extensions.sharedLibrary}${stdenv.lib.optionalString stdenv.hostPlatform.isLinux ".3"}
ln -s $out/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}${stdenv.lib.optionalString stdenv.hostPlatform.isLinux ".3"}
ln -s $out/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/liblapacke${stdenv.hostPlatform.extensions.sharedLibrary}${stdenv.lib.optionalString stdenv.hostPlatform.isLinux ".3"}
'';

meta = with stdenv.lib; {
2 changes: 2 additions & 0 deletions pkgs/development/python-modules/scipy/default.nix
Original file line number Diff line number Diff line change
@@ -53,6 +53,8 @@ in buildPythonPackage rec {

setupPyBuildFlags = [ "--fcompiler='gnu95'" ];

SCIPY_USE_G77_ABI_WRAPPER = 1;

meta = {
description = "SciPy (pronounced 'Sigh Pie') is open-source software for mathematics, science, and engineering. ";
homepage = "https://www.scipy.org/";