SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Contacts SED Projects SED Products and Publications Search SED Pages

Downloading DATAPLOT Source Code for Unix Systems

Introduction Most Unix users will be able to download a pre-built Dataplot executable. However, there are cases in which you may need to build Dataplot from the source code:
  • We do not provide a Dataplot executable for your platform.
  • You are running an incompatible version of the operating system for a supported platform.
  • You would like to modify the size of the Dataplot work sheet (i.e., the maximum number of rows of data Dataplot can handle).
  • You would like to make local changes to the source code.
For any of these cases, you will need to download and compile the source code.
What You Need Dataplot is written primarily in Fortran 77. Code for certain device drivers is written in C. This means that you need the following on your local system:
  • A Fortran 77 or Fortran 90 compiler. The g77 compiler can be freely downloaded for most Unix/Linux sites.
  • If you do not have a Fortran compiler, you can alternatively use the f2c utility and a C compiler. Most Unix platforms will have f2c already installed. If not, it can be freely downloaded from netlib. If you do not have a C compiler, then the gcc compiler can be freely downloaded from one of the GNU web sites.
  • You need the xlib library (and the xlib.h include file). This should be available on most Unix systems by default. Check with your local system adminstrator if you are not sure.
  • The GD PNG/JPEG/GIF device driver requires several auxillary libraries:

    1. GD library from Thomas Bouttel
    2. JPEG library
    3. PNG library
    4. ZLIB compression library

    A little care needs to be taken with appropriate versions of these libraries. The original implementation of the Dataplot GD driver used version 1.84 of GD (and in turn used version 1.09 of PNG and version 1.1.3 of ZLIB). The 4/2006 version of the Dataplot source was upgraded to version 2.0.33 of GD (and version 1.2.8 of PNG and version 1.2.3 of ZLIB). The only source code modification to "gd_src.c" (the Dataplot routine that provides the interface to the GD library) was the addition of the GIF driver. These libraries may already be installed on your site. If so, you should be able to use them. Just check the version on your system. There is a compiler definition you can set in "gd_src.c" to turn off the calls to the GIF driver if you have a version of GD that does not support GIF.

    The Sun Solaris, Red Hat Linux, Cygwin, and Mac OSX pre-built executables use version 2.0.33 of GD. The pre-built executable for the SGI IRIX is still using version 1.84 of GD.

    Generally, I recommend building Dataplot without this device driver first. Then, once you get Dataplot working, you can go back and download and build these libraries. This is discussed further below.

Files to Download There are two files to download:
  1. The current version of the Dataplot source files (Fortran files, C files, and include files) (updated 02/25/2008).

    The following previous versions of the source code are also available:

  2. Script files for building Dataplot on various platforms
You also need to download the Dataplot auxillary files.
Building Dataplot After Downloading Files
Step 1: Unpack Source/Script Files The first step is to upack the source and script files. If you have superuser priveleges, you may want to create the directory "/usr/local/src/dataplot" and move the source files to that directory. If not, you should create a new directory of your choice. One suggestion is ~/dataplot/src, but this is really your choice. Once you have moved the files to this directory, do the following:
  • gunzip dpsrc.tar.gz | tar -xf
  • gunzip dataplot_command.tar.gz | tar -xf
