PGPLOT graphics device for Windows
Written by: Jan Saroun, [email protected]
- Allows to use PGPLOT interactive graphics on Windows
- Provides a new JSDRIV device server (analogy to pgxwin_server on Linux)
- Requires mingw-w64 gcc compiler suite to compile PGPLOT with JSDRIV support
- Requires Lazarus FreePascal to compile the graphics device library
- Developed and tested on Windows 10, 64 bit
=====================================================================
Lazarus project files (*.lpr) which allow to build:
jsdrivlib.dll, a library dynamically loaded by libpgplot.dll (to be linked with client applications)
jsdriv_server.exe , a server providing persistent graphics windows (similar to pgxwin_server on Linux)
Extensions to PGPLOT needed to create libpgplot.dll which supports the JSDRIV device.
sys_mingw - Source files to be compiled with the original PGPLOT source distribution
makeflie_gfortran - makefile for compiling PGPLOT using mingw-w64 gcc + gfortran (includes drivers: NULL, PSDRIV, JSDRIV)
grexec.f - Generated driver function GREXEC for the NULL, PSDRIV and JSDRIV devices.
compile.bat - A batch file for compilig PGPLOT with JSDRIV support
- Install Lazarus FreePascal RAD (https://www.lazarus-ide.org/) if you don't have it already
- Build the project
jsdrivlib.lprto create the client library,jsdrivlib.dll. - Build the project
jsdriv_server.lprto create the server,jsdriv_server.exe
The binaries are saved in ./jsdriv/bin, you should move them to appropriate directories:
- copy
jsdrivlib.dllalongside with the program executable - copy
jsdriv_server.exealongside withgrfont.dat(i.e. where the environment variablePGPLOT_DIRpoints to)
(paths are relative to the ./pgplot_binding folder)
- Download the original PGPLOT ver. 5.2 source files from http://www.astro.caltech.edu/~tjp/pgplot/)
- Extract it to a new directory, e.g.
./src - Open Windows command line and make
./pgplot_bindingyour current directory - Make sure you call the correct gcc compiler from mingw-w64 distribution, try
> gcc --version - Run
compile all ./srcto build libpgplot.dll - Run
compile prog ./srcto build PGPLOT examples - Run
compile cleanto remove temporary object files
See the contents of compile.bat to learn how to use makeflie_gfortran directly.
- Copy
jsdriv_server.exeandjsdrivlib.dllto./pgplot_binding - From Windows command line, make ./tgt your current directory
- Define environment variables:
PGPLOT_DEV=/JSDRIV
PGPLOT_DIR="full path to
./pgplot_binding" - Run the pgdemoxx.exe examples from the command line
NOTE: when running te program for the first time, an anitvirus program may slow down the startup of jsdriv_server. Just wait for ~ 10 sec till the server starts. Its icon should be visible on the tray.
- Install
libpgplot.dllandjsdrivlib.dllalongside with your application executable, or in the system directory:%SystemRoot%\system32 - On systems without mingw-w64 installed, some other mingw runtime libraries may be needed:
libquadmath-0.dlllibgcc_s_seh-1.dll
- Install
grfont.datandjsdriv_server.exein the directory defined in the PGPLOT_DIR variable. Recommended place is the folder with the dll's and the application binaries.