javac
and java
are available,
and have the make
command available.
export PTII=c:/Ptolemy/ptII4.0
setenv PTII /users/yourname/ptII
cd "$PTII" rm -f config.* ./configure
make fast install
$PTII/bin/vergil
PTII
is covered in
the Unix and Windows
sections below.
http://java.sun.com/j2se/1.5/
.
Locally, we used Java 1.4.2_06 and Java 1.5.0_01.
The Java download is available in several formats.
javac
bin
directory is in your path so that
the javac
and java
commands are available.
http://java.sun.com/products/plugin/
Currently, the Java Plug-in 1.5 is included in the JRE and JDK downloads for Windows.
If you are running under Solaris, you can download a separate plug-in or a complete Netscape installation.
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.
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/
.
Usually, one not need install Jython as
all Ptolemy II distributions that include the PythonScript actor
also include Jython as If, for some reason you want to install Jython by hand:
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 For more information about Jacl and Tcl Blend, see
If the code generator is present, then we include
Soot and Jasmin are both covered by the
Soot and Jasmin specific copyright
You need not download the CaffeineMark benchmark unless you are
interested in benchmarking the Copernicus C code generator.
The main page for the CaffeineMark is
You need not download Colt unless you are planning on using
the Colt actors or running the demonstrations in ptolemy/actor/lib/colt.
We verified that Colt 1.0.3 works with these actors.
You need not download the Garbage Collector unless you are
planning on using the Copernicus C code generator.
The configure program looks for the Garbage Collector in
To install the Garbage Collector:
As of 4/03, we were using version 6.1
You need not install JAI if you are not planning on using the JAI Actors.
We verified that JAI 1.1.2_01 works with these actors.
You probably want to install the JAI "JDK Install".
Note that under Web Start, we had to install the JAI jar files
by hand in
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.
We have verified the demos with the Java 3D 1.3.1 SDK (DirectX Version).
Note that JDK1.4.0 requires Java 3D 1.2.1_04 or later. If you run
with Java 3D 1.2.1_03 and JDK1.4.0, the GR demos will fail to initialize
and you will see the message:
You must download and install the Joystick interface to use the
Joystick actor.
Configure looks for the joystick interface in
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 We verified that JMF 2.1.1e works with these actors.
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
The Matlab interface works under Windows and Linux.
In theory, the Matlab interface might work under Solaris, but
we have not tested it.
If you do not have The Matlab interface is implemented using the Java Native Interface
(JNI). When If these components were not found at when configure was run, then
you can rerun configure, remake and run the demo with:
To use these actors, install QuickTime with the "QuickTime For Java"
option from
There is a standalone installer with QuickTime For Java at
The
X10 actors
require the Java serial port communcations package and the X10 package.
For installation instructions, see the
X10Interface class documentation in 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 It seems that the make that is included with SGI Irix 6.5 may have
problems, the workaround is to installed GNU make.
JavaCC is only necessary if you modify the expression parser in
To configure the makefiles,
run To build:
To build Ptolemy II under Windows XP:
Be sure to add the See the
Ptolemy II 4.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
The Cygwin installer tends to change
over time, but below is a summary of the steps
necessary:
If you are serious about development you may also want
to install the packages below. To install an individual package,
click on the The PTII value should be set using back slashes so that javac
gets the right path if you've installed Cygwin in a location
other than 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.
An example PTII value would be:
Note that Cygwin remaps directories, so Unfortunately, the For example, When you run cygwin.bat, your path
should be set to include the Cygwin tools. You can test this
by typing Currently, Ptolemy II does not support building via Microsoft
Visual Studio The instructions for setting up a parallel tree using CVS can be found in
Last Updated: $Date: 2005/02/24 21:02:22 $
$PTII/lib/jython.jar
.
The Ptolemy II source distribution also includes
$PTII/lib/jython.jar
.
Jython is covered by a
Jython specific copyright
Configure looks for http://www.jython.org
http://www.jython.org/install.html
Basically, you should do something like
java -classpath . jython-21
and then install Jython in $PTII/vendors/jython
$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.
$PTII/lib/ptjacl.jar
is shipped with Ptolemy II.
Soot
Soot is used by the code generator.
Soot, is a Java optimization framework from
http://www.sable.mcgill.ca/soot/
sootclasses.jar
and jasminclasses.jar
in
$PTII/lib
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.
CaffeineMark
The CaffeineMark benchmark is used by the Copernicus C code generator.
http://www-sor.inria.fr/~java/tools/cmkit
To install, do
cd $PTII/vendors/cm
# Download http://www-sor.inria.fr/~java/tools/cmkit/embed.zip
jar -xf embed.zip
Colt
Colt is the 'Open Source Libraries for High Performance
Scientific and Technical Computing in Java'.
For more information, see
http://hoschek.home.cern.ch/hoschek/colt/
http://hoschek.home.cern.ch/hoschek/colt/download.htm
$PTII/vendors/misc/colt
$PTII/vendors/misc/colt/colt.jar
to $PTII/lib/
GC
The Copernicus C code generator uses the Boehm Garbarge Collector,
which can be found at
http://www.hpl.hp.com/personal/Hans_Boehm/gc/
$PTII/vendors/gc
.
http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/
cd $PTII/vendors/gc
tar -zxf /tmp/gc.tar.gz
cd gc6.1
./configure --prefix=$PTII
make
make check
make install
Note that under Windows, PTII cannot have a backslash in it or
else make will have problems.
JAI
The Java Advanced Imaging (JAI) actors require that JAI, which can be downloaded from
http://java.sun.com/products/java-media/jai/
c:/Program Files/java/j2re1.4.1_02/lib/ext
by copying jai_codec.jar
, jai_core.jar
,
and mlibwrapper_jai.jar
from the
c:/j2sdk1.4.1_02/jre/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://java.sun.com/products/java-media/3D/
.
You need not install Java3d if you are not planning on using GR domain.
Fail to create back buffer - DDERR_INALIDPARAM
The Java 3D 1.2.1_04 release notes say that this bug:
4470749 Java3D fail to initialize underlying OGL/D3D library in jdk1.4
was fixed in Java 3D 1.2.1_04
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
$PTII/vendors/misc/joystick
. In that directory,
it looks for joystick.jar
.
http://sourceforge.net/projects/javajoystick/
$PTII/vendors/misc
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://java.sun.com/products/java-media/jmf/
c:/Program Files/JMF2.1.1e/bin/jmfinit.exe
Matlab
Ptolemy II includes an interface to Matlab that was
developed by Zoltan Kemenczy and Sean Simmons of
Research in Motion Limited.
$PTII/ptolemy/matlab/demo/MatlabExpression/MatlabExpression.xml
Compiling the Matlab interface
gcc
or dlltool
installed, you can install them as part of the
Cygwin installation
$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
.
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.
jdk_root>/include/win32/jni_md.h
,
Where jdk_root
is the installation root (eg.,
c:/Program Files/Java/jdk1.5.0_01
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.
http://developer.apple.com/quicktime/qtjava/
http://www.apple.com/quicktime/download/standalone/
(This page seems to have problems with Firefox, try IE).
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/java/j2re1.4.2_04/lib/ext/QTJava.zip c:/j2sdk1.4.2_04/jre/lib/ext
X10
X10 is a protocol used to control household electrical devices.
$PTII/ptolemy/actor/lib/x10/X10Interface.java
.
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.
/usr/ccs/bin/make
.
JavaCC
JavaCC is the Java Compiler Compiler, which similar to yacc
and lex
.
ptolemy/data/expr
.
javacc-3.2.tar.gz
from
http://javacc.dev.java.net/http://javacc.dev.java.net/
$PTII/vendors/sun
if necessary
mkdir -p $PTII/vendors/sun
cd $PTII; rm config.*; ./configure
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.
$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
.
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.
http://java.sun.com/j2se/1.4/
bin
directory
to your path so that javac
and java
are available.
http://sources.redhat.com/cygwin/
http://sources.redhat.com/cygwin/faq
,
http://sources.redhat.com/cygwin/setup.exe
and save it in the empty directory
setup
, then Next
Install from Internet
, then
click on Next
c:/cygwin
If you select Unix instead of DOS, then you will likely have
Cygwin CR/NL problems with CVS.
Next
button.
Next
Next
The initial default installs packages from Base
,
which is roughly a 6Mb download that expands into about 26Mb
of files.
+
to the left of the group name, then
click on the arrows to the right of the group name
until Default
changes to Install
Next
, which should download the packages and
install them
Add icon to Start Menu
, and then
Finish
.
Start
-> Cygnus Solutions
->
Cygwin Bash Shell
PTII
environment variable
to the
name of the directory where Ptolemy II is installed.
Under Windows XP, you set the environment variable via
the Environment tab of the System control panel
(Start Menu
-> Settings
->
Control Panels
-> System
->
Advanced
-> Environment Variables
)
C:\
such as C:\Cygwin
.
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.
How to tell Cygwin where your home directory is
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
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
pwd
c:\users\yourname\ptII
Cygwin directory mapping
d:\tmp
may appear as /cygdrive/d/tmp
.
java
command
does not understand the Cygwin /cygdrive
notation,
so java
may not find the files it needs.
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.
C:\j2sdk1.4.1_01\bin
)
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.
bash
, and cd to the Ptolemy II directory.
rm -f config.*
./configure
make fast all
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
nmake
under Windows. Also, we have not
tried building Ptolemy II under Windows '95 or Windows '98.
$PTII/doc/coding/develsetup
.