Hey All, I am not sure if this is the correct mailing list for this, but I am using instant and petsc4py from a Firedrake install so I figured I would start here. I am trying to get instant to compile a (minimal) example of a C function that takes in a DM (actually a DMDA), a Vec and a Mat, and then call this compiled function from a python script. Here is the code: ****************************** import sys, petsc4py petsc4py.init(sys.argv) from petsc4py import PETSc import instant import os include_dirs = [os.path.join(os.getenv('PETSC_DIR'), 'include'), petsc4py.get_include(), '/usr/lib/openmpi/include', '/usr/lib/openmpi/include/openmpi', ] swig_include_dirs = [petsc4py.get_include()] library_dirs = [os.path.join(os.getenv('PETSC_DIR'),'lib')] libraries = ['petsc'] test_routine = r""" #ifdef SWIG #%include "petsc4py/petsc4py.i" #endif #include <petsc.h> PetscErrorCode testfunction(DM da, Mat A, Vec v) { } """ testfunction = instant.build_module(code=test_routine, include_dirs=include_dirs, library_dirs=library_dirs, libraries=libraries, swig_include_dirs=swig_include_dirs).testfunction da = PETSc.DMDA().create([10,],stencil_width=1,comm=PETSc.COMM_WORLD) mat = PETSc.Mat().create(comm=PETSc.COMM_WORLD) vec = PETSc.Vec().create(comm=PETSc.COMM_WORLD) testfunction(da,mat,vec) ******************************************** This fails with: File "minimal_instant_fail_example.py", line 37, in <module> testfunction(da,mat,vec) TypeError: in method 'testfunction', argument 1 of type 'DM' It looks like DMDA is not being properly recognized as a subclass of DM? Is there something else that I am missing? Any help is greatly appreciated! Regards, -Chris Eldred -- Chris Eldred Postdoctoral Fellow, LAGA, University of Paris 13 PhD, Atmospheric Science, Colorado State University, 2015 DOE Computational Science Graduate Fellow (Alumni) B.S. Applied Computational Physics, Carnegie Mellon University, 2009 chris.eldred@gmail.com