13 stdenv.mkDerivation rec {
17 outputs = [ "out" "examples" ];
20 url = "https://computation.llnl.gov/projects/${pname}/download/${pname}-${version}.tar.gz";
21 sha256 = "jW3QlP7Mu41uzEE0DsFqZfq6yC7UQVAj9tfBwjkOovM=";
24 nativeBuildInputs = [ cmake ];
29 ++ lib.optionals (lapackSupport)
30 # Check that the same index size is used for both libraries
31 (assert (blas.isILP64 == lapack.isILP64); [
36 # KLU support is based on Suitesparse.
37 # It is tested upstream according to the section 1.1.4 of
38 # [INSTALL_GUIDE.pdf](https://raw.githubusercontent.com/LLNL/sundials/master/INSTALL_GUIDE.pdf)
39 ++ lib.optionals (kluSupport) [
44 "-DEXAMPLES_INSTALL_PATH=${placeholder "examples"}/share/examples"
45 ] ++ lib.optionals (lapackSupport) [
47 "-DLAPACK_LIBRARIES=${lapack}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}"
48 ] ++ lib.optionals (kluSupport) [
50 "-DKLU_INCLUDE_DIR=${suitesparse.dev}/include"
51 "-DKLU_LIBRARY_DIR=${suitesparse}/lib"
53 # Use the correct index type according to lapack and blas used. They are
54 # already supposed to be compatible but we check both for extra safety. 64
55 # should be the default but we prefer to be explicit, for extra safety.
57 "-DSUNDIALS_INDEX_SIZE=64"
59 "-DSUNDIALS_INDEX_SIZE=32"
67 description = "Suite of nonlinear differential/algebraic equation solvers";
68 homepage = "https://computation.llnl.gov/projects/sundials";
69 platforms = platforms.all;
70 maintainers = with maintainers; [ idontgetoutmuch ];
71 license = licenses.bsd3;