export is in lspackages, comment cleanup
[tsl.git] / defsys.lsp
blobe56f2b82672934edf8a476166f1539f86df5e15e
1 ;;; -*- mode: lisp -*-
3 ;;;; defsys -- System setup for CL version of Lisp-Stat
4 ;;;;
5 ;;;; Copyright (c) 1991, by Luke Tierney. Permission is granted for
6 ;;;; unrestricted use.
8 ;;;;
9 ;;;; CLtL, 2nd Edition, essentially requires that features be keyword
10 ;;;; symbols. To allow for this, the folloing code puts keyword versions
11 ;;;; of all feature symbols on the features list.
12 ;;;;
14 #+kcl
15 (dolist (f *features*)
16 (if (symbolp f)
17 (pushnew (intern (symbol-name f) 'keyword) *features*)))
19 #-:mcl (require "lspackages")
20 #-:mcl (require "lsmacros")
22 ;;;;
23 ;;;; Macintosh CL
24 ;;;;
26 #+:mcl (pushnew :CLtL2 *features*)
27 #+:mcl (def-logical-directory "mcls;" "ccl;:MCLS:")
28 #+:mcl (setf *break-on-errors* nil)
29 #+:mcl (set-mac-default-directory "mcls;")
30 #+:mcl (setf *save-definitions* t)
31 #+:mcl (defpackage "COMMON-LISP" (:nicknames "CL" "LISP"))
32 #+:mcl (pushnew :stat-float-is-double-float *features*)
33 #+:mcl (require :ff)
35 ;;;;
36 ;;;; AKCL
37 ;;;;
39 ;#+:kcl (proclaim '(optimize (safety 2) (space 3) (speed 3)))
40 #+:kcl (setf *break-enable* nil)
42 #+:kcl (allocate 'cons 600)
43 #+:kcl (allocate 'cfun 1000)
44 #+:kcl (si:allocate-relocatable-pages 100)
46 ;; **** This feature should only be used if the patches in num_sfun.c
47 ;; **** and numlib.lsp habe been applied to AKCL -- see lsfloat.lsp for
48 ;; **** more details.
50 ;#+:kcl (pushnew :stat-float-is-double-float *features*)
52 ;;;;
53 ;;;; EXCL (Allegro)
54 ;;;;
56 (setf *read-default-float-format* 'double-float)
58 ;;;;
59 ;;;; Switch to Lisp-Stat package
60 ;;;;
62 #+:mcl (load "lspackages")
63 #+:mcl (load "lsmacros")
65 #+:CLtL2
66 (in-package lisp-stat)
67 #-:CLtL2
68 (in-package 'lisp-stat)
70 (export '(*default-path* debug nodebug))
72 (defvar *common-lisp-stat-version* "1.0 Alpha 1")
74 (defvar *default-path* "./")
76 ;;;;
77 ;;;; Functions for switching into and out of debug mode
78 ;;;;
80 (defun debug ()
81 #+:kcl (setf *break-enable* t)
82 #+:mcl (setf *break-on-errors* t))
84 (defun nodebug ()
85 #+:kcl (setf *break-enable* nil)
86 #+:mcl (setf *break-on-errors* nil))
88 ;;;;
89 ;;;; MCL definitions
90 ;;;;
92 #+:mcl (setf *default-path* ":")
94 ;;;;
95 ;;;; AKCL definitions
96 ;;;;
98 #+:kcl (setf *clibs*
99 #+:mips "lib/clib.a -lm_G0 -lc_G0"
100 #-:mips "lib/clib.a -lm -lc")
102 ;;;;
103 ;;;; EXCL definitions
104 ;;;;
106 ;;;;
107 ;;;; Compilation and Loading Utilities
108 ;;;;
110 (defvar *lsos-files* (list "lsobjects"))
112 (defvar *basic-files*
113 (list #+:kcl "kclpatch"
114 #+:mcl "mclglue"
115 #+:excl "exclglue"
116 "lsbasics"
117 "lsfloat"
118 "fastmap"
119 "compound"
120 "matrices"
121 "ladata"
122 "linalg"
123 "dists"))
125 (defvar *ls-files*
126 (list "lsmath"
127 ; #-:kcl "help"
128 "statistics"
129 "regression"
130 "nonlin"
131 "maximize"
132 "bayes"
133 "lstoplevel"))
135 (defun use-ls-package (name)
136 (shadowing-import (package-shadowing-symbols name))
137 (use-package name))
139 (defun use-stats ()
140 #+:kcl (shadowing-import '(ls::x))
141 (use-ls-package 'lisp-stat-object-system)
142 (use-ls-package 'lisp-stat-basics)
143 (use-ls-package 'lisp-stat))
145 (defun lispfile (x)
146 (concatenate 'string x
147 #+:kcl ".lsp"
148 #+(or :mcl :excl) ".lisp"))
150 (defun load-files (files)
151 (dolist (f files) (load f :verbose t)))
153 (defun compile-load-files (files &optional (load t))
154 (dolist (f files)
155 #+:mcl (format t "compiling ~a~%" f)
156 #+:excl (load (lispfile f))
157 (compile-file f)
158 (if load (load f))))
160 (defun load-lsos ()
161 (load-files *lsos-files*))
163 (defun load-ls-basics ()
164 (load-lsos)
165 (load-files *basic-files*)
166 #+:kcl (if (and (probe-file "kclglue.o")
167 (probe-file "lib/clib.a"))
168 (si:faslink "kclglue" *clibs*)))
170 (defun load-stats ()
171 (load-ls-basics)
172 (load-files *ls-files*))
174 (defun compile-lsos ()
175 (compile-load-files *lsos-files*))
177 (defun compile-ls-basics (&optional (compile-all t))
178 (if compile-all (compile-lsos) (load-lsos))
179 (compile-load-files *basic-files*)
180 #+:kcl (progn (compile-file "kclglue")
181 (si:faslink "kclglue" *clibs*)))
183 (defun compile-stats (&optional (compile-all t))
184 (if compile-all (compile-ls-basics) (load-ls-basics))
185 (compile-load-files *ls-files*))