This repository contains my attempt to use the cl_F object from the CLN library as the realtype in SUNDIALS. Only the CVODE program, the shared files, and the nvec_ser files have been converted. If you have questions, comments, complaints, or further extensions and improvements, contact me: Warren Weckesser wweckesser [at] mail [dot] colgatge [dot] edu Dept. of Mathematics, Colgate University, Hamilton, NY (Be sure you make the obvious corrections to the above email address before using it.) To install and use this software: --------------------------------- 0. Install the CLN library: http://www.ginac.de/CLN/ The following instructions assume that this library is installed in a standard location. 1. Save and extract the tar files. In the following, I will assume that this was done in your $HOME directory. $ tar xvjf sundials_cln.tar.bz2 or $ tar xvzf sundials_cln.tar.gz 2. Change to the sundials_cln/sundials directory, and run the configure/make/make install sequence as follows. (The configure command should be all on one line. I've written the backslashes to remind you of this. If you type it all on one line, don't include the backslashes.) $ cd sundials_cln/sundials $ ./configure CC=/usr/bin/g++ --prefix=$HOME/sundials_cln/local \ --disable-cvodes --disable-ida --disable-kinsol \ --disable-f77 --disable-mpi $ make $ make install Depending on your system, you may have to add more options to the configure command. 3. I have converted two of the examples in cvode/examples_ser to use the CLN version. I have not converted the Makefile.in for these programs. Instead, I have create a simple Makefile for them, called Makefile-cln. To compile and run these examples, use the following commands: $ cd cvode/example_ser $ make -f Makefile-cln $ ./cvbanx $ ./cvdenx $ cd ../.. 4. The test directory contains some programs that I have used to experiment with this modified library. $ cd test $ make canard_search $ ./canard_search Directory Contains --------- ------------------------------------------------------------ sundials The modified version of SUNDIALS v 2.2.0 local This will be the install directory during development. The option --prefix=$HOME/sundials_cln/local is given to the ./configure command test Some tests of my own. Brief Summary of the Changes to the SUNDIALS Code ------------------------------------------------- o The realtype definition was defined to be the CLN class cl_F in shared/include/sundials_types.h. o The global variable cln_precision_ and the function set_realtype_precision are defined in sundials_math.c. (This seemed as good a place as any to put these.) o At the beginning of each file, before any includes of SUNDIALS header files, added the lines #define WANT_OBFUSCATING_OPERATORS #include (These must also be included in any progams that will use this library.) o Any calls to malloc() that create a realtype must be changed to use new, and the corresponding free() must be changed to delete. This includes most of the "big" structures, such as the structure created by CVodeMalloc. By using new, the constructors of the realtype data fields in the structures will be called. This also includes the memory allocated by the linear algebra routines. (This means that the code must be compiled with the C++ compiler.) o Integer variables (e.g. N) in arithmetic expressions are wrapped in cl_float(N,cln_precision_). o Calling printf with a realtype argument doesn't work, so any such statements were changed. o Changed some of the calls in sundials_math.c to use CLN functions.