Installing PGPLOT

iSALEPlot, the visualisation software accompanying iSALE, uses PGPLOT graphics libraries. These are not distributed with iSALE: PGPLOT must be installed independently. For information about PGPLOT, visit .


For Ubuntu/Debian systems PGPLOT is packaged as ``pgplot5''. Install using:

sudo apt-get install pgplot5

This installation requires PNG and X11 libraries to be installed.

With this installation of PGPLOT, the necessary configure option is:

--with-pgplot-lib="/usr/lib/libpgplot.a -lpng -lX11" 

Mac OS X

Mac OS X installing from Fink

PGPLOT can be installed via Fink; however, note that PGPLOT is currently only available through the unstable Fink tree, so you will need to configure Fink appropriately to install PGPLOT this way.

This installation requires AquaTerm, PNG and X11 libraries to be installed. If you do not have AquaTerm installed, it can be downloaded from It can also be installed via fink and Port Authority, etc.

With the fink installation of PGPLOT and AquaTerm the necessary configure option is:

--with-pgplot-lib="/sw/lib/libpgplot.a -L/sw/lib -laquaterm -lpng -lX11" 

Mac OS X installing from src

I have had some problems using pgplot from fink or macports. I have, however, successfully built pgplot from source on a mac, and been able to use that with iSALEPlot. Here I will document the steps I had to take to build pgplot on OS X, as officially pgplot doesn't have an OS X installation procedure. Hopefully this will be of help to someone else.

First, download the source from and unpack it.

Create a directory where you will install the pgplot library. (your downloaded source should be in a different location). Here I use /opt/pgplot

sudo mkdir /opt/pgplot
sudo chown <your username> pgplot

Next, copy the drivers.list file from your source directory (note my downloaded, unpacked source was in ~/Downloads/pgplot). Edit it and select the drivers you want to use. I selected png and gif drivers.

cd /opt/pgplot
cp ~/Downloads/drivers.list .
vim drivers.list

The next step is to run the makemake command from the source directory. Here you must specify the operating system and compiler you will use. You should select 'bsd' and 'g77_gcc'. So, the command is

~/Downloads/pgplot/makemake ~/Downloads/pgplot bsd g77_gcc

This should copy a few files over to /opt/pgplot (grexec.f,, makefile, rgb.txt). Now, before typing make, there are a few adjustments to make to the makefile.

vim makefile
Here you want to change a few things:
  1. FCOMPL=g77 to FCOMPL=gfortran (you should make sure this is a 32bit version of gfortran). I also changed CCOMPL=gcc to CCOMPL=gcc-4 (which on my mac is a 32bit version of gcc).
  2. Also, change the line beginning pndriv.o (for me this is line 874) to pndriv.o : /sw/include/png.h /sw/include/pngconf.h /opt/local/include/zlib.h /opt/local/include/zconf.h. (Note, you may need to locate where png.h, pngconf.h, zlib.h and zconf.h are on your machine. For me I found some the png stuff from fink and zlib from macports. If you can't find them, try using one of those to install them).
  3. And the final change in the makefile is to run a search and replace to change all instances of ar ru to libtool -s -o

Now to built the library


For me, this gets past the point where it links the libpgplot.a file, but then fails while building the demo files. This doesn't seem to be a problem, since I'm not interested in the demos anyway. Check to make sure you have a libpgplot.a file.

Finally, it might be worth building the grfont.dat file

make grfont.dat

And you should be done. Then, when configuring iSALE, you just need

./configure --with-isaleplot --with-pgplot-lib="/opt/pgplot/libpgplot.a -L/usr/X11R6/lib -lX11 -L/usr/local/lib/ -laquaterm"