Pristine Start using Luke's original CLS 1.0 alpha 1
[CommonLispStat.git] / defsys.lsp
blobc55e6d3b8b738215366ea934a442e607d6381542
1 ;;;; defsys -- System setup for CL version of Lisp-Stat
2 ;;;;
3 ;;;; Copyright (c) 1991, by Luke Tierney. Permission is granted for
4 ;;;; unrestricted use.
6 ;;;;
7 ;;;; CLtL, 2nd Edition, essentially requires that features be keyword
8 ;;;; symbols. To allow for this, the folloing code puts keyword versions
9 ;;;; of all feature symbols on the features list.
10 ;;;;
12 #+kcl
13 (dolist (f *features*)
14 (if (symbolp f)
15 (pushnew (intern (symbol-name f) 'keyword) *features*)))
17 #-:mcl (require "lspackages")
18 #-:mcl (require "lsmacros")
20 ;;;;
21 ;;;; Macintosh CL
22 ;;;;
24 #+:mcl (pushnew :CLtL2 *features*)
25 #+:mcl (def-logical-directory "mcls;" "ccl;:MCLS:")
26 #+:mcl (setf *break-on-errors* nil)
27 #+:mcl (set-mac-default-directory "mcls;")
28 #+:mcl (setf *save-definitions* t)
29 #+:mcl (defpackage "COMMON-LISP" (:nicknames "CL" "LISP"))
30 #+:mcl (pushnew :stat-float-is-double-float *features*)
31 #+:mcl (require :ff)
33 ;;;;
34 ;;;; AKCL
35 ;;;;
37 ;#+:kcl (proclaim '(optimize (safety 2) (space 3) (speed 3)))
38 #+:kcl (setf *break-enable* nil)
40 #+:kcl (allocate 'cons 600)
41 #+:kcl (allocate 'cfun 1000)
42 #+:kcl (si:allocate-relocatable-pages 100)
44 ;; **** This feature should only be used if the patches in num_sfun.c
45 ;; **** and numlib.lsp habe been applied to AKCL -- see lsfloat.lsp for
46 ;; **** more details.
48 ;#+:kcl (pushnew :stat-float-is-double-float *features*)
50 ;;;;
51 ;;;; EXCL (Allegro)
52 ;;;;
54 (setf *read-default-float-format* 'double-float)
56 ;;;;
57 ;;;; Switch to Lisp-Stat package
58 ;;;;
60 #+:mcl (load "lspackages")
61 #+:mcl (load "lsmacros")
63 #+:CLtL2
64 (in-package lisp-stat)
65 #-:CLtL2
66 (in-package 'lisp-stat)
68 (export '(*default-path* debug nodebug))
70 (defvar *common-lisp-stat-version* "1.0 Alpha 1")
72 (defvar *default-path* "./")
74 ;;;;
75 ;;;; Functions for switching into and out of debug mode
76 ;;;;
78 (defun debug ()
79 #+:kcl (setf *break-enable* t)
80 #+:mcl (setf *break-on-errors* t))
82 (defun nodebug ()
83 #+:kcl (setf *break-enable* nil)
84 #+:mcl (setf *break-on-errors* nil))
86 ;;;;
87 ;;;; MCL definitions
88 ;;;;
90 #+:mcl (setf *default-path* ":")
92 ;;;;
93 ;;;; AKCL definitions
94 ;;;;
96 #+:kcl (setf *clibs*
97 #+:mips "lib/clib.a -lm_G0 -lc_G0"
98 #-:mips "lib/clib.a -lm -lc")
100 ;;;;
101 ;;;; EXCL definitions
102 ;;;;
104 ;;;;
105 ;;;; Compilation and Loading Utilities
106 ;;;;
108 (defvar *lsos-files* (list "lsobjects"))
110 (defvar *basic-files*
111 (list #+:kcl "kclpatch"
112 #+:mcl "mclglue"
113 #+:excl "exclglue"
114 "lsbasics"
115 "lsfloat"
116 "fastmap"
117 "compound"
118 "matrices"
119 "ladata"
120 "linalg"
121 "dists"))
123 (defvar *ls-files*
124 (list "lsmath"
125 ; #-:kcl "help"
126 "statistics"
127 "regression"
128 "nonlin"
129 "maximize"
130 "bayes"
131 "lstoplevel"))
133 (defun use-ls-package (name)
134 (shadowing-import (package-shadowing-symbols name))
135 (use-package name))
137 (defun use-stats ()
138 #+:kcl (shadowing-import '(ls::x))
139 (use-ls-package 'lisp-stat-object-system)
140 (use-ls-package 'lisp-stat-basics)
141 (use-ls-package 'lisp-stat))
143 (defun lispfile (x)
144 (concatenate 'string x
145 #+:kcl ".lsp"
146 #+(or :mcl :excl) ".lisp"))
148 (defun load-files (files)
149 (dolist (f files) (load f :verbose t)))
151 (defun compile-load-files (files &optional (load t))
152 (dolist (f files)
153 #+:mcl (format t "compiling ~a~%" f)
154 #+:excl (load (lispfile f))
155 (compile-file f)
156 (if load (load f))))
158 (defun load-lsos ()
159 (load-files *lsos-files*))
161 (defun load-ls-basics ()
162 (load-lsos)
163 (load-files *basic-files*)
164 #+:kcl (if (and (probe-file "kclglue.o")
165 (probe-file "lib/clib.a"))
166 (si:faslink "kclglue" *clibs*)))
168 (defun load-stats ()
169 (load-ls-basics)
170 (load-files *ls-files*))
172 (defun compile-lsos ()
173 (compile-load-files *lsos-files*))
175 (defun compile-ls-basics (&optional (compile-all t))
176 (if compile-all (compile-lsos) (load-lsos))
177 (compile-load-files *basic-files*)
178 #+:kcl (progn (compile-file "kclglue")
179 (si:faslink "kclglue" *clibs*)))
181 (defun compile-stats (&optional (compile-all t))
182 (if compile-all (compile-ls-basics) (load-ls-basics))
183 (compile-load-files *ls-files*))