aboutsummaryrefslogtreecommitdiff
path: root/pkgs/development/libraries/sundials
diff options
context:
space:
mode:
authorGuillaume Desforges <aceus02@gmail.com>2020-08-08 11:36:03 +0200
committerJon <jonringer@users.noreply.github.com>2020-09-21 11:02:15 -0700
commit860bc40a2276f8129ea122c2a3544a9b465de74b (patch)
tree69f7783be72f453280df52f1bd642c9a396dfb7d /pkgs/development/libraries/sundials
parent143289ad5ba74c60e576534d0c760493f4497608 (diff)
sundials: add KLU support
Diffstat (limited to 'pkgs/development/libraries/sundials')
-rw-r--r--pkgs/development/libraries/sundials/default.nix23
1 files changed, 21 insertions, 2 deletions
diff --git a/pkgs/development/libraries/sundials/default.nix b/pkgs/development/libraries/sundials/default.nix
index 24980e9b709b..11a1c922b9ba 100644
--- a/pkgs/development/libraries/sundials/default.nix
+++ b/pkgs/development/libraries/sundials/default.nix
@@ -5,7 +5,9 @@
, blas
, lapack
, gfortran
-, lapackSupport ? true }:
+, suitesparse
+, lapackSupport ? true
+, kluSupport ? true }:
assert (!blas.isILP64) && (!lapack.isILP64);
@@ -13,7 +15,20 @@ stdenv.mkDerivation rec {
pname = "sundials";
version = "5.3.0";
- buildInputs = [ python ] ++ stdenv.lib.optionals (lapackSupport) [ gfortran blas lapack ];
+ buildInputs = [
+ python
+ ] ++ stdenv.lib.optionals (lapackSupport) [
+ gfortran
+ blas
+ lapack
+ ]
+ # KLU support is based on Suitesparse.
+ # It is tested upstream according to the section 1.1.4 of
+ # [INSTALL_GUIDE.pdf](https://raw.githubusercontent.com/LLNL/sundials/master/INSTALL_GUIDE.pdf)
+ ++ stdenv.lib.optionals (kluSupport) [
+ suitesparse
+ ];
+
nativeBuildInputs = [ cmake ];
src = fetchurl {
@@ -35,6 +50,10 @@ stdenv.mkDerivation rec {
"-DSUNDIALS_INDEX_TYPE=int32_t"
"-DLAPACK_ENABLE=ON"
"-DLAPACK_LIBRARIES=${lapack}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}"
+ ] ++ stdenv.lib.optionals (kluSupport) [
+ "-DKLU_ENABLE=ON"
+ "-DKLU_INCLUDE_DIR=${suitesparse.dev}/include"
+ "-DKLU_LIBRARY_DIR=${suitesparse}/lib"
];
doCheck = true;