Ticket #9 (closed defect: fixed)

Opened 8 years ago

Last modified 8 years ago

problem compiling CLASP

Reported by: moody Owned by: gb
Priority: major Milestone:
Component: Compiler Version: 1.1
Keywords: Cc:

Description

Hi Gary,

I found another problem related to the compilation of CLASP.

OpenMCL 1.1-pre-070408: darwin-ppc32, darwin-ppc64, linux-x86-64

  1. updated from cvs at 12:00 PM 16 April 2007
  1. executed (ccl::rebuild-ccl :full t) on platforms listed above
  1. encountered the following problem on all platforms listed above when compiling:
CLASP> (defun invert-matrix (matrix &optional into-matrix)                                                                                                                                                
  "If matrix is singular returns nil, else returns its inverse.                                                                                                                                           
   If into-matrix is supplied, inverse is returned in it,                                                                                                                                                 
    otherwise a new array is created."                                                                                                                                                                    
  (let* ((dims (array-dimensions matrix))                                                                                                                                                                 
         (rows (car dims))                                                                                                                                                                                
         (cols (cadr dims)))                                                                                                                                                                              
    (unless (= rows cols)                                                                                                                                                                                 
      (error () "Matrix ~s not square" matrix))                                                                                                                                                           
    (if (null into-matrix)                                                                                                                                                                                
        (setq into-matrix (make-array dims))                                                                                                                                                              
        (let ((dims-into (array-dimensions into-matrix)))                                                                                                                                                 
          (unless (and (= rows (car dims-into)) (= cols (cadr dims-into)))                                                                                                                                
            (error () "into-matrix ~s does not have same dimensions as matrix ~s" into-matrix                                                                                                             
                   matrix))))                                                                                                                                                                             
    (let ((xcols (+ rows cols))                                                                                                                                                                           
          (vv (make-array rows)))                                                                                                                                                                         
      (dotimes (r rows)                                                                                                                                                                                   
        (let ((v (make-array xcols :initial-element #o0)))                                                                                                                                                
          (setf (aref v (+ r rows)) #o1)                                                                                                                                                                  
          (dotimes (c cols)                                                                                                                                                                               
            (setf (aref v c) (aref matrix r c)))                                                                                                                                                          
          (setf (aref vv r) v)))                                                                                                                                                                          
      (dotimes (r rows)                                                                                                                                                                                   
        (let ((imax #o-1)                                                                                                                                                                                 
              (vmax #o-1))                                                                                                                                                                                
          (do ((i r (1+ i)))                                                                                                                                                                              
              ((= i rows))                                                                                                                                                                                
            (let ((v (abs (aref (aref vv i) r))))                                                                                                                                                         
              (cond                                                                                                                                                                                       
                ((> v vmax) (setq vmax v) (setq imax i)))))                                                                                                                                               
          (cond ((zerop vmax) (return-from invert-matrix ())))                                                                                                                                            
          (cond ((not (= r imax))                                                                                                                                                                         
                 (let ((exch-temp (aref vv r)))                                                                                                                                                           
                   (setf (aref vv r) (aref vv imax))                                                                                                                                                      
                   (setf (aref vv imax) exch-temp)))))                                                                                                                                                    
        (let ((pivot-row (aref vv r)))                                                                                                                                                                    
          (do ((d (aref pivot-row r))                                                                                                                                                                     
               (i (1+ r) (1+ i)))                                                                                                                                                                         
              ((= i xcols))                                                                                                                                                                               
            (setf (aref pivot-row i)                                                                                                                                                                      
                  (/ (aref pivot-row i) d)))                                                                                                                                                              
          (do ((i (1+ r) (1+ i)))                                                                                                                                                                         
              ((= i rows))                                                                                                                                                                                
            (let ((row (aref vv i)))                                                                                                                                                                      
              (do ((d (aref row r))                                                                                                                                                                       
                   (j (1+ r) (1+ j)))                                                                                                                                                                     
                  ((= j xcols))                                                                                                                                                                           
                (setf (aref row j) (- (aref row j) (* d (aref pivot-row j)))))))))                                                                                                                        
      (do ((r (1- rows) (1- r)))                                                                                                                                                                          
          ((= r #o0))                                                                                                                                                                                     
        (let ((pivot-row (aref vv r)))                                                                                                                                                                    
          (do ((i (1- r) (1- i)))                                                                                                                                                                         
              ((< i #o0))
             (do ((d (aref row r))                                                                                                                                                                       
                   (j rows (1+ j)))                                                                                                                                                                       
                  ((= j xcols))                                                                                                                                                                           
                (setf (aref row j) (- (aref row j) (* d (aref pivot-row j)))))))))                                                                                                                        
      (dotimes (r rows)                                                                                                                                                                                   
        (let ((v (aref vv r)))                                                                                                                                                                            
          (dotimes (c cols)                                                                                                                                                                               
            (setf (aref into-matrix r c) (aref v (+ c cols)))))))                                                                                                                                         
    (values into-matrix))) =>
value (VARIABLE  . "ccl:l1;l1-typesys.lisp.newest") is not of the expected type (SATISFIES CCL::CTYPE-P).

Backtrace:
  0: (CCL::TYPE-SPECIFIER)
  1: (CCL::ACODE-FORM-TYPE '(#<VAR  #x30004147ECAD>) #<VAR  #x30004147EC2D>)
  2: (CCL::NX1-NOTE-VAR-BINDING '(25674 (24614 #<VAR  #x30004147F7DD>) (24614 #<VAR  #x30004144330D>)) '(#<VAR  #x30004147ECAD>))
  3: (CCL::NX1-NOTE-VAR-BINDINGS '(#<VAR  #x30004147EC2D> #<VAR  #x30004147ECAD>) 'NIL)
  4: (CCL::NX1-LET '(LET ((D #) (I #)) (TAGBODY (GO #1=#:G38) #:G37 (TAGBODY #) (PSETQ I #) #1# (UNLESS # #))) #<LEXICAL-ENVIRONMENT  #x30004147F48D>)
  5: (CCL::NX1-COMBINATION #<LEXICAL-ENVIRONMENT  #x30004147F48D> '(LET ((D #) (I #)) (TAGBODY (GO #1=#:G38) #:G37 (TAGBODY #) (PSETQ I #) #1# (UNLESS # #))))
  6: (CCL::NX1-FORM '(LET ((D #) (I #)) (TAGBODY (GO #1=#:G38) #:G37 (TAGBODY #) (PSETQ I #) #1# (UNLESS # #))))
  7: (CCL::NX1-BLOCK '(BLOCK NIL (LET (# #) (TAGBODY # #:G37 # # #:G38 #))) #<LEXICAL-ENVIRONMENT  #x30004147F96D>)
  8: (CCL::NX1-COMBINATION #<LEXICAL-ENVIRONMENT  #x30004147F96D> '(DO ((D #) (I # #)) ((= I XCOLS)) (SETF (AREF PIVOT-ROW I) (/ # D))))
  9: (CCL::NX1-FORM '(DO ((D #) (I # #)) ((= I XCOLS)) (SETF (AREF PIVOT-ROW I) (/ # D))))
 10: (CCL::NX1-FORMLIST '((DO (# #) (#) (SETF # #)) (DO (#) (#) (LET # #))))
 11: (CCL::NX1-PROGN-BODY 'NIL)
 12: (CCL::NX1-ENV-BODY '((DO (# #) (#) (SETF # #)) (DO (#) (#) (LET # #))) #<LEXICAL-ENVIRONMENT  #x3000414430FD>)
 13: (CCL::NX1-LET* '(LET* ((PIVOT-ROW #)) (DO (# #) (#) (SETF # #)) (DO (#) (#) (LET # #))) #<LEXICAL-ENVIRONMENT  #x3000414430FD>)

This function can be found in clasp/dev/matrices.lisp.

This is old code (pre-1990) that compiles fine under ACL, MCL, LispWorks?, and the OpenMCL 2006-10-24 release.

I've attached a tarball of the CLASP asdf system (unix-newlines).

Thanks,

jjm

Change History

comment:1 Changed 8 years ago by moody

The tarball was too large to attach.

Find it here:  http://pearl.isi.edu/~moody/clasp.tar.gz

comment:2 Changed 8 years ago by gb

  • Status changed from new to closed
  • Resolution set to fixed

Should be fixed in changeset:6284, which should be in CVS in about an hour.

Note: See TracTickets for help on using tickets.