File: INSTALL_NOTES

package info (click to toggle)
sundials 2.5.0-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 10,312 kB
  • ctags: 12,897
  • sloc: ansic: 91,776; sh: 8,351; fortran: 2,943; makefile: 2,702
file content (559 lines) | stat: -rw-r--r-- 20,579 bytes parent folder | download
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
                     SUNDIALS Installation Instructions
                        Release 2.7.0, March 2011  


These are generic installation instructions. For complete installation instructions, 
consult the user guide for any of the SUNDIALS solvers.

Contents:

[A] Preliminaries
    A.1. Libraries and exported headers
[B] autotools-based installation
    B.1. Basic Installation
    B.2. Installation names
    B.3. Compilers and Options
       B.3.1. General options
       B.3.2. Options for Fortran support
       B.3.3. Options for Blas/Lapack support
       B.3.4. Options for MPI support
       B.3.5. Options for library support
       B.3.6. Environment variables
    B.4. Configuration examples
[C] CMake-based installation
    C.1. Prerequisites
    C.2. Configuration and build

================
A. Preliminaries
================

The SUNDIALS suite (or an individual solver) is distributed as a compressed archive
(.tar.gz). The name of the distribution archive is of the form 'solver'-x.y.z.tar.gz,
where 'solver' is one of: 'sundials', 'cvode', 'cvodes', '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

   % tar xzf solver-x.y.z.tar.gz

This will extract source files under a directory 'solver'-x.y.z.

In the remainder of this chapter, we make the following distinctions:

'srcdir' 

  is the directory 'solver'-x.y.z created above; i.e., the 
  directory containing the SUNDIALS sources.

'builddir'

  is the directory under which SUNDIALS is built; i.e., the directory from within 
  which the configure or ccmake command is issued. 

  NOTE: When using the autoconf configure script, this directory can be the same 
  as 'srcdir'. However, when using ccmake, insource builds are prohibited.

'instdir'

  is the directory under which the SUNDIALS exported header files and libraries will 
  be installed. Typically, header files are exported under a directory 'instdir'/include 
  while libraries are installed under 'instdir'/lib, with 'instdir' specified with the 
  --prefix flag to configure. See below for more details on the installation directories, 
  including the special cases of the SUNDIALS examples.

  NOTE: The installation directory 'instdir' should NOT be the same as the source 
        directory 'srcdir'.


SUNDIALS provides two build alternatives:
1) autotools-based build system. This options, suitable for *nix systems 
   (Linux, Unix, Mac OS X, cygwin, mingw, etc.) is based on running a 'configure'
   shell script which generates all required makefiles. 
2) CMake-based build system. This option is available on a variety of platforms 
   (*nix, Windows, Mac OS, etc) but relies on additional software (freely
   available CMake).


-----------------------------------
A.1. Libraries and exported headers
-----------------------------------

By default, 'make install' will install the SUNDIALS libraries under 'libdir' and the public 
header files under 'includedir'. The default values for these directories are 'instdir'/lib 
and 'instdir'/include, respectively, but can be changed at the configuration stage.

The SUNDIALS libraries and header files are summarized below (names are relative to 'libdir' 
for libraries and to 'includedir' for header files)

SHARED module
  header files: sundials/sundials_types.h      sundials/sundials_math.h
                sundials/sundials_config.h     sundias/sundials_nvector.h
                sundials/sundials_smalldense.h sundials/sundials_dense.h
                sundials/sundials_iterative.h  sundials/sundials_band.h
                sundials/sundials_spbcgs.h     sundials/sundials_sptfqmr.h
                sundials/sundials_spgmr.h      sundials/sundials_lapack.h
                sundials/sundials_fnvector.h


NVECTOR_SERIAL module
  libraries:    libsundials_nvecserial.{a,so} libsundials_fnvecserial.a
  header files: nvector/nvector_serial.h


NVECTOR_PARALLEL module
  libraries:    libsundials_nvecparallel.{a,so} libsundials_fnvecparallel.a
  header files: nvector/nvector_parallel.h


CVODE module
  libraries:    libsundials_cvode.{a,so} libsundials_fcvode.a
  header files: cvode/cvode.h          cvode/cvode_direct.h
                cvode/cvode_dense.h    cvode/cvode_band.h
                cvode/cvode_diag.h     cvode/cvode_spils.h
                cvode/cvode_bandpre.h  cvode/cvode_bbdpre.h
                cvode/cvode_spgmr.h    cvode/cvode_spbcgs.h
                cvode/cvode_sptfqmr.h  cvode/cvode_impl.h
                cvode/cvode_lapack.h


