compiling linearalgebra



Robert Dodier wrote:
> On 7/19/07, Raymond Toy <raymond.toy at ericsson.com> wrote:
> 
> OK by me to use defsystem to compile linearalgebra.
> I don't know how to do it, though.

I've appended a sample implementation.  Needs some work to make sure the 
binary goes to the right place.  (And gcl is probably broken because it 
doesn't have ensure-directories-exist so the binary might not get 
written to the correct place.)  The dependencies, if any, might need to 
be specified too.

All that's needed now is a simple file that loads linearalgebra.system 
and runs (mk:oos "linearalgebra" :compile)
> 
> If we do create a defsystem file, can we set it up so that
> it doesn't ask any questions? Defsystem is the orgin of
> the "Should I compile while loading?" and other stuff
> like that, right? That drives me bonkers.

How do you invoke mk:oos?  I always do (mk:oos "foo" :compile) so it 
compiles and loads.  I don't think mk:oos will ask any other questions 
unless some file can't be found or can't be written or some other error. 
  I'd have to read up on mk:oos to see if these can just be made to be 
errors without asking....

Ray

share/linearalgebra/linearalgebra.system:

;;; -*- Mode: lisp -*-

#-gcl
(progn
   (defun linearalgebra-source-pathname (subdir)
     (merge-pathnames (make-pathname :directory (list :relative subdir))
		     (make-pathname :directory (pathname-directory *load-truename*))))
(defun linearalgebra-binary-pathname (subdir)
   (merge-pathnames
    (make-pathname
     :name (concatenate 'string "binary-"
		       #+clisp "clisp"
		       #+cmu "cmucl"
		       #+scl "scl"
		       #+sbcl "sbcl"
		       #+allegro "acl"
		       #+openmcl "openmcl"
		       #-(or clisp cmu scl sbcl gcl allegro openmcl) "unknownlisp")
     :directory (list :relative subdir))
    (make-pathname :directory (pathname-directory *load-truename*))))
)

#+gcl
(progn
   (defun linearalgebra-source-pathname (subdir)
     (merge-pathnames (make-pathname :directory (list subdir))
		     (make-pathname :directory (pathname-directory sys:*load-pathname*))))
(defun linearalgebra-binary-pathname (subdir)
   (merge-pathnames (make-pathname :directory (list subdir))
		   (make-pathname :directory (pathname-directory sys:*load-pathname*))))
)

(mk:defsystem linearalgebra
   :source-pathname (linearalgebra-source-pathname ".")
   :binary-pathname (linearalgebra-binary-pathname ".")
   :source-extension "lisp"
   :components
   ((:file "polynomialp")
    (:file "mring")
    (:file "lu")
    (:file "linalgcholesky")
    (:file "eigens-by-jacobi")
    (:file "linalg-extra")
    (:file "matrixexp")
    (:file "linalg-utilities")))