Received: from SOUTH-STATION-ANNEX.MIT.EDU by po7.MIT.EDU (5.61/4.7) id AA12797; Thu, 23 Nov 95 06:43:43 EST
Received: from demon-gw.cam-ani.co.uk by MIT.EDU with SMTP
	id AA13299; Thu, 23 Nov 95 06:42:39 EST
Received: from gnasher by gateway.cam-ani.co.uk (CAS1.1)
	id AA11154; Thu, 23 Nov 95 11:41:51 GMT
Received: from ren by gnasher.cam-ani.co.uk (NX5.67d/NX3.0M)
	id AA04168; Thu, 23 Nov 95 11:41:05 GMT
Message-Id: <9511231141.AA04168@cam-ani.co.uk>
Received: by ren.hidden (NX5.67f2/NX3.0X)
	id AA00605; Thu, 23 Nov 95 11:41:05 GMT
Mime-Version: 1.0 (NeXT Mail 3.3 v118.2)
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Received: by NeXT.Mailer (1.118.2)
From: Ellis Pritchard <ellis@cam-ani.co.uk>
Date: Thu, 23 Nov 95 11:41:03 GMT
To: proven@MIT.EDU (Chris Provenzano)
Subject: pthreads for IRIX 5.3
X-Homemail: efp90@nuke.dircon.co.uk
X-Mailer: NeXT Mail 3.3

Hi Chris,

Having used pthreads on DEC OSF with some success, I recently =
picked up your pthreads-1_60_beta4_1 package from MIT's ftp site =
with a view to using it on our IRIX 5.3 machines in place of the =
exceedingly kludgy sproc() threading we've been forced to use up =
until now.=20

After a struggle I've managed to get it compiled up using the =
standard IRIX compliers (rather than gcc). Unfortunately that =
doesn't mean I got it working, and I thought you might be able to =
point me in the right direction!

Just as a bit of fun, here's what I had to do to get pthreads =
compiled on our system:

The standard IRIX make command doesn't like the makefiles which =
come with the package at all, so I switched to smake which only =
complained about the '.' at the start of some command lines. I =
then got hold of GNU make which worked fine.

The SGI cc compiler firstly falls over all 'inline' keywords, =
which I had to rename to __inline (although the C++ compiler =
doesn't like this, <sigh>), and seems to crash horribly if it =
encounters the sequence 'long double' or gets a file with the =
extension '.S' (rather than .s) (spouts large quanities of =
complete gibberish forever in the former case, core dumps in the =
latter!). So I replaced long double with double (only one =
instance) and renamed the .S files to .s.

The standard pre-processor cpp seems to have problems with the =
trickery set up to do the syscall stuff: it doesn't resolve the =
macros properly. After trying various devious schemes with the =
macros and failing, I ended up rewriting the Makefile to process =
the syscall template through sed, doing a global substitution and =
then compiling the output file.=20

The syscall.S file with lstat etc. in it seems not to get copied =
to the pthreads directory (I would have had to rename it anyway to =
stop the compiler crashing!), and I couldn't get the thing to be =
included in the make... so I ended up compiling it by hand.

After these changes I had a fully defined pthreads library.

Now on to the test files! I found I needed to compile (or at least =
link) the test files using the C++ compiler or I got the undefined =
symbol "__nw__FUi" which appears to be something to do with the =
C++ auto-init functionality (referenced in init.cc).

If I then run e.g. test_create I get:

	Original thread stack at 7fffaf00

and then nothing else: the process uses up 100% CPU time and won't =
die unless it is kill -9'ed.


Well, that's basically the end of my story, only thing remaining =
is to ask, What'd I do wrong?!!

If this is a case of 'It's a beta!' then don't worry too much... =
but I'd really like to get this working.

I'd be grateful for any comments and suggestions you can make!

Cheers!

Ellis.
____________________________________________________________
Ellis Pritchard	:  Cambridge Animation Systems Ltd : Tel. (+44) =
1223 578100
    Software	:  20 Cambridge Place, Cambridge    : Fax. (+44) 1223 =
578101
    Engineer 	:  Cambs CB2 1NR, UK                         :  =
ellis@cam-ani.co.uk
