Installing PGPLOT for IFEFFIT
-----------------------------

Starting with Ifeffit 1.2.10, PGPLOT must be installed BEFORE Ifeffit is
built, and must be built with the PGPLOT_Install script.   Specifically,
pre-compiled binary packages from linux distributions (debian, ubuntu, etc)
WILL NOT WORK.  If you try to use of these, IFEFFIT will not find PGPLOT.

To install PGPLOT, type 

  ~> sh ./PGPLOT_install

The shell script 'PGPLOT_install' will attempt to download, build and 
install PGPLOT for you.  Running PGPLOT_install can be as simple as 
  ./PGPLOT_install --system=linux

This will install Ifeffit to /usr/local/share/ifeffit/pgplot.  You can
specifiy a different location for the 'share/ifeffit/pgpplot' tree, but
it is recommended that you use the same prefix for PGPLOT_install and 
Ifeffit's configure script.

Other options for PGPLOT_Install are:
    --prefix=/usr/local/    base name of install directory
    --system=linux          name of system type
    --with-fortran=g77      force name of fortran compiler (default is to autoseek)
    --with-64bit            for 64bit systems (not always needed)
    --no-clean              do not clean up temporary files from install folder.
    --no-log                do not write it PGPLOT_install.log
    --with-png              use png driver
    --with-gif              use gif driver (may fail on some systems)
    --no-png
    --no-gif
    --help                  show help

I've not tried installing PGPLOT with this script on any non-linux system
in many years.

Note: You will need libpng and X Windows development tools.  For some
modern linux systems (notably Ubuntu), you may need to install libpng-devel
and Xorg-devel packages. 

The PGPLOT_install script will will download the PGPLOT kit, configure,
build, and install PGPLOT for you.  The script has the following requirements:

  1. If the file pgplot5.2.tar.gz isn't already here, it will try 
     to download it for you.  This may fail, in which case you'll
     have to download it yourself from
         http://www.astro.caltech.edu/~tjp/pgplot/
     Only after the file pgplot5.2.tar.gz is in the same directory
     as PGPLOT_install can the installation proceed.

  2. By default, PGPLOT_install will install the pgplot files in 
       /usr/local/share/ifeffit/pgplot
     To do this successfully, you probably need to run PGPLOT_install
     with root access.  If you don't have root access, or want to use
     some other location for the PGPLOT libraries, specify the
     directory prefix with the --prefix switch:
       ./PGPLOT_install --prefix=/home/matt/libs

     which will install to /home/matt/libs/share/ifeffit/pgplot.  You 
     will want configure Ifeffit to use the same prefix.

  3. PGPLOT_install assumes it's building on a linux system with
     g77 and gcc.  It will probably work on an IRIX or other Unix 
     system, by using commands like:
       ./PGPLOT_install --system=irix   --prefix=/home/matt/libs/
       ./PGPLOT_install --system=sun4  
     the argument is passed on to PGPLOT to help compilation),
     but this is not tested.

If the script fails, consult the PGPLOT instructions, or contact me when
you've run out of ideas.  The goal of the PGPLOT build is to create a
library file 'libpgplot.a' against which Ifeffit will be linked.  If
this gets built and the demos run, PGPLOT should work with Ifeffit.

Configuring Ifeffit:
--------------------

Unless told otherwise (ie, with an explicit --with-pgpplot,
--without-pgplot, or --with-pgplot-link), the configuration script will
try to determine how to build Ifeffit using the iconf_pgplot script.  You 
can run this yourself:
  ~>./iconf_pgplot

which should write out a set of link options for how to successfully link
with the PGPLOT library.  Something like
    -L/usr/local/share/ifeffit/pgplot -lpgplot_iff -lpng -lz -L/usr/X11R6/lib -lX11

should get written out.  If you get something like
    .../src/pgstub/libnopgplot.a

then Ifeffit will be built without plotting capabilities.

Note that the same fortran compiler must be used to compile PGPLOT and
Ifeffit.  Normally, the --with-fortran option can be ignored.

PGPLOT Environmental Variables:
-------------------------------

After installation, you may want to set some environmental variables 
associated with PGPLOT.  You will not need to set PGPLOT_DIR  or PGPLOT_DEV
unless you want to change the defaults (PGPLOT_DIR being set to the
originial installation directory and PGOLOT_DEV = /xserve

For Postscript and / or GIF output from IFEFFIT, you may want to
set the height and widths of the resulting output plots.  For the
Postscript devices, the size is specified in units of 0.001" (25
microns).  An appropriate size might be:
 csh:    setenv PGPLOT_PS_HEIGHT 9000
         setenv PGPLOT_PS_WIDTH  6000

For GIFs, the units are pixels, so appropriate sizes might be:
 bash:   export PGPLOT_GIF_HEIGHT=400
         export PGPLOT_GIF_WIDTH=500

Finally, for the X windows devices, you may want to put a few
setting into your .Xdefaults or .Xresources file. Typical setting
might be these:

 pgxwin.server.visible:	false
 pgxwin.Win.geometry:	610x377

The first of these will hide the annoying little extra PGPLOT
window.  The second configures the starting size of the PGPLOT
plot window.  You can always resize it, but why not have it be
close to the right size to begin with?

If you have an older video card and get 'color flashing' from the
PGPLOT window, PGPLOT (or something else) is probably taking too
much of the X windows 'color map'.  Setting the maximum number of
colors that PGPLOT can use might help. Start with

 pgxwin.Win.maxColors:	512

and work your way down until it works OK.  Setting this number
_too_ small will not give you enough colors.

After changing your .Xdefaults file you'll have to restart your X
session or issue a 'xrdb --merge .Xdefaults' command.


