SUNDIALS v6.1.1 Installation Guide
SUNDIALS v6.1.1 Installation Guide
SUNDIALS v6.1.1
UCRL-SM-208116
DISCLAIMER
This document was prepared as an account of work sponsored by an agency of the United States government. Neither
the United States government nor Lawrence Livermore National Security, LLC, nor any of their employees makes any
warranty, expressed or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or useful-
ness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately
owned rights. Reference herein to any specific commercial product, process, or service by trade name, trademark,
manufacturer, or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by
the United States government or Lawrence Livermore National Security, LLC. The views and opinions of authors ex-
pressed herein do not necessarily state or reflect those of the United States government or Lawrence Livermore National
Security, LLC, and shall not be used for advertising or product endorsement purposes.
This work was performed under the auspices of the U.S. Department of Energy by Lawrence Livermore National
Laboratory under Contract DE-AC52-07NA27344.
Other contributors to SUNDIALS include: James Almgren-Bell, Lawrence E. Banks, Peter N. Brown, George Byrne,
Rujeko Chinomona, Scott D. Cohen, Aaron Collier, Keith E. Grant, Steven L. Lee, Shelby L. Lockhart, John Loffeld,
Daniel McGreer, Slaven Peles, Cosmin Petra, H. Hunter Schwartz, Jean M. Sexton, Dan Shumaker, Steve G. Smith,
Allan G. Taylor, Hilari C. Tiedeman, Chris White, Ting Yan, and Ulrike M. Yang.
Contents
Index 27
i
ii
Chapter 1
The installation of any SUNDIALS package is accomplished by installing the SUNDIALS suite as a whole, according
to the instructions that follow. The same procedure applies whether or not the downloaded file contains one or all
solvers in SUNDIALS.
The SUNDIALS suite (or individual solvers) are distributed as compressed archives (.[Link]). The name of the
distribution archive is of the form [Link], where SOLVER is one of: sundials, cvode, cvodes,
arkode, ida, idas, or kinsol, and X.Y.Z represents the version number (of the SUNDIALS suite or of the individual
solver). To begin the installation, first uncompress and expand the sources, by issuing
1
SUNDIALS Installation Guide, v6.1.1
Further details on the CMake-based installation procedures, instructions for manual compilation, and a roadmap of the
resulting installed libraries and exported header files, are provided in §1.1 and §1.2.
CMake-based installation provides a platform-independent build system. CMake can generate Unix and Linux Make-
files, as well as KDevelop, Visual Studio, and (Apple) XCode project files from the same configuration file. In addition,
CMake also provides a GUI front end and which allows an interactive build and installation process.
The SUNDIALS build process requires CMake version 3.12.0 or higher and a working C compiler. On Unix-like
operating systems, it also requires Make (and curses, including its development libraries, for the GUI front end to
CMake, ccmake or cmake-gui), while on Windows it requires Visual Studio. While many Linux distributions offer
CMake, the version included may be out of date. CMake adds new features regularly, and you should download the
latest version from [Link] Build instructions for CMake (only necessary for Unix-like systems) can be
found on the CMake website. Once CMake is installed, Linux/Unix users will be able to use ccmake or cmake-gui
(depending on the version of CMake), while Windows users will be able to use CMakeSetup.
As previously noted, when using CMake to configure, build and install SUNDIALS, it is always required to use a
separate build directory. While in-source builds are possible, they are explicitly prohibited by the SUNDIALS CMake
scripts (one of the reasons being that, unlike autotools, CMake does not provide a make distclean procedure and it
is therefore difficult to clean-up the source tree after an in-source build). By ensuring a separate build directory, it is an
easy task for the user to clean-up all traces of the build by simply removing the build directory. CMake does generate
a make clean which will remove files generated by the compiler and linker.
The default CMake configuration will build all included solvers and associated examples and will build static and
shared libraries. The INSTDIR defaults to /usr/local and can be changed by setting the CMAKE_INSTALL_PREFIX
variable. Support for FORTRAN and all other options are disabled.
CMake can be used from the command line with the cmake command, or from a curses-based GUI by using the
ccmake command, or from a wxWidgets or QT based GUI by using the cmake-gui command. Examples for using
both text and graphical methods will be presented. For the examples shown it is assumed that there is a top level
SUNDIALS directory with appropriate source, build and install directories:
$ mkdir (...)/INSTDIR
$ mkdir (...)/BUILDDIR
$ cd (...)/BUILDDIR
Using CMake with the ccmake GUI follows the general process:
1. Select and modify values, run configure (c key)
2. New values are denoted with an asterisk
3. To set a variable, move the cursor to the variable and press enter
• If it is a boolean (ON/OFF) it will toggle the value
• If it is string or file, it will allow editing of the string
• For file and directories, the <tab> key can be used to complete
4. Repeat until all values are set as desired and the generate option is available (g key)
5. Some variables (advanced variables) are not visible right away; to see advanced variables, toggle to advanced
mode (t key)
6. To search for a variable press the / key, and to repeat the search, press the n key
Using CMake with the cmake-gui GUI follows a similar process:
1. Select and modify values, click Configure
2. The first time you click Configure, make sure to pick the appropriate generator (the following will assume
generation of Unix Makfiles).
3. New values are highlighted in red
4. To set a variable, click on or move the cursor to the variable and press enter
• If it is a boolean (ON/OFF) it will check/uncheck the box
• If it is string or file, it will allow editing of the string. Additionally, an ellipsis button will appear ... on
the far right of the entry. Clicking this button will bring up the file or directory selection dialog.
• For files and directories, the <tab> key can be used to complete
5. Repeat until all values are set as desired and click the Generate button
6. Some variables (advanced variables) are not visible right away; to see advanced variables, click the advanced
button
To build the default configuration using the curses GUI, from the BUILDDIR enter the ccmake command and point to
the SOLVERDIR:
$ ccmake (...)/SOLVERDIR
Similarly, to build the default configuration using the wxWidgets GUI, from the BUILDDIR enter the cmake-gui com-
mand and point to the SOLVERDIR:
$ cmake-gui (...)/SOLVERDIR
$ make
or for a faster parallel build (e.g. using 4 threads), you can run
$ make -j 4
To install SUNDIALS in the installation directory specified in the configuration, simply run:
$ make install
Fig. 1.1: Default configuration screen. Note: Initial screen is empty. To get this default configuration, press ‘c’
repeatedly (accepting default values denoted with asterisk) until the ‘g’ option is available.
Fig. 1.2: Changing the INSTDIR for SUNDIALS and corresponding EXAMPLES.
Using CMake from the command line is simply a matter of specifying CMake variable settings with the cmake com-
mand. The following will build the default configuration:
$ cmake -DCMAKE_INSTALL_PREFIX=/home/myname/sundials/instdir \
> -DEXAMPLES_INSTALL_PATH=/home/myname/sundials/instdir/examples \
> ../srcdir
$ make
$ make install
A complete list of all available options for a CMake-based SUNDIALS configuration is provide below. Note that the
default values shown are for a typical configuration on a Linux system and are provided as illustration only.
BUILD_ARKODE
Build the ARKODE library
Default: ON
BUILD_CVODE
Build the CVODE library
Default: ON
BUILD_CVODES
Build the CVODES library
Default: ON
BUILD_IDA
Build the IDA library
Default: ON
BUILD_IDAS
Build the IDAS library
Default: ON
BUILD_KINSOL
Build the KINSOL library
Default: ON
BUILD_SHARED_LIBS
Build shared libraries
Default: ON
BUILD_STATIC_LIBS
Build static libraries
Default: ON
CMAKE_BUILD_TYPE
Choose the type of build, options are: None, Debug, Release, RelWithDebInfo, and MinSizeRel
Default:
Note: Specifying a build type will trigger the corresponding build type specific compiler flag options below
which will be appended to the flags set by CMAKE_<language>_FLAGS.
CMAKE_C_COMPILER
C compiler
Default: /usr/bin/cc
CMAKE_C_FLAGS
Flags for C compiler
Default:
CMAKE_C_FLAGS_DEBUG
Flags used by the C compiler during debug builds
Default: -g
CMAKE_C_FLAGS_MINSIZEREL
Flags used by the C compiler during release minsize builds
Default: -Os -DNDEBUG
CMAKE_C_FLAGS_RELEASE
Flags used by the C compiler during release builds
Default: -O3 -DNDEBUG
CMAKE_C_STANDARD
The C standard to build C parts of SUNDIALS with.
Default: 99
Options: 90, 99, 11, 17.
CMAKE_C_EXTENSIONS
Enable compiler specific C extensions.
Default: OFF
CMAKE_CXX_COMPILER
C++ compiler
Default: /usr/bin/c++
Note: A C++ compiler is only required when a feature requiring C++ is enabled (e.g., CUDA, HIP, SYCL,
RAJA, etc.) or the C++ examples are enabled.
All SUNDIALS solvers can be used from C++ applications without setting any additional configuration options.
CMAKE_CXX_FLAGS
Flags for C++ compiler
Default:
CMAKE_CXX_FLAGS_DEBUG
Flags used by the C++ compiler during debug builds
Default: -g
CMAKE_CXX_FLAGS_MINSIZEREL
Flags used by the C++ compiler during release minsize builds
Default: -Os -DNDEBUG
CMAKE_CXX_FLAGS_RELEASE
Flags used by the C++ compiler during release builds
Default: -O3 -DNDEBUG
CMAKE_CXX_STANDARD
The C++ standard to build C++ parts of SUNDIALS with.
Default: 11
Options: 98, 11, 14, 17, 20.
CMAKE_CXX_EXTENSIONS
Enable compiler specific C++ extensions.
Default: OFF
CMAKE_Fortran_COMPILER
Fortran compiler
Default: /usr/bin/gfortran
Note: Fortran support (and all related options) are triggered only if either Fortran-C support (BUILD_FORTRAN_-
MODULE_INTERFACE) or LAPACK (ENABLE_LAPACK) support is enabled.
CMAKE_Fortran_FLAGS
Flags for Fortran compiler
Default:
CMAKE_Fortran_FLAGS_DEBUG
Flags used by the Fortran compiler during debug builds
Default: -g
CMAKE_Fortran_FLAGS_MINSIZEREL
Flags used by the Fortran compiler during release minsize builds
Default: -Os
CMAKE_Fortran_FLAGS_RELEASE
Flags used by the Fortran compiler during release builds
Default: -O3
CMAKE_INSTALL_LIBDIR
The directory under which libraries will be installed.
Default: Set based on the system: lib, lib64, or lib/<multiarch-tuple>
CMAKE_INSTALL_PREFIX
Install path prefix, prepended onto install directories
Default: /usr/local
Note: The user must have write access to the location specified through this option. Exported SUNDIALS
header files and libraries will be installed under subdirectories include and lib of CMAKE_INSTALL_PREFIX,
respectively.
ENABLE_CUDA
Build the SUNDIALS CUDA modules.
Default: OFF
CMAKE_CUDA_ARCHITECTURES
Specifies the CUDA architecture to compile for.
Default: sm_30
ENABLE_XBRAID
Enable or disable the ARKStep + XBraid interface.
Default: OFF
EXAMPLES_ENABLE_C
Build the SUNDIALS C examples
Default: ON
EXAMPLES_ENABLE_CXX
Build the SUNDIALS C++ examples
Default: OFF
EXAMPLES_ENABLE_CUDA
Build the SUNDIALS CUDA examples
Default: OFF
EXAMPLES_ENABLE_F2003
Build the SUNDIALS Fortran2003 examples
Default: ON (if BUILD_FORTRAN_MODULE_INTERFACE is ON)
EXAMPLES_INSTALL
Install example files
Default: ON
Note: This option is triggered when any of the SUNDIALS example programs are enabled (EXAMPLES_-
ENABLE_<language> is ON). If the user requires installation of example programs then the sources and sample
output files for all SUNDIALS modules that are currently enabled will be exported to the directory specified
by EXAMPLES_INSTALL_PATH. A CMake configuration script will also be automatically generated and exported
to the same directory. Additionally, if the configuration is done under a Unix-like system, makefiles for the
compilation of the example programs (using the installed SUNDIALS libraries) will be automatically generated
and exported to the directory specified by EXAMPLES_INSTALL_PATH.
EXAMPLES_INSTALL_PATH
Output directory for installing example files
Default: /usr/local/examples
Note: The actual default value for this option will be an examples subdirectory created under CMAKE_IN-
STALL_PREFIX.
BUILD_FORTRAN_MODULE_INTERFACE
Enable Fortran2003 interface
Default: OFF
ENABLE_HYPRE
Flag to enable hypre support
Default: OFF
HYPRE_INCLUDE_DIR
Path to hypre header files
Default: none
HYPRE_LIBRARY
Path to hypre installed library files
Default: none
ENABLE_KLU
Enable KLU support
Default: OFF
KLU_INCLUDE_DIR
Path to SuiteSparse header files
Default: none
KLU_LIBRARY_DIR
Path to SuiteSparse installed library files
Default: none
ENABLE_LAPACK
Enable LAPACK support
Default: OFF
Note: Setting this option to ON will trigger additional CMake options. See additional information on building
with LAPACK enabled in §1.1.4.
LAPACK_LIBRARIES
LAPACK (and BLAS) libraries
Default: /usr/lib/[Link];/usr/lib/[Link]
Note: CMake will search for libraries in your LD_LIBRARY_PATH prior to searching default system paths.
ENABLE_MAGMA
Enable MAGMA support.
Default: OFF
Note: Setting this option to ON will trigger additional options related to MAGMA.
MAGMA_DIR
Path to the root of a MAGMA installation.
Default: none
SUNDIALS_MAGMA_BACKENDS
Which MAGMA backend to use under the SUNDIALS MAGMA interface.
Default: CUDA
ENABLE_MPI
Enable MPI support. This will build the parallel nvector and the MPI-aware version of the ManyVector library.
Default: OFF
Note: Setting this option to ON will trigger several additional options related to MPI.
MPI_C_COMPILER
mpicc program
Default:
MPI_CXX_COMPILER
mpicxx program
Default:
Note: This option is triggered only if MPI is enabled (ENABLE_MPI is ON) and C++ examples are enabled
(EXAMPLES_ENABLE_CXX is ON). All SUNDIALS solvers can be used from C++ MPI applications by default
without setting any additional configuration options other than ENABLE_MPI.
MPI_Fortran_COMPILER
mpif90 program
Default:
Note: This option is triggered only if MPI is enabled (ENABLE_MPI is ON) and Fortran-C support is enabled
(EXAMPLES_ENABLE_F2003 is ON).
MPIEXEC_EXECUTABLE
Specify the executable for running MPI programs
Default: mpirun
ENABLE_ONEMKL
Enable oneMKL support.
Default: OFF
ONEMKL_DIR
Path to oneMKL installation.
Default: none
ENABLE_OPENMP
Enable OpenMP support (build the OpenMP NVector)
Default: OFF
ENABLE_PETSC
Enable PETSc support
Default: OFF
PETSC_DIR
Path to PETSc installation
Default: none
PETSC_LIBRARIES
Semi-colon separated list of PETSc link libraries. Unless provided by the user, this is autopopulated based on
the PETSc installation found in PETSC_DIR.
Default: none
PETSC_INCLUDES
Semi-colon separated list of PETSc include directroies. Unless provided by the user, this is autopopulated based
on the PETSc installation found in PETSC_DIR.
Default: none
ENABLE_PTHREAD
Enable Pthreads support (build the Pthreads NVector)
Default: OFF
ENABLE_RAJA
Enable RAJA support.
Default: OFF
Note: You need to enable CUDA or HIP in order to build the RAJA vector module.
SUNDIALS_RAJA_BACKENDS
If building SUNDIALS with RAJA support, this sets the RAJA backend to target. Values supported are CUDA,
HIP, or SYCL.
Default: CUDA
ENABLE_SUPERLUDIST
Enable SuperLU_DIST support
Default: OFF
SUPERLUDIST_INCLUDE_DIR
Path to SuperLU_DIST header files (under a typical SuperLU_DIST install, this is typically the SuperLU_DIST
SRC directory)
Default: none
SUPERLUDIST_LIBRARY_DIR
Path to SuperLU_DIST installed library files
Default: none
SUPERLUDIST_LIBRARIES
Semi-colon separated list of libraries needed for SuperLU_DIST
Default: none
SUPERLUDIST_OpenMP
Enable SUNDIALS support for SuperLU_DIST built with OpenMP
Default: none
Note: SuperLU_DIST must be built with OpenMP support for this option to function. Additionally the environ-
ment variable OMP_NUM_THREADS must be set to the desired number of threads.
ENABLE_SUPERLUMT
Enable SuperLU_MT support
Default: OFF
SUPERLUMT_INCLUDE_DIR
Path to SuperLU_MT header files (under a typical SuperLU_MT install, this is typically the SuperLU_MT SRC
directory)
Default: none
SUPERLUMT_LIBRARY_DIR
Path to SuperLU_MT installed library files
Default: none
SUPERLUMT_THREAD_TYPE
Must be set to Pthread or OpenMP, depending on how SuperLU_MT was compiled.
Default: Pthread
ENABLE_SYCL
Enable SYCL support.
Default: OFF
Note: At present the only supported SYCL compiler is the DPC++ (Intel oneAPI) compiler. CMake does not
currently support autodetection of SYCL compilers and CMAKE_CXX_COMPILER must be set to a valid SYCL
compiler i.e., dpcpp in order to build with SYCL support.
SUNDIALS_BUILD_WITH_MONITORING
Build SUNDIALS with capabilties for fine-grained monitoring of solver progress and statistics. This is primarily
useful for debugging.
Default: OFF
Warning: Building with monitoring may result in minor performance degradation even if monitoring is not
utilized.
SUNDIALS_BUILD_WITH_PROFILING
Build SUNDIALS with capabilties for fine-grained profiling.
Default: OFF
ENABLE_CALIPER
Enable CALIPER support
Default: OFF
CALIPER_DIR
Path to the root of a Caliper installation
Default: None
SUNDIALS_F77_FUNC_CASE
Specify the case to use in the Fortran name-mangling scheme, options are: lower or upper
Default:
Note: The build system will attempt to infer the Fortran name-mangling scheme using the Fortran compiler.
This option should only be used if a Fortran compiler is not available or to override the inferred or default (lower)
scheme if one can not be determined. If used, SUNDIALS_F77_FUNC_UNDERSCORES must also be set.
SUNDIALS_F77_FUNC_UNDERSCORES
Specify the number of underscores to append in the Fortran name-mangling scheme, options are: none, one, or
two
Default:
Note: The build system will attempt to infer the Fortran name-mangling scheme using the Fortran compiler.
This option should only be used if a Fortran compiler is not available or to override the inferred or default (one)
scheme if one can not be determined. If used, SUNDIALS_F77_FUNC_CASE must also be set.
SUNDIALS_INDEX_TYPE
Integer type used for SUNDIALS indices. The size must match the size provided for the SUNDIALS_INDEX_SIZE
option.
Default: Automatically determined based on SUNDIALS_INDEX_SIZE
Note: In past SUNDIALS versions, a user could set this option to INT64_T to use 64-bit integers, or INT32_T
to use 32-bit integers. Starting in SUNDIALS 3.2.0, these special values are deprecated. For SUNDIALS 3.2.0
and up, a user will only need to use the SUNDIALS_INDEX_SIZE option in most cases.
SUNDIALS_INDEX_SIZE
Integer size (in bits) used for indices in SUNDIALS, options are: 32 or 64
Default: 64
Note: The build system tries to find an integer type of appropriate size. Candidate 64-bit integer types are
(in order of preference): int64_t, __int64, long long, and long. Candidate 32-bit integers are (in order of
preference): int32_t, int, and long. The advanced option, SUNDIALS_INDEX_TYPE can be used to provide a
type not listed here.
SUNDIALS_PRECISION
The floating-point precision used in SUNDIALS packages and class implementations, options are: double,
single, or extended
Default: double
SUNDIALS_INSTALL_CMAKEDIR
Installation directory for the SUNDIALS cmake files (relative to CMAKE_INSTALL_PREFIX).
Default: CMAKE_INSTALL_PREFIX/cmake/sundials
USE_GENERIC_MATH
Use generic (stdc) math libraries
Default: ON
XBRAID_DIR
The root directory of the XBraid installation.
Default: OFF
XBRAID_INCLUDES
Semi-colon separated list of XBraid include directories. Unless provided by the user, this is autopopulated based
on the XBraid installation found in XBRAID_DIR.
Default: none
XBRAID_LIBRARIES
Semi-colon separated list of XBraid link libraries. Unless provided by the user, this is autopopulated based on
the XBraid installation found in XBRAID_DIR.
Default: none
USE_XSDK_DEFAULTS
Enable xSDK (see [Link] for more information) default configuration settings. This sets CMAKE_-
BUILD_TYPE to Debug, SUNDIALS_INDEX_SIZE to 32 and SUNDIALS_PRECISION to double.
Default: OFF
The following examples will help demonstrate usage of the CMake configure options.
To configure SUNDIALS using the default C and Fortran compilers, and default mpicc and mpif90 parallel compilers,
enable compilation of examples, and install libraries, headers, and example sources under subdirectories of /home/
myname/sundials/, use:
% cmake \
> -DCMAKE_INSTALL_PREFIX=/home/myname/sundials/instdir \
> -DEXAMPLES_INSTALL_PATH=/home/myname/sundials/instdir/examples \
> -DENABLE_MPI=ON \
> /home/myname/sundials/srcdir
% make install
% cmake \
> -DCMAKE_INSTALL_PREFIX=/home/myname/sundials/instdir \
> -DEXAMPLES_INSTALL_PATH=/home/myname/sundials/instdir/examples \
> -DENABLE_MPI=ON \
> -DEXAMPLES_INSTALL=OFF \
> /home/myname/sundials/srcdir
% make install
The SUNDIALS suite contains many options to enable implementation flexibility when developing solutions. The
following are some notes addressing specific configurations when using the supported third party libraries.
To enable LAPACK, set the ENABLE_LAPACK option to ON. If the directory containing the LAPACK library is in the
LD_LIBRARY_PATH environment variable, CMake will set the LAPACK_LIBRARIES variable accordingly, otherwise
CMake will attempt to find the LAPACK library in standard system locations. To explicitly tell CMake what library to
use, the LAPACK_LIBRARIES variable can be set to the desired libraries required for LAPACK.
% cmake \
> -DCMAKE_INSTALL_PREFIX=/home/myname/sundials/instdir \
> -DEXAMPLES_INSTALL_PATH=/home/myname/sundials/instdir/examples \
> -DENABLE_LAPACK=ON \
> -DLAPACK_LIBRARIES=/mylapackpath/lib/[Link];/mylapackpath/lib/[Link] \
> /home/myname/sundials/srcdir
% make install
Note: If a working Fortran compiler is not available to infer the Fortran name-mangling scheme, the options SUNDI-
ALS_F77_FUNC_CASE and SUNDIALS_F77_FUNC_UNDERSCORES must be set in order to bypass the check for a Fortran
compiler and define the name-mangling scheme. The defaults for these options in earlier versions of SUNDIALS were
lower and one, respectively.
KLU is a software package for the direct solution of sparse nonsymmetric linear systems of equations that arise in
circuit simulation and is part of SuiteSparse, a suite of sparse matrix software. The library is developed by Texas A&M
University and is available from the SuiteSparse GitHub repository.
To enable KLU, set ENABLE_KLU to ON, set KLU_INCLUDE_DIR to the include path of the KLU installation and
set KLU_LIBRARY_DIR to the lib path of the KLU installation. The CMake configure will result in populating the
following variables: AMD_LIBRARY, AMD_LIBRARY_DIR, BTF_LIBRARY, BTF_LIBRARY_DIR, COLAMD_LIBRARY, CO-
LAMD_LIBRARY_DIR, and KLU_LIBRARY.
SUNDIALS has been tested with SuiteSparse version 5.10.1.
SuperLU_DIST is a general purpose library for the direct solution of large, sparse, nonsymmetric systems of linear
equations in a distributed memory setting. The library is developed by Lawrence Berkeley National Laboratory and is
available from the SuperLU_DIST GitHub repository.
To enable SuperLU_DIST, set ENABLE_SUPERLUDIST to ON, set SUPERLUDIST_INCLUDE_DIR to the SRC path of the
SuperLU_DIST installation, and set the variable SUPERLUMT_LIBRARY_DIR to the lib path of the SuperLU_DIST
installation. At the same time, the variable SUPERLUDIST_LIBRARIES must be set to a semi-colon separated list of
other libraries SuperLU_DIST depends on. For example, if SuperLU_DIST was built with LAPACK, then include the
LAPACK library in this list. If SuperLU_DIST was built with OpenMP support, then you may set SUPERLUDIST_-
OpenMP to ON utilize the OpenMP functionality of SuperLU_DIST.
SUNDIALS has been tested with SuperLU_DIST 7.1.1.
SuperLU_MT is a general purpose library for the direct solution of large, sparse, nonsymmetric systems of linear
equations on shared memory parallel machines. The library is developed by Lawrence Berkeley National Laboratory
and is available from the SuperLU_MT GitHub repository.
To enable SuperLU_MT, set ENABLE_SUPERLUMT to ON, set SUPERLUMT_INCLUDE_DIR to the SRC path of the Su-
perLU_MT installation, and set the variable SUPERLUMT_LIBRARY_DIR to the lib path of the SuperLU_MT installa-
tion. At the same time, the variable SUPERLUMT_LIBRARIES must be set to a semi-colon separated list of other libraries
SuperLU_MT depends on. For example, if SuperLU_MT was build with an external blas library, then include the full
path to the blas library in this list. Additionally, the variable SUPERLUMT_THREAD_TYPE must be set to either Pthread
or OpenMP.
Do not mix thread types when building SUNDIALS solvers. If threading is enabled for SUNDIALS by having either
ENABLE_OPENMP or ENABLE_PTHREAD set to ON then SuperLU_MT should be set to use the same threading type.
SUNDIALS has been tested with SuperLU_MT version 3.1.
The Portable, Extensible Toolkit for Scientific Computation (PETSc) is a suite of data structures and routines for simu-
lating applications modeled by partial differential equations. The library is developed by Argonne National Laboratory
and is available from the PETSc GitLab repository.
To enable PETSc, set ENABLE_PETSC to ON, and set PETSC_DIR to the path of the PETSc installation. Alternatively,
a user can provide a list of include paths in PETSC_INCLUDES and a list of complete paths to the PETSc libraries in
PETSC_LIBRARIES.
SUNDIALS has been tested with PETSc version 3.16.1.
hypre is a library of high performance preconditioners and solvers featuring multigrid methods for the solution of large,
sparse linear systems of equations on massively parallel computers. The library is developed by Lawrence Livermore
National Laboratory and is available from the hypre GitHub repository.
To enable hypre, set ENABLE_HYPRE to ON, set HYPRE_INCLUDE_DIR to the include path of the hypre installation,
and set the variable HYPRE_LIBRARY_DIR to the lib path of the hypre installation.
Note: SUNDIALS must be configured so that SUNDIALS_INDEX_SIZE is compatible with HYPRE_BigInt in the
hypre installation.
The Matrix Algebra on GPU and Multicore Architectures (MAGMA) project provides a dense linear algebra library
similar to LAPACK but targeting heterogeneous architectures. The library is developed by the University of Tennessee
and is available from the UTK webpage.
To enable the SUNDIALS MAGMA interface set ENABLE_MAGMA to ON, MAGMA_DIR to the MAGMA installation path,
and SUNDIALS_MAGMA_BACKENDS to the desired MAGMA backend to use with SUNDIALS e.g., CUDA or HIP.
SUNDIALS has been tested with MAGMA version 2.6.1.
The Intel oneAPI Math Kernel Library (oneMKL) includes CPU and DPC++ interfaces for LAPACK dense linear
algebra routines. The SUNDIALS oneMKL interface targets the DPC++ routines, to utilize the CPU routine see
§[Link].
To enable the SUNDIALS oneMKL interface set ENABLE_ONEMKL to ON and ONEMKL_DIR to the oneMKL installation
path.
SUNDIALS has been tested with oneMKL version 2021.4.
The NVIDIA CUDA Toolkit provides a development environment for GPU-accelerated computing with NVIDIA
GPUs. The CUDA Toolkit and compatible NVIDIA drivers are available from the NVIDIA developer website.
To enable CUDA, set ENABLE_CUDA to ON. If CUDA is installed in a nonstandard location, you may be prompted to
set the variable CUDA_TOOLKIT_ROOT_DIR with your CUDA Toolkit installation path. To enable CUDA examples, set
EXAMPLES_ENABLE_CUDA to ON.
SUNDIALS has been tested with the CUDA toolkit versions 10 and 11.
RAJA is a performance portability layer developed by Lawrence Livermore National Laboratory and can be obtained
from the RAJA GitHub repository.
Building SUNDIALS RAJA modules requires a CUDA, HIP, or SYCL enabled RAJA installation. To enable RAJA, set
ENABLE_RAJA to ON, set SUNDIALS_RAJA_BACKENDS to the desired backend (CUDA, HIP, or SYCL), and set ENABLE_-
CUDA, ENABLE_HIP, or ENABLE_SYCL to ON depending on the selected backend. If RAJA is installed in a nonstandard
location you will be prompted to set the variable RAJA_DIR with the path to the RAJA CMake configuration file. To
enable building the RAJA examples set EXAMPLES_ENABLE_CXX to ON.
SUNDIALS has been tested with RAJA version 0.14.0.
XBraid is parallel-in-time library implementing an optimal-scaling multigrid reduction in time (MGRIT) solver. The
library is developed by Lawrence Livermore National Laboratory and is available from the XBraid GitHub repository.
To enable XBraid support, set ENABLE_XBRAID to ON, set XBRAID_DIR to the root install location of XBraid or the
location of the clone of the XBraid repository.
Note: At this time the XBraid types braid_Int and braid_Real are hard-coded to int and double respectively.
As such SUNDIALS must be configured with SUNDIALS_INDEX_SIZE set to 32 and SUNDIALS_PRECISION set to
double. Additionally, SUNDIALS must be configured with ENABLE_MPI set to ON.
If SUNDIALS was configured with EXAMPLES_ENABLE_<language> options to ON, then a set of regression tests can
be run after building with the make command by running:
% make test
Additionally, if EXAMPLES_INSTALL was also set to ON, then a set of smoke tests can be run after installing with the
make install command by running:
% make test_install
Each of the SUNDIALS solvers is distributed with a set of examples demonstrating basic usage. To build and in-
stall the examples, set at least of the EXAMPLES_ENABLE_<language> options to ON, and set EXAMPLES_INSTALL to
ON. Specify the installation path for the examples with the variable EXAMPLES_INSTALL_PATH. CMake will generate
[Link] configuration files (and Makefile files if on Linux/Unix) that reference the installed SUNDIALS
headers and libraries.
Either the [Link] file or the traditional Makefile may be used to build the examples as well as serve as a
template for creating user developed solutions. To use the supplied Makefile simply run make to compile and generate
the executables. To use CMake from within the installed example directory, run cmake (or ccmake or cmake-gui to
use the GUI) followed by make to compile the example code. Note that if CMake is used, it will overwrite the traditional
Makefile with a new CMake-generated Makefile.
The resulting output from running the examples can be compared with example output bundled in the SUNDIALS
distribution.
Note: There will potentially be differences in the output due to machine architecture, compiler versions, use of third
party libraries etc.
CMake can also be used to build SUNDIALS on Windows. To build SUNDIALS for use with Visual Studio the
following steps should be performed:
1. Unzip the downloaded tar file(s) into a directory. This will be the SOLVERDIR
2. Create a separate BUILDDIR
3. Open a Visual Studio Command Prompt and cd to BUILDDIR
4. Run cmake-gui ../SOLVERDIR
a. Hit Configure
b. Check/Uncheck solvers to be built
c. Change CMAKE_INSTALL_PREFIX to INSTDIR
d. Set other options as desired
e. Hit Generate
5. Back in the VS Command Window:
a. Run msbuild ALL_BUILD.vcxproj
b. Run msbuild [Link]
The resulting libraries will be in the INSTDIR.
The SUNDIALS project can also now be opened in Visual Studio. Double click on the ALL_BUILD.vcxproj file to
open the project. Build the whole solution to create the SUNDIALS libraries. To use the SUNDIALS libraries in
your own projects, you must set the include directories for your project, add the SUNDIALS libraries to your project
solution, and set the SUNDIALS libraries as dependencies for your project.
$ make install
will install the libraries under LIBDIR and the public header files under INCLUDEDIR. The values for these directories
are INSTDIR/lib and INSTDIR/include, respectively. The location can be changed by setting the CMake variable
CMAKE_INSTALL_PREFIX. Although all installed libraries reside under LIBDIR/lib, the public header files are further
organized into subdirectories under INCLUDEDIR/include.
The installed libraries and exported header files are listed for reference in the table below. The file extension .LIB is
typically .so for shared libraries and .a for static libraries. Note that, in this table names are relative to LIBDIR for
libraries and to INCLUDEDIR for header files.
A typical user program need not explicitly include any of the shared SUNDIALS header files from under the
INCLUDEDIR/include/sundials directory since they are explicitly included by the appropriate solver header files
(e.g., sunlinsol_dense.h includes sundials_dense.h). However, it is both legal and safe to do so, and would be
useful, for example, if the functions declared in sundials_dense.h are to be used in building a preconditioner.
The make install command will also install a CMake package configuration file that other CMake projects can load
to get all the information needed to build against SUNDIALS. In the consuming project’s CMake code, the find_-
package command may be used to search for the configuration file, which will be installed to instdir/SUNDIALS_-
INSTALL_CMAKEDIR/[Link] alongside a package version file instdir/SUNDIALS_INSTALL_-
CMAKEDIR/[Link]. Together these files contain all the information the consuming project
needs to use SUNDIALS, including exported CMake targets. The SUNDIALS exported CMake targets follow the same
naming convention as the generated library binaries, e.g. the exported target for CVODE is SUNDIALS::cvode. The
CMake code snipped below shows how a consuming project might leverage the SUNDIALS package configuration file
to build against SUNDIALS in their own CMake project.
project(MyProject)
find_package(SUNDIALS REQUIRED)
add_executable(myexec main.c)
27
SUNDIALS Installation Guide, v6.1.1
S
SUNDIALS_BUILD_WITH_MONITORING (CMake option),
14
SUNDIALS_BUILD_WITH_PROFILING (CMake option),
14
SUNDIALS_F77_FUNC_CASE (CMake option), 14
SUNDIALS_F77_FUNC_UNDERSCORES (CMake option),
14
SUNDIALS_INDEX_SIZE (CMake option), 15
SUNDIALS_INDEX_TYPE (CMake option), 14
SUNDIALS_INSTALL_CMAKEDIR (CMake option), 15
SUNDIALS_MAGMA_BACKENDS (CMake option), 11
SUNDIALS_PRECISION (CMake option), 15
SUNDIALS_RAJA_BACKENDS (CMake option), 12
SUPERLUDIST_INCLUDE_DIR (CMake option), 13
SUPERLUDIST_LIBRARIES (CMake option), 13
SUPERLUDIST_LIBRARY_DIR (CMake option), 13
SUPERLUDIST_OpenMP (CMake option), 13
SUPERLUMT_INCLUDE_DIR (CMake option), 13
SUPERLUMT_LIBRARY_DIR (CMake option), 13
SUPERLUMT_THREAD_TYPE (CMake option), 13
U
USE_GENERIC_MATH (CMake option), 15
USE_XSDK_DEFAULTS (CMake option), 15
X
XBRAID_DIR (CMake option), 15
XBRAID_INCLUDES (CMake option), 15
XBRAID_LIBRARIES (CMake option), 15
28 Index