[petsc-users] petsc4py: PetSc is no longer initialised when calling C Function from Cython

Jeff Wiens jeffrey.k.wiens at gmail.com
Thu Oct 20 17:34:32 CDT 2011


Lisandro, the shared library was the problem. I seem to have
everything working by including the --with-shared and --with-dynamic
options in my PetSc 3.1 configuration.

Note, I had to make significant modifications to your setup.py file
for your cython demo to work (on my installation). I have attached my
setup.py file, which is based on code I found in PyClaw. The main
differences is overloading:
         build_src.build_src.generate_a_pyrex_source = generate_a_cython_source
and including the following directories:
    INCLUDE_DIRS +=["/PATH/To/openmpi/1.4.3/include"]
    INCLUDE_DIRS += ["/PATH/To/hdf5/1.8.5-patch1/include"]

Thanks for your help. It saved me a LOT of time.
Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setup.py
Type: application/octet-stream
Size: 3278 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111020/dd128d8e/attachment.obj>


More information about the petsc-users mailing list