15 stdenv.mkDerivation rec {
25 url = "https://github.com/LLNL/sundials/releases/download/v${version}/sundials-${version}.tar.gz";
26 hash = "sha256-N4Hj983zcsoS9/vmT1Yai5pQe4qLLE1s4o2OTfS+++o=";
39 lib.optionals (lapackSupport)
40 # Check that the same index size is used for both libraries
42 assert (blas.isILP64 == lapack.isILP64);
48 # KLU support is based on Suitesparse. It is tested upstream according to the
49 # section 1.1.4.2 of INSTALL_GUIDE.pdf found in the source tarball.
50 ++ lib.optionals (kluSupport) [
56 "-DEXAMPLES_INSTALL_PATH=${placeholder "examples"}/share/examples"
58 ++ lib.optionals (lapackSupport) [
60 "-DLAPACK_LIBRARIES=${lapack}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}"
62 ++ lib.optionals (kluSupport) [
64 "-DKLU_INCLUDE_DIR=${suitesparse.dev}/include"
65 "-DKLU_LIBRARY_DIR=${suitesparse}/lib"
69 # Use the correct index type according to lapack and blas used. They are
70 # already supposed to be compatible but we check both for extra safety. 64
71 # should be the default but we prefer to be explicit, for extra safety.
72 if blas.isILP64 then "-DSUNDIALS_INDEX_SIZE=64" else "-DSUNDIALS_INDEX_SIZE=32"
80 description = "Suite of nonlinear differential/algebraic equation solvers";
81 homepage = "https://computing.llnl.gov/projects/sundials";
82 platforms = platforms.all;
83 maintainers = with maintainers; [ idontgetoutmuch ];
84 license = licenses.bsd3;