1The following notes are reproduced from an earlier version of PGPLOT. 2PGPLOT v5.0 has not yet been ported to MS-DOS. Neither I nor Allyn 3Tennant has the resources to do this. Anyone planning to try to port 4PGPLOT to MS-DOS should contact me before doing so, to avoid 5duplication of effort. 6 7The makefile in this directory is not complete, but may serve as a 8model. 9 10Tim Pearson 1130 December 1994 12------------------------------------------------------------------------ 13 14 15 PGPLOT on an MS-DOS machine 16 Allyn F. Tennant 17 Marshall Space Flight Center 18 1991-Jun-30 19 20This this directory contains all the files needed to get PGPLOT to 21compile with Microsoft Fortran 5.0 (or later) using the huge memory 22model. Earlier versions of Microsoft Fortran do not support the INCLUDE 23statement, and also do not come with the GRAPHICS library. The current 24code was tested on a 286 machine with a floating point co-processor 25and an EGA display. The code should support other configurations. 26 27If you are using another Fortran compiler then it is unlikely that 28you will be able to directly use the files in this directory. However, 29the files included here will give you some idea of what you will need 30to port. Writing a new device handler is the only thing that might 31be difficult. There are many books that provide routines for drawing 32lines on an IBM PC screen that can be included in a device handler. 33For example, see the routines in "Programmer's Guide to the EGA/VGA" 34by George Sutty and Steve Blair (Simon & Schuster, 1988). It is a 35simple matter to write a device handler that uses these routines. 36Due to copyright these routines cannot be provided. 37 38 39GETTING THE FILES TO THE MS-DOS MACHINE 40 41There are two ways to get PGPLOT on to an MS-DOS machine. First, 42you can use KERMIT (or your favorite file transfer method) to copy 43the various directories from a UNIX machine to the DOS machine. If 44you do this you should try to preserve the directory structure from 45a UNIX system, thus files from pgplot/sys_dos should be placed in 46PGPLOT\SYS_DOS. The second method involves using the AIX access package 47from IBM. We have a IBM RS/6000 machine and AIX Access allows us 48to mount the IBM disks on the DOS machine. With this method it is 49not necessary to move any files. 50 51UNIX terminates lines with a linefeed character whereas DOS uses the 52double character sequence return/linefeed. Much DOS software cannot 53cope with the UNIX record structure, however, the Microsoft Fortran 54seems to be able to compile files where the lines terminate with only 55a linefeed character. Should you need to convert two AIX routines 56are provided for file conversion. The routine 2aix will strip any 57extra return characters, effectively converting the file to UNIX format. 58Likewise 2dos will append a return character to every line the file 59converting to DOS format. 60 61Note, do not worry about the file extensions. The current version 62of MAKEFILE.DOS can cope with either *.F (typical UNIX) or *.FOR 63(needed by DOS). The makefile works by copying the *.F file into 64an *.FOR file, compiling, and then deleting the *.FOR file. 65 66 67TESTED DRIVERS 68 69Currently only the following drivers have been tested under MS-DOS: 70 71/NULL to plot onto the null device. 72 73/MSOFT to use the Microsoft graphics library routines to plot onto 74supported graphics displays. This driver has only been tested with 75an EGA display but should work with other types. Currently, the cursor 76is not supported. 77 78/PS to produce a file that can be printed on a Postscript printer. 79 80/VPS to produce a 'vertical' or portrait mode Postscript file. 81 82 83BUILDING THE LIBRARY 84 85The directory PGPLOT\SYS_DOS contains the source code for GRSY00.FOR 86contains the name and path of the font file. The default location 87for the font file is given by: 88 89 PARAMETER (UNIX='C:\lib\grfont.dat') 90 91If you do not like that location, then you should modify this file to 92contain the location where you will keep the font file. The environment 93variable PGPLOT_FONT can be used to override this location at run time. 94If PGPLOT cannot find the font file, then plots will still be drawn, 95but without labels or markers. 96 97If you are using AIX Access, then on the IBM side you should copy 98pgadvance.f to pgadvanc.f. This is because the NMAKE file includes 99this file and (of course) DOS only allows 8 letter file names. 100 101Next, copy the file MAKEFILE.DOS from PGPLOT\SYS_DOS to the PGPLOT 102directory. Then in that directory type: 103 104NMAKE -F MAKEFILE.DOS 105NMAKE -F MAKEFILE.DOS 106 107and go out to lunch (actually on a 286 using AIX Access it takes about 1082 hours for the above to complete). About half way through the 109execution of the first NMAKE, DOS announces that it cannot load 110FL. I think the problem is DOS runs out of memory keeping track of 111what has already been made. Starting over seems to free up enough 112memory so that NMAKE should complete. If you are low on memory, then 113I would not be surprised if NMAKE fails to finish on the second try. 114All I can say is keep trying (or better yet trade in your DOS machine 115for a real computer). 116 117 118PGPLOT ENVIRONMENT VARIABLES 119 120As mentioned above, you can override the location of the FONT library 121at run time by setting an environment variable. For example, 122 123SET PGPLOT_FONT=C:\LIB 124 125would cause PGPLOT to look in the C:\LIB directory for the GRFONT.DAT 126file. 127 128MS-DOS does not support user-ids, and therefore if you want a user-id 129to appear on your plots when PGIDEN is used, then you should define 130the environment variable PGPLOT_USER. For example, I include the 131following line 132 133SET PGPLOT_USER=TENNANT 134 135in my AUTOEXEC.BAT file. 136 137 138TRY THE DEMO PROGRAMS 139 140Currently PGDEMO3.EXE will link but not run. It is too big to fit 141into the 8088 address space that DOS uses. However, all the other 142PGDEMOx and PGEXxx programs should run. 143 144Note, if you are using the /MSOFT device, then the PC will be left 145in graphics mode. This allows the graph to remain after the program 146exits. If you would like to return to text mode, you should use a 147command like: 148 149MODE CO80 150 151 152LINKING WITH THE PGPLOT LIBRARY 153 154You will notice that the MAKEFILE compiles the code with the /Gt option. 155The Microsoft Fortran compiler default is to place all variables and 156arrays greater than 32K into a common segment. At link time, the 157sum of all these common areas (one for each subroutine) cannot exceed 15864K (I believe the error is L1072, but have forgotten). When this 159problem occurs, the only solution is to re-compile enough routines 160with a smaller threshold value (and for a package consisting of over 161100 routines, this could be a lot of routines). Using /Gt (with no 162number) reduces the threshold size to 256 bytes. (Actually to be 163extra safe, you should trade in your machine for a computer that has 164never heard of 64K segments). 165 166The linker always looks in the directory specified by the LIB 167environment variable. If you copy PGPLOT to that directory then the 168following command line should work: 169 170LINK /SEGMENTS:256 prog.obj,,NUL,PGPLOT+GRAPHICS; 171 172where object is the name of the object module(s) that you have 173previously complied. GRAPHICS is the name of the Microsoft graphics 174library supplied with Fortran 5.0 and is required if you wish to use 175the Microsoft device handler (MSDRIV.FOR). With the huge memory model, 176each subroutine is compiled into a separate segment. A complicated 177program can easily contain calls to more than 128 routines (the default 178maximum number of segments). Therefore you are encouraged to use 179the /SEGMENTS:256 to increase this default. 180