Installing Ptplot

Ptplot is distributed in several formats.
  • The first format is the usual tar file and zip file format.
  • The second format is an experimental format using the Installshield JShield installer.
  • Ptplot Installation under Unix or Windows with Cygwin from tar or zip files

    Ptplot is shipped with the java files precompiled, so you need not recompile. However, if you are using the standalone scripts such as ptplot, then you may want to go through the installation procedure so that the standalone scripts are properly localized.

    If you are using Windows and you want to rebuild Ptplot or localize the standalone scripts, then you will need to install the Cygwin toolkit from http://sourceware.cygnus.com/cygwin/ so that you can run /bin/sh and make. If you are running Windows and do not want to install the Cygwin toolkit, then see Using Ptplot under Windows without Cygwin

    Below are the installation instructions for Unix and Windows with Cygwin.

    1. Be sure that JDK1.2 is installed, and that javac is in your path.
    2. Untar or unzip the Ptplot distribution.
    3. Set the PTII environment variable to point to the top of the Ptplot tree. Under C-shell, one would do:
      setenv PTII ~/src/ptplot3.1
      
    4. cd into the PTII directory:
      cd $PTII
      
    5. Run configure
      ./configure
      
    6. Run make
      make
      
    7. View the applets by going starting your browser and going to: ptolemy/plot/doc/index.htm

    Installshield Installer

    Ptplot is also available in several self-extracting formats that were created with the Installshield JShield tool.

    Our use of this tool is still experimental. If you have problems, please try the tar or zip files.

    Note that when you run the installer under Windows, Ptplot is added to your Start menu under Ptolemy -> Ptplot.

    Installshield limitations

  • When the Installer Applet is run under Windows, the Installer Window is not listed in the Windows Start Bar.
  • The File browser does not work very well. Installshield says that this is because we are using JDK1.2. The standalone applications require JDK1.2 so that they can use Swing. Note that the applets can still be run with JDK1.1.x, so we don't require JDK1.2.
  • Installing Ptplot in a directory whose pathname has a space in it seem to cause problems with the start up scripts.
  • If you choose the Microsoft jvm, which sometimes found at c:\winnt\jview, then the format window will not come up. This is probably because the format window uses Swing facilities that are not in jview
  • Ideally, Ptplot should be installed on machines with JDK1.2. It is best if you install Java before installing Ptplot. However The Installshield applet installer can download and install a JRE for you. Usually the JRE that can be downloaded via the Installshield applet installer is JDK1.1.7B. We were able to substitute in the JRE 1.2.2 .exe file so that under Windows, JRE1.2.2 is properly installed. However, we were not able to get this to work under Solaris, it appears that the JRE1.2.2 installation hangs part way through the installation. As a result, JRE1.1.7B is the JRE that is optionally downloaded for Sparcs.
  • The InstallShield installer places the ptplot, histogram and pxgraph startup scripts in the toplevel ptplot3.1 directory rather than placing them in ptplot3.1/bin
  • Notes about building and installing

    How does configure work?

    configure is a /bin/sh script that determines some information about your environment and then modifies a few files. When the configure script is run, it reads in mk/ptII.mk.in and ptolemy/plot/ptplot.in generates mk/ptII.mk and ptolemy/plot/ptplot

    To get help with configure, try

    ./configure --help
    

    configure reads in the .in files and substitutes strings inside the @

    For example, configure reads in ptolemy/plot/ptplot.in and

    PTII_DEFAULT=@PTII_DEFAULT@
    PTJAVA_DIR=@PTJAVA_DIR@
    
    becomes
    PTII_DEFAULT=/users/cxh/ptII
    PTJAVA_DIR=/usr/java1.1
    

    Using Ptplot under Windows without Cygwin

    Below are the instructions for using Ptplot if you are under Windows and you do not have the Cygwin and have downloaded the tar or zip files.
    1. Set the PTII variable to the top-level directory of the Ptplot tree.
      C:\ptplot3.1> PTII=c:\ptplot3.1
      
      PTII is used by the standalone ptplot.bat script and other scripts
    2. Be sure that java is in your path by running java -version
    3. Added %PTII\bin to your PATH.
    4. Run ptplot.in
    Usually, it is not necessary to recompile the Ptplot classes, but below are the instructions for recompiling by hand under Windows without Cygwin.
    1. To compile the Ptplot Java classes, they must be in the directory ptolemy\plot.
      C:\ptplot3.1> cd ptolemy\plot
      
    2. set your CLASSPATH to ..\..
      C:\ptplot3.1\ptolemy\plot>set CLASSPATH=..\..
      C:\ptplot3.1\ptolemy\plot>echo %CLASSPATH%
      ..\..
      
    3. Remove the old Java files and compile them
      C:\ptplot3.1\ptolemy\plot>del  *.java *\*.java
      C:\ptplot3.1\ptolemy\plot>javac *.java
      
    4. Run ptplot.bat, which reads %PTII%
      C:\ptplot3.1\ptolemy\plot>ptplot.bat
      

    Installing Ptplot as an applet

    Ptplot includes several jar files, which are collections of Java .class files
    plotapplet.jar
    .class files necessary for simple JDK1.1 browser applets - no pxgraph, no plotml.
    pxgraphapplet.jar
    .class files necessary for simple JDK1.1 browser applets with pxgraph classes, no plotml. Applets that use the pxgraphargs applet parameter should use this jar file.
    plotmlapplet.jar
    .class files necessary for PlotML applets - includes com/microstar/xml and the plotml code, but does not include pxgraph, or PlotFrame.
    plot.jar
    The standard Ptolemy II jar file that includes the ptolemy/plot/*.class files and the class files in plotml and compat. Does not include com/microstar/xml or ptolemy/gui. plot.jar is used by the Ptolemy II build system.
    plotapplication.jar
    .class files necessary for standalone applications - includes com/microstar/xml, ptolemy/gui and the plotml code, but does not include pxgraph. If plotapplication.jar is present, then it is used by the standalone scripts (ptplot etc.)
    The best way to use Ptplot as an applet is to copy the appropriate *applet.jar file into the same directory as your applet, and then to use the archive applet directive. For examples of applet html code, see the demonstrations.

    Installing Ptplot as an application

    Under Unix and Windows with the Cygwin toolkit, ptplot can be run as three standalone applications:
  • ptplot - A modern plot application that with a menubar and such.
  • histogram - A histogram plot application
  • pxgraph - A plot application that is mostly backward compatible with the older X11 pxgraph program
  • When configure is run, it substitutes variables inside ptplot.in and produced ptplot. The ptplot script is shared between the standalone applications, ptplot determines what name it was called with, and selects the appropriate class accordingly.

    If the ptplot script is run, then ptolemy.plot.PlotApplication is run

    If the ptplot script is copied to histogram, then ptolemy.plot.plotml.HistogramMLApplication is run

    If the ptplot script is copied to pxgraph, then ptolemy.plot.compat.PxgraphApplication is run

    Under Unix, you can use a hard link to create the histogram and pxgraph script:

    ln ptplot histogram
    ln ptplot pxgraph
    

    Under Windows, three .bat scripts are provided: ptplot.bat, histogram.bat and pxgraph.bat

    Last Updated: $Date: 1999/08/20 15:58:52 $