From 95909d4fb6abdfc491ccfe6d478d1af17cf315c7 Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Fri, 28 Dec 2018 22:46:10 +0100 Subject: [PATCH] Revert "sage: preload openblasCompat" This reverts commit 4900bbee179f393c447671424b5cab6e35c29bd3. The issue that was supposed to fix is now fixed by lazy-loading rpy2 and makign sure scipy is loaded before that. That is not quite as nice, but preloading is now causing its own issues with openblas 0.3.4: https://github.com/xianyi/OpenBLAS/issues/1936 --- .../science/math/sage/default.nix | 22 +++++++++++++++---- .../science/math/sage/sage-env.nix | 11 ---------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/pkgs/applications/science/math/sage/default.nix b/pkgs/applications/science/math/sage/default.nix index 84cd5758acb2..dfdf210eec04 100644 --- a/pkgs/applications/science/math/sage/default.nix +++ b/pkgs/applications/science/math/sage/default.nix @@ -32,9 +32,8 @@ let # `sagelib`, i.e. all of sage except some wrappers and runtime dependencies sagelib = self.callPackage ./sagelib.nix { - inherit ecl; - inherit sage-src; - pynac = pkgs.pynac; # *not* python.pkgs.pynac + inherit flint ecl arb; + inherit sage-src pynac singular; linbox = pkgs.linbox.override { withSage = true; }; }; }; @@ -60,6 +59,7 @@ 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 palp pythonEnv; + inherit python ecl singular palp flint pynac pythonEnv; pkg-config = pkgs.pkgconfig; # not to confuse with pythonPackages.pkgconfig }; @@ -84,6 +84,7 @@ 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; }; @@ -123,6 +124,19 @@ 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 { diff --git a/pkgs/applications/science/math/sage/sage-env.nix b/pkgs/applications/science/math/sage/sage-env.nix index c7f0a19f1768..7d4a66ea2b9c 100644 --- a/pkgs/applications/science/math/sage/sage-env.nix +++ b/pkgs/applications/science/math/sage/sage-env.nix @@ -163,17 +163,6 @@ 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