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
suitable quality.
Instructions for setting up your parallel tree can be found at
http://chess.eecs.berkeley.edu/ptexternal/
.
Below are the steps necessary to rename an actor:
svn mv foo/Bar.java bif/Boo.java
foo/makefile
)bar/makefile
)snv commit -m "Moved Bar from foo to bif and renamed it to Boo." foo/Bar.java bif/boo.java foo/makefile bif/makefile
svn mv
.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/configure
looks for these packages in places like $PTII/vendors
.
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 ptII/vendors
.
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,$PTII/pom.xml
.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
$PTII/configure
.
During the build process, users run
$PTII/configure
which
reads in
$PTII/mk/ptII.mk.in
and substitutes in makefile variables and creates
$PTII/mk/ptII.mk
.
In addition, $PTII/configure
reads in $PTII/build.xml.in
and produces $PTII/build.xml
,
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.in
and 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.in
and 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
. See
$PTII/vendors/README.txt
for information about naming conventions. The configure
script should look in $PTII/vendors
for
the external package.cd $PTII rm -f config.status config.cache; autoconf; ./configureuntil you get the settings in
ptII.mk
right.PTKVM_DIR
makefile variable in the makefile
above your package to determine whether make runs
in your Ptolemy II code.
$PTII/ptolemy/apps/kvm
requires
that kvm be present to compile. configure
sets
the PTKVM_DIR
makefile variable to kvm
if the kvm package was found.
$PTIIptolemy/apps/makefile
uses PTKVM_DIR
in the DIRS
variable
to select whether make goes into the kvm
subdirectory:
# $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_CLASSES
to
set the CLASSPATH:
CLASSPATH="$(ROOT)$(CLASSPATHSEPARATOR)$(KVM_CLASSES)"If you need access to a binary in the external package tree, use the
KVM_DIR
makefile variable.package-license.htm
file 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.java
and add the class name of the primary class of the third
party package and the path to the
package-license.htm
file.
in GenerateCopyrights.java
add 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
$PTII/.classpath.default
./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.$PTII/doc/makefile
XXX_PACKAGES
makefile variable in $PTII/mk/ptII.mk that lists the Ptolemy
packages that are compiled. This variable XXX_PACKAGES
variable is passed to javadoc
to generate documentation. Typically, the package is added to the ALLPACKAGES
variable.$PTII/mk/jnlp.mk
$PTII/makefile
and WebStart. Typically, the jar file for the ptolemy directory is added under FULL_ONLY_JNLP_JARS
adm/gen-N.M/ptIIN_M_devel_setup_windows.xml
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
to $PTII/pom.xml
so
that maven knows about it.
maven packagename
will find the xml.$PTII/pom.xml
mvn compile
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?
When configure
runs, it also reads in
$PTII/bin/ptinvoke.in
and generates
$PTII/bin/ptinvoke
. When make is run in the
bin directory, ptinvoke
is copied to the various
startup scripts like vergil
and ptolemy
.
Note that all the startup scripts share a common body and
use a switch statement to select the appropriate jar files
at runtime.
ptinvoke.in
issues:
ptolemy
switch 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.$PTII/bin/makefile
.Last Updated: $Date: 2014-10-23 21:17:40 -0700 (Thu, 23 Oct 2014) $