[petsc-users] Petsc Draw to pixmap

Sean Dettrick sdettrick at trialphaenergy.com
Thu Dec 3 02:06:38 CST 2015


No, it is my fault, when I was unable to download from afterstep.org<http://afterstep.org> earlier I didn’t realize that it was probably my work firewall blocking me.  Thus sending me on a wild goose chase with macports and home-brew and github version, which didn’t compile.

But now I’ve tried to follow your advice, and have a new problem.

I installed Afterimage from your suggested site, with suggested X lib flags:

   ./configure --x-includes=/opt/X11/include -x-libraries=/opt/X11/lib
   make
   make install

No errors.  Then re-configured and built petsc:

   export PETSC_DIR=/Users/sdettrick/libs/petsc-3.6.1
   export PETSC_ARCH=mac-gcc-hdf5-mpich-afterimage
  ./configure --with-afterimage --download-hdf5 --download-mpich --PETSC_ARCH=mac-gcc-hdf5-mpich-afterimage --PETSC_DIR=/Users/sdettrick/libs/petsc-3.6.1
   make PETSC_DIR=/Users/sdettrick/libs/petsc-3.6.1 PETSC_ARCH=mac-gcc-hdf5-mpich-afterimage all

No errors.  Then try to run an example with image output:

   cd src/dm/examples/tutorials/
   make ex5
   ./ex5
   ./ex5 -draw_save test.png

The example generates the error you mentioned, which it didn’t before installing afterimage:

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  1 (X_CreateWindow)
  Value in failed request:  0x40
  Serial number of failed request:  7
  Current serial number in output stream:  14

Browsing through configure.log, it seems that petsc is using the same X11 library.

Did I miss something?

Thanks!
Sean


On Dec 2, 2015, at 11:10 PM, Barry Smith <bsmith at mcs.anl.gov<mailto:bsmith at mcs.anl.gov>> wrote:


 I am such an idiot. No I did build it from source I forgot the comment in afterimage.py

 After image is available from http://www.afterstep.org/afterimage/getcode.php
#
#  It is used by the PetscDrawSetSave() routine to save X windows graphics to files
#
#  If installing on an Apple make sure to read the details on PetscDrawSetSave manual
#  page before installing
#

from that page I found

If X windows generates an error message about X_CreateWindow() failing then Afterimage was installed without X windows. Reinstall Afterimage using the
  ./configure flags --x-includes=/pathtoXincludes --x-libraries=/pathtoXlibraries   For example under Mac OS X Mountain Lion --x-includes=/opt/X11/include -x-libraries=/opt/X11/lib

Did you try all this stuff?

 Barry


On Dec 3, 2015, at 1:00 AM, Sean Dettrick <sdettrick at trialphaenergy.com<mailto:sdettrick at trialphaenergy.com>> wrote:

Hi Barry,

Thanks for the amazingly fast reply.  I installed home-brew but then was unable to find afterstep available as a package.  The closest thing I could find was asterm (after step terminal emulator.  Do you remember if you installed it from a canonical repo?

I did find afterstep on github, but had trouble installing it on the mac.

Meanwhile, a colleague has given me a python script, so I’ll probably use that instead for now.

Thanks again,
Sean

On Dec 2, 2015, at 1:45 PM, Barry Smith <bsmith at mcs.anl.gov<mailto:bsmith at mcs.anl.gov>> wrote:


Sean,

I have never been able to build from that source either.

I used homebrew to install it and its worked for several years.

I also tried to see if one could pull the image from the X pixel map and it looked like a huge project (the pixmap stuff is not as trivial as one would think it would be) so I gave up on that and started using afterimage (which essentially does all the for you).

Barry

On Dec 2, 2015, at 3:39 PM, Sean Dettrick <sdettrick at trialphaenergy.com<mailto:sdettrick at trialphaenergy.com>> wrote:

Hi,

I’d like to have petsc draw output to a pixmap, but have been unable to install afterstep on my Mac.  Direct download of the tar files from http://www.afterstep.org/afterimage/getcode.php failed, as did cvs checkout.  It seems the target sites may not exist at present.

Is there another way to install afterstep?

Alternatively, is there a way to manually redirect the X11 output using something like XCreatePixmap?

Thanks!
Sean Dettrick




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20151203/f66b6eda/attachment.html>


More information about the petsc-users mailing list