sage: preload openblasCompat

wip/yesman
Timo Kaufmann 6 years ago
parent 7ca2915a50
commit 4900bbee17
  1. 22
      pkgs/applications/science/math/sage/default.nix
  2. 11
      pkgs/applications/science/math/sage/sage-env.nix

@ -32,8 +32,9 @@ let
# `sagelib`, i.e. all of sage except some wrappers and runtime dependencies
sagelib = self.callPackage ./sagelib.nix {
inherit flint ecl arb;
inherit sage-src pynac singular;
inherit ecl;
inherit sage-src;
pynac = pkgs.pynac; # *not* python.pkgs.pynac
linbox = pkgs.linbox.override { withSage = true; };
};
};
@ -59,7 +60,6 @@ let
# the files its looking fore are located. Also see `sage-env`.
env-locations = callPackage ./env-locations.nix {
inherit pari_data ecl;
inherit singular;
cysignals = python.pkgs.cysignals;
three = nodePackages.three;
mathjax = nodePackages.mathjax;
@ -70,7 +70,7 @@ let
sage-env = callPackage ./sage-env.nix {
sagelib = python.pkgs.sagelib;
inherit env-locations;
inherit python ecl singular palp flint pynac pythonEnv;
inherit python ecl palp pythonEnv;
pkg-config = pkgs.pkgconfig; # not to confuse with pythonPackages.pkgconfig
};
@ -84,7 +84,6 @@ let
sage-with-env = callPackage ./sage-with-env.nix {
inherit pythonEnv;
inherit sage-env;
inherit pynac singular;
pkg-config = pkgs.pkgconfig; # not to confuse with pythonPackages.pkgconfig
three = nodePackages.three;
};
@ -124,19 +123,6 @@ let
ignoreCollisions = true;
} // { extraLibs = pythonRuntimeDeps; }; # make the libs accessible
arb = pkgs.arb.override { inherit flint; };
singular = pkgs.singular.override { inherit flint; };
# *not* to confuse with the python package "pynac"
pynac = pkgs.pynac.override { inherit singular flint; };
# With openblas (64 bit), the tests fail the same way as when sage is build with
# openblas instead of openblasCompat. Apparently other packages somehow use flints
# blas when it is available. Alternative would be to override flint to use
# openblasCompat.
flint = pkgs.flint.override { withBlas = false; };
# Multiple palp dimensions need to be available and sage expects them all to be
# in the same folder.
palp = symlinkJoin {

@ -163,6 +163,17 @@ writeTextFile rec {
# for find_library
export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [stdenv.cc.libc singular]}:$DYLD_LIBRARY_PATH"
# Make sure the correct openblas library is picked up. Without this, sage
# can either end up using flints openblas (which is not openblasCopmat, thus
# leading to the issues described in https://trac.sagemath.org/ticket/26000)
# or R's blas, leading to the issues described in
# https://bitbucket.org/rpy2/rpy2/issues/491.
# The first issue could alternatively be solved by overriding flint's
# openblas dependency and the second one is effectively solved by loading
# rpy2 lazily in sage. Preloading explicitly makes all the headaches go
# away much easier and more future proof though.
export LD_PRELOAD="${openblasCompat}/lib/libopenblas.so:$LD_PRELOAD"
'';
} // {
lib = sagelib; # equivalent of `passthru`, which `writeTextFile` doesn't support

Loading…
Cancel
Save