fixed loading issues related to configuration and packaging.
[CommonLispStat.git] / lispstat.asd
blob18b9e8c1df1c93a0fa237cbf3b6611856d8e7e4a
1 ;;  -*- mode: lisp -*-
2 ;;; Copyright (c) 2005--2008, by AJ Rossini <blindglobe@gmail.com>
3 ;;; ASDF packaging for CommonLisp Stat
4 ;;; License: BSD, see the top level directory file LICENSE for details.
5 ;;; Time-stamp: <2008-11-19 01:22:59 tony>
6 ;;; Created:    <2005-05-30 17:09:47 blindglobe>
8 (in-package :cl-user)
10 (defpackage :lisp-stat-config
11   (:use :common-lisp)
12   (:export *default-path*
13            *lsos-files* *basic-files* *ls-files*
14            *lispstat-home-dir*
15            *lispstat-data-dir* *lispstat-examples-dir*))
17 (in-package :lisp-stat-config)
19 (defparameter *lispstat-home-dir*
20   (directory-namestring
21    (truename (asdf:system-definition-pathname :lispstat)))
22   "Value considered \"home\" for our data")
25   (setf *lispstat-home-dir*
26       (directory-namestring (truename (asdf:system-definition-pathname
27                                        :lispstat))))
30 (macrolet ((ls-dir (root-str)
31              `(pathname (concatenate 'string
32                                      (namestring *lispstat-home-dir*) ,root-str)))
34            (ls-defdir (target-dir-var  root-str)
35              `(defvar ,target-dir-var (ls-dir ,root-str))))
37   ;; reminder of testing
38   ;;(macroexpand '(ls-defdir *lispstat-asdf-dir* "ASDF"))
39   ;;(macroexpand-1 '(ls-defdir *lispstat-asdf-dir* "ASDF"))
40   ;;(macroexpand-1 '(ls-dir "ASDF"))
42   (ls-defdir *lispstat-asdf-dir* "ASDF/")
43   (ls-defdir *lispstat-data-dir* "Data/")
44   (ls-defdir *lispstat-external-dir* "external/")
47 (pushnew *lispstat-asdf-dir* asdf:*central-registry*)
48 ;; (pushnew #p"C:/Lisp/libs/" asdf-util:*source-dirs* :test #'equal) ; eg for Microsoft
50 ;;; back to our regularly scheduled work...
51 ;;; We should not need these, I think, but?
52 ;; (asdf:oos 'asdf:compile-op :cffi)            ;; FFI
53 ;; (asdf:oos 'asdf:compile-op :lift)            ;; Unit Testing 
54 ;; (asdf:oos 'asdf:load-op :cffi)            ;; FFI
55 ;; (asdf:oos 'asdf:load-op :lift)            ;; Unit Testing 
57 ;;; MAJOR HACK, FIXME!
58 ;;(load "/media/disk/Desktop/sandbox/matlisp.git/start.lisp")
60 (in-package :cl-user)
62 (defpackage #:lispstat-system
63     (:use :common-lisp :asdf))
65 (in-package #:lispstat-system)
67 ;;; To avoid renaming everything from *.lsp to *.lisp...
68 ;;; borrowed from Cyrus Harmon's work, for example for the ch-util.
69 ;;; NOT secure against serving multiple architectures/hardwares from
70 ;;; the same file system (i.e. PPC and x86 would not be
71 ;;; differentiated). 
73 (defclass lispstat-lsp-source-file (cl-source-file) ())
74 (defparameter *fasl-directory*
75    (make-pathname :directory '(:relative
76                                #+sbcl "sbcl-fasl"
77                                #+openmcl "openmcl-fasl"
78                                #+cmu "cmucl-fasl"
79                                #+clisp "clisp-fasl"
80                                #-(or sbcl openmcl clisp cmucl) "fasl"
81                                )))
84 ;;; Handle Luke's *.lsp suffix
85 (defmethod source-file-type ((c lispstat-lsp-source-file) (s module)) "lsp")
86 (defmethod asdf::output-files :around ((operation compile-op)
87                                        (c lispstat-lsp-source-file))
88   (list (merge-pathnames *fasl-directory*
89                          (compile-file-pathname (component-pathname c)))))
90 ;;; again, thanks to Cyrus for saving me time...
93 (defsystem "lispstat"
94   :version #.(with-open-file
95                  (vers (merge-pathnames "version.lisp-expr" *load-truename*))
96                (read vers))
97   :author "A.J. Rossini <blindglobe@gmail.com>"
98   :license "BSD"
99   :description "CommonLispStat (CLS): A System for Statistical
100   Computing with Common Lisp; based on CLS alpha1 by Luke Tierney
101   <luke@stat.uiowa.edu> (apparently originally written when Luke was
102   at CMU, on leave somewhere?).   Last touched by him in 1991, then in
103   2005--2008." 
104   :serial t
105   :depends-on (:cffi  :lift :lisp-matrix) ;; need a matrix library
106   :components ((:static-file "version" :pathname #p"version.lisp-expr")
107                (:static-file "LICENSE")
108                (:static-file "README")
109                
110                (:module "packaging"
111                         :pathname #p"src/"
112                         :components
113                         ((:file "packages")))
115                (:module "proto-objects"
116                         :pathname "src/objsys/"
117                         :serial t
118                         :depends-on ("packaging")
119                         :components
120                         ((:lispstat-lsp-source-file "lsobjects")))
122                (:module "lispstat-core"
123                         :pathname "src/basics/"
124                         :serial t
125                         :depends-on ("packaging" "proto-objects")
126                         :components
127                         (; (:lispstat-lsp-source-file "defsys")
128                          (:lispstat-lsp-source-file "lstypes")
129                          (:lispstat-lsp-source-file "lsfloat")
130                          
131                          (:lispstat-lsp-source-file "compound")
132                          (:lispstat-lsp-source-file "lsmacros" 
133                                                     :depends-on ("compound"))
134                          
135                          (:lispstat-lsp-source-file "lsmath"
136                                                     :depends-on ("compound"
137                                                                  "lsmacros"
138                                                                  "lsfloat"))))
140                (:module
141                 "numerics-internal"
142                 :pathname "src/numerics/"
143                 :depends-on ("packaging" "proto-objects" "lispstat-core")
144                 :components
145                 ((:lispstat-lsp-source-file "cffiglue")
146                  (:lispstat-lsp-source-file "dists"
147                                             :depends-on ("cffiglue"))
148                  (:lispstat-lsp-source-file "matrices"
149                                             :depends-on ("cffiglue"))
150                  (:lispstat-lsp-source-file "ladata"
151                                             :depends-on ("cffiglue"
152                                                          "matrices"))
153                  (:lispstat-lsp-source-file "linalg"
154                                             :depends-on ("cffiglue"
155                                                          "matrices"
156                                                          "ladata"))))
158                ;; prototype and CLOS approaches.
159                (:module
160                 "stat-data"
161                 :pathname "src/data/"
162                 :depends-on ("packaging"
163                              "proto-objects"
164                              "lispstat-core"
165                              "numerics-internal")
166                 :components
167                 ((:file "data-clos")
168                  (:file "data")))
170                (:module
171                 "lispstat-basics"
172                 :pathname "src/basics/"
173                 :depends-on ("packaging"
174                              "proto-objects"
175                              "lispstat-core"
176                              "numerics-internal"
177                              "stat-data")
178                 :components
179                 ((:lispstat-lsp-source-file "lsbasics")))
182                (:module
183                 "descriptives"
184                 :pathname "src/describe/"
185                 :depends-on ("packaging"
186                              "proto-objects"
187                              "lispstat-core"
188                              "numerics-internal"
189                              "stat-data"
190                              "lispstat-basics")
191                 :components
192                 ((:lispstat-lsp-source-file "statistics")))
194                (:module
195                 "optimization"
196                 :pathname "src/numerics/"
197                 :depends-on ("packaging"
198                              "proto-objects"
199                              "lispstat-core"
200                              "numerics-internal"
201                              "stat-data"
202                              "lispstat-basics")
203                 :components
204                 ((:file "optimize")))
205                  
206                
207                ;; Applications
208                (:module
209                 "stat-models"
210                 :pathname "src/stat-models/"
211                 :depends-on ("packaging"
212                              "proto-objects"
213                              "lispstat-core"
214                              "numerics-internal"
215                              "lispstat-basics"
216                              "descriptives"
217                              "optimization")
218                 :components
219                 ((:lispstat-lsp-source-file "regression")
220                  ;; (:lispstat-lsp-source-file "nonlin"
221                  ;;       :depends-on ("regression"))
222                  ;; (:lispstat-lsp-source-file "bayes"
223                  ;;       :depends-on ("regression"))
224                  ))
226                ;; Applications
227                (:module
228                 "example-data"
229                 :pathname "Data/"
230                 :depends-on ("packaging"
231                              "proto-objects"
232                              "lispstat-core"
233                              "numerics-internal"
234                              "lispstat-basics"
235                              "descriptives"
236                              "optimization")
237                 :components
238                 ((:file "examples")
239                  (:lispstat-lsp-source-file "absorbtion")
240                  (:lispstat-lsp-source-file "diabetes")
241                  (:lispstat-lsp-source-file "leukemia")
242                  (:lispstat-lsp-source-file "randu")
243                  (:lispstat-lsp-source-file "aircraft")
244                  (:lispstat-lsp-source-file "metabolism")
245                  (:lispstat-lsp-source-file "book")
246                  (:lispstat-lsp-source-file "heating")
247                  (:lispstat-lsp-source-file "oxygen")
248                  (:lispstat-lsp-source-file "stackloss") 
249                  (:lispstat-lsp-source-file "car-prices")
250                  (:lispstat-lsp-source-file "iris")
251                  (:lispstat-lsp-source-file "puromycin")
252                  (:lispstat-lsp-source-file "tutorial")))
254                (:module
255                  "lisp-stat-unittest"
256                 :depends-on  ("packaging" "proto-objects"
257                               "lispstat-core"
258                               "numerics-internal" 
259                               "stat-data"
260                               "lispstat-basics"
261                               "descriptives"
262                               "optimization"
263                               "stat-models"
264                               "example-data")
265                  :pathname "src/unittests/"
266                  :components ((:file "unittests")
267                               (:file "unittests-lstypes" :depends-on ("unittests"))
268                               (:file "unittests-specfn" :depends-on ("unittests"))
269                               (:file "unittests-prob" :depends-on ("unittests"))
270                               (:file "unittests-proto" :depends-on ("unittests"))
271                               (:file "unittests-regression" :depends-on ("unittests"))
272                               ;; not ready yet:
273                               ;; (:file "unittests-data-clos" :depends-on ("unittests"))
274                               (:file "unittests-arrays" :depends-on ("unittests"))))))