[petsc-dev] calling petsc from a mex file

Smith, Barry F. bsmith at mcs.anl.gov
Tue May 8 13:02:55 CDT 2018



> On May 8, 2018, at 12:30 PM, Munson, Todd <tmunson at mcs.anl.gov> wrote:
> 
> 
> Hi,
> 
> I wonder if anyone has experience calling petsc from matlab using mex.  I have the 
> simplest possible mexFunction that just calls PetscInitialize() and 
> PetscFinalize().  That part seems to work fine, but when I exit 
> from matlab I get a segmentation violation and a petsc error
> message.

   What are all the error messages? Cut and paste. I've done this in the past but not for years.

> 
> I have tried compiling both with --download-mpich and --with-mpi=0 with the
> same outcome.
> 
> Maybe I am missing something flags I need to set when configuring petsc?
> 
> Any help would be appreciated.
> 
> My backup plan is to rewrite the matlab code that wants to invoke a petsc solver so 
> that I can make it work using a PetscMatlabEngine instead.
> 
> Thanks, Todd.
> 



More information about the petsc-dev mailing list