This page describes how local developers setup parallel development trees. The information below is primarily for use by developers at U.C. Berkeley. Remote sites doing Ptolemy II development may want to emulate the U.C. Berkeley developer setup.
We also include notes about various configuration management issues.
Currently, the Subversion (SVN) Repository for the Ptolemy II tree is on
repo.eecs.berkeley.edu. The Ptolemy II Subversion
repository is world-readable. Write access to the Ptolemy Subversion
Repository is by invitation only. We consider software releases a
form of publication, so we would like to be sure our software is of
Instructions for setting up your parallel tree can be found at
Below are the steps necessary to rename an actor:
svn mv foo/Bar.java bif/Boo.java
snv commit -m "Moved Bar from foo to bif and renamed it to Boo." foo/Bar.java bif/boo.java foo/makefile bif/makefile
There are several types of external, third party packages
$PTII/lib. These packages are freely available, not too large and have BSD compatibile license. These packages are distributed with Ptolemy II releases.
$PTII/vendors. These packages may have more restrictive licenses, be large, or are of limited use. These packages are not distributed with the Ptolemy II release.
$PTII/configurelooks for these packages in places like
Not all users will have these packages installed, so the build and runtime environment needs to allow users to build with and without the external packages and to have the external packages in different locations.
Packages that are large or have restricted copyrights (such as GPL)
should go into
In general, do not add GPL'd code to the repository.
See What is the copyright and license? in the Ptolemy II FAQ.
Large packages should optionally be placed in a separate repository
and a directory in
$PTII/vendors should be created
that contains a
README.txt file that describes how
to obtain the package (either by download or by using version control (cvs, svn, git etc.).
Adding a third-party package involves changes in several places:
$PTII/configure, which creates configuration files for make, ant and Eclipse,
Each of the above is described below.
The Ptolemy Java classes that use a third party package typically go into a directory that shares the name of the package. The reason is that it is helpful to group dependencies so that if a configuration does not need to use functionality provided by a third party package, then it is easy to exclude.
For details, see the Checklist for creating a new directory at the end of the Ptolemy Coding Style document.
During development, we use GNU autoconf to read in
$PTII/configure.in to generate
During the build process, users run
and substitutes in makefile variables and creates
which is used by ant and the nightly build.
The primary method is to look for a directory that contains the external package. Another method is to compile a program that uses the package and see if it works. Usually, all you need to do is to try to compile a file that imports the package. The javasound and java3d portions of configure.in try to compile files from $PTII/conf that contain the appropriate import statements.
Below is a rough outline of the steps necessary to add a package. by looking for a directory. In general, your best bet is to find a similar package that has already been added and mimic that setup.
$PTII/mk/ptII.mk.inand add three variables for your package:
# KVM is the JDK for PalmOS, see # http://java.sun.com/products/kvm KVM_CLASSES = @KVM_CLASSES@ # Directory that contains the kvm used by PalmOS KVM_DIR = @KVM_DIR@ # Set to kvm and used in $PTII/ptolemy/makefile if the PalmOS KVM was found PTKVM_DIR = @PTKVM_DIR@
$PTII/configure.inand add a new section for your package. It is easiest to copy a section for an existing package. There are many small design decisions to be made here:
configure.in, lines like
updateClasspath "$CALTROP_DIR/ptCal.jar"update both the ant and Eclipse classpaths.
$PTII/vendors/README.txtfor information about naming conventions. The configure script should look in
$PTII/vendorsfor the external package.
cd $PTII rm -f config.status config.cache; autoconf; ./configureuntil you get the settings in
PTKVM_DIRmakefile variable in the makefile above your package to determine whether make runs in your Ptolemy II code.
$PTII/ptolemy/apps/kvmrequires that kvm be present to compile.
PTKVM_DIRmakefile variable to
kvmif the kvm package was found.
DIRSvariable to select whether make goes into the
# $PTII/configure looks for various packages and sets variables # in $PTII/mk/ptII.mk if these packages are found, otherwise # the variables are empty # # PTKVM_DIR is set to kvm by configure if the kvm runtime was found # PTLEGO_DIR is set to lego if the commapi was found. # PTWABA_DIR is set to waba if waba was found # DIRS = agilent $(PTKVM_DIR) $(PTLEGO_DIR) $(PTWABA_DIR)
KVM_CLASSESto set the CLASSPATH:
CLASSPATH="$(ROOT)$(CLASSPATHSEPARATOR)$(KVM_CLASSES)"If you need access to a binary in the external package tree, use the
package-license.htmfile that describes the copyright and license for the third party package. This file should be in the same directory as the Java class that uses the third party package.
$PTII/ptolemy/actor/gui/GenerateCopyrights.javaand add the class name of the primary class of the third party package and the path to the
GenerateCopyrights.javaadd something like:
_addIfPresent(copyrightsMap, "com.sun.jna.Pointer", "lib/jna-license.htm");Add a similar line for your jar file and test that it works by compiling, invoking Vergil and selecting Help | About
./configure. If the jar file is in
$PTII/lib, then add it to the list of jar files. If the jar file is in vendors or elsewhere, then exclude the directory.
XXX_PACKAGESmakefile variable in $PTII/mk/ptII.mk that lists the Ptolemy packages that are compiled. This variable
XXX_PACKAGESvariable is passed to
javadocto generate documentation. Typically, the package is added to the
$PTII/makefileand WebStart. Typically, the jar file for the ptolemy directory is added under
Since Kepler uses Ptolemy II, it is best to update the Kepler files that exclude Ptolemy II third party directories. See https://kepler-project.org/developers/reference/update-ptolemy-third-party-package-dependencies
To check your work, download and build Kepler under Eclipse.
In addition, the dependency must be added
that maven knows about it.
maven packagenamewill find the xml.
If there is no public Maven repository for the jar, then it will need to be added to http://chess.eecs.berkeley.edu/ptexternal/src/maven/. See How do I update workgroup pages using SVN?
configure runs, it also reads in
$PTII/bin/ptinvoke.in and generates
$PTII/bin/ptinvoke. When make is run in the
ptinvoke is copied to the various
startup scripts like
Note that all the startup scripts share a common body and
use a switch statement to select the appropriate jar files
ptolemyswitch section. The ptolemy command should not require non-standard packages that we do not ship. The right solution is to add another switch section that uses your package.
Last Updated: $Date: 2014-10-23 21:17:40 -0700 (Thu, 23 Oct 2014) $