Build PGPLOT

Ref: http://software.intel.com/en-us/articles/performance-tools-for-software-developers-building-pgplot-with-the-intel-compilers/index.htm#buildingPGPLOT

$cd tmp
$wget ftp://ftp.astro.caltech.edu/pub/pgplot/pgplot5.2.tar.gz
$tar xzvf pgplot5.2.tar.gz

 

You will need to make some changes to the script that generates the makefiles. Comment out the pndriv.orule on line 1028 of pgplotsrc/makemake by adding a “#” at the beginning of the line. Also, add a –nofor_mainswitch to line 1055 of the same file, on the second command under the cpgdemo rule. The file is shown as it should look below:

pgplotsrc/makemake

… # Miscellaneous include files required by drivers

griv00.o : $(DRVDIR)/gadef.h $(DRVDIR)/gmdef.h $(DRVDIR)/gphdef.h 
grivas.o : $(DRVDIR)/gadef.h 
grtv00.o : $(DRVDIR)/imdef.h 
pgxwin.o : $(DRVDIR)/pgxwin.h 
#pndriv.o : ./png.h ./pngconf.h ./zlib.h ./zconf.h
x2driv.o figdisp_comm.o: $(DRVDIR)/commands.h
... 
cpgdemo: cpgplot.h $(SRC)/cpg/cpgdemo.c libcpgplot.a 
$(CCOMPL) $(CFLAGD) -c -I. $(SRC)/cpg/cpgdemo.c 
$(FCOMPL) –nofor_main -o cpgdemo cpgdemo.o 
$(CPGPLOT_LIB) $(LIBS) 
rm -f cpgdemo.o 
...
$cd /pkg/pgplot/5.2/$PRG_ENV
$cp /tmp/pgplot/drivers.list ./

Edit drivers.list in the current ( pgplot) directory. Enable the PNG and PostScript drivers by deleting the exclamation points at the beginning of the following line numbers: 40 (PNG), 41 (TPNG), 44 (PS), 45 (VPS) 46 (CPS), 47 (VCPS). You may also enable any other drivers that you find useful. However, be aware that other drivers may cause additional issues not covered in this guide. The file is shown below as it should look:

/pkg/pgplot/5.2/$PRG_ENV/drivers.list

...
 ! NEDRIV 0 /NEXT Computers running NeXTstep operat ing system
 NUDRIV 0 /NULL Null device (no output) Std F77
 ! PGDRIV 0 /PGMF PGPLOT metafile (new format, experimental) Std F77
 PNDRIV 1 /PNG Portable Network Graphics file C
 PNDRIV 2 /TPNG Portable Network Graphics file - transparent background C
 ! PPDRIV 1 /PPM Portable Pixel Map file, landscape
 ! PPDRIV 2 /VPPM Portable PIxel Map file, portrait
 PSDRIV 1 /PS PostScript printers, monochrome, landscape Std F77
 PSDRIV 2 /VPS Postscript printers, monochrome, portrait Std F77
 PSDRIV 3 /CPS PostScript printers, color, landscape Std F77
 PSDRIV 4 /VCPS PostScript printers, color, portrait Std F77
 ! PXDRIV 0 /PRINTRONI Printronix P300 or P600 dot-matrix printer
 ! QMDRIV 1 /QMS QUIC devices (QMS and Talaris), landscape Std F77
 ...
$module load compiler/gcc/4.4 #load Compiler Version
$mkdir -p /pkg/pgplot/5.2/$PRG_ENV
$/tmp/pgplot/makemake /tmp/pgplot/ linux g77_gcc
$make CCOMPL=gcc FCOMPL=gfortran LIBS="-L/usr/lib64 -lX11" LD_RUN_PATH=`pwd` 
$make cpg CCOMPL=gcc FCOMPL=gfortran LIBS="-L/usr/lib64 -lX11" LD_RUN_PATH=`pwd`

usage
$module load compiler/gcc-4.4 pgplot/5.2
$gfortran $(PGPLOT_LIBS)