PySundials
From charlesreid1
The pysundials library is available here: http://pysundials.sourceforge.net/
Installation
Mac OS X
First, download and unpack the pysundials tarball:
$ wget http://downloads.sourceforge.net/project/pysundials/pysundials-2.3.0/pysundials-2.3.0-rc4/pysundials-2.3.0-rc4.tar.gz
$ tar xzf pysundials-2.3.0-rc4.tar.gz
$ cd pysundials-2.3.0-rc4/
The next step, installing using the usual setup.py routine, had to be modified to point the C compiler to the Sundials library:
$ sudo CC='gcc -lsundials -I/Users/charlesreid/pkg/sundials/std/include -L/Users/charlesreid/pkg/sundials/std/lib' 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'