🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pdx.utek
Article #6

Re: problems building perl on a Tek 4319 running Utek 4.1

#6
From: Kaveh R. Ghazi
Date: Thu, 12 Nov 1992 17:29
54 lines
2446 bytes
 > I'm trying to build perl using the utek C compiler and I get the following
 > errors from "make test".  All of the other tests pass.
 > 
 > op/dbm.........FAILED on test 8
 > op/exec........FAILED on test 6
 > op/regexp......FAILED on test 109
 > op/sprintf.....FAILED on test 1
 > op/stat........FAILED on test 35
 > op/vec.........FAILED on test 11
 > lib/big........FAILED on test 152
 > Failed 7 tests.
 > 
 > Turning off the optimizer and defining CRIPPLED_CC do not appear to affect
 > the results of the tests.  Any ideas?  I've included my config.sh below.
 > 
 > Thanks,
 > Galen Seitz
 > galens@htbawd.rain.com

	I had the same result.  The problem is that the atof() and other math
routines in utek are not very accurate.  I know it sounds wierd but that
causes all the seemingly unrelated above errors in the test suite.

	Perl reads all numbers as strings and keeps them internally as doubles
using the atof() call for the conversion.  It then casts them to ints when
doing integer operations.

	For some numbers, the atof() in utek is off by a bit.  The following
code illustrates this:

 > #include <math.h>
 > 
 > main()
 > {
 >   printf("%f\n",atof("255"));
 > }
	
	The output of this program is:  254.999990.  When you cast that to
an int, it gets rounded down to 254 and thus in a test suite which was
expecting a result of 255, you get what look like test failures but which
are really atof() inaccuracies.

	My solution was to get better atof() and related routines and link
them in by hand to create the perl executable.  I found good math code in
the GNU libc package.  I remember you definitely need more of the math
functions than just atof(), definitely strtod() and maybe pow() and log*().
I forget which ones exactly but it should become clear when you do it.

		Good luck,
		--Kaveh
-- 
Kaveh R. Ghazi			CAIP Center, Rutgers University.
ghazi@caip.rutgers.edu		rutgers!caip.rutgers.edu!ghazi
Technical Details
Message-ID: <Nov.12.12.29.54.1992.4743@caip.rutgers.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!dziuxsolim.rutgers.edu!caip.rutgers.edu!ghazi
References: <BxLEt7.C49@neon.rain.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!dziuxsolim.rutgers.edu!caip.rutgers.edu!ghazi
From: ghazi@caip.rutgers.edu (Kaveh R. Ghazi)
Newsgroups: pdx.utek,comp.lang.perl
Subject: Re: problems building perl on a Tek 4319 running Utek 4.1
Message-ID: <Nov.12.12.29.54.1992.4743@caip.rutgers.edu>
Date: 12 Nov 92 17:29:54 GMT
References: <BxLEt7.C49@neon.rain.com>
Followup-To: pdx.utek
Distribution: pdx
Organization: Rutgers Univ., New Brunswick, N.J.
Lines: 54
Cc: ghazi@caip