PySundials: Difference between revisions
From charlesreid1
(Created page with "The python-sundials library is available here: https://code.google.com/p/python-sundials/ =Installation= =Usage=") |
|||
| Line 2: | Line 2: | ||
=Installation= | =Installation= | ||
==Mac OS X== | |||
First, download and unpack the python-sundials tarball: | |||
<source lang="bash"> | |||
$ wget https://python-sundials.googlecode.com/files/python-sundials-0.5.tar.gz | |||
$ tar xzf python-sundials-0.5.tar.gz | |||
</source> | |||
Now install using the usual setup.py routine: | |||
<source lang="bash"> | |||
$ cd python-sundials-0.5/ | |||
$ python setup.py build && python setup.py install | |||
</source> | |||
==Errors== | |||
===Header Files Not Found=== | |||
I saw some errors related to header files not being found: | |||
<pre> | |||
$ 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 | |||
</pre> | |||
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 <code>CC</code> environmental variable: | |||
<pre> | |||
$ CC='gcc -lsundials -I/Users/charles/pkg/sundials/std/include -L/Users/charles/pkg/sundials/std/lib' | |||
</pre> | |||
=Usage= | =Usage= | ||
Revision as of 19:42, 30 January 2014
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'