We also include notes about various configuration management issues.
gigascale.eecs.berkeley.edu. Access to the Ptolemy CVS
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://www.gigascale.org/ptexternal/
mkdir ~/public_html/privateAn alternative name is
~/public_html/local
.htaccess file that limits access:
cd ~/public_html/private ln -s /usr/local/apache/htaccess/ohmCluster .htaccess
ln -s ~/ptII .
cvs delete -f Foo.java cvs commit -m "Moved Foo to new directory blah" Foo.java makefile
cd blah cvs add Foo.java cvs commit -m "Moved Foo from oldblah directory" Foo.java makefile
cd $PTII make glimpse glimpse -H $PTII Foo
ptII/vendors, which we do not distribute.
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 cvs).
For example, JHDL is a large package that is used
by the code generator.
$PTII/vendors/jhdl/README.txt would desribe how to
get JHDL. In this case, it says to use cvs so
that $PTII/vendors/jhdl/ptjhdllib is created.
$PTII/configure would then be modified to
look $PTII/vendors/jhdl/ptjhdllib for the pieces that it
needs.
$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:
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.
For example, $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.
$PTII/build.xml.in,
rerun ./configure and ant until
$PTII/build.xml is correct.configure.in, lines like
updateClasspath "$CALTROP_DIR/ptCal.jar"update both the ant and Eclipse classpaths.
$PTII/lib/*-license.htm files for examples. Determine
the license and create a *-license.htm file. Be
sure to update the makefile.
about:copyright to list copyrights.
For this system to work, a class in the jar file must be added
to $PTII/ptolemy/actor/gui/GenerateCopyrights.java.
For example,
_addIfPresent(copyrightsMap, "com.sun.jna.Pointer",
"lib/jna-license.htm");
Add a similar line for your jar file and test that it works by
viewing the copyrights from within the Vergil help menu.
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
Also, you will need to update $PTII/.classpath.default
and $PTII/.classpath.in for Eclipse users.
In Kepler, you will need to modify these files:
kepler/build-area/resources/eclipse/PtolemyClasspath
kepler/build-area/resources/idea/PtolemyModule
kepler/build-area/settings/ptolemy-excludes
Last Updated: $Date: 2012-11-01 19:47:52 +0100 (Thu, 01 Nov 2012) $