#ode #numerics #ffi #simulation

sys sundials-sys

Bindings to the SUNDIALS suite of Nonlinear and DAE Solvers

9 unstable releases (3 breaking)

0.4.0 Dec 26, 2023
0.3.0 Sep 11, 2023
0.2.5 Mar 21, 2023
0.2.4 Feb 11, 2023
0.1.1 Jan 12, 2019

#694 in Math

Download history 41/week @ 2023-10-29 25/week @ 2023-11-05 31/week @ 2023-11-12 42/week @ 2023-11-19 42/week @ 2023-11-26 16/week @ 2023-12-03 26/week @ 2023-12-10 10/week @ 2023-12-17 111/week @ 2023-12-24 159/week @ 2023-12-31 11/week @ 2024-01-07 11/week @ 2024-01-14 13/week @ 2024-01-21 26/week @ 2024-01-28 9/week @ 2024-02-04 71/week @ 2024-02-11

120 downloads per month
Used in cvode-wrap


185K SLoC

C 118K SLoC // 0.2% comments FORTRAN Modern 51K SLoC // 0.0% comments C++ 8K SLoC // 0.1% comments CUDA 3.5K SLoC // 0.1% comments SWIG 1.5K SLoC // 0.4% comments Python 1K SLoC // 0.2% comments Shell 761 SLoC // 0.2% comments Rust 235 SLoC // 0.0% comments

Cargo Build & Test


A barebones -sys crate around the SUNDIALS suite of ODE solvers. The system must have CMake (cmake dependency) and clang (bindgen dependency) already installed for compilation to succeed.

System Dependencies

This library will try to detect whether a system SUNDIALS library is present (with header files) and otherwise compile a vendored version of it. If your SUNDIALS library is installed at an unusual location, you may declare the environment variables SUNDIALS_LIBRARY_DIR and SUNDIALS_INCLUDE_DIR to communicate this to the build script. You may force the use of the vendored version by enabling the feature build_libraries.


Use your package manager to install cmake and clang.

System SUNDIALS libraries are available: install libsundials-dev for Debian based systems, sundials-devel for Redhat and Suse, and sundials for Arch, MacOS, and the BSD distributions.


If you haven't already, you must install visual studio, enabling C++ development. You must also install cmake. After this, you must reboot your machine otherwise cmake will not find the C++ compiler and you will have an error such as “Generator Visual Studio 16 2019 could not find any instance of Visual Studio.”

To install a system SUNDIALS, we recommend you install vcpkg and then issue (from the vcpkg directory):

vcpkg install sundials --triplet=x64-windows

Alternatively, you may use Chocolatey to install cmake and llvm (which provides clang).


The license and copyright information for the SUNDIALS suite can be viewed here. At the time of writing, it is a BSD 3-Clause license. The code specific to this crate is also made available under the BSD 3-Clause license.


  • 0.3.0 — Ensure sundials version ≥ 6, use vcpkg on Windows.
  • 0.2.0 — Make compilation of sundials optional (allowing to link against the system library). Add static library option.
  • 0.1.1 — removal of (S) libraries from default features, addition of pthreads support if requested
  • 0.1.0 — initial -sys wrapper with minor tests


The package sundials-sys was started by by Jason Dark (repo) in January 2019. From June 2021 to October 2022, Arthur Carcano (repo) polished and maintained it.