Ptolemy II Installation

See the Ptolemy II 10.0 release notes for details about this release. The instructions on this page concern installing rebuilding Ptolemy II from sources.

Instructions for the impatient

  1. Install JDK1.6 or later, add the jdk bin directory to your path so that javac and java are available, and have the make command available.
  2. Set the PTII environment variable to the top level Ptolemy directory, that is the directory above this directory
    bash (such as Cygwin under Windows)
    export PTII=c:/Ptolemy/ptII10.0.1
    
    csh
    setenv PTII /users/yourname/ptII
    
  3. Run configure
    cd "$PTII"
    rm -f config.*
    ./configure
    
  4. The safest thing to do is to run make fast install on the entire tree:
    make fast install
    
    OR: Install Apache Ant from https://ant.apache.org/ and run
    ant
    cd bin; make
    
    Apache ant is much faster than make.
  5. Start vergil
    $PTII/bin/vergil
    

Requirements

The PTII variable

The PTII environment variable is used to refer to the directory that contains the Ptolemy II tree. Setting PTII is covered in the Unix and Windows sections below.

Java

Ptolemy II has been developed under Java 1.6.0 under Mac OS X and Java 1.7 under Mac OS X and other operating systems. Oracle calls calls Java 1.7 Java SE 7, which is available from http://www.oracle.com/technetwork/java/javase/downloads/index.html. Locally, we use Java 1.7.0_51.

The Java download is available in several formats.

JRE - Java Runtime Environment
Runtime only
If you are planning on only using the prebuilt Ptolemy II actors, you can download the JRE.
JDK - Java Development Kit
Runtime and development tools like the Java compiler javac
If you are planning on writing your own actors or recompiling from sources, download the JDK. If you install the JDK, be sure that the bin directory is in your path so that the javac and java commands are available.

Java Plug-in

The applet tags have been configured to require JDK1.6, so to run the applets in Mozilla 1.x, Netscape 4.7 or Internet Explorer 6.0 under Windows, you will need to use the Java Plug-in from http://www.oracle.com/technetwork/java/index-jsp-141438.html

Currently, the Java Plug-in 1.6 is included in the JRE and JDK downloads for Windows.

If your platform is not supported by the plug-in, you can run the applets with the JDK appletviewer command.

See the Plug-in section of the Ptolemy II Troubleshooting guide for details.

Optional packages that are shipped with Ptolemy

Colt

Colt is the 'Open Source Libraries for High Performance Scientific and Technical Computing in Java'.
For more information, see http://acs.lbl.gov/software/colt/ (Formerly http://hoschek.home.cern.ch/hoschek/colt/)

We include a subset of Colt, based on Colt 1.0.3, in $PTII/lib/ptcolt.jar.

Colt is covered by a Colt specific copyright.

Diva

Diva is a visualization package used by some of the demos and by vergil, the Ptolemy II user interface.

The Ptolemy II distribution includes $PTII/lib/diva.jar.

As of Ptolemy II 4.0, the Diva sources and documentation are included in the source release.

More information about Diva can be found at http://embedded.eecs.berkeley.edu/diva/.

Jython

Jython is a Java implementation of a subset of Python. The PythonScript actor requires Jython.

Usually, one not need install Jython as all Ptolemy II distributions that include the PythonScript actor also include Jython as $PTII/lib/jython.jar. The Ptolemy II source distribution also includes $PTII/lib/jython.jar. Jython is covered by a Jython specific copyright

If, for some reason you want to install Jython by hand:

  1. Download Jython from http://www.jython.org
  2. Follow the instructions in http://www.jython.org/install.html
    Basically, you should do something like
    java -jar jython_installer-2.2.1.jar
    
    and then select the Standalone Jython installation, which will create jython.jar and then install Jython in $PTII/vendors/jython.

    Note that if you don't select the Standalone Jython install, then a set of Jython directories will be created. You should add the directory where Jython was installed to your path.

