Need to export a few more things.
[CommonLispStat.git] / defsys.lsp
blob20aab92ec2ac49c045f9f21120a6eb21721c00ae
1 ;;; -*- mode: lisp -*-
3 (in-package :cl-user)
5 (defpackage :lisp-stat-config
6 (:use :common-lisp)
7 (:export *default-path*
8 *lsos-files* *basic-files* *ls-files*
10 *lispstat-data-dir* *lispstat-examples-dir*
13 (in-package :lisp-stat-config)
15 ;; KCL
16 ;; (proclaim '(optimize (safety 2) (space 3) (speed 3)))
17 ;; (setf *break-enable* nil)
20 ;;;;
21 ;;;; EXCL (Allegro)
22 ;;;;
24 ;; (setf *read-default-float-format* 'double-float)
26 (defvar *common-lisp-stat-version* "1.0 Alpha 1")
28 (defvar *default-path* "./")
30 ;;;
31 ;;; Functions for switching into and out of debug mode
32 ;;;
33 ;;; Note that ANSI Common Lisp post-dates these, we need to ensure
34 ;;; that CL's signal handling is taken into consideration.
37 (defun ls-debug-on (signals-to-break-on) ;; FIXME:AJR
38 (setf *break-on-signals* signals-to-break-on))
40 (defun ls-debug-off ()
41 (setf *break-on-signals* nil))
44 ;;;;
45 ;;;; Compilation and Loading Utilities
46 ;;;;
48 (defvar *lsos-files* (list "lsobjects"))
50 (defvar *basic-files*
51 (list "lsbasics"
52 "lsfloat"
53 "fastmap"
54 "compound"
55 "matrices"
56 "ladata"
57 "linalg"
58 "dists"))
60 (defvar *ls-files*
61 (list "lsmath"
62 ; #-:kcl "help"
63 "statistics"
64 "regression"
65 "nonlin"
66 "maximize"
67 "bayes"
68 "lstoplevel"))
70 (defun use-ls-package (name)
71 (shadowing-import (package-shadowing-symbols name))
72 (use-package name))
74 (defun use-stats ()
75 #+:kcl (shadowing-import '(ls::x))
76 (use-ls-package 'lisp-stat-object-system)
77 (use-ls-package 'lisp-stat-basics)
78 (use-ls-package 'lisp-stat))
80 (defun lispfile (x)
81 "Add suffix/type to string name."
82 (concatenate 'string x
83 #+:kcl ".lsp"
84 #+(or :mcl :excl) ".lisp"))
86 (defun load-files (files)
87 (dolist (f files) (load f :verbose t)))
89 (defun compile-load-files (files &optional (load t))
90 (dolist (f files)
91 #+:mcl (format t "compiling ~a~%" f)
92 #+:excl (load (lispfile f))
93 (compile-file f)
94 (if load (load f))))
96 (defun load-lsos ()
97 (load-files *lsos-files*))
99 (defun load-ls-basics ()
100 (load-lsos)
101 (load-files *basic-files*)
102 #+:kcl (if (and (probe-file "kclglue.o")
103 (probe-file "lib/clib.a"))
104 (si:faslink "kclglue" *clibs*)))
106 (defun load-stats ()
107 (load-ls-basics)
108 (load-files *ls-files*))
110 (defun compile-lsos ()
111 (compile-load-files *lsos-files*))
113 (defun compile-ls-basics (&optional (compile-all t))
114 (if compile-all (compile-lsos) (load-lsos))
115 (compile-load-files *basic-files*)
116 #+:kcl (progn (compile-file "kclglue")
117 (si:faslink "kclglue" *clibs*)))
119 (defun compile-stats (&optional (compile-all t))
120 (if compile-all (compile-ls-basics) (load-ls-basics))
121 (compile-load-files *ls-files*))
124 (defvar *lispstat-home-dir* #p"/home/tony/sandbox/CLS.git/"
125 "Value considered \"home\" for our data")
127 (setf *lispstat-home-dir*
128 ;; #p"/cygdrive/c/local/sandbox/Lisp/CommonLispStat/"w
129 ;; #p"/home/tony/sandbox/CommonLispStat.git/"
130 #p"/home/tony/sandbox/CLS.git/")
132 (defmacro ls-dir (root-str)
133 `(pathname (concatenate 'string (namestring *lispstat-home-dir*) ,root-str)))
135 (defmacro ls-defdir (target-dir-var root-str)
136 `(defvar ,target-dir-var (ls-dir ,root-str)))
138 ;;(macroexpand '(ls-defdir *lispstat-asdf-dir* "ASDF"))
139 ;;(macroexpand-1 '(ls-defdir *lispstat-asdf-dir* "ASDF"))
140 ;;(macroexpand-1 '(ls-dir "ASDF"))
142 (ls-defdir *lispstat-asdf-dir* "ASDF/")
143 (ls-defdir *lispstat-data-dir* "data/")
144 (ls-defdir *lispstat-external-dir* "external/")
145 (ls-defdir *lispstat-examples-dir* "examples/")
147 ;; Load ASDF if it isn't loaded
148 #-asdf(load (pathname (concatenate 'string (namestring *lispstat-external-dir*) "asdf")))
150 ;; (pushnew #p"C:/Lisp/libs/" asdf-util:*source-dirs* :test #'equal)
151 ;;(pushnew *lispstat-asdf-dir* asdf:*central-registry*))