Debojyoti Ghosh

Computational Scientist · Center for Applied Scientific Computing, Lawrence Livermore National Laboratory

SUNDIALS installation

Build notes for the SUNDIALS ODE and DAE solver suite.

SUNDIALS a library of linear and non-linear equation solvers and ODE solvers, developed and maintained at the Center for Applied Scientific Computing, Lawrence Livermore National Laboratory. The official webpage of SUNDIALS and the repository has the documentation. This page has quick instructions to download and install it.

Download

git clone https://github.com/LLNL/sundials.git sundials

Installation

The following steps should install SUNDIALS:

  • Go to the SUNDIALS directory

  • Create build and install subdirectories:
    mkdir build && mkdir install
    cd build
  • Compile and install
    cmake -DCMAKE_INSTALL_PREFIX=../install \
          -DENABLE_MPI=ON \
          -DMPI_C_COMPILER=mpicc \
          -DMPI_CXX_COMPILER=mpicxx \
          -DCMAKE_C_FLAGS='-O3' \
          -DSUNDIALS_BUILD_WITH_MONITORING=ON ../
    make install

  • Linking to SUNDIALS

  • Set environment variable SUNDIALS_DIR (Can be set in .bashrc too)
    export SUNDIALS_DIR=/path/to/sundials/install
    (Eg. SUNDIALS_DIR=/home/ghosh/sundials/install)
  • Include flags:
    -I$(SUNDIALS_DIR)/include
  • Linker flags (for ARKODE with parallel vectors):
    -L$(SUNDIALS_DIR)/lib \
    -L$(SUNDIALS_DIR)/lib64 \
    -lsundials_arkode \
    -lsundials_nvecparallel
    See SUNDIALS documentation for the appropriate linker flags for other packages.