The configure script will look for jython and jython.jar in your path and then look for $PTII/lib/jython.jar and then $PTII/vendors/jython/jython.jar.

Jacl

Jacl is a 100% Java implementation of Tcl that we use for testing Ptolemy II. Each Java directory contains a test subdirectory that contains Tcl files that use Jacl to test the Ptolemy II Java code.

Jacl is only necessary if you are planning on running the Ptolemy II test suite.

We ship a customized version of Jacl called Ptjacl. The primary difference between Ptjacl and Jacl1.1 is that Ptjacl is shipped as one jar file.

The Ptjacl jar file at $PTII/lib/ptjacl.jar is shipped with Ptolemy II.

For more information about Jacl and Tcl Blend, see:

  • Activestate.com Jacl and Tcl Blend page.
  • Christopher Brooks' Java Page.
  • If you have a read/write account on repo.eecs.berkeley.edu, then the sources for ptjacl are available via svn:
    svn co https://repo.eecs.berkeley.edu/svn-anon/projects/chess/tcl/
    
    or
  • java:: man page
  • Soot

    Soot is used by the Copernicus code generator.

    Soot, is a Java optimization framework from http://www.sable.mcgill.ca/soot/

    If the code generator is present, then we include sootclasses.jar and jasminclasses.jar in $PTII/lib

    Soot and Jasmin are both covered by the Soot and Jasmin specific copyright

    Optional packages not shipped with Ptolemy used at runtime

    The packages below are used at runtime. Parts of the prebuilt Ptolemy II installers use these packages to provide added functionality. For size or licensing reasons, we do not include these packages with the prebuilt Ptolemy releases, so you may want to install these packages if you are interested in using the functionality they provide.

    JAI

    The Java Advanced Imaging (JAI) actors require that JAI, which can be downloaded from http://www.oracle.com/technetwork/java/current-142188.html

    You need not install JAI if you are not planning on using the JAI Actors.

    Note that you probably want to install the JAI "JDK Install".

    We verified that jai-1_1_3-lib-windows-i586-jdk.exe works with these actors.

    Note that under Windows, only a x86 JAI installer is available, so you will may need to copy jar files to the 64-bit jre directory:

    cp c:/Program\ Files\ \(x86\)/Java/jdk1.7.0_51/jre/lib/ext/jai* c:/Program\ Files/Java/jdk1.7.0_51/jre/lib/ext
    cp c:/Program\ Files\ \(x86\)/Java/jdk1.7.0_51/jre/lib/ext/jai* c:/Program\ Files/Java/jre7/lib/ext/
    cp c:/Program\ Files\ \(x86\)/Java/jdk1.7.0_51/jre/bin/mlib* c:/Program\ Files/Java/jdk1.7.0_51/jre/bin
    cp c:/Program\ Files\ \(x86\)/Java/jdk1.7.0_51/jre/bin/mlib* c:/Program\ Files/Java/jre7/bin
    

    Note that under Web Start, we had to install the JAI jar files by hand in c:/Program Files/Java/jre1.6.0_04/lib/ext by copying jai_codec.jar, jai_core.jar, and mlibwrapper_jai.jar from the c:/Program Files/Java/jdk1.6.0_04/lib/ext Web Start users might want to try the "Windows Auto-installation for Java Plug-in"

    Java3d

    The 3-D graphics (GR) domain demos require Java3d, which can be installed from http://www.oracle.com/technetwork/java/javase/tech/index-jsp-138252.html. You need not install Java3d if you are not planning on using GR domain.

    If you plan on recompiling the GR domain, then install the Java 3D SDK and runtime. If you plan on only running the GR domain demos, then installing only the Java 3D runtime should be sufficient.

    You may need to update the jre by hand:

    cp c:/Program\ Files/Java/jdk1.7.0_51/jre/bin/j3dcore-ogl.dll c:/Program\ Files/Java/jre7/bin/
    cp c:/Program\ Files/Java/jdk1.7.0_51/jre/lib/ext/j3*  c:/Program\ Files/Java/jre7/lib/ext/
    cp c:/Program\ Files/Java/jdk1.7.0_51/jre/lib/ext/vecmath.jar  c:/Program\ Files/Java/jre7/lib/ext/
    

    We have verified the demos with the java3d-1_5_1-windows-amd64.exe installer.

    Joystick

    The Joystick actor requires the Joystick interface from http://sourceforge.net/projects/javajoystick/. The Joystick interface works under Windows and Linux. Joystick is covered by a Joystick specific copyright

    You must download and install the Joystick interface to use the Joystick actor.

    Configure looks for the joystick interface in $PTII/vendors/misc/joystick. In that directory, it looks for joystick.jar.

    1. Download the Joystick 0.6 zip file from http://sourceforge.net/projects/javajoystick/
    2. Unzip it in $PTII/vendors/misc
    3. Under Windows, copy the .dll into your path
      cp $PTII/vendors/misc/joystick/lib/jjstick.dll $PTII/bin
      

    JMF

    The Java Media Framework (JMF) actors require that JMF, which can be downloaded from http://www.oracle.com/technetwork/java/javase/tech/index-jsp-140239.html

    You need not install JMF if you are not planning on using the JMF Actors.

    The installer also looks for the USB camera, so you may find it helpful if you connect a USB camera before running the installer. To configure a USB camera after installation, run c:/Program Files/JMF2.1.1e/bin/jmfinit.exe

    Under 64-bit Windows, we copied the jar files and other files into the JRE.

    cp c:/Program\ Files\ \(x86\)/JMF2.1.1e/lib/* c:/Program\ Files/Java/jdk1.7.0_51/jre/lib/ext 
    cp c:/Program\ Files\ \(x86\)/JMF2.1.1e/lib/* c:/Program\ Files/Java/jre7/lib/ext/
    

    We verified that jmf-2_1_1e-windows-i586.exe works with these actors.

    Matlab

    Ptolemy II includes an interface to Matlab that was developed by Zoltan Kemenczy and Sean Simmons of Research in Motion Limited.

    The Matlab interface works only under Windows and it requires that Matlab be installed on the local machine. The Matlab interface has been tested with Matlab 6.1, which corresponds with R12.1.

    The Matlab Expression actor can access Matlab methods to process matrices and plot data using the Matlab plotter.

    A demo can be found at $PTII/ptolemy/matlab/demo/MatlabExpression/MatlabExpression.xml

    Compiling the Matlab interface

    The Matlab interface works under Windows and Linux. In theory, the Matlab interface might work under Solaris, but we have not tested it.

    Under Windows, we compile the Matlab interface with Microsoft Visual C if it is available. Matlab interface has problems work with gcc-3.3 Under Windows, the Matlab interface has problems at runtime with gcc-3.3.
    Under Windows, we recommend using gcc-3.2 or Microsoft Visual C. If you do not have Microsoft Visual C, you can try installing cygwinDevel with gcc-3.2 from https://ptolemy.berkeley.edu/ptolemyII/ptIIlatest/cygwin.htm.

    Note that you should uninstall the previous version of cygwin and then install the new version.
    Below are the instructions for compiling under gcc.

    If you do not have gcc or dlltool installed, you can install them as part of the Cygwin installation

    The Matlab interface is implemented using the Java Native Interface (JNI). When $PTII/configure is run, it look in the user path for a binary called matlab, determines the location of the Matlab extern/include/libeng.dif file and then checks for gcc and dlltool.

    If these components were not found at when configure was run, then you can rerun configure, remake and run the demo with:

    cd $PTII
    rm config.*; ./configure
    cd $PTII/ptolemy/matlab
    make
    $PTII/bin/vergil ./demo/MatlabExpression/MatlabExpression
    

    You might need to edit jni_md.h
    GCC doesn't have a __int64 built-in, and this patch basically uses "long long" instead.
    1. Edit the file jdk_root>/include/win32/jni_md.h, Where jdk_root is the installation root (eg., c:/Program Files/Java/jdk1.6.0_20
    2. Replace the segment:
       typedef long jint;
       typedef __int64 jlong;
       
    with:
       typedef long jint;
       #ifdef __GNUC__
       typedef long long jlong;
       #else
       typedef __int64 jlong;
       #endif
       typedef signed char jbyte;
       

    Quicktime

    The Quicktime GR domain actors use Quicktime from Apple.

    To use these actors, go to https://www.apple.com/quicktime/download/
    (Note that the QuickTime SDK does not include QuickTime For Jav)
    We chose the "Quicktime Standalone Installer", which does not contain iTunes.
    During installation, choose "custom" and then "select all". This drops QTJava.zip into the lib/ext of all your installed JREs. Then you have to copy this zip file to the jre/lib/ext directory of your SDK, for example:

    cp c:/Program\ Files\ \(x86\)/Java/jre7/lib/ext/QTJava.zip c:/Program\ Files/Java/jdk1.7.0_51/jre/lib/ext/
    cp c:/Program\ Files\ \(x86\)/Java/jre7/lib/ext/QTJava.zip c:/Program\ Files/Java/jre7/lib/ext/
    

    RXTX: Serial Port API

    The actor.lib.io.comm actors use the RXTX serial port API from http://mfizz.com/oss/rxtx-for-java.
    RXTX binary builds provided as a courtesy of Mfizz Inc. (http://mfizz.com/). Please see http://mfizz.com/oss/rxtx-for-java for more information.

    Under Windows, download the zip file, then do something like:

    cp ~/src/rxtx/mfz-rxtx-2.2-20081207-win-x64/RXTXcomm.jar c:/Program\ Files/Java/jdk1.7.0_51/jre/lib/ext/
    cp ~/src/rxtx/mfz-rxtx-2.2-20081207-win-x64/RXTXcomm.jar c:/Program\ Files/Java/jre7/lib/ext/
    cp ~/src/rxtx/mfz-rxtx-2.2-20081207-win-x64/*.dll c:/Program\ Files/Java/jdk1.7.0_51/jre/bin
    cp ~/src/rxtx/mfz-rxtx-2.2-20081207-win-x64/*.dll c:/Program\ Files/Java/jre7/bin
    

    Under Mac OS X, see http://jlog.org/rxtx-mac.html. These files should be copied as follows:

    sudo -i
    cp ~yourlogin/Downloads/librxtxSerial.jnilib  /Library/Java/Extensions/
    cp ~yourlogincxh/Downloads/RXTXcomm.jar /Library/Java/Extensions/
    

    Optional Packages not shipped with Ptolemy that are used at compile time

    The packages below are used when Ptolemy II is compiled.
    You need not install these packages if you are running a prebuilt version of Ptolemy II If you install a package after building Ptolemy II, rerun configure
    cd $PTII; rm config.*; ./configure
    
    and then make
    make fast
    

    make

    Ptolemy II uses makefiles to build. We include a subset of the Cygwin tools for Windows, see the Cygwin installation notes.

    Ptolemy II has been built with GNU make 3.77, but does not use GNU make extensions, so GNU make is not requires. Ptolemy II has also been built with Solaris 8 /usr/ccs/bin/make.

    It seems that the make that is included with SGI Irix 6.5 may have problems, the workaround is to installed GNU make.

    JavaCC

    JavaCC is the Java Compiler Compiler, which similar to yacc and lex.

    JavaCC is only necessary if you modify the expression parser in ptolemy/data/expr.

    1. Download javacc-5.0.tar.gz from http://java.net/projects/javacc/downloads
    2. Create $PTII/vendors/sun if necessary
      mkdir -p $PTII/vendors/sun
      
    3. Extract cd $PTII/vendors/sun tar -zxf where_ever_you_downloaded/javacc-5.0.tar.gz
    4. Re run configure:
      cd $PTII; rm config.*; ./configure
      

      Note that JavaCC-4.2 will not work, there are problems with ReInit() in the data.expr tests.

    Rebuilding from source

    Unix

    If you would like to rebuild from the Java sources under Unix, you should set the PTII environment variable in your environment. Under C Shell:
    setenv PTII /users/ptII
    
    You may want to add that line to your ~/.cshrc file.

    To configure the makefiles, run $PTII/configure, which is a GNU autoconf script that looks for your Java compiler, reads in $PTII/mk/ptII.mk.in and generates $PTII/mk/ptII.mk:

    cd "$PTII"
    rm -f config.*
    ./configure
    
    $PTII/configure creates $PTII/config.status and $PTII/config.cache. If you would like to reconfigure Ptolemy II to use a different Java compiler, set your path so that the appropriate compiler is first in your path, then remove config.status and rerun configure. You may also use the --with-java= configure command line argument. For more information, run configure -help.

    To build:

    make fast all
    

    Windows

    Ptolemy II was developed under Windows XP. We have successfully installed Ptolemy II under Windows '98, but if you have problems under Windows '98 we recommend upgrading Windows XP.

    To build Ptolemy II under Windows XP:

    1. Install JDK 1.6 from http://www.oracle.com/technetwork/java/javase/overview/index.html

      Be sure to add the bin directory to your path so that javac and java are available.

    2. Install the Cygwin toolkit from http://sources.redhat.com/cygwin/

      See the Ptolemy II 6.0 Website for Cygwin downloads that include the tools necessary to build Ptolemy II.

      An alternative to using the Cygwin downloads we provide is to download directly from the Cygwin website.

      Complete installation instructions can be found at http://sources.redhat.com/cygwin/faq,

      The Cygwin installer tends to change over time, but below is a summary of the steps necessary:

      1. Create an empty directory
      2. Go to http://cygwin.com/install.html and download and install either the 32-bit or 64-bit version of setup.exe.
        See 32-bit vs. 64-bit for which to select.
      3. Click on setup, then Next
      4. Select Install from Internet, then click on Next
      5. Use the default install root directory, which should be C:\cygwin or C:\cygwin64.
      6. Use the default Local Package Directory, which is probably the Downloads directory in your home directory.
      7. If you are not behind a firewall, click on direct connection, then click Next
      8. Select a nearby mirror, then click Next
      9. You will be presented with a list of packages to install.
        The initial default installs packages from Base, which is roughly a 6Mb download that expands into about 26Mb of files.

        If you are serious about development you may also want to install the packages below. To install an individual package, click on the + to the left of the group name, then click on the arrows to the right of the group name until Default changes to Install

        • Devel Category
          • autoconf - requires gawk and m4 from the Interpreters Category
          • binutils, gcc-core, gcc-g++ make, wget - The matlab interface requires gcc, mingw64-x86_64-gcc-core, mingw64-x86-gcc-g++, mingw64x86_64-runtime and Matlab. You may find it easier to install all of the Devel category
          • subversion
        • Text Category: less Probably already selected by default
    3. Hit Next, which should compute the dependencies, download the packages and install them.
    4. Click on Add icon to Start Menu, and then Finish.
    5. Start up bash with Start -> Cygnus Solutions -> Cygwin Bash Shell
    6. Set the value of the PTII environment variable to the name of the directory where Ptolemy II is installed.

      Executive Summary: Under Windows, it is safest if you use forward slashes in both the Environment Variables panel and when running Cygwin bash. In Cygwin bash, don't use pwd to set your PTII variable.

      Under Windows 8, you set the environment variable via the Control Panel, then search for env and click on Edit environment variables for your account.

      Under older versions of Windows, you set the environment variable via the Environment tab of the System control panel (Start Menu -> Settings -> Control Panels -> System -> Advanced -> Environment Variables)

      The PTII value in the Environment tab should be set using forward slashes.

      If Cygwin is installed in a location other than C:\ such as C:\Cygwin, then try using backslashes, though installing Cygwin in such a manner is not recommended.

      Windows 8 users should set PTII in the Environment Tab using forward slashes.

      Note that when setting PTII from Cygwin bash, you should use forward slashes.

      If you have installed Cygwin in c:/cygwin, and your Ptolemy II installation is in a directory outside of the c:/cygwin tree, then Cygwin may change your PTII variable to include "/cygdrive/c". This will cause problems with non-Cygwin tools like javac that do not understand /cygdrive/c.

      The best fix for this is to move your home directory outside of c:/cygwin. An alternative is to place your Ptolemy II tree outside of c:/cygwin.

      How to tell Cygwin where your home directory is

      1. Cygwin gets the location of your home directory from a line that contains your login in c:/cygwin/etc/passwd. If your login is not listed, then run
        mkpasswd -l
        
        To list all the local accounts and add the line for your account to c:/cygwin/etc/passwd using workdpad. To start wordpad, do Start -> Run and type in wordpad.
        Note: you can use mkpasswd -help to get help. If you are logged in to the domain and not the local machine, try
        mkpasswd -d | grep yourlogin
        
        to get just your login
      2. Edit c:/cygwin/etc/passwd with wordpad and change the home directory from /home/yourlogin to /cygdrive/c/users/yourlogin, which will set your home directory as c:/users/yourlogin
        Savec:/cyginw/etc/passwd
      3. Start up a new bash shell and see where your home directory is by typing pwd

      An example PTII value in the Environment Tab would be:

      c:/Users/yourname/ptII
      

      An example PTII value inside Cygwin bash would be:

      export PTII=c:/users/yourname/ptII
      

      Cygwin directory mapping

      Note that Cygwin remaps directories, so d:\tmp may appear as /cygdrive/d/tmp.

      Unfortunately, the java command does not understand the Cygwin /cygdrive notation, so java may not find the files it needs.

      For example, pwd returns /cygdrive/d/tmp/ptII, which will not work with java:

      cxh@MOWAT-171 /cygdrive/d/tmp/ptII
      $ PTII=d:\\tmp\\ptII
      
      cxh@MOWAT-171 /cygdrive/d/tmp/ptII
      $ echo $PTII
      d:\tmp\ptII
      
      cxh@MOWAT-171 /cygdrive/d/tmp/ptII
      $ cd $PTII
      
      cxh@MOWAT-171 /cygdrive/d/tmp/ptII
      $ pwd
      /cygdrive/d/tmp/ptII
      
      So, under Cygwin, it is best to avoid using pwd when setting variables. Avoid:
      PTII=`pwd`/ptII
      
      and use
      PTII=d:\\tmp\\ptII
      
      instead. Note that the configure script checks for this sort of thing.
    7. In the Environment tab, you should also set your path to include the location of the JDK bin directory (i.e. C:\Program Files\Java\jdk1.6.0_04\bin)

      When you run cygwin.bat, your path should be set to include the Cygwin tools. You can test this by typing type make, which should return

      make is /usr/bin/make
      
      If make cannot be found, then you may also need to add the Cygwin bin directory c:\cygwin\usr\bin to your path.
    8. Optional: Install JavaCC, see the instructions above.
    9. Start up Cygwin bash, and cd to the Ptolemy II directory.
    10. Run rm -f config.*
    11. Run ./configure
    12. Run make fast all
    13. Now type vergil (or $PTII/bin/vergil if you did not set your path) in the C shell or cygwin Bash window and the Ptolemy II GUI should start up

    Currently, Ptolemy II does not support building via Microsoft Visual Studio nmake under Windows. Also, we have not tried building Ptolemy II under Windows '95 or Windows '98.

    The instructions for setting up a parallel tree using CVS can be found in $PTII/doc/coding/develsetup.

    Last Updated: $Date: 2014-12-16 13:52:11 -0800 (Tue, 16 Dec 2014) $