From charlesreid1

The python-sundials library is available here: https://code.google.com/p/python-sundials/

Installation

Mac OS X

First, download and unpack the python-sundials tarball:

$ wget https://python-sundials.googlecode.com/files/python-sundials-0.5.tar.gz
$ tar xzf python-sundials-0.5.tar.gz

Now install using the usual setup.py routine:

$ cd python-sundials-0.5/
$ python setup.py build && python setup.py install


Errors

Header Files Not Found

I saw some errors related to header files not being found:

$ python setup.py build
running build
running build_py
creating build
creating build/lib.macosx-10.8-intel-2.7
creating build/lib.macosx-10.8-intel-2.7/pysundials
copying src/__init__.py -> build/lib.macosx-10.8-intel-2.7/pysundials
copying src/cvode.py -> build/lib.macosx-10.8-intel-2.7/pysundials
copying src/cvodes.py -> build/lib.macosx-10.8-intel-2.7/pysundials
copying src/ida.py -> build/lib.macosx-10.8-intel-2.7/pysundials
copying src/kinsol.py -> build/lib.macosx-10.8-intel-2.7/pysundials
copying src/nvecserial.py -> build/lib.macosx-10.8-intel-2.7/pysundials
copying src/sundials_core.py -> build/lib.macosx-10.8-intel-2.7/pysundials
running build_ext
building 'pysundials.realtype' extension
creating build/temp.macosx-10.8-intel-2.7
creating build/temp.macosx-10.8-intel-2.7/src
clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/realtype.c -o build/temp.macosx-10.8-intel-2.7/src/realtype.o
clang: warning: argument unused during compilation: '-mno-fused-madd'
src/realtype.c:3:10: fatal error: 'sundials/sundials_types.h' file not found
#include "sundials/sundials_types.h"
         ^
1 error generated.
error: command 'clang' failed with exit status 1

This was a result of the fact that I had installed Sundials in a non-standard location. I was able to to customize my C compiler command to point, specifically, to the Sundials libraries I was using, by assigning a vlaue to the CC environmental variable:

$ CC='gcc -lsundials -I/Users/charles/pkg/sundials/std/include -L/Users/charles/pkg/sundials/std/lib'

Usage