Académique Documents
Professionnel Documents
Culture Documents
1 of 2
http://users.monash.edu.au/~dprice/splash/pgplot.html
Home
About
PGPLOT is no longer necessary in SPLASH 2.0. This FAQ is kept for historical interest and as a resource for other
people on the internet still using PGPLOT.
Download
Mailing Lists
FAQ
Gallery
Userguide
How do you get/install PGPLOT? What is PGPLOT anyway?
PGPLOT is a library of Fortran (77) routines for plotting applications. It can be downloaded from
22nd Oct 2015:
v2.6.0 released.
When compiling PGPLOT with g95 on my mac, I get the following errors:
ld: Undefined symbols:
_fprintf$LDBLStub
_printf$LDBLStub
_sprintf$LDBLStub
solution: Set the PGPLOT_DIR environment variable to the install directory (e.g. /sw/lib/pgplot). This should solve both
problems (although see below for problems with the font file on 64 bit machines).
In tcsh this means something like
setenv PGPLOT_DIR /sw/lib/pgplot
22/10/2015 16:39
PGPLOT FAQ
2 of 2
http://users.monash.edu.au/~dprice/splash/pgplot.html
assuming of course that you have the permissions to do so (try "sudo rm grfont.dat" and "sudo make grfont.dat").
Problems with PGPLOT fonts and runtime endian changing
solution: the PGPLOT font file (grfont.dat, see above question) is an unformatted binary file read when PGPLOT is first
called. With gfortran-compiled PGPLOT (and SPLASH), changing the endian-ness in SPLASH (either with a compile time
flag or using the GFORTRAN_CONVERT_UNIT environment variable) also affects the grfont.dat file, making it unreadable.
One solution is to compile a grfont.dat file for each endian-ness, using the endian-changing flags for gfortran in the
PGPLOT makefile (ie. add -fconvert=little-endian or -fconvert=big-endian to the flags in the PGPLOT makefile), then
remake the grfont.dat file:
rm grfont.dat
make grfont.dat
(see above problem also). Then make a copy (e.g. mv grfont.dat grfont.dat_little) and use the environment variable
PGPLOT_FONT to point to this file instead of the default grfont.dat
setenv PGPLOT_FONT /mypgplotdir/pgplot/grfont.dat_little
solution: This means that the shared PGPLOT library file (libpgplot.so) cannot be found, most likely because the directory
which contains it is not in the LD_LIBRARY_PATH. To fix this amend the LD_LIBRARY_PATH environment variable
appropriately, ie. insert the following line into your .tcshrc file:
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/me/pgplot (or wherever you installed pgplot)
Another possibility is that the shared libraries (ie. libpgplot.so) have not been compiled in your PGPLOT installation. The
simplest solution in this case is to link to the static libraries instead (ie. libpgplot.a). In the Makefile the easiest way is to
modify the SYSTEMFILE variable to include the static libraries, e.g.
SYSTEMFILE = system_unix.f90 /usr/local/lib/pgplot/libpgplot.a
or something similar. Note that for static linking you do not need the -lpgplot in the LDFLAGS.
22/10/2015 16:39