PGPLOT Installation Instructions: Windows 95/NT with Compaq Visual Fortran

PGPLOT version 5.2.2

The following notes are based on information received from Phil Seeger. Please send any suggestions for improvement to Tim Pearson.

Supported system: Microsoft Windows 95 or Windows NT with Compaq Visual Fortran 5.0. Information about the compiler can be found at http://www.digital.com/fortran/index.html.

Note: The Compaq Visual Fortran driver for Windows uses an extension (quickwin) which prevents the PGPLOT library from being dynamically loadable. So, although PGPLOT itself works, code generated with it cannot be made into a shared-object. Among other things, this means it cannot be used with PGPERL.

Installation Instructions

  1. Download PGPLOT by your favorite method from URL:
    ftp://ftp.astro.caltech.edu/pub/pgplot/pgplot5.2.tar.gz.

  2. Uncompress the file (gunzip) and extract the files from the tar archive (tar cv). Versions of gunzip and tar for Windows are available on the Web. One program that will handle both steps is WinZip. It is available from http://www.winzip.com and many other web sites.

    The files in the tar archive are organized in a hierarchical directory structure, with the top level directory called PGPLOT. You will need the files from the following directories:

         x:\PGPLOT
                  \CPG
    	      \DRIVERS
    	      \EXAMPLES
    	      \FONTS
    	      \PGMF
                  \SRC
                  \SYS_WIN
    
    The other SYS_* directories can be ignored.

  3. Then follow the installation instructions in PGPLOT\SYS_WIN\AAAREAD.ME:
                PGPLOT 5.2.0  for  Windows95/WindowsNT
and either MS PowerStation Fortran 4.0  or  DIGITAL Visual Fortran 5.0
                   P. A. Seeger, December 15, 1997
                      e-mail:  PASeeger@aol.com
                    (Based on C. T. Dum, May 1995)

The following notes describe the porting of Tim Pearson's PGPLOT 5.1.0
to Microsoft Windows95 (or WindowsNT), using Microsoft PowerStation 
Fortran 4.0 or DIGITAL Visual Fortran 5.0.  This 32-bit operating system 
is easy to use, but most importantly removes the severe memory restrictions 
of DOS.  The size of applications which can be linked with PGPLOT.LIB is 
limited only by total physical and virtual memory.  The graphics libraries
MSFLIB (Microsoft) or DFLIB (Compaq) also include many additional (system) 
functions known from C.  Even for an old-fashioned command-line Fortran 
programer (like PAS), it is relatively easy to add features like dialog 
boxes and custom menus.

Once PGPLOT.LIB is built, applications are most easily compiled using 
the Microsoft Developer Studio.  The application type must be "QuickWin",
or it must be compiled with command line option "/MW".  Programs execute 
in a text window, with the graphical output in up to 8 separate child 
windows.  Cursor functions (including rubber-band modes) are implemented 
with the mouse. 
NOTE: applications developed in this Fortran will NOT execute under 
      DOS or Windows 3.x (no, not even with WIN32s).

The steps in building PGPLOT.LIB are the following: 

1. Download PGPLOT 5.2.0 by your favorite method.  I decompressed ver. 
   5.0.3 on VAX-VMS system, and ver. 5.1.beta from a Unix machine 
   ("uncompress" followed by "tar -xcf").  But I have now acquired
   WinZip (Nico Mak Computing, Inc., www.winzip.com) which performs Gunzip 
   and tar in the PC (very good program - I even sent them the $29 fee!).
   Just make the file name "PGPLOT52.TGZ".

2. Create an appropriate subdirectory structure; e.g.
     x:\PGPLOT
              \SRC
              \SYS_WIN
              \DRIVERS
              \FONTS
              \EXAMPLES
   where x: is either C: or another hard disk in your system.  Extract 
   files from the corresponding subdirectories of the downloaded .TGZ file.  
   Note: The copy of GRFIL.F from the \SRC folder must be omitted in favor
   of the copy in \SYS_WIN to get an appropriate default directory.
   (Personal preference note: I also copy \APPLICAT\PLOT10\PLOT10.F into 
   the \SRC subdirectory.)  

   The files in \SYS_WIN should include
      AAAREAD.ME   (this file)
      AAAREAD.ME2  (information for C programmers)
      GIDRIV.F     (Fortran90 version of GIF driver, without "C" calls)
      GRDOS.F
      GREXEC.F
      GRGFIL.F
      GRSY00.F     (not system dependent)
      PGBIND.MAK   (see AAAREAD.ME2 for discussion)
      W9DRIV.F     (the driver itself, with attached subroutines)

   The file W9DRIV.F as included is appropriate for Compaq.  To convert
   to Microsoft, replace the fourth line
      USE DFLIB
   with
      USE MSFLIB

3. If you did not use C: in step 2, create a directory C:\PGPLOT and
   copy RGB.TXT to it.  You also need to compile and execute the program
   PGPACK in subdirectory x:\PGPLOT\FONTS to convert file GRFONT.TXT to
   GRFONT.DAT, and copy or move GRFONT.DAT to C:\PGPLOT.  (Note: PGPACK
   wants to read GRFONT.TXT from the standard input; if you cannot
   arrange this, then edit PGPACK.F to open the file explicitly.)

   The directory containing RGB.TXT and GRFONT.DAT (used at run time)
   can be elsewhere if identified by environment
   variable PGPLOT_DIR, or the full [path]filenames can be given in
   environment variables PGPLOT_RGB and PGPLOT_FONT.

