There are at least three ways to build your own pigiRpc
, depending on the kind of extensions you are making. The first way uses src/pigiExample
, and it is intended for users who just need to add new stars. The second and third ways use the mkPtolemyTree
script and csh aliases and are for users that are creating new domains or making other more extensive changes.
If you want to extend Ptolemy by modifying or adding a new scheduler, target, or even an entire domain, it is recommended that you create a duplicate directory hierarchy. This allows you to experiment with and fully test any changes separately, rather than incorporating them into the "official" version of Ptolemy. This way, your experimentation will not interfere with other Ptolemy users at your site, and your changes will not be overwritten by future installations of Ptolemy releases. It also means that all of the existing makefiles will work without modification because all of the paths specified are relative to the root of the hierarchy.
The most direct way to do this is to copy the entire Ptolemy hierarchy. This could be done with a command such as:
mkPtolemyTree
and the csh aliases can help you setup these symbolic links.$PTOLEMY/src/pigiExample.
In the example below, we assume that $PTOLEMY
and $PTARCH
are set and that you have write permission to the Ptolemy source tree. If you don't have write permission, you can set up a parallel tree with the Unix ln
-s
command. If, for example, the Ptolemy tree was at /users/ptolemy
, but you wanted to build under ~/pt
, you could do the following to create the directory and create symbolic links for the dot files, like .cshrc
, and create symbolic links for the other files and directories in the distribution:
Continuing with our example of how to build a pigiRpc
that includes your own stars:
pigiRpc
. PigiRpc
depends on .o
files under $PTOLEMY/obj.$PTARCH
, so you must do a basic build. To build all the .o
files, type:
override.mk
file, you can reduce the build time by building only the functionality you need. See
"Using mkPtolemyTree to create a custom Ptolemy trees" on page 1-9 for more information.
$PTOLEMY/src/pigiExample/make.template
. Add your stars to LOCAL_OBJS
and PL_SRCS
.
cd
to $PTOLEMY/obj.$PTARCH/pigiExample
and type:
makefile
from the
make.template
. You will see messages something like:
$PTOLEMY/obj.$PTARCH/pigiExample
, type
pigiRpc
executable with your own stars statically linked in. If later you add a new star, you should modify the symbols OBJS
and PLSRCS
in make.template
to include it, and repeat the above procedure.
pigiRpc
with SDFMyStar.o
, you can test your pigiRpc
by starting up with:
PIGIRPC
environment variable to the name of the binary you just built:
pigi
, your new executable will be used instead of the standard one. To revert to using the installed pigiRpc
, just type
pigiRpc
to be the default pigiRpc
, you can install it in $PTOLEMY/bin.$PTARCH
, but this will wipe out whatever pigiRpc
is in that directory
With the same makefile, you can make a version of the pigiRpc
program that has debug symbols. Just type:gdb
is in your path, specify the executable as follows:pigi
as follows:pigiRpc
, just type$PTOLEMY/mk/ptbin.mk
and $PTOLEMY/mk/stars.mk
, need to be modified to include your own code. Building your own pigiRpc
, ptcl
or tysh
this way requires extensive knowledge of the Ptolemy directory tree structure and makefiles, but if you are doing serious development in Ptolemy, you will need to know this anyway.
Warning: If you have write permission in the directory where Ptolemy is installed, make sure to modify the place where "make install" puts the completed executable, or it will attempt to overwrite the pigiRpc
in the Ptolemy installation, and other users may be upset with you if you succeed in doing that. (If you are using the makefile from $PTOLEMY/src/pigiExample
, you do not need to worry about this because "make install" has been removed from that makefile.) The simplest thing to do is to replace the line in the makefile
:
pigiRpc
in whatever directory you make it even if you type: