Subject: [clisp-list] Problems compiling clisp 2.27 for Tru64 5.1 on Alpha using cc

From: Kalman Reti <[email-masked]>
Date: Thu Sep 20 08:41:04 2001

[I'm a Lisp expert, not a C expert, so forgive any infelicities of
expression in the report below.]

I tried to follow the unix/INSTALL instructions to compile clisp but I had a
couple of serious problems (as well as a few minor ones).  I'm using release
5.1 of Tru64 (nee Dec nee OSF) Unix with the native (non GNU) tools.

The first problem I encountered was that the compiler generated an error for the
extern inline declarations in file lispbibl for input_stream_p and
output_stream-p, with the text of the error message being "There is no definition
for the inline function named ... in this compilation unit."

I noticed that there was already a conditionalized turning off of the inline
declaration in lispbibl, but only if both GNU and UNIXCONF were undefined.
Removing the dependency on UNIXCONF in the source got me past this error by
removing the inline declaration altogether, but I wonder if that is the correct
fix.

The second problem is that the typedef in stdbool.h

  typedef enum { false = 0, true = 1 } _Bool;

gets an error "In this declaraction, "enum" cannot be combined with "_Bool"."
I took out the typedef to get around this problem.

With those two changes, the rest of the build proceeded with only warnings.
However, some of the warnings looked troublesome.  (There were also lots that
looked benign, including lots of complaints about return values for functions
declared void.)  

The troublesome ones all had to do with types (e.g. line, isearch_terimnators,
etc.) reducing to unsigned char not matching char because they differed in the
signed/unsigned attribute.  I have the log file of the build, in case anyone is
interested in looking at it.

Finally, although the build completed and I had a working image,

 make testsuite

confusingly said that tests failed and I should look in .erg files for the errors,
but there were no .erg files!  [Later] I found one in the suite/ subdirectory
(streamslong.erg).  Its contents are:

