Skip to content

sundialr

0.2.1Package record

An Interface to 'SUNDIALS' Ordinary Differential Equation (ODE) Solvers

0packages depend
5.9Kdownloads / year
95.9%test coverage
13/13flavors OK

Overview

About

Provides a way to call the functions in 'SUNDIALS' C ODE solving library (https://computing.llnl.gov/projects/sundials). Currently the serial version of ODE solver, 'CVODE', sensitivity calculator 'CVODES' and differential algebraic solver 'IDA' from the 'SUNDIALS' library are implemented. The package requires ODE to be written as an 'R' or 'Rcpp' function and does not require the 'SUNDIALS' library to be installed on the local machine.

Changes in 0.2.1
  • **New feature**: the C API gains a second integrator, ARKODE run as a fully implicit ESDIRK method (singly diagonally implicit Runge-Kutta with an explicit first stage) with Newton iteration and a dense linear solver. Its sundialr_arkode_* entry points mirror the sundialr_cvode_* ones one for one — the same callback types, handle lifecycle, tolerance and step-size setters, set_udata, step counting, and the same no-throw, no-allocation-on-reuse and one-handle-per-thread contracts — so a host loop written against the CVODE API can switch integrator by changing which entry points it looks up. The method defaults to ARKODE_ESDIRK436L2SA_6_3_4 (order 4); sundialr_arkode_set_order() picks ARKODE's default ESDIRK of order 2 to 5 and sundialr_arkode_set_table_name() any ARKODE DIRK table by name. Status codes are ARKODE's, mirrored as SUNDIALR_ARK_*; they coincide with the CVODE codes for the common failures but not everywhere. sundialr_arkode_reinit() is warm: it uses ARKodeReset, which keeps the step size and the error controller's history from the previous segment, the natural restart after a dose within one trajectory. sundialr_arkode_reinit_cold() is the full re-initialisation (ARKStepReInit), with CVodeReInit's semantics: it leaves a used handle exactly as a new one would be (pinned bit for bit by a test), so a handle reused across unrelated problems, such as the subjects of a population, gives results that do not depend on what it solved before; the step count keeps running across it. The addition is binary-compatible, so SUNDIALR_ABI_VERSION stays 1. To support it the bundled build now compiles ARKODE, with CRAN-compliance patches for the stdout references in its parameter-printing paths
  • Updated the underlying SUNDIALS library to v7.9.0 (Sep 2026). The changes relevant to the bundled solvers are bug fixes: the SUNNonlinearSolver_Auto stiffness switch no longer moves to Newton iteration prematurely, and IDA no longer writes duplicate keys in its logging output (logging is disabled in this build). The sundialr interface and the C API are unchanged, and the existing CRAN-compliance patches apply to the new sources without modification. The installed headers change accordingly: the N_Vector operations table gains an nvsetdevicearraypointer entry, so code compiled against these headers must also be built against 7.9.0 sources
  • The cmake call now uses the current option names SUNDIALS_ENABLE_C_EXAMPLES and SUNDIALS_ENABLE_CXX_EXAMPLES, silencing two deprecation warnings during installation
  • The build no longer needs Perl's open module. The step that normalises the line endings of the two cmake-generated headers used perl -Mopen=IO,:raw, and open is not part of the minimal perl-base, so installing from source on a minimal Debian/Ubuntu image (for example rocker/r-ver) failed with "Can't locate open.pm in @INC". The step now uses POSIX tr, which behaves the same on Linux, macOS and Windows (Rtools)
  • **New feature**: two additions to the C API for host loops that drive many small solves. sundialr_cvode_set_udata() replaces the callback-data pointer on an existing handle, so one handle can serve many parameter sets — a population of subjects — instead of paying a create/free cycle (SUNContext, cvode_mem, matrix and linear solver allocations) per set. sundialr_cvode_reset_stats() zeroes the accumulated step count so sundialr_cvode_get_num_steps() can report per-subject counts from a shared handle. Both are additive and binary-compatible, so SUNDIALR_ABI_VERSION stays 1
  • Fixed sundialr_cvode_get_num_steps() under the reinit-per-segment pattern: CVodeReInit zeroes CVODE's internal step counter, so the count previously restarted at every sundialr_cvode_reinit() and never reflected more than the current segment, despite being documented as a running total. The handle now accumulates the count across reinits, counting from create() or the last reset_stats()
  • The C API's handle-reuse and thread-safety contracts are now documented in sundialr_capi.h and pinned by tests: after the first reinit+solve cycle, further reinit/solve calls on a handle perform no heap allocation (a tight-loop test drives 10^4 segments and checks the state buffer is never reallocated), and distinct handles — each owning its own SUNContext and error record, with no global mutable state and no R API on any entry point — may be driven from concurrent threads, one handle per thread (pinned by a two-thread test)
  • The vignette has a new section, "Using ARKODE and CVODE from compiled code", showing how another package uses the C API: it looks up the sundialr_arkode_* entry points with R_GetCCallable, simulates repeated doses of a one-compartment model with ARKODE, restarting the integrator at each dose, and checks the result against the closed-form solution. It also covers method selection, warm and cold reinitialisation and switching to CVODE. The Introduction and Summary no longer describe ARKODE as a future addition; it is available through the C API, though not yet as an R function

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 10.4 min · r-devel-windows-x86_64
Status changes
  • OK13 OK2026-08-04
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK10 OK2026-04-25
  • ERROR5 OK, 2 NOTE, 1 WARNING, 1 ERROR2026-04-22
Advisories

none known

Documentation

In release 0.2.1
READMEYes · 868 wordsVignettesYes · 1 · dynamicNEWSYes · 33% structured · mentions 0.2.1Citation fileYes · software entry onlyWebsiteYes · pkgdown
Help pages
4
Examples that run
100%4 run in a plain check
Exported functions with examples
100%
Documented parameters
not tracked
Return-value docs
not tracked
Help pages citing references
0%

Downloads

5.9K
CRAN downloads in the past year
Rank #5,836 · ~16/day · ~489/mo
Daily download trend is not available in this view yet.
53330 days
1.4K90 days
5.9K1 year
Compare downloads with other packages →
Also on419 r2u3 autocran120 c2d4u

Repository

11Stars
6Forks
3Open issues
0Open PRs
7Releases
375Commits
6Commit identities
sundialsode-solver
375 commits · Last activity 2026-10-18
Responsiveness
How these are sampled
PRs merged (all time)
88%
Median days to close, 50 most recently updated closed issues
not measured
Median days to close, 50 most recently updated closed PRs
0

Stars over time

2025-03-20 · 112026-07-07 · 11
PracticesBeta

11 development-tooling and community-health practices detected across 5 families in the upstream repository

Checks run against github.com/sn248/sundialr on 2026-10-25.

Continuous integration (4)
GitHub ActionsR CMD check workflowTravis CI (config file)AppVeyor

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Docs source (3)
pkgdown

GitHub Pages site last deployed 2026-10-18 · The repository has a site deploy workflow

pkgdown site last built 2026-10-18

CRAN release process (2)
cran-comments.mdCRAN-SUBMISSION
Lint, format, editor (1)
RStudio project
Show all practicesHide 1 practice
Git structural (1)
.gitattributes
How this is detected·Detection ruleset v4 (2026-10-20)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-03-28
    Named in .Rbuildignore: .claude, CLAUDE.md
    Named in .gitignore: CLAUDE.md
    Pull request it wrote: opened by a project member
    Commits: at least 16 crediting it in the message
Models named in its commits
  • Claude Opus 5.58 commits · Oct 2026
  • Claude Opus 54 commits · Aug 2026
  • Claude Sonnet 4.63 commits · Mar 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
6 external dependencies (excludes base and recommended)

Installing sundialr adds 2 packages (2 with compiled code, 2.8 MB of source tarballs). Heaviest: Rcpp 1.8 MB, RcppArmadillo 1.0 MB.

Depends (0)
none
Imports (1)
LinkingTo (2)
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (4)
Author, Maintainer since 0.1.0 (2018), Copyright holder
Copyright holder · added in 0.2.0
Listed in earlier versions (12)
Show 8 of 12 peopleHide 8 people
Peter Brown
no longer listed · 0.1.0 to 0.1.3
Scott D Cohen
no longer listed · 0.1.0 to 0.1.3
no longer listed · 0.1.0 to 0.1.3
David Gardner
no longer listed · 0.1.0 to 0.1.3
Alan C Hindmarsh
no longer listed · 0.1.0 to 0.1.3
no longer listed · 0.1.0 to 0.1.3
Daniel R Reynolds
no longer listed · 0.1.0 to 0.1.3
no longer listed · 0.1.0 to 0.1.3
Releases (14)

Pick two releases to compare their code metrics.

  • 0.2.1Latest
    record
    2026-10-18 · current release · diff ↗
  • 0.2.0
    record
    2026-08-07 · diff ↗
  • R
    R 4.6.0 released · 2026-04-24
  • unarchivedReturned to CRAN
    2026-04-21
  • 0.1.7
    record
    2026-04-21 · diff ↗
  • archivedRemoved from CRAN
    2025-05-12
    issues were not corrected despite reminders
  • R
    R 4.5.0 released · 2025-04-11
  • 0.1.6.2
    record
    2025-01-14 · diff ↗
  • 0.1.6.1
    record
    2024-12-18 · diff ↗
  • 0.1.6
    record
    2024-12-15 · diff ↗
  • 0.1.5
    record
    2024-11-11 · diff ↗
  • unarchivedReturned to CRAN
    2024-07-02
  • 0.1.4.2
    record
    2024-07-02 · diff ↗
  • R
    R 4.4.0 released · 2024-04-24
  • archivedRemoved from CRAN
    2023-05-19
    issues were not corrected in time Policy violation on bundled-only use of external libs Policy violation on improperly forward emails to 'gmail.com'
  • R
    R 4.3.0 released · 2023-04-21
Show 15 earlier eventsHide 15 earlier events
  • R
    R 4.2.0 released · 2022-04-22
  • R
    R 4.1.0 released · 2021-05-18
  • 0.1.4.1
    record
    2021-05-16 · diff ↗
  • 0.1.4
    record
    2020-05-31 · diff ↗
  • R
    R 4.0.0 released · 2020-04-24
  • 0.1.3
    record
    2019-06-09 · diff ↗
  • R
    R 3.6.0 released · 2019-04-26
  • unarchivedReturned to CRAN
    2019-01-12
  • 0.1.2
    record
    2019-01-12 · diff ↗
  • archivedRemoved from CRAN
    2019-01-09
    installation problems reported in August 2018 had not been corrected install with parallel make often failed
  • unarchivedReturned to CRAN
    2018-07-22
  • 0.1.1
    record
    2018-07-22 · diff ↗
  • archivedRemoved from CRAN
    2018-07-19
    installation errors were not corrected despite reminder
  • 0.1.0
    record
    2018-07-05
  • R
    R 3.5.0 released · 2018-04-23

Package metadata

First published
2018-07-05
Total releases
14 / 8 yrs
License
BSD_3_clause + file LICENSE OSI · relicensed from GPL (>= 2) in 0.1.4
Copyright
See COPYRIGHTS in the package
Download size
2.4 MB

Cite

Cite this package

Run in R for the authors' entry:

citation("sundialr")

The package provides a citation file, so citation() returns the authors' own entry.

It points to 10.5281/zenodo.5501631.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for sundialr version 0.2.1 [Data set]. HJJB, LLC. Data release v2026-10-26. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-26, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy