init variables to correct referencing.
[CommonLispStat.git] / defsys.lsp
blobd2a9c4f96d903bd621e1ae4b9a29419ea0806725
1 ;;; -*- mode: lisp -*-
3 (defpackage :lisp-stat-config
4 (:use :common-lisp)
5 (:export *default-path*
6 *lsos-files* *basic-files* *ls-files*
8 *lispstat-data-dir* *lispstat-examples-dir*
9 ))
11 (in-package :lisp-stat-config)
13 ;; KCL
14 ;; (proclaim '(optimize (safety 2) (space 3) (speed 3)))
15 ;; (setf *break-enable* nil)
18 ;;;;
19 ;;;; EXCL (Allegro)
20 ;;;;
22 ;; (setf *read-default-float-format* 'double-float)
24 (defvar *common-lisp-stat-version* "1.0 Alpha 1")
26 (defvar *default-path* "./")
28 ;;;
29 ;;; Functions for switching into and out of debug mode
30 ;;;
31 ;;; Note that ANSI Common Lisp post-dates these, we need to ensure
32 ;;; that CL's signal handling is taken into consideration.
35 (defun ls-debug-on (signals-to-break-on) ;; FIXME:AJR
36 (setf *break-on-signals* signals-to-break-on))
38 (defun ls-debug-off ()
39 (setf *break-on-signals* nil))
42 ;;;;
43 ;;;; Compilation and Loading Utilities
44 ;;;;
46 (defvar *lsos-files* (list "lsobjects"))
48 (defvar *basic-files*
49 (list "lsbasics"
50 "lsfloat"
51 "fastmap"
52 "compound"
53 "matrices"
54 "ladata"
55 "linalg"
56 "dists"))
58 (defvar *ls-files*
59 (list "lsmath"
60 ; #-:kcl "help"
61 "statistics"
62 "regression"
63 "nonlin"
64 "maximize"
65 "bayes"
66 "lstoplevel"))
68 (defun use-ls-package (name)
69 (shadowing-import (package-shadowing-symbols name))
70 (use-package name))
72 (defun use-stats ()
73 #+:kcl (shadowing-import '(ls::x))
74 (use-ls-package 'lisp-stat-object-system)
75 (use-ls-package 'lisp-stat-basics)
76 (use-ls-package 'lisp-stat))
78 (defun lispfile (x)
79 "Add suffix/type to string name."
80 (concatenate 'string x
81 #+:kcl ".lsp"
82 #+(or :mcl :excl) ".lisp"))
84 (defun load-files (files)
85 (dolist (f files) (load f :verbose t)))
87 (defun compile-load-files (files &optional (load t))
88 (dolist (f files)
89 #+:mcl (format t "compiling ~a~%" f)
90 #+:excl (load (lispfile f))
91 (compile-file f)
92 (if load (load f))))
94 (defun load-lsos ()
95 (load-files *lsos-files*))
97 (defun load-ls-basics ()
98 (load-lsos)
99 (load-files *basic-files*)
100 #+:kcl (if (and (probe-file "kclglue.o")
101 (probe-file "lib/clib.a"))
102 (si:faslink "kclglue" *clibs*)))
104 (defun load-stats ()
105 (load-ls-basics)
106 (load-files *ls-files*))
108 (defun compile-lsos ()
109 (compile-load-files *lsos-files*))
111 (defun compile-ls-basics (&optional (compile-all t))
112 (if compile-all (compile-lsos) (load-lsos))
113 (compile-load-files *basic-files*)
114 #+:kcl (progn (compile-file "kclglue")
115 (si:faslink "kclglue" *clibs*)))
117 (defun compile-stats (&optional (compile-all t))
118 (if compile-all (compile-ls-basics) (load-ls-basics))
119 (compile-load-files *ls-files*))
122 (defvar *lispstat-home-dir* #p"/home/tony/sandbox/CLS.git/"
123 "Value considered \"home\" for our data")
125 (setf *lispstat-home-dir*
126 ;; #p"/cygdrive/c/local/sandbox/Lisp/CommonLispStat/"w
127 ;; #p"/home/tony/sandbox/CommonLispStat.git/"
128 #p"/home/tony/sandbox/CLS.git/")
130 (defmacro ls-dir (root-str)
131 `(pathname (concatenate 'string (namestring *lispstat-home-dir*) ,root-str)))
133 (defmacro ls-defdir (target-dir-var root-str)
134 `(defvar ,target-dir-var (ls-dir ,root-str)))
136 ;;(macroexpand '(ls-defdir *lispstat-asdf-dir* "ASDF"))
137 ;;(macroexpand-1 '(ls-defdir *lispstat-asdf-dir* "ASDF"))
138 ;;(macroexpand-1 '(ls-dir "ASDF"))
140 (ls-defdir *lispstat-asdf-dir* "ASDF/")
141 (ls-defdir *lispstat-data-dir* "data/")
142 (ls-defdir *lispstat-external-dir* "external/")
143 (ls-defdir *lispstat-examples-dir* "examples/")
145 ;; Load ASDF if it isn't loaded
146 #-asdf(load (pathname (concatenate 'string (namestring *lispstat-external-dir*) "asdf")))
148 ;; (pushnew #p"C:/Lisp/libs/" asdf-util:*source-dirs* :test #'equal)
149 ;;(pushnew *lispstat-asdf-dir* asdf:*central-registry*))