

The complete version of Ptolemy for Linux can be found on:
	cnuce_arch.cnr.it (131.114.1.10): pub/Linux-local/ptolemy

This was the README file included in this version:



Ptolemy 0.5 for Linux		Alberto Vignani		Apr 18,1994
-----------------------------------------------------------------------------


This is my port of Ptolemy 0.5 to Linux.

It includes:
	- most of the sources from the Berkeley version, updated with
	  the latest patches (Apr.14,1994)
	  (I've left out xv and tcl/tk, which are normally included in
	   the Linux distributions)
	- the user manual
	- the hash/btree sources, from the BSD C library
	- the play program (renamed ptplay)
	- the Linux executables
	- some extra configuration files (e.g. for fvwm and joe)

The system and tools I used to build and test it:
	- i486DX33, 8M RAM, 16M swap
	- Linux 1.1.5
	- gcc 2.5.8
	- libc 4.5.26 (huh?)
	- libg++ 2.5.3
	- libf2c 1.9.2
	- XFree 2.1 with fvwm window manager
	- tcl 7.3
	- tk 3.6p1
	- gdb 4.12
	- binutils 1.9

All the executables are statically linked.

Disk space:
	this archive should unpack in about 50Mbytes. You need A LOT
	MORE (up to 120M) if you plan to recompile it and get the
	full documentation in uncompressed form.

-----------------------------------------------------------------------------


WHAT IS PTOLEMY (adapted from: Catalog of free compilers and interpreters)