CVODES module
  library:      libsundials_cvodes.{a,so}
  header files: cvodes/cvodes.h           cvodes/cvodes_direct.h
                cvodes/cvodes_dense.h     cvodes/cvodes_band.h
                cvodes/cvodes_diag.h      cvodes/cvodes_spils.h
                cvodes/cvodes_bandpre.h   cvodes/cvodes_bbdpre.h
                cvodes/cvodes_spgmr.h     cvodes/cvodes_spbcgs.h
                cvodes/cvodes_sptfqmr.h   cvodes/cvodes_impl.h
                cvodes/cvodes_lapack.h


IDA module
  library:      libsundials_ida.{a,so}
  header files: ida/ida.h          ida/ida_direct.h
                ida/ida_dense.h    ida/ida_band.h
                ida/ida_spils.h    ida/ida_spgmr.h
                ida/ida_spbcgs.h   ida/ida_sptfqmr.h
                ida/ida_bbdpre.h   ida/ida_impl.h
                ida/dia_lapack.h


IDAS module
  library:      libsundials_idas.{a,so}
  header files: idas/idas.h          idas/idas_direct.h
                idas/idas_dense.h    idas/idas_band.h
                idas/idas_spils.h    idas/idas_spgmr.h
                idas/idas_spbcgs.h   idas/idas_sptfqmr.h
                idas/idas_bbdpre.h   idas/idas_impl.h
                idas/dia_lapack.h


KINSOL module
  libraries:    libsundials_kinsol.{a,so} libsundials_fkinsol.a
  header files: kinsol/kinsol.h
                kinsol/kinsol_dense.h   kinsol/kinsol_band.h
                kinsol/kinsol_spils.h   kinsol/kinsol_spgmr.h
                kinsol/kinsol_spbcgs.h  kinsol/kinsol_sptfqmr.h
                kinsol/kinsol_bbdpre.h  kinsol/kinsol_impl.h



===============================
B. autotools-based installation
===============================

-----------------------
B.1. Basic Installation
-----------------------

The installation procedure outlined below will work on commodity Linux/Unix 
systems without modification. However, users are still encouraged to carefully read 
the entire chapter before attempting to install the SUNDIALS suite, in case
non-default choices are desired for compilers, compilation options, or the like.
Instead of reading the option list below, the user may invoke the configuration
script with the help flag to view a complete listing of available options, which
may be done by issuing 

   % ./configure --help 

from within the 'srcdir' directory created above.


The installation steps for SUNDIALS can be as simple as 

   % tar xzf solver-x.y.z.tar.gz
   % cd solver-x.y.z
   % ./configure
   % make
   % make install

in which case the SUNDIALS header files and libraries are installed under /usr/local/include
and /usr/local/lib, respectively. Note that, by default, the example programs are not built 
and installed.

If disk space is a priority, then to delete all temporary files created by building SUNDIALS, issue

   % make clean

To prepare the SUNDIALS distribution for a new install (using, for example, different options and/or
installation destinations), issue

   % make distclean


-----------------------
B.2. Installation names
-----------------------

By default, 'make install' will install the SUNDIALS libraries under 'libdir' and the public 
header files under 'includedir'. The default values for these directories are 'instdir'/lib 
and 'instdir'/include, respectively, but can be changed using the configure script options
--prefix, --exec-prefix, --includedir, and --libdir (see below). For example, a global 
installation of SUNDIALS on a *NIX system could be accomplished using

   % ./configure --prefix=/opt/sundials-2.3.0

Although all installed libraries reside under 'libdir', the public header files are further 
organized into subdirectories under 'includedir'.

The installed libraries and exported header files are listed for reference in Section A.1.

