treewide: use blas and lapack

This makes packages use lapack and blas, which can wrap different
BLAS/LAPACK implementations.

treewide: cleanup from blas/lapack changes

A few issues in the original treewide:

- can’t assume blas64 is a bool
- unused commented code
This commit is contained in:
Matthew Bauer
2020-04-17 16:24:09 -05:00
parent 43873351ff
commit 1c8aba8334
68 changed files with 272 additions and 311 deletions
+4 -6
View File
@@ -4,15 +4,13 @@
, python
# GNU Octave needs KLU for ODE solvers
, suitesparse
, liblapack
, blas, lapack
, gfortran
, lapackSupport ? true }:
let liblapackShared = liblapack.override {
shared = true;
};
assert (!blas.is64bit) && (!lapack.is64bit);
in stdenv.mkDerivation rec {
stdenv.mkDerivation rec {
pname = "sundials";
version = "2.7.0";
@@ -44,7 +42,7 @@ in stdenv.mkDerivation rec {
"-DKLU_INCLUDE_DIR=${suitesparse}/include"
"-DKLU_LIBRARY_DIR=${suitesparse}/lib"
"-DLAPACK_ENABLE=ON"
"-DLAPACK_LIBRARIES=${liblapackShared}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary};${liblapackShared}/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}"
"-DLAPACK_LIBRARIES=${lapack}/lib/lapack${stdenv.hostPlatform.extensions.sharedLibrary};${blas}/lib/blas${stdenv.hostPlatform.extensions.sharedLibrary}"
];
# flaky tests, and patch in https://github.com/LLNL/sundials/pull/21 doesn't apply cleanly for sundials_3
@@ -2,17 +2,18 @@
, cmake
, fetchurl
, python
, openblas
, blas
, lapack
, gfortran
, lapackSupport ? true }:
let openblas32 = openblas.override { blas64 = false; };
assert (!blas.is64bit) && (!lapack.is64bit);
in stdenv.mkDerivation rec {
stdenv.mkDerivation rec {
pname = "sundials";
version = "5.1.0";
buildInputs = [ python ] ++ stdenv.lib.optionals (lapackSupport) [ gfortran openblas32 ];
buildInputs = [ python ] ++ stdenv.lib.optionals (lapackSupport) [ gfortran blas lapack ];
nativeBuildInputs = [ cmake ];
src = fetchurl {
@@ -33,7 +34,7 @@ in stdenv.mkDerivation rec {
] ++ stdenv.lib.optionals (lapackSupport) [
"-DSUNDIALS_INDEX_TYPE=int32_t"
"-DLAPACK_ENABLE=ON"
"-DLAPACK_LIBRARIES=${openblas32}/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary}"
"-DLAPACK_LIBRARIES=${lapack}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}"
];
doCheck = true;