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: ~/mypt
.
~/override.mk
that contains:
$PTOLEMY/mk/ptbin.mk
contains a list of the makefile variables that can be set to bring in the various domains.
$PTOLEMY
to point to the Ptolemy distribution, in this example, the Ptolemy distribution is at /users/ptolemy:
$PTARCH
to the appropriate value:
mkPtolemyTree
command so that the override.mk
file is used to create a custom tree in the ~/mypt
directory.
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:
$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:
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.
$PTOLEMY
tree are copied over if the directory exists using tar
(to save modification times).
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.
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.
override.mk
files are constructed that reference NEW_ROOT
/mk/override.mk
specific to tysh
, ptcl
and pigiRpc
.
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
.
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:
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.
$PTOLEMY/mk/ptbin.mk
and $PTOLEMY/mk/stars.mk
files.
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
SDF
or CG56
to 1 in your override.mk
. If you happen to have an environment variable called SDF
or CG56
, this procedure fails because the rule in stars.mk
just checks whether the variable is defined or not, not what value it has. So, ensure that you have no environment variables that clash with the variables used in override.mk
.
stars.mk
, not only check whether a variable like SDF
is defined, but also check its value.mkPtolemyTree
gives you the following message:
/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.mkPtolemyTree
cannot add new directories to an already existing tree, it can only be used to create a brand new parallel tree.
MAKEARCH
may fail when used with a tree that was created with mkPtolemyTree
, since MAKEARCH
may follow symbolic links into the master tree, where the user does not have write permission.
mkPtolemyTree
requires that the master Ptolemy tree have a fully expanded obj.$PTARCH
directory. Otherwise you will get an error about `no sources rule found'.