packages moved to packages file.
[CommonLispStat.git] / lispstat.asd
blob13e40a5879637b3dbc2049bedaa215a28b319086
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-10-03 02:25:15 tony>
6 ;;; Created:    <2005-05-30 17:09:47 blindglobe>
8 (in-package :cl-user)
10 (defvar *lispstat-home-dir*
11   (directory-namestring
12    (truename (asdf:system-definition-pathname :lispstat)))
13   "Value considered \"home\" for our data")
16   (setf *lispstat-home-dir*
17       (directory-namestring (truename (asdf:system-definition-pathname
18                                        :lispstat))))
21 (macrolet ((ls-dir (root-str)
22              `(pathname (concatenate 'string
23                                      (namestring *lispstat-home-dir*) ,root-str)))
25            (ls-defdir (target-dir-var  root-str)
26              `(defvar ,target-dir-var (ls-dir ,root-str))))
28   ;; reminder of testing
29   ;;(macroexpand '(ls-defdir *lispstat-asdf-dir* "ASDF"))
30   ;;(macroexpand-1 '(ls-defdir *lispstat-asdf-dir* "ASDF"))
31   ;;(macroexpand-1 '(ls-dir "ASDF"))
33   (ls-defdir *lispstat-asdf-dir* "ASDF/")
34   (ls-defdir *lispstat-data-dir* "data/")
35   (ls-defdir *lispstat-external-dir* "external/")
36   (ls-defdir *lispstat-examples-dir* "examples/"))
38 (pushnew *lispstat-asdf-dir* asdf:*central-registry*)
39 ;; (pushnew #p"C:/Lisp/libs/" asdf-util:*source-dirs* :test #'equal) ; eg for Microsoft
41 ;;; back to our regularly scheduled work...
42 ;;; We should not need these, I think, but?
43 ;; (asdf:oos 'asdf:compile-op :cffi)            ;; FFI
44 ;; (asdf:oos 'asdf:compile-op :lift)            ;; Unit Testing 
45 ;; (asdf:oos 'asdf:load-op :cffi)            ;; FFI
46 ;; (asdf:oos 'asdf:load-op :lift)            ;; Unit Testing 
48 ;;; MAJOR HACK, FIXME!
49 ;;(load "/media/disk/Desktop/sandbox/matlisp.git/start.lisp")
51 (in-package :cl-user)
53 (defpackage #:lispstat-system
54     (:use :common-lisp :asdf))
56 (in-package #:lispstat-system)
58 ;;; To avoid renaming everything from *.lsp to *.lisp...
59 ;;; borrowed from Cyrus Harmon's work, for example for the ch-util.
60 ;;; NOT secure against serving multiple architectures/hardwares from
61 ;;; the same file system (i.e. PPC and x86 would not be
62 ;;; differentiated). 
64 (defclass lispstat-lsp-source-file (cl-source-file) ())
65 (defparameter *fasl-directory*
66    (make-pathname :directory '(:relative
67                                #+sbcl "sbcl-fasl"
68                                #+openmcl "openmcl-fasl"
69                                #+cmu "cmucl-fasl"
70                                #+clisp "clisp-fasl"
71                                #-(or sbcl openmcl clisp cmucl) "fasl"
72                                )))
75 ;;; Handle Luke's *.lsp suffix
76 (defmethod source-file-type ((c lispstat-lsp-source-file) (s module)) "lsp")
77 (defmethod asdf::output-files :around ((operation compile-op)
78                                        (c lispstat-lsp-source-file))
79   (list (merge-pathnames *fasl-directory*
80                          (compile-file-pathname (component-pathname c)))))
81 ;;; again, thanks to Cyrus for saving me time...
84 (defsystem "lispstat"
85   :version #.(with-open-file
86                  (vers (merge-pathnames "version.lisp-expr" *load-truename*))
87                (read vers))
88   :author "A.J. Rossini <blindglobe@gmail.com>"
89   :license "BSD"
90   :description "CommonLispStat (CLS): A System for Statistical
91   Computing with Common Lisp; based on CLS alpha1 by Luke Tierney
92   <luke@stat.uiowa.edu> (apparently originally written when Luke was
93   at CMU, on leave somewhere?).   Last touched by him in 1991, then in
94   2005--2008." 
95   :serial t
96   :depends-on (:cffi  :lift :lisp-matrix) ;; need a matrix library
97   :components ((:static-file "version" :pathname #p"version.lisp-expr")
98                (:static-file "LICENSE")
99                (:static-file "README")
100                
101                (:module "packaging"
102                         :pathname #p"src/"
103                         :components
104                         ((:source-file "packages")))
106                (:module "proto-objects"
107                         :pathname "src/objsys/"
108                         :serial t
109                         :depends-on ("packaging")
110                         :components
111                         ((:lispstat-lsp-source-file "lsobjects")))
113                (:module "lispstat-core"
114                         :pathname "src/basics/"
115                         :serial t
116                         :depends-on ("packaging" "proto-objects")
117                         :components
118                         ((:lispstat-lsp-source-file "defsys")
119                          (:lispstat-lsp-source-file "lstypes")
120                          (:lispstat-lsp-source-file "lsfloat")
121                          
122                          (:lispstat-lsp-source-file "compound")
123                          (:lispstat-lsp-source-file "lsmacros" 
124                                                     :depends-on ("compound"))
125                          
126                          (:lispstat-lsp-source-file "lsmath"
127                                                     :depends-on ("compound"
128                                                                  "lsmacros"
129                                                                  "lsfloat"))))
131                (:module
132                 "numerics-internal"
133                 :pathname "src/numerics/"
134                 :depends-on ("packaging" "proto-objects" "lispstat-core")
135                 :components
136                 ((:lispstat-lsp-source-file "cffiglue")
137                  (:lispstat-lsp-source-file "dists"
138                                             :depends-on ("cffiglue"))
139                  (:lispstat-lsp-source-file "matrices"
140                                             :depends-on ("cffiglue"))
141                  (:lispstat-lsp-source-file "ladata"
142                                             :depends-on ("cffiglue"
143                                                          "matrices"))
144                  (:lispstat-lsp-source-file "linalg"
145                                             :depends-on ("cffiglue"
146                                                          "matrices"
147                                                          "ladata"))))
149                (:module
150                 "stat-data"
151                 :pathname "src/data/"
152                 :depends-on ("packaging"
153                              "proto-objects"
154                              "lispstat-core"
155                              "numerics-internal")
156                 :components
157                 (;; (:file "data-clos")
158                  (:file "data")))
160                (:module
161                 "lispstat-basics"
162                 :pathname "src/basics/"
163                 :depends-on ("packaging"
164                              "proto-objects"
165                              "lispstat-core"
166                              "numerics-internal"
167                              "stat-data")
168                 :components
169                 ((:lispstat-lsp-source-file "lsbasics")))
172                (:module
173                 "descriptives"
174                 :pathname "src/describe/"
175                 :depends-on ("packaging"
176                              "proto-objects"
177                              "lispstat-core"
178                              "numerics-internal"
179                              "stat-data"
180                              "lispstat-basics")
181                 :components
182                 ((:lispstat-lsp-source-file "statistics")))
184                (:module
185                 "optimization"
186                 :pathname "src/numerics/"
187                 :depends-on ("packaging"
188                              "proto-objects"
189                              "lispstat-core"
190                              "numerics-internal"
191                              "stat-data"
192                              "lispstat-basics")
193                 :components
194                 ((:file "optimize")))
195                  
196                
197                ;; Applications
198                (:module
199                 "stat-models"
200                 :pathname "src/stat-models/"
201                 :depends-on ("packaging"
202                              "proto-objects"
203                              "lispstat-core"
204                              "numerics-internal"
205                              "lispstat-basics"
206                              "descriptives"
207                              "optimization")
208                 :components
209                 ((:lispstat-lsp-source-file "regression")
210                  ;; (:lispstat-lsp-source-file "nonlin"
211                  ;;       :depends-on ("regression"))
212                  ;; (:lispstat-lsp-source-file "bayes"
213                  ;;       :depends-on ("proto-objects"
214                  ;;                    "lsmath"
215                  ;;                    "dists"))
216                  ))
218                (:module
219                 "lisp-stat-user"
220                 :pathname "src/"
221                 :depends-on  ("packaging" "proto-objects"
222                               "lispstat-core"
223                               "numerics-internal" 
224                               "stat-data"
225                               "lispstat-basics"
226                               "descriptives"
227                               "optimization"
228                               "stat-models")
229                 :components ((:file "ls-user")))
231                (:module
232                  "lisp-stat-unittest"
233                  :depends-on ( "lisp-stat-user" ) ;; lift at overall depends level
234                  :pathname "src/unittests/"
235                  :components ((:file "unittests")
236                               (:file "unittests-lstypes")
237                               ;;  "unittests-arrays.lisp"
238                               ;;  "unittests-data-clos.lisp"
239                               ;;  "unittests-proto.lisp"
240                               ;;  "unittests-regression.lisp"
241                               ))))