Top Up Prev Next Bottom Contents Index Search

1.4 Using mkPtolemyTree to create a custom Ptolemy trees


In Ptolemy 0.6 and later, there are two methods of building custom Ptolemy trees that have a user selected set of domains: csh aliases and the mkPtolemyTree script. This section discusses the mkPtolemyTree script, see "Using csh aliases to create a Parallel Software Development Tree" on page 1-12 for an alternative method of creating a parallel tree.

In Ptolemy 0.6 and later, the mkPtolemyTree script and a user supplied override.mk file to create an entire custom object tree. The tree will have copies of all Ptolemy directories on which the customized installation depends. The script will also set up the override.mk files needed to build custom pigiRpc, tysh and ptcl binaries. Since mkPtolemyTree runs very fast, you may avoid having to recompile the entire Ptolemy tree, which can take 3 hours on a fast workstation.

1.4.1 mkPtolemyTree example

The mkPtolemytree command usage is:

mkPtolemyTree override.mk_file root_pathname_of_new_tree For example, say that you wanted to build a tree that only has the VHDL domain in
~/mypt.

1. One would create a file called ~/override.mk that contains:
VHDL=1
DEFAULT_DOMAIN=VHDL
VERSION_DESC="VHDL only"
The file $PTOLEMY/mk/ptbin.mk contains a list of the makefile variables that can be set to bring in the various domains.
2. Set $PTOLEMY to point to the Ptolemy distribution, in this example, the Ptolemy distribution is at /users/ptolemy:
setenv PTOLEMY /users/ptolemy
3. Set $PTARCH to the appropriate value:
setenv PTARCH `$PTOLEMY/bin/ptarch`
4. Set the path properly:
set path = ($PTOLEMY/bin $PTOLEMY/bin.$PTARCH $path)
5. Execute the mkPtolemyTree command so that the override.mk file is used to create a custom tree in the ~/mypt directory.
mkPtolemyTree ~/override.mk ~/mypt In general, you will want to define the variables TK and HOF. Setting TK indicates that you want to include Tcl/Tk extensions to the domains. Setting HOF means that you want to include the higher-order functions domain. The higher-order functions domain is used in many demonstrations to configure stars with multiple portholes and to specify scalable systems. So, adding these make variables in the same override.mk file would make it look like the following:

HOF=1
TK=1
VHDL=1
DEFAULT_DOMAIN=VHDL
VERSION_DESC="VHDL only"

1.4.2 How mkPtolemyTree works

To accumulate a list of the directories necessary to build a custom tree, $PTOLEMY/src/stars.mk contains a makefile variable named CUSTOM_DIRS. In stars.mk, each feature, such as VHDL adds directories to CUSTOM_DIRS. Also a feature can require sub-features, and the sub-features can add directories to CUSTOM_DIRS. For example, VHDL requires CG, and CG adds more directories to CUSTOM_DIRS.

When you run $PTOLEMY/bin/mkPtolemyTree, the following events occur:

1. From the override.mk file that the user specifies, the script builds a tree with the directories as specified the value of the CUSTOM_DIRS makefile variable.
2. Next, the files in the $PTOLEMY tree are copied over if the directory exists using tar (to save modification times).
3. For each directory specified by CUSTOM_DIRS, we create symbolic links to all the directories that we have not expanded from the $PTOLEMY tree the make.template and makefile symbolic links in the obj directories are set correctly.
4. The override.mk file is copied into the new tree as NEW_ROOT/mk/override.mk, where NEW_ROOT is the root path name of the tree we are constructing.
5. override.mk files are constructed that reference NEW_ROOT/mk/override.mk specific to tysh, ptcl and pigiRpc.
6. make install is run in NEW_ROOT/obj.$PTARCH/ which creates the hard link for the libraries in NEW_ROOT/lib.$PTARCH and builds the custom tysh, ptcl, and pigiRpc. This new tree has all the symbolic links and directories necessary to act as a full-fledged Ptolemy tree. You should be able to set your PTOLEMY environment variable to this new tree and pigi will run your custom pigiRpc binary.

Currently the Tcl libraries and Tycho are not expanded but are accessible via symbolic links. To have the utility expand the $PTOLEMY/lib/tcl directory, add the following line to your override.mk file:

CUSTOM_DIRS += $(CROOT)/lib/tcl To expand Tycho, consult the Tycho documentation and use the tylndir script.

There is no documentation of the variables to pull in each domain yet. In general, it is the standard abbreviation for the domain in capital letter. For example, the Synchronous Dataflow (SDF) domain is SDF, the Discrete-Event (DE) domain is DE, and so forth. Some of the domains are split up, the entire domain can be brought in by defining FOOFULL (e.g., SDFFULL or CGCFULL). When defined, they include all of the SDF and CGC functionality, respectively, whereas SDF and CGC include only the basic functionality. The basic version of the SDF domain does not include the image, matrix, Matlab, DSP, and Tcl/Tk stars. If you are attempting to build a pigi that includes the Process Network (PN) domain, then you should add the following to your override.mk file.

INCLUDE_PN_DOMAIN = yes For a listing of the possible make variables, refer to the $PTOLEMY/mk/ptbin.mk and $PTOLEMY/mk/stars.mk files.

1.4.3 Combining mkPtolemyTree and pigiExample

It is possible to use the override.mk file used by mkPtolemyTree in the pigiExample directory to create a custom pigiRpc with user added stars. One reason for doing this would be to that on some platforms, stars that have been incrementally linked are not visible from the debugger. Creating a custom pigiRpc with the star as a built in star can aid debugging.

After running mkPtolemyTree, edit $PTOLEMY/src/pigiExample/make.template and add your stars as described in "Creating a pigiRpc that includes your own stars" on page 1-7.

1.4.4 Known Bugs in mkPtolemyTree

Making a customized Ptolemy development tree using the version of
Ptolemy installed in the directory /users/ptolemy
The new customized Ptolemy tree will go in /users/cxh/mypt
mkdir: illegal option -- n
mkdir: usage: mkdir [-m mode] [-p] dirname ...

The try setting your path so that /usr/ucb is before /usr/bin. The problem here is that in Ptolemy 0.7, the mkPtolemyTree script uses the -n option with echo, which is not portable.


Top Up Prev Next Bottom Contents Index Search

Copyright © 1990-1997, University of California. All rights reserved.