fixed loading issues related to configuration and packaging.
[CommonLispStat.git] / src / basics / defsys.lsp
blob9ef363fb3653458383ebaedab5dddaa64657e7a3
1 ;;; -*- mode: lisp -*-
3 (in-package :lisp-stat-config)
5 ;;; KCL
7 ;; (proclaim '(optimize (safety 2) (space 3) (speed 3)))
8 ;; (setf *break-enable* nil)
11 ;;; EXCL (Allegro)
13 ;; (setf *read-default-float-format* 'double-float)
15 (defvar *common-lisp-stat-version* "1.0 Alpha 1")
17 (defvar *default-path* "./")
19 ;;;
20 ;;; Functions for switching into and out of debug mode
21 ;;;
22 ;;; Note that ANSI Common Lisp post-dates these, we need to ensure
23 ;;; that CL's signal handling is taken into consideration.
26 (defun ls-debug-on (signals-to-break-on) ;; FIXME:AJR
27 (setf *break-on-signals* signals-to-break-on))
29 (defun ls-debug-off ()
30 (setf *break-on-signals* nil))
33 ;;;;
34 ;;;; Compilation and Loading Utilities
35 ;;;;
37 (defvar *lsos-files* (list "lsobjects"))
39 (defvar *basic-files*
40 (list "lsbasics"
41 "lsfloat"
42 "compound"
43 "matrices"
44 "ladata"
45 "linalg"
46 "dists"))
48 (defvar *ls-files*
49 (list "lsmath"
50 ; #-:kcl "help"
51 "statistics"
52 "regression"
53 "nonlin"
54 "maximize"
55 "bayes"
56 "lstoplevel"))
58 (defun use-ls-package (name)
59 (shadowing-import (package-shadowing-symbols name))
60 (use-package name))
62 (defun use-stats ()
63 #+:kcl (shadowing-import '(ls::x))
64 (use-ls-package 'lisp-stat-object-system)
65 (use-ls-package 'lisp-stat-basics)
66 (use-ls-package 'lisp-stat))
68 (defun lispfile (x)
69 "Add suffix/type to string name."
70 (concatenate 'string x
71 #+:kcl ".lsp"
72 #+(or :mcl :excl) ".lisp"))
74 (defun load-files (files)
75 (dolist (f files) (load f :verbose t)))
77 (defun compile-load-files (files &optional (load t))
78 (dolist (f files)
79 #+:mcl (format t "compiling ~a~%" f)
80 #+:excl (load (lispfile f))
81 (compile-file f)
82 (if load (load f))))
84 (defun load-lsos ()
85 (load-files *lsos-files*))
87 (defun load-ls-basics ()
88 (load-lsos)
89 (load-files *basic-files*)
90 #+:kcl (if (and (probe-file "kclglue.o")
91 (probe-file "lib/clib.a"))
92 (si:faslink "kclglue" *clibs*)))
94 (defun load-stats ()
95 (load-ls-basics)
96 (load-files *ls-files*))
98 (defun compile-lsos ()
99 (compile-load-files *lsos-files*))
101 (defun compile-ls-basics (&optional (compile-all t))
102 (if compile-all (compile-lsos) (load-lsos))
103 (compile-load-files *basic-files*)
104 #+:kcl (progn (compile-file "kclglue")
105 (si:faslink "kclglue" *clibs*)))
107 (defun compile-stats (&optional (compile-all t))
108 (if compile-all (compile-ls-basics) (load-ls-basics))
109 (compile-load-files *ls-files*))
112 (defvar *lispstat-home-dir* #p"/home/tony/sandbox/CLS.git/"
113 "Value considered \"home\" for our data")
115 (setf *lispstat-home-dir*
116 ;; #p"/cygdrive/c/local/sandbox/Lisp/CommonLispStat/"w
117 ;; #p"/home/tony/sandbox/CommonLispStat.git/"
118 #p"/home/tony/sandbox/CLS.git/")
120 (defmacro ls-dir (root-str)
121 `(pathname (concatenate 'string (namestring *lispstat-home-dir*) ,root-str)))
123 (defmacro ls-defdir (target-dir-var root-str)
124 `(defvar ,target-dir-var (ls-dir ,root-str)))
126 ;;(macroexpand '(ls-defdir *lispstat-asdf-dir* "ASDF"))
127 ;;(macroexpand-1 '(ls-defdir *lispstat-asdf-dir* "ASDF"))
128 ;;(macroexpand-1 '(ls-dir "ASDF"))
130 (ls-defdir *lispstat-asdf-dir* "ASDF/")
131 (ls-defdir *lispstat-data-dir* "Data/")
132 (ls-defdir *lispstat-external-dir* "external/")
133 (ls-defdir *lispstat-examples-dir* "examples/")
135 ;; Load ASDF if it isn't loaded
136 #-asdf(load (pathname (concatenate 'string (namestring *lispstat-external-dir*) "asdf")))
138 ;; (pushnew #p"C:/Lisp/libs/" asdf-util:*source-dirs* :test #'equal)
139 ;;(pushnew *lispstat-asdf-dir* asdf:*central-registry*))