
Porting Ptolemy 0.5 to Linux		Alberto Vignani		May 2,1994
-----------------------------------------------------------------------------
|									    |
|NOTES to this release							    |
|									    |
| These are the patches *against the standard 0.5 Berkeley distribution* of |
| mid-April 1994 needed to compile Ptolemy on Linux.			    |
|									    |
| They contain the differences between the Berkeley distribution and my     |
| own Linux version, *PLUS* the latest patches up to patchlevel 3 (end of   |
| April 1994). These latest patches were not included in my previous full   |
| version.								    |
|									    |
| This is my *FINAL* release of a patch set against the full standard 0.5   |
| distribution. From now on it will be possible to directly apply the	    |
| official patches (to be found on the ptolemy ftp site under pub/ptolemy/  |
| ptolemy0.5/patches).							    |
|									    |
| In the future, any patch specific to Linux will be clearly marked	    |
|	#ifdef linux							    |
|	<Linux-specific code>						    |
|	#endif								    |
| and submitted to the Ptolemy team at Berkeley for inclusion in the	    |
| official patches.							    |
|									    |
-----------------------------------------------------------------------------

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; DSP56001, DSP96002 (and now Linux)
status:		active research project
discussion:	ptolemy-hackers[-request]@ohm.berkeley.edu
contact:	cxh@eecs.berkeley.edu


WHERE TO GET PTOLEMY

	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.

	The complete Linux version can be obtained by ftp from
	  cnuce_arch.cnr.it (131.114.1.10): pub/Linux-local/ptolemy

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

WHAT YOU NEED to compile Ptolemy on Linux

	*GET* the source/doc archives from ptolemy.berkeley.edu
	----------------------------------------------------
	Linux 1.0 or newer
	120 Mbytes of free hard disk space
	gcc 2.5.8
	libc 4.5.21 or newer
	libg++ 2.5.3
	f2c with libf2c 1.9.1 or newer
	XFree86 2.0 or newer, with twm, mwm or fvwm
	GNU binutils (ar,ld) 1.9 or newer
	----------------------------------------------------
	The following are provided by the Ptolemy distribution, but
	chances are that your Linux distribution has them already:
	 tcl7.3
	 tk3.6a
	 xv

HOW TO PROCEED

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

	Set up the .profile,.cshrc,.X* files with the correct values
	of the environment variables PTOLEMY,OCTTOOLS,ARCH etc. (See my
	.profile as an example).

2)	unpack the two source archives from the Berkeley distribution.
	You don't need to unpack the doc archive for the moment, unless
	you have a lot of space on your disk.
	Remember to go up one directory before unpacking. See the
	INSTALLATION_0.5 file for details.
	DO NOT INSTALL or MAKE anything; unpack only.

3)	Check the permissions and the ownership of files; in particular,
	check that the main directory (/users/ptolemy) has the correct
	owner.group (in my case, ptolemy.users). Unless you want to
	compile ptolemy as root, I suggest changing the ownership of
	ALL the files and also the permissions of the source files, which
	in many cases have the 'x' bit set (I use permissions 0644 for
	all the *.c,*.cc,*.h,*.pl files).

4)	Check the network: all the RPC daemons should be activated
	at bootstrap.
	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. You can easily do that by modifying
	/etc/hosts; just put your hostname.domainname at the end of the
	'localhost' line and remove it from anywhere else in the hosts file.

5)	Apply the patches.
		mv pt05p3-linux.diff /users
		cd /users
		patch -p0 < pt05p3-linux.diff 2>ERRS

	Look for errors (*# or *.rej files). There should be none.

6)	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 ':.'

***	Now COPY from this archive:
	 the files in usr/include/bsd to /usr/include/bsd
	 the files in users/ptolemy to /users/ptolemy (subdirectories too).
	   This step adds the missing files.
	   You can safely overwrite the existing ones.

7)	Type
		make sources
	This step creates directories and links, and builds makefiles
	from templates. Then it builds the Ptolemy translator 'ptlang'
	and generates source(.c,.cc,.h) and doc(.t) files from .pl
	files. There should be no errors/warnings.

8)	Now you can try to compile the whole thing.
	Begin with the BSD btree/hash libraries.
		cd ~/src/bsdlibs
		make
	Then octtools/vem:
		cd
		make install_octtools
	Then
		make other_octtools
	And finally
		make install

	The whole process takes FROM 4 TO 6 HOURS on a 486. Be patient.

	There is one further step:
		cd ~/src/filters/optfir
		make
		cd ~/src/filters/wfir
		make
	because Linux uses f2c instead of a true Fortran compiler.

9)	test the installation. See the INSTALL_0.5 file. You also have to
	print the file doc/users_man/pigi.ps (in the 'doc' tar file)
	which explains how to use the demos.

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

NOTES to the Linux port:

Please see the file README.LinuxPort in this archive

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

Good luck.

Alberto Vignani		FIAT Research Center, TORINO

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