A typical user program need not explicitly include any of the shared SUNDIALS header files 
from under the 'includedir'/sundials directory since they are explicitly included by the 
appropriate solver header files (e.g., cvode_dense.h includes sundials_dense.h). 
However, it is both legal and safe to do so (e.g., the functions declared in 
sundials_smalldense.h could be used in building a preconditioner.


--------------------------
B.3. Compilers and Options
--------------------------

Some systems require unusual options for compilation or linking that the `configure' 
script does not know about.  Run `./configure --help' for details on some of the 
pertinent environment variables.

You can give `configure' initial values for these variables by setting them in the 
environment.  You can do that on the command line like this:

     % ./configure CC=gcc CFLAGS=-O2 F77=g77 FFLAGS=-O

Here is a detailed description of the configure options that are pertinent to SUNDIALS. 
In what follows, 'build_tree' is the directory from where 'configure' was invoked.


----------------------
B.3.1. General options
----------------------

--help
-h

  print a summary of the options to `configure', and exit.

--quiet
--silent
-q

  do not print messages saying which checks are being made.  To
  suppress all normal output, redirect it to `/dev/null' (any error
  messages will still be shown).


--prefix=PREFIX

  Location for architecture-independent files.
  Default: PREFIX=/usr/local

--exec-prefix=EPREFIX

  Location for architecture-dependent files.
  Default: EPREFIX=/usr/local
  
--includedir=DIR

  Alternate location for header files.
  Default: DIR=PREFIX/include
  
--libdir=DIR

  Alternate location for libraries.
  Default: DIR=EPREFIX/lib

--disable-solver

  Although each existing solver module is built by default, support for a
  given solver can be explicitly disabled using this option. 
  The valid values for solver are: cvode, cvodes, 
  ida, and kinsol.

--enable-examples

  Available example programs are not built by default. Use this option
  to enable compilation of all pertinent example programs. Upon completion of 
  the 'make' command, the example executables will be created under solver-specific
  subdirectories of 'builddir'/examples:

    'builddir'/examples/'solver'/serial :         serial C examples
    'builddir'/examples/'solver'/parallel :       parallel C examples
    'builddir'/examples/'solver'/fcmix_serial :   serial Fortran examples
    'builddir'/examples/'solver'/fcmix_parallel : parallel Fortran examples

  Note: Some of these subdirectories may not exist depending upon the
  solver and/or the configuration options given.

--with-exinstdir=DIR

  Alternate location for example sources and sample output files (valid only if
  examples are enabled). Note that installtion of example files can be completely
  disabled by issuing DIR=no (in case building the examples is desired only as a
  test of the SUNDIALS libraries).

  Default: DIR=EPREFIX/examples

--with-cppflags=ARG

  Specify C preprocessor flags (overrides the environment variable CPPFLAGS)
  (e.g., ARG=-I<include_dir> if necessary header files are located in nonstandard locations).

--with-cflags=ARG

  Specify C compilation flags (overrides the environment variable CFLAGS)

--with-ldflags=ARG

  Specify linker flags (overrides the environment variable LDFLAGS)
  (e.g., ARG=-L<lib_dir> if required libraries are located in nonstandard locations).

--with-libs=ARG

  Specify additional libraries to be used 
  (e.g., ARG=-l<foo> to link with the library named libfoo.a or libfoo.so).

--with-precision=ARG

  By default, sundials will define a real number (internally referred to as
  realtype) to be a double-precision floating-point numeric data type (double
  C-type); however, this option may be used to build sundials with realtype
  alternatively defined as a single-precision floating-point numeric data type
  (float C-type) if ARG=single, or as a long double C-type if ARG=extended.

  Default: ARG=double

----------------------------------
B.3.2. Options for Fortran support
----------------------------------

--disable-fcmix

  Using this option will disable all F77 support. The fcvode, fida, fkinsol and
  fnvector modules will not be built regardless of availability.

--with-fflags=ARG

  Specify F77 compilation flags (overrides the environment variable FFLAGS)

--------------------------------------
B.3.3. Options for Blas/Lapack support
--------------------------------------

--disable-lapack

  Disable support for the linear solver module based on Blas/Lapack.

--with-blas=ARG

  Specifies the BLAS library to be used

--with-lapack=ARG

  Specifies the LAPACK library to be used

------------------------------
B.3.4. Options for MPI support
------------------------------

The following configuration options are only applicable to the parallel sundials packages:

  
--disable-mpi

  Using this option will completely disable MPI support.

--with-mpicc=ARG
--with-mpif77=ARG

  By default, the configuration utility script will use the MPI compiler
  scripts named mpicc and mpif77 to compile the parallelized
  sundials subroutines; however, for reasons of compatibility, different
  executable names may be specified via the above options. Also, ARG=no
  can be used to disable the use of MPI compiler scripts, thus causing
  the serial C and F compilers to be used to compile the parallelized
  sundials functions and examples.

--with-mpi-root=MPIDIR

  This option may be used to specify which MPI implementation should be used.
  The sundials configuration script will automatically check under the
  subdirectories MPIDIR/include and MPIDIR/lib for the necessary
  header files and libraries. The subdirectory MPIDIR/bin will also be
  searched for the C and F MPI compiler scripts, unless the user uses
  --with-mpicc=no or --with-mpif77=no.

--with-mpi-incdir=INCDIR
--with-mpi-libdir=LIBDIR
--with-mpi-libs=LIBS

  These options may be used if the user would prefer not to use a preexisting
  MPI compiler script, but instead would rather use a serial complier and
  provide the flags necessary to compile the MPI-aware subroutines in
  sundials.

  Often an MPI implementation will have unique library names and so it may
  be necessary to specify the appropriate libraries to use (e.g., LIBS=-lmpich).

  Default: INCDIR=MPIDIR/include, LIBDIR=MPIDIR/lib and LIBS=-lmpi

--with-mpi-flags=ARG

  Specify additional MPI-specific flags.

----------------------------------
B.3.5. Options for library support
----------------------------------

By default, only static libraries are built, but the following option
may be used to build shared libraries on supported platforms.

--enable-shared

  Using this particular option will result in both static and shared versions
  of the available sundials libraries being built if the systsupports
  shared libraries. To build only shared libraries also specify --disable-static.

  Note: The fcvode and fkinsol libraries can only be built as static
  libraries because they contain references to externally defined symbols, namely
  user-supplied F77 subroutines.  Although the F77 interfaces to the serial and
  parallel implementations of the supplied nvector module do not contain any
  unresolvable external symbols, the libraries are still built as static libraries
  for the purpose of consistency.

----------------------------
B.3.6. Environment variables
----------------------------

The following environment variables can be locally (re)defined for use during the 
configuration of sundials. See the next section for illustrations of these.

CC

F77

  Since the configuration script uses the first C and F77 compilers found in
  the current executable search path, then each relevant shell variable (CC
  and F77) must be locally (re)defined in order to use a different compiler. 
  For example, to use xcc (executable name of chosen compiler) as the C
  language compiler, use CC=xcc in the configure step.

CFLAGS

FFLAGS

  Use these environment variables to override the default C and F77 compilation flags.


---------------------------
B.4. Configuration examples
---------------------------

The following examples are meant to help demonstrate proper usage of the configure options.

To build SUNDIALS using the default C and Fortran compilers, and default mpicc and mpif77 
parallel compilers, enable compilation of examples, and install them under the default
directory /home/myname/sundials/examples, use

   % ./configure --prefix=/home/myname/sundials --enable-examples

To disable installation of the examples, use:
   % ./configure --prefix=/home/myname/sundials \
                 --enable-examples --with-examples-instdir=no

The following example builds SUNDIALS using gcc as the serial C compiler, g77 as the serial 
Fortran compiler, mpicc as the parallel C compiler, mpif77 as the parallel Fortran compiler, 
and uses the -g3 C compilation flag:

   % ./configure CC=gcc F77=g77 --with-cflags=-g3 --with-fflags=-g3 \
                 --with-mpicc=/usr/apps/mpich/1.2.4/bin/mpicc \ 
                 --with-mpif77=/usr/apps/mpich/1.2.4/bin/mpif77

The next example again builds SUNDIALS using gcc as the serial C compiler, but the 
--with-mpicc=no option explicitly disables the use of the corresponding MPI compiler 
script. In addition, since the  --with-mpi-root option is given, the compilation flags
-I/usr/apps/mpich/1.2.4/include and -L/usr/apps/mpich/1.2.4/lib are passed to gcc when 
compiling the MPI-enabled functions. 
The --disable-examples option explicitly disables the examples.
The --with-mpi-libs option is required so that the configure script can check if gcc 
can link with the appropriate MPI library.

   % ./configure CC=gcc --disable-examples --with-mpicc=no \
                 --with-mpi-root=/usr/apps/mpich/1.2.4 \
                 --with-mpi-libs=-lmpich



===========================
C. CMake-based installation
===========================

Using CMake as a build system for the SUNDIALS libraries has the advantage 
that GUI based build configuration is possible. Also build files for Windows 
development environments can be easily generated. On the Windows platform 
compilers such as the Borland C++ compiler or Visual C++ compiler are natively 
supported. 

The installation options are very similar to the options mentioned above. 
Note, however, that CMake may not support all features and plattforms that 
are supported by the autotools build system.

------------------
C.1. Prerequisites
------------------

You may need to get CMake if it isn't available on your system already. 
In order to use the CMake build system, you need a fairly recent CMake version. 
You can download it from http://www.cmake.org www.cmake.org. 

----------------------------
C.2. Configuration and build
----------------------------

We assume here a *nix system. For other systems, the required steps are very 
similar and are explained in more detail in the SUNDIALS user guides.
The installation steps are as follows:

- uncompress solver-x.y.z.tar.gz to obtain 'srcdir'
- create the directories 'builddir' and 'instdir'
- change directory to 'builddir'
- run ccmake with 'srcdir' as an argument

You should now see the ccmake curses interface. Press 'c' to configure your build 
with the default options. (If you don't have curses on your system and cannot use 
ccmake, you can configure cmake with command line options very similar to ./configure 
of the autotools. You can read about this on the cmake webpage.)

In the dialog you can adjust the build options. For details see the options above
in the autotools section. To adjust advanced options press 't' to show all the options
and settings CMake offers. 

After adjusting some options, for instance enabling the examples by turning 
ENABLE_EXAMPLES to ON, you need to press 'c' again. Depending on the options, 
you will see new options at the top of the list, marked with a star. After 
adjusting the new options, press 'c' again. Once all options have been set, 
you can press 'g' to generate the make files.

Now you can build and install the sundials library:
   % make
   % make install