# Error message when trying to get PETSc to draw to an X terminal by passing -mat_view_draw

I've made a matrix, and now I want to draw it on the screen to make a basic check of correctness. The documentation for MatAssemblyEnd() states that I can pass an option to do this:

-mat_view_draw - PetscDraws nonzero structure of matrix, using MatView() and PetscDrawOpenX().

But when I run my program with this option, I get the following error:

[0]PETSC ERROR: --------------------- Error Message ------------------------------------
[0]PETSC ERROR: No support for this operation for this object type!
[0]PETSC ERROR: Viewer type draw not supported!
[0]PETSC ERROR: ------------------------------------------------------------------------


Does PETSc still support drawing to X terminals? Or is this just an indication of a bug somewhere in my code?

Configure probably did not find X11. You can check whether it was found using

$grep '\<PETSC_HAVE_X\>'$PETSC_DIR/\$PETSC_ARCH/include/petscconf.h
#ifndef PETSC_HAVE_X
#define PETSC_HAVE_X 1


If you don't see PETSC_HAVE_X defined, try reconfiguring --with-x (perhaps with a path, see ./configure --help for details on what to specify).

• I don't get PETSC_HAVE_X, but I do see #ifndef PETSC_HAVE_X11 #define PETSC_HAVE_X11 1. Should that also work? – Dan Apr 11 '12 at 23:47
• Yeah, the macro depends on the version of PETSc. What matrix type are you using? – Jed Brown Apr 11 '12 at 23:52
• I'm using SEQAIJ. And the version of PETSc I'm using is 3.2. – Dan Apr 12 '12 at 5:30
• Send the full error message to petsc-maint@mcs.anl.gov. – Jed Brown Apr 12 '12 at 13:33
• I checked the configuration options, and --with-x isn't in there. I think that's probably the problem. – Dan Apr 16 '12 at 16:54