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).

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.