4. In the Developer Studio, in the File/New menu, Create a new Project 
   Workspace of Type "Static Library", Name PGPLOT, Location 
   x:\MSDEV\PROJECTS\  (Microsoft)  or  
   x:\Program Files\DevStudio\MyProjects\  (Compaq).
   Use the Insert/"Files into Project..." or
           Project/Add to Project/Files...
   and the search box to associate the following files with the project:
      x:\PGPLOT\SRC\*.F
      x:\PGPLOT\SYS_WIN\*.F
      x:\PGPLOT\DRIVERS\LXDRIV.F,NUDRIV.F,PSDRIV.F
   (The dependent *.INC files will be included automatically.)


NOTE:
   The following compiler option is required for GIDRIV.F:
     /assume:byterecl 
   which can be activated in Developer Studio by
     Project/Settings/Fortran tab
     category: Fortran Data
     check: Use Bytes as Units for Unformatted Files


5. Build the project.  From the Build menu, choose "Build PGPLOT.LIB".  
   The default compiler options are suitable; in particular, the Debug 
   configuration is not optimized, but the Release configuration uses
   full optimization.  (If the choice of "Release" is not apparent, use 
   Build/Set Active Configuration...)  Expect 7 Warning messages with 
   Microsoft, or 2 with Compaq.  When both Debug and Release have 
   successfully  completed, I like to copy the Release version of the 
   library from 
   x:\MSDEV\PROJECTS\PGPLOT\RELEASE to x:\MSDEV\BIN, or from
   x:\Program Files\DevStudio\MyProjects\PGPLOT\RELEASE to
   x:\Program Files\DevStudio\DF\BIN
   where subsequent applications can find it more easily.  

6. Run the examples.  In the same Project Workspace, use Insert/
   "Project..." to Create a project of Type="QuickWin Application",
   Name EXAMPLES.  Then use Build/"Subprojects..." to specify that 
   PGPLOT is a subproject of EXAMPLES.  One at a time, use Insert/
   "Files into Project..." to select a file from x:\PGPLOT\EXAMPLES.
   (The previous file may be deleted from the FileView window when
   successfully completed.)  From the Build menu, choose "Execute
   EXAMPLES.EXE".  The first page of the first test (PGDEMO1.F) should 
   be a parabola.  If there is no text on the plot, then you have not
   successfully created or located the file GRFONT.DAT (see step 3 
   above).  You may delete all of the PGPLOT folders from 
   x:\MSDEV\PROJECTS after successfully testing the library.

7. Drivers for Windows95, PostScript, GIF, LaTeX, and the Null driver
   have been included. If you add additional drivers (which may require 
   debugging to eliminate perceived syntax errors etc.) to the library, 
   then subroutine GREXEC.F must also be modified to reflect the changes; 
   in particular NDEV must reflect the total number of drivers.
   The default graphic window size for device type "/W9" is 800*600 with 
   236 colors (SVGA).  The default can be changed by setting an 
   environment variable (either in AUTOEXEC.BAT, or from a command line
   before starting the application) as follows: 
      SET PGPLOT_VIDEO=VGA  (or V),   640 * 480
                       SVGA (or S),   800 * 600
                       XGA  (or X),  1024 * 768
                       ZGA  (or Z),  1280 * 1024
   Modes may also be selected by using alternate device types
   "/WV", "/WS", "/WX", or "/WZ".  Modes exceeding the capability of the
   Windows screen driver will be reduced to the maximum available.  For
   an example of the 236-color modes, see PGDEMO4.  For an example of
   different resolutions, try using "/WV" for the first window and
   "/WX" for the second window in PGDEMO13.

8. The cursor is emulated by an interrupt driven mouse routine (see
   GRW901 in file W9DRIV.F).  The cursor moves continuously whenever
   the window is selected, but the position is not returned to the
   calling program until a key has been struck, and the character is
   also returned.  Control then returns to the "text" window for any
   additional input or processing.  If you lose track, there is a status 
   message at the bottom of the frame window which tells you which 
   window is waiting for input.  The color of the cursor may be dim 
   against some backgrounds (especially green in the default palette), 
   but you can usually see it at the tip of the mouse arrow while you  
   move it around.  You might try using PGBAND mode 7 for the cursor to
   improve visibility.  See especially programs PGDEMO5 and PGDEMO6.

9. Plots can be clipped and copied to other applications, such as Word.
   Unfortunately, black is black and white is white, so printing uses a
   lot of ink and the white lines tend to disappear.  One option is to 
   exchange palette colors 0 and 1 in PGPLOT with 
      CALL PGSCR(0, 1., 1., 1.)    !black becomes white
      CALL PGSCR(1, 0., 0., 0.)    !white becomes black
   before making the version to be printed; another is to cut and paste 
   to a utility (I use Paint-Shop-Pro) in which you can adjust the color 
   palette; and a third way is to specify the "/PS" device and write a
   file.  (Note: this might be a good use for a custom menu entry in
   your application.)  Yet another option is to create a second device
   window and change the color palette only in that window.  (See 
   PGDEMO13 for an example of multiple simultaneous windows.)

10. Finally, this port has been thoroughly tested (starting with earlier
   versions of PGPLOT, and using the Microsoft compiler), but no 
   responsibility for any damages is accepted (by either [PAS], [CTD], 
   or even [TJP])!


PGPLOT
Tim Pearson, California Institute of Technology, tjp·astro.caltech.edu
Copyright © 1997 California Institute of Technology