Form: (LOOP FOR SIZE FROM 2 TO 40 DO (BIN-STREAM-TEST :SIZE SIZE :TYPE 'SIGNED-BYTE))
CORRECT: NIL
CLISP: ERROR

I tried it by hand, and, sure enough, that test fails.

  (with-open-file (o "/tmp/test" :direction :output :element-type'(signed-byte 2))
	(write-byte 1 o)
	(write-byte 0 o)
	(write-byte -1 o)
	(write-byte -2 o))

writes a file which

  (with-open-file (i "/tmp/test" :direction :input :element-type'(signed-byte 2))
	(loop repeat 4 collect (read-byte i)))

returns as

  (1 0 1.7014s38 1.70139s38) !!

---

From: Sam Steingold <[email-masked]>
Date: Thu Sep 20 10:48:01 2001

> * In message <[email-masked]>
> * On the subject of "[clisp-list] Problems compiling clisp 2.27 for Tru64 5.1 on Alpha using cc"
> * Sent on Thu, 20 Sep 2001 11:40 -0400
> * Honorable Kalman Reti <[email-masked]> writes:
>

this is fixed in the current development sources (since 2001-08-05)

> I took out the typedef to get around this problem.

this has been fixed on 2001-08-05 too (C++ compilation patch from Bruno)

> looked benign, including lots of complaints about return values for functions

this is because we do not know your compiler-specific declaration for
non-returning functions (see nonreturning_function in lispbibl.d).
patches are welcome.

> interested in looking at it.

these are harmless.

> Finally, although the build completed and I had a working image,

congratulations!
do you mind creating a binary distribution for your platform?

> I tried it by hand, and, sure enough, that test fails.

what about

(LOOP FOR SIZE FROM 3 TO 40 DO (BIN-STREAM-TEST :SIZE SIZE :TYPE 'SIGNED-BYTE))

is the problem only with '(signed-byte 2)?

>   (1 0 1.7014s38 1.70139s38) !!

ouch!  this is weird...
can you try 2.26 (2001-05-23)?
(I fixed a big bug in non-whole byte i/o on 2001-06-27, I wonder if that
patch was at fault...)

-- 
Sam Steingold (http://www.podval.org/~sds)
Support Israel's right to defend herself! <http://www.i-charity.com/go/israel>
Read what the Arab leaders say to their people on <http://www.memri.org/>
Daddy, what does "format disk c: complete" mean?

---

From: [email-masked]
Date: Thu Sep 20 14:37:05 2001

Date: Thu, 20 Sep 2001 13:45 EDT
    From: Sam Steingold <[email-masked]>

[stuff elided]

    what about

I tried this form:

      (loop for size from 2 to 40 do (handler-case (bin-stream-test :size size :type'signed-byte) (error (e) (format t "~&Case ~d got error ~a" size e))))

and got this result:

Case 2 got error 
 * [(SIGNED-BYTE 2)] -10 != 1.70139s38
Case 3 got error 
 * [(SIGNED-BYTE 3)] -100 != 1.70136s38
Case 4 got error 
 * [(SIGNED-BYTE 4)] 0-111 != 1.70132s38
Case 5 got error 
 * [(SIGNED-BYTE 5)] 0-1111 != 1.70122s38
Case 6 got error 
 * [(SIGNED-BYTE 6)] -1 1011 != 1.70106s38
Case 7 got error 
 * [(SIGNED-BYTE 7)] -11 1000 != 1.70068s38
Case 8 got error 
 * [(SIGNED-BYTE 8)] 0-111 0001 != 1.69995s38
Case 9 got error 
 * [(SIGNED-BYTE 9)] 0-1001 1101 != 01.69937s38
Case 10 got error 
 * [(SIGNED-BYTE 10)] -1 0001 0110 != 0001.6978s38
Case 11 got error 
 * [(SIGNED-BYTE 11)] -10 0111 1011 != 0001.69317s38
Case 12 got error 
 * [(SIGNED-BYTE 12)] 0-100 1100 1110 != 000001.68545s38
Case 13 got error 
 * [(SIGNED-BYTE 13)] 000-10 1111 1111 != 0000001.69146s38
Case 14 got error 
 * [(SIGNED-BYTE 14)] -1 0000 1000 0001 != 00000001.64657s38
Case 15 got error 
 * [(SIGNED-BYTE 15)] 000-1011 1011 0101 != 000000001.66251s38
Case 16 got error 
 * [(SIGNED-BYTE 16)] 0-110 0100 1100 1100 != 00000000001.36646s38
Case 17 got error 
 * [(SIGNED-BYTE 17)] 00-111 1001 1111 1110 != 000000000001.29602s38
Case 18 got error 
 * [(SIGNED-BYTE 18)] 000-111 1010 0011 0101 != 0000000000001.29531s38
Case 19 got error 
 * [(SIGNED-BYTE 19)] 0000-110 0010 1010 0010 != 00000000000001.37365s38
Case 20 got error 
 * [(SIGNED-BYTE 20)] 0-101 1101 0111 1111 0111 != 00000000000000003.0742s36
Case 21 got error 
 * [(SIGNED-BYTE 21)] 0-1001 1000 1100 1111 0010 != 00000000000000002.40828s35
Case 22 got error 
 * [(SIGNED-BYTE 22)] 00-1111 0111 0110 1000 1111 != 000000000000000003.98997s33
Case 23 got error 
 * [(SIGNED-BYTE 23)] 0000-111 1000 0110 0110 0100 != 00000000000000000009.8033s35
Case 24 got error 
 * [(SIGNED-BYTE 24)] 0-111 0011 1010 1000 1000 1011 != 0000000000000000000002747.66s0
Case 25 got error 
 * [(SIGNED-BYTE 25)] 0-1101 0100 1000 0111 1111 1111 != 000000000000000000001.89833s-26
Case 26 got error 
 * [(SIGNED-BYTE 26)] 00-1000 1110 1111 0100 0011 1010 != 00000000000000000000001.59605s-5
Case 27 got error 
 * [(SIGNED-BYTE 27)] -10 0111 1101 1111 1111 1100 1011 != 0000000000000000000000002.00162s0
Case 28 got error 
 * [(SIGNED-BYTE 28)] 00-10 1010 0011 0011 1100 1011 0110 != 0000000000000000000000001.28264s-11
Case 29 got error 
 * [(SIGNED-BYTE 29)] 000-11 1100 1111 0100 1010 1110 0100 != 000000000000000000000000007.0619s-25
Case 30 got error 
 * [(SIGNED-BYTE 30)] -1 0101 0111 0000 1110 1100 0011 0100 != 000000000000000000000000000017651.0s0
Case 31 got error 
 * [(SIGNED-BYTE 31)] 0-1 1001 0100 1101 0001 0000 1001 0010 != 00000000000000000000000000001.08946s15
Case 32 got error 
 * [(SIGNED-BYTE 32)] 00000-1111 1001 1010 1110 0111 1111 1001 != 0000000000000000000000000000004.07493s-9
Case 33 got error 
 * [(SIGNED-BYTE 33)] 0-1011 1110 0011 1000 1001 0011 1000 1000 != 00000000000000000000000000000001.68082s21
Case 34 got error 
 * [(SIGNED-BYTE 34)] 00-1001 0110 1110 1001 0110 0000 1011 0101 != 000000000000000000000000000000009.9978s-33
Case 35 got error 
 * [(SIGNED-BYTE 35)] 000-1111 1001 0000 0000 1100 1001 1111 1101 != 0000000000000000000000000000000001.03019s38
NIL

    ouch!  this is weird...

2.26 passed the tests according to the script, but my hand test above returned
the same bogus values as above!

Under both 2.26 and 2.27 reading the same file back as '(unsigned-byte 2) returns
(1 0 3 2), which seems right.

---

From: Sam Steingold <[email-masked]>
Date: Thu Sep 20 14:42:02 2001

> * In message <[email-masked]>
> * On the subject of "Re: [clisp-list] Problems compiling clisp 2.27 for Tru64 5.1 on Alpha using cc"
> * Sent on Thu, 20 Sep 2001 17:36 -0400
> * Honorable [email-masked] writes:
>
> 2.26 passed the tests according to the script, but my hand test above
> returned the same bogus values as above!

the binary i/o test was added after the bug was fixed.
thanks for testing.

can you give me access to your machine so that I will be able to debug
the problem?

-- 
Sam Steingold (http://www.podval.org/~sds)
Support Israel's right to defend herself! <http://www.i-charity.com/go/israel>
Read what the Arab leaders say to their people on <http://www.memri.org/>
Our business is run on trust.  We trust you will pay in advance.