1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
|
PGPLOT 5.10 for MS Power Station 1.0A (FL32)
C. T. Dum, May 1996
The following notes describe the porting of Tim Pearson's PGPLOT 5.10
to the Microsoft Power Station for 32 bit Fortran. This compiler is very
easy to use, but most importantly removes the severe memory restrictions
of 16bit Fortran. Rather large applications can thus be linked with
PGPLOT.LIB. The FL32 Library also includes many additional (system)
functions known from C.
Once PGPLOT.LIB is built applications are most easily compiled using the
Programmers workbench under Windows. (Programs, however, are executed
in a DOS window.)
The steps in building PGPLOT.LIB are the following:
1. Download PGPLOT5.10.TAR.Z
Uncompress and De-Tar as usual (There are also Dos Versions of these
programs) or download files from a UNIX machine.
It is not necessary to change files from UNIX LF termination of lines
to DOS CR-LF.
(A ZIP archive is also available
2. Create the subdirectory structure corresponding to the tar file
in the directory of your choice ( in my case c:\pgl)
Eliminate unneeded subdirectories (see Makefile), e.g. pgdisp and
various sys subdirectories.
3. F32\include\FGRAPH.FD (MS distribution)
add declaration of $GRTEXTNOTSUPPORTED as INTEGER*2 (MS bug)
4. Place MAKEFILE (for FL32) in your chosen directory (c:\pgl)and modify
directory names if applicable. DOS supports only names with up to
8 characters, thus the directory for the DOS files becomes
sys_msdo and pgadvance.f in \src must be shortened to pgadvanc.f.
MAKEFILE has been derived from Tennant's version. Copying of files from
the .F extension to the .FOR extension is avoided by using the
lag /Tf in FL32. The flag /Fo could be used to replace the default
extension .obj of the output by .o
5. Drivers for the Screen (vga), Postscript, LaTeX, and the Null driver
have been included.
The SVGA (resolution 800*600), X modes (1024*768) and
Z modes (1278*1024) modes with 16 or 256 colors require a VESA
compliant video card or a corresponding TSR (some are included in
the FL32 distribution).
By default the 16 color mode (vga16) or B/W for mono
monitors is implemented by msdriv.for. Other modes can be set with
the environment variable PGPLOT_VIDEO (e.g. SET PGPLOT_VIDEO=VGA25,
or SGA16, SGA25, XGA16, XGA25, ZGA16, ZGA25). For these modes make
sure, however, that they are supported by your video card and
monitor, else damage may result.!!
MSDRIV.F has been modified such that PGEND now returns the screen
to the default video mode (text mode) after pressing ENTER. Issuing
MODE CO80 from the DOS command line thus is no longer necessary for
returning to the text mode.
The default device can be set with PGPLOT_DEV (e.g. /MS).
The /NULL, /LATEX and /PS drivers have also been enabled.
The /HJ driver contains a PC version (commented out). It works for
the most part with a HP laserjet. However, Pgdemo7,8 produce several
extra formfeeds. If you add additional drivers (the may require
changes for FL32 to eliminate syntax errors, VAX extensions etc.)
to the library then grexec.f must also be modified to reflect this
changes, in particular ndev must reflect the total number of drivers.
The cursor routine has been extracted from the file MSDRIV.F and
was placed in a separate file GRMS1C.F. Using a mouse in place of
the cursor keys, e.g. in pgdemo5, 6, requires an appropriate TSR (in
addition to the mouse driver) which simulates cursor input. Software
accompanying the mouse may contain such programs. The cursor routine
can also be extended by Assembler or C code using DOS interrupt 0x33
for the mouse. (This interrupt is enabled by the mouse driver). Such
code, based upon the .asm program in the directory
\samples\graphics\demo of the FL32 distribution, is included in
MSDRIV.FOR. It apparently works only for VGA16 mode (or mono?).
Therefore MSDRIV.F switches to cursor input for other graphics
modes. Use of this mouse routine requires that MOUSE.OBJ from the
FL32 distribution (in \samples\graphics\demo) is linked
(added to PGPLOT.LIB). The left mouse button inputs 'A' for a
single click, X for a double click (within 1 sec).
The right mouse button inputs 'D' and 'CTRL-D' respectively.
These assigments can easily be changed or augmented for a middle
button or 2 button input. Subroutine GRMS1M in MSDRIV.F can be
replaced by GRMS2M.F which waits for keyboard input instead of
mouse clicks. If you use the cursor keys only, or figure out how
to extend the mouse routine to SVGA modes the switch between
cursor routines in subroutine GRMS00 of MSDRIV.F can be
eliminated. MAKEFILE by default is configured for using the mouse
with GRMS1M. For cursor input only linking of mouse.obj is not
needed, else place MOUSE.OBJ into the PGPLOT_DIR.
Also place the include files mouse.fi, mouse.fd into the directory
f32\include.
6. Under DOS (not windows) say nmake. It will take a while to generate
some 221 .obj files, PGPLOT.LIB, PGPACK.EXE and the 12 exes for the
examples. Unless you immediately plan modifications, the .obj files
can be then be deleted, of course.
The execution of PGPACK with generates grfont.dat from grfont.txt
does not work within NMAKE, as different DOS extender versions are
used. Run PGPACK < path\grfont.txt outside nmake.
7. If a source file is modified remove the old file.obj file from the
lib with link32 -lib pgplot.lib /remove:file.obj before issuing nmake
again. A new module can also be generated with fl32 /c new.for
and added to pgplot.lib with link32 -lib pgplot.lib new.obj.
A demo.exe can be generated with fl32 demo.for pgplot.lib or
fl32 /Tfpath\demo.f pgplot.lib.
8. The compiler option with optimization /Op is used in the
MAKEFILE. It has been found that the cursor routine (GRMS1C) works
incorrectly (coordinates are modified when the background image is
saved!) if compiled with this option and a SVGA mode is used.
The switch from version 1.0 of FL32 to version 1.0A (bug fixes, new
dos extender) also required minor changes (in grsy00.for, grgfil.for)
in order to avoid crashes (protection faults, heap errors). This
dependence on functionally equivalent statements (block ifs instead
of if, or addition of print statements) is due to compiler bugs.
(see below).
9. A list of all the modules in PGPLOT.LIB can be generated with
link32 -lib pgplot.lib /list > pgplot.lst
10.Finally, this port has been thoroughly tested (starting with earlier
versions of PGPLOT), but no responsibility for any damages is
accepted!
11. TODO: update and port of printer drivers, mouse routine for SVGA,
C binding (According to MS, combining C/C++ with Fortran requires
the 32 bit version of Visual C/C++.).
12. Notes on version 5.10
PGOPEN now allows the use of several output devices, as shown
in PGDEMO13. It can be used here e.g. for the simultaneous
generation of screen output and Postscript files. As this DOS
version does not have separate windows for text and graphics,
text output (from print statements) will overwrite graphics or
become invisible after a switch to a high resolution display
mode. It is thus recommended to specify the screen mode as the
last device, i.e. the menu in the this example.
pgdemo14 requires keyboard input in addition to mouse/cursor input.
msdriv.f thus has been modified to call mouse routine grms2m instead
of grms1m. As described above grms1m allows only fixed input
assigned to the buttons.
If there is extra mouse/cursor input, e.g. outside the menu
buttons in pgdemo13, a runtime error R6001 (null pointer assignment) is
reported, but is harmless.
Appendix:
The Microsoft Fortran compiler fails to compile some subroutines
correctly. As far as possible, these problems have been circumvented
in the PGPLOT code, but some problems may remain. According to Microsoft,
bad code is generated, and a run-time unexpected heap error occurs under
the following circumstances:
1. There is an if statement alone, not a block if.
2. There is a call to a subroutine that takes a character
argument in the IF block
3. The actual argument passed to the subroutine is a character
expression that includes concatenation of characters
4. The IF expression is evaluated as False so that the
call is not carried out.
"Subroutines" includes intrinsics such as PRINT and write.
The cure is to use either block if or to assign character expressions
to a temporary variable rather than passing it directly.
________________________________________________________________________
***Usage with Windows 95*******
There is a newer version, PowerStation 4.0, which is designed
for Windows 95/Windows NT. An implementation by P. A. Seeger has
just been added to this disatribution (sys_win).
However, the current version can also be run under Windows 95 if a
patch fpsfix95.exe (available from a Microsoft BBS) is installed as
described by the following MS readme file:
Microsoft FORTRAN PowerStation for MS-DOS/Windows Fix for Windows 95
********************************************************************
Microsoft FORTRAN PowerStation for MS-DOS and Windows is designed to
work optimally with Microsoft Windows 3.1. When used with Windows 95,
there is a problem with graphics programs and a simple work-around is
described here.
Microsoft FORTRAN PowerStation 1.0a
===================================
First, you should be using the maintenance release of Microsoft FORTRAN
PowerStation.
To tell if you are using 1.0a, run "link.exe" from the bin directory.
You should see "Version 1.0F"; look for the "F". If it is there, you
have 1.0a. If not, please contact Microsoft support services at the number
listed in your documentation for where you live. If you live in the
United States or Canada, call 206-635-7015.
Installing The Fix
==================
Run the setup.bat batch file included with this package.
Executables built with this fix in place can still be used on MS-DOS
and Windows 3.1 systems.
Problem Corrected:
==================
Graphics Programs Fail
----------------------
Graphics programs compiled with FORTRAN PowerStation fail when run.
Instead of the usual graphics output, you will instead see a runtime
error.
The cause of this problem is that Windows 95 is running the graphics
program as a true Win32 program, instead of as a DOS-extended program.
>From a console Win32 program graphics are not supported, so the program
fails. The program 'fpsfix' marks the executable so that Windows 95
will treat it as a DOS program, and not a Win32 program.
Setup.bat will install fpsfix so that all programs compiled will
automatically be fpsfix'ed. If you have any graphics programs that were
previously compiled, you can run fpsfix by hand on these by running:
fpsfix exename.exe
where exename.exe is the name of your executable.
-------------------------------------------------------------------------
|