language:	CASE-DSP (Computer Aided Software Eng. for Digital Signal Proc)
package:	Ptolemy
version:	0.5
parts:		graphical algorithm layout, code generator, simulator
author:		Berkekey EECS team
how to get:	ftp pub/ptolemy/* from ptolemy.bekeley.edu
description:	Ptolemy provides a highly flexible foundation for the
		specification, simulation, and rapid prototyping of systems.
		It is an object oriented framework within which diverse models
		of computation can co-exist and interact.  For example, using
		Ptolemy a data-flow system can be easily connected to a
		hardware simulator which in turn may be connected to a
		discrete-event system, etc.  Because of this, Ptolemy can be
		used to model entire systems.
		In addition, Ptolemy now has code generation capabilities.
		From a flow graph description, Ptolemy can generate both C code
		and DSP assembly code for rapid prototyping.
requires:	C++, C
ports:		Sun-4; MIPS/Ultrix; HPPA; FreeBSD (in progress); Linux
status:		active research project
discussion:	ptolemy-hackers[-request]@ohm.berkeley.edu
contact:	ptolemy@ohm.berkeley.edu


WHERE TO GET PTOLEMY (Original distribution - for mips,sun4,hppa)

	Ptolemy can be obtained by ftp from
	  ptolemy.eecs.berkeley.edu (128.32.240.78)
	You need the following files:
	  /pub/ptolemy/ptolemy0.5/pt-0.5.src.tar.Z	  10Mbytes
	  /pub/ptolemy/ptolemy0.5/pt-0.5.doc.tar.Z	   9Mbytes
	  /pub/ptolemy/ptolemy0.5/pt-0.5.other.src.tar.Z   7Mbytes
	  and also the latest versions of INSTALL_0.5,README etc.
	You can obtain Ptolemy also from mail or tape. See the READMEs.

----------------------------------------------------------------------------

HOW TO INSTALL

1)	Create a 'ptolemy' user and assign it a directory. The settings
	I used (in /etc/passwd) were:
	user name   - ptolemy		(for me is number 101)
	group       - users		(for me is number 20)
	no password
	shell       - /bin/bash
	working dir - /users/ptolemy.

2)	Create the directory /users. Go under it and unpack this archive.
	(of course you can decide to put it somewhere else, but then you
	have to edit some files).

4)	Check the network: all the RPC daemons should be active (see
	rc.inet1 and rc.inet2 somewhere in /etc or /conf/net).
	Also, *if you have no ethernet adapter*, check that your
	hostname.domainname, if different from 'localhost', points
	to localhost (127.0.0.1), or you'll see 'Network is unreachable'
	errors starting pigiRpc.

5)	Check the setup files. I use bash and fvwm, so I changed only
	.profile and .fvwmrc; most of the other files (e.g. .cshrc) are
	the original ones from Berkeley. You have probably to edit some
	of them to follow your system configuration and your tastes.

6)	Don't forget to set the 3-button mouse emulation in your
	Xconfig if you have a two-button mouse. Ptolemy requires a
	three-button mouse. And XFree86/fvwm doesn't emulate it very well.

7)	Login as 'ptolemy'. Check that the environment variables have the
	correct values:
		$ARCH	must be set to 'linux'
		$PTOLEMY must be set to the user's root directory ~ptolemy
			(e.g. /users/ptolemy), should be the same as HOME
		$PATH	must begin with '$PTOLEMY/bin:$PTOLEMY/bin.linux'
			and end with ':.'

8)	At this point, I just type 'startx' and enter Ptolemy. See my
	.xinitrc.

9)	Please print and read AT LEAST the chapters
		installation.ps
		overview.ps
		pigi.ps
	in ~ptolemy/doc/users_man before going further.

----------------------------------------------------------------------------

HOW TO RECOMPILE

	Almost all is just ready for recompilation under Linux.
	Check your compiler and libraries; install xv and tcl/tk if
	you haven't. Install libf2c.

1)	Move all the /users/ptolemy/src/bsdlibs/*.h files to /usr/include/
	bsd. Some of them are already there, depending on the version of
	libc you use (must be 4.5.21 or later).

2)	Log in as ptolemy. If possible, do not compile as root.

3)	Enter the directory ~/src/bsdlibs and type
		make
	This creates libhash.a and libbtree.a in ~/lib.linux.
	The latter is not required by Ptolemy; I just ported all the
	db package that comes with 386BSD.

4)	cd to your root (~) directory and type

		make install_octtools

	This creates vem and the related packages in ~/bin.linux.
	At this point you can already test vem by starting 'pigi' under
	X (see the docs). If vem is ok, you'll see the vem console window
	in the upper left corner and the Top-Level Demo Directory window
	just below it. You can experiment drawing points and boxes with
	the mouse, and activating the menu with the 3rd button, but
	nothing more. (Type Ctrl-D in the vem console window to quit).

5)	Always from the ~ directory type

		make makefiles

	This updates the makefiles in the source tree. Nothing should
	happen if you haven't changed any 'make.template' file; the
	makefiles are already there. Just to check that all is in order.
	Then type

		make install

	and be VERY patient: it takes HOURS (at least 4) to recompile
	all.
	At the end you'll find the executables (ptcl, pigiRpc etc.) in the
	~/bin.linux directory. Start X and follow the instructions
	in Chapter 2 (pigi.ps) of the User's Manual.

6)	Things are a little more complicated to recompile the 'optfir'
	and 'wfir' programs, which were written in FORTRAN. You don't
	need f2c because the *.c files are already there; but you need
	the library (libf2c 1.9.x). - see below

----------------------------------------------------------------------------

WHERE TO MODIFY THINGS

	If you want to modify the gcc/g++ settings you must edit
	~ptolemy/mk/config-g++.mk and ~ptolemy/mk/config-linux.mk.

	Some other important compilation parameters are in the file
	~ptolemy/octtools/include/port.h (there are acually THREE
	copies of this file; the other two are in ~/ptolemy/src/octtools/
	include and ~ptolemy/src/octtools/Packages/port. Better make some
	link...)

	Other options are scattered through the makefiles (e.g. the
	static/dynamic link flag for vem is in the variable LOCSTATIC
	in ~ptolemy/src/octtools/vem/makefile).

---------------------------------------------------------------------------

NOTES to the Linux port

The 'pigiRpc' and 'ptcl' programs MUST be statically linked.
Vem can be linked with shared libraries to reduce its size; it works.
I think that also the 'other octtools' programs could be dynamically
linked without any problem.

I used the following gcc flags (see config-g++.mk):
	-Dlinux
	-Dsun
	-D_GNU_SOURCE
	-D_BSD_SOURCE		(it comes from Berkeley...)
	-m486
	-O2			(use -g instead for debugging)
	-fwritable-strings	(as a safety measure; needed by vem)

	-pipe			to speed compilation (if you have enough RAM)

	-fomit-frame-pointer	don't use it together with -g !!

	-traditional		to build vem/octtools

The directory src/filters has been excluded from the make; this is because
Linux has no Fortran compiler. You must compile the 'optfir' and 'wfir'
programs and install them yourself, using f2c and my makefile as a guide.
(I'm not yet sure it works fully).

The 'cp' domain has not been included.

The makefiles were modified to avoid excess repetitions. You should
use only the 'makefiles','clean' and 'install'-type parameters, as
shown before.

Also be careful: I didn't check that all the changes I made to the
makefiles have been reflected in the corresponding templates. If you
delete the makefiles (make clean) and then rebuild them (make makefiles)
something could change (I hope not).

Don't use this version to compile on another architecture unless you're
sure of what you're doing. Get the original sources instead.

---------------------------------------------------------------------------

THINGS TO DO

Of course a lot. But I would like to use my SoundBlaster to hear the
sound demos after replacing the calls to /dev/audio and /dev/audioctl
with the appropriate calls to /dev/dsp and /dev/mixer in the kernel
sound driver.

I would like to have a c30..c80 domain to produce code for the Texas DSPs.
I know the assembler well enough, but I have to find the time...

I would like to interface Ptolemy to the 40-MHz 56002 PC card I built
some months ago (and maybe make it compatible with Motorola PC-Media
standard ... anyone interested in building and selling such a card?)

---------------------------------------------------------------------------

BUG REPORT

If you think you've found a bug, DON'T EMAIL ME unless you're sure the
problem is Linux-specific (e.g. you can't start the program, or you get
core dumps...). Send mail instead to the Ptolemy mailing list

	ptolemy-hackers@ohm.berkeley.edu

---------------------------------------------------------------------------

Good luck.

Alberto Vignani


address:	Centro Ricerche FIAT - C.E.A.
		Strada Torino,50
		I-10043 ORBASSANO (TO)

email:		alberto.vignani@pmn.it / alberto.vignani@crf.it

