summaryrefslogtreecommitdiff
path: root/docs/SUNDIALS.md
blob: e41313193582fb330c14311ffa2e27575fd1a67c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Sundials installation

You can download the Sundials source files [here](https://computation.llnl.gov/projects/sundials/sundials-software). Note: `hmatrix-sundials` doesn't work with versions superior to 3.2.1 (4.0.0 and above).

Assuming we choose the 3.2.1 version:

    $ wget https://computation.llnl.gov/projects/sundials/download/sundials-3.2.1.tar.gz
    $ tar -xzf sundials-3.2.1.tar.gz
    $ cd sundials-3.2.1
    $ mkdir instdir
    $ mkdir builddir
    $ cd builddir
    $ cmake -DCMAKE_INSTALL_PREFIX=/absolute/path/to/sundials-3.2.1/instdir -DEXAMPLES_INSTALL_PATH=/absolute/path/to/sundials-3.2.1/instdir/examples ../../sundials-3.2.1
    $ make
    $ make install


Then for an installation in a project, one should add to `stack.yaml`:
```
extra-include-dirs:
- /absolute/path/to/instdir/sundials-3.2.1/include
extra-lib-dirs:
- /absolute/path/to/instdir/sundials-3.2.1/builddir/src/cvode
- /absolute/path/to/instdir/sundials-3.2.1/builddir/src/arkode
```

Or in the global scope: `stack install hmatrix-sundials --extra-lib-dirs=/absolute/path/to/instdir/sundials-3.2.1/builddir/src/arkode --extra-lib-dirs=//absolute/path/to/instdir/sundials-3.2.1/builddir/src/cvode --extra-include-dirs=/absolute/path/to/instdir/sundials-3.2.1/include`