If you like, you can either remove or re-compress the two tar files.
Step 2: Make any Needed Source Changes The next step is to make any needed changes to the DATAPLOT source code.
  1. The size data sets that Dataplot can handle is determined by several PARAMETER statements in the file "DPCOPA.INC". Specifically, the following limits are defined:

    • MAXOBV - maximum number of observations per variable (default = 20,000)
    • MAXOBW - maximum number of observations total (default = 200,000)
    • MAXPOP - maximum number of points per ploto (default = 40,000)

    If you want to change the default values, read the comments in DPCOPA.INC for details and make the desired changes there. These values are normally changed only if you want to be able to handle larger size data files than the default. We have in fact set these fairly large for a few implementations (e.g., we have a version that handles a maximum of 150,000 observations per variable on an SGI workstation).

  2. Dataplot is written in standard Fortran 77. The one exception is the use of INCLUDE files, which is supported by Unix Fortran compilers.

  3. The machine dependent code for Dataplot is isolated in the file "dp1.f". For convience, several versions of this file are available with changes already made for a particular host. This includes the following:
    • dp1.f - default, set-up for the Sun
    • dp1_sun.f - set-up for the Sun Sparc workstation
    • dp1_convex.f - set-up for the Convex
    • dp1_cray.f - set-up for the Cray Y-MP and C-90 (UNICOS)
    • dp1_rs6000.f - set-up for the IBM RS-6000
    • dp1_linux.f - set-up for the Red Hat Linux g77 compiler
    Unix machines using 32-bit IEEE arithmetic (i.e., most Unix workstations) should be able to use dp1_sun.f without modification.

    The desired file should be copied to dp1.f.

    Hosts that use their own compilers (e.g., the Cray and Convex) are more likely to require a few changes. The following are the relevant changes for Unix machines:

    • The routine INITMC contains machine constants. As long as your host uses 32-bit IEEE arithmetic, the Sun machine constants can be used without modification. If not, INITMC needs to be modified (the Convex and Cray machines have their own machine constants defined).

    • The DPTIME routine returns the current date and time. Unix hosts use the "fdate" library routine for this. The Cray uses a different call (which is activated in dp1_cray.f) and the RS-6000 does not support fdate (the dp1_rs6000.f file simply comments out the fdate call, there is undoubtedly a comparable call, I just haven't bothered to track it down). All other Unix hosts we have tried support the fdate call.

    • The routine DPSYS2 activates the SYSTEM command (which allows you to make a call to the operating system). Unix uses the "system" library call for this. The Cray uses the "ishell" library routine. It is supported by all other Unix hosts that we have tried.

    • The routine CKCLAR extracts arguments from the command line. Unix uses the getarg library call. The Cray uses a different library call. All other Unix hosts we have tried support the getarg routine.
Graphics Device Drivers Support for certain graphics devices requires special attention.
  • X11 - the source files contain an "x11_src.c" and "x11_src.c". You normally want to use the x11_src.c file. There are some "-D" compile switches to address certain issues in the Fortran calling C interface. For most Unix platforms, the default choices work. If you have a problem, read the comments at the beginning of the x11_src.c file. Only use "x11src.f" if you do not have the xlib library on your system (this is simply a file containing dummy subroutines). interface:

  • GD PNG/JPEG - this device driver uses the GD library of Thomas Bouttell to provide PNG (Portable Network Graphics format) and JPEG support. These devices are useful for web applications, importing into word processors, and providing bit map formats that can be converted to other bit map formats.

    There are 2 files: gd_src.f and gd_src.c. The gd_src.f file is a dummy file that is used if you do not want to install this device driver. If you do want to install this device driver, then use gd_src.c and, in addition, download and install the following additional libraries:

    • GD library from Thomas Bouttel
    • JPEG library
    • PNG library
    • ZLIB compression library

    The GD web site contains links to the sites for the three additional libraries. Each of these libraries contains install notes. Follow the directions.

    I generally recommend intially building Dataplot without this device driver. Once everything is working ok, you can go back and try to install these libraries.

    Note that I am using version 1.84 of GD, version 1.1.3 of zlib, version 1.0.9 of PNG, and version 6b of the JPEG library. Your local site may have one or more these libraries already installed. I would recommend using the versions of these libraries listed here as I have not tested the Dataplot implementation of GD with other versions of these libraries.

  • For now, use "gl_src.f" rather than "gl_src.c". I am working on an Open-GL driver. However, it is not ready yet.

  • The Sun CGI and Calcomp device drivers are basically obsolete. The Sun CGI calls are commented out in dp37.f, dp38.f, and dp39.f (lines start with CSUN). The file "dpcalc.for" is a dummy file for the Calcomp driver. If you in fact have a local Calcomp based library that you would like to use, then don't compile dpcacl.f and link with the appropriate Calcomp library.
When you edit the script file, be sure to add the appropriate "-llibname" options to the link command.
Script File for Building Dataplot The next step is to create a command script to compile and link DATAPLOT. For Unix systems, you can either use a makefile or a command script. The file "makefile" is a make file for the Sun Sparc. Makefiles are included for a few other systems as well. One of these files should be easily adapted to other Unix systems. As I have been using script files rather than make files for the last several years, these makefiles may be a little out of date (shouldn't be too hard to edit them to make them up to date).

Alternatively, you can use a shell script file. The file "build_sun" is a sample command script for the Sun. There are sample script files for other systems as well. One of these build files can be easily adapted to other Unix systems (primarily change the line that sets the compile options).

I recommend using the script files

After putting together the script file (or command file), run it to build Dataplot. We recommend putting the resulting executable file in /usr/local/bin/dataplot, but you can in fact put it anywhere that is convenient on your system.

Date created: 6/5/2001
Last updated: 2/28/2008
Please email comments on this WWW page to sedwww@cam.nist.gov.

Dataplot |  Dataplot Downloading |  Unix Downloading |  Executable Files |  Auxillary Files ]