
INSTALL INSTRUCTIONS FOR Win32 Systems
=======================================

Author:  "Sisyphus" - sisyphus1 at optusnet dot com dot au 

Last update to this file: Apr 10th 2006

Caveats
=======


Here's how to build the PGPLOT perl module on Win32 ... or at least
here's one way to do it. There are no doubt other approaches that 
will work.

These instructions relate to a native Win32 environment, NOT Cygwin.
PGPLOT-2.19 should build straight out of the box on Cygwin if the pgplot C
library can be found. I don't know what sort of graphics display Cygwin
users have for running the test suite - they may also need to specify
'/PNG'.


From here on, I shall refer to the pgplot C library as "pgplot" - 
and to the perl module as "PGPLOT".

=============
PRELIMINARIES
=============

First up you need a pgplot C library against which to build PGPLOT.
I've used Jose Fonseca's (MinGW-built) pgplot library available from
http://www.kalinabears.com.au/w32perl/pgplot-5.2.2-mingw32.tar.bz2.

It's an old port, but is adequate for building PGPLOT if you can't find
a more recent port - and don't want to (or can't) build pgplot yourself.
If you do want to build pgplot yourself using MinGW, then the diff at
the following location might be useful to you:

http://jrfonseca.home.dyndns.org/projects/gnu-win32/software/ported/patches/pgplot-5.2.2-mingw32.diff.gz

Anyway, Fonseca's port of pgplot has all the files needed to build 
PGPLOT for both MinGW-built perl and MSVC++-built perl:

pgplot/bin/cpgplot.dll
pgplot/bin/pgplot.dll
pgplot/bin/grfont.dat
pgplot/include/cpgplot.h
pgplot/lib/cpgplot.a
pgplot/lib/pgplot.a

The location of the 2 dll's (cpgplot.dll and pgplot.dll) needs to be added to the
system path.

We also need to set an environment variable so the system can find grfont.dat:

set PGPLOT_FONT=\full_path\to_grfont.dat\grfont.dat

On Win32 I don't have a decent graphics display, so I use PGPLOT's capability to write
images to a png file. For that it's also necessary to add the location of libpng.dll and
zlib.dll to the system path. (These can both be readily Googled if you don't have them.)

The pgplot library needs to be found by the PGPLOT build process. To make sure that
happens copy libcpgplot.a and libpgplot.a from Fonseca's library to X:\usr\lib. And copy
cpgplot.h from Fonseca's library to X:\usr\include. (You'll need to replace X with 
whatever letter it is that denotes the drive you're building PGPLOT in - ie if your
PGPLOT build directory is in the D drive, copy to D:\usr\lib and D:\usr\include 
respectively.)

Install dmake (available from http://search.cpan.org/dist/dmake/) if you don't 
already have it and add the location of dmake.exe to your path.

Install MinGW (available from http://www.mingw.org/download.shtml) if you don't
already have it and add the MinGW\bin folder to your path.

That should take care of the preliminaries.

================
MINGW-BUILT PERL
================

Having done the preliminaries:

Install ExtUtils::F77-1.15 or later (from CPAN source).

Then build PGPLOT by simply running (as per usual):

perl Makefile.PL
dmake 
dmake test (Here you'll be prompted to specify '/PNG' so that the tests can be written to
            png files and viewed at the conclusion of the test suite.)
dmake install


===========================================================
MSVC-BUILT PERL (including ActiveState and IndigoStar perl)
===========================================================

Having done the preliminaries:

Install Extutils::FakeConfig (according to the instructions in its readme).

Install Extutils::F77-1.15 or later (from CPAN source) by running:

perl -MConfig_m Makefile.PL
dmake 
dmake test
dmake install

Then build PGPLOT by running:

perl -MConfig_m Makefile.PL
dmake 
dmake test (Here you'll be prompted to specify '/PNG' so that the tests can be written to
            png files and viewed at the conclusion of the test suite.)
dmake install

For ActiveState builds 815 and later it should NOT be necessary to install 
ExtUtils::FakeConfig as these builds should work seamlessly with dmake and the MinGW 
compiler. If you have such a build of ActiveState perl and opt to NOT install 
ExtUtils::FakeConfig, then do NOT supply the '-MConfig_m' option whenever running
'perl Makefile.PL'. Other than that, the procedure is identical.

If that involves too much work there are ppm packages (which include the png and zlib
dll's) for PGPLOT available from http://www.kalinabears.com.au/w32perl/pgplot.html
(for both perl-5.6 and perl-5.8).





