first set of changes from Brent Fulgham, a bunch more coming in the C code.
[CommonLispStat.git] / lispstat.asd
bloba73db0e269741f22bb424cff4dbb1addbc41aeb2
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-09-17 12:06:22 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, but have in the past due to errors...
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 
49 ;;; MAJOR HACK, FIXME!
50 ;;(load "/media/disk/Desktop/sandbox/matlisp.git/start.lisp")
52 (in-package :cl-user)
54 (defpackage #:lispstat-system
55     (:use :common-lisp :asdf))
57 (in-package #:lispstat-system)
59 ;;; To avoid renaming everything from *.lsp to *.lisp...
60 ;;; borrowed from Cyrus Harmon's work, for example for the ch-util.
61 ;;; NOT secure against serving multiple architectures/hardwares from
62 ;;; the same file system (i.e. PPC and x86 would not be
63 ;;; differentiated). 
65 (defclass lispstat-lsp-source-file (cl-source-file) ())
66 (defparameter *fasl-directory*
67    (make-pathname :directory '(:relative
68                                #+sbcl "sbcl-fasl"
69                                #+openmcl "openmcl-fasl"
70                                #+cmu "cmucl-fasl"
71                                #+clisp "clisp-fasl"
72                                #-(or sbcl openmcl clisp cmucl) "fasl"
73                                )))
76 ;;; Handle Luke's *.lsp suffix
77 (defmethod source-file-type ((c lispstat-lsp-source-file) (s module)) "lsp")
78 (defmethod asdf::output-files :around ((operation compile-op)
79                                        (c lispstat-lsp-source-file))
80   (list (merge-pathnames *fasl-directory*
81                          (compile-file-pathname (component-pathname c)))))
82 ;;; again, thanks to Cyrus for saving me time...
85 (defsystem "lispstat"
86   :version #.(with-open-file
87                  (vers (merge-pathnames "version.lisp-expr" *load-truename*))
88                (read vers))
89   :author "A.J. Rossini <blindglobe@gmail.com>"
90   :license "BSD"
91   :description "CommonLispStat (CLS): A System for Statistical
92   Computing with Common Lisp; based on CLS alpha1 by Luke Tierney
93   <luke@stat.uiowa.edu> (apparently originally written when Luke was
94   at CMU, on leave somewhere?).   Last touched by him in 1991, then in
95   2005--2008." 
96   :serial t
97   :depends-on (:cffi  :lift :lisp-matrix) ;; need a matrix library
98   :components ((:static-file "version" :pathname #p"version.lisp-expr")
99                (:static-file "LICENSE")
100                (:static-file "README")
102                (:module "proto-objects"
103                         :pathname "src/objsys/"
104                         :components
105                         ((:lispstat-lsp-source-file "lsobjects")))
107                (:module "lispstat-core"
108                         :pathname "src/basics/"
109                         :serial t
110                         :depends-on ("proto-objects")
111                         :components
112                         ((:lispstat-lsp-source-file "defsys")
113                          (:lispstat-lsp-source-file "lstypes")
114                          (:lispstat-lsp-source-file "lsfloat")
115                          
116                          (:lispstat-lsp-source-file "compound")
117                          (:lispstat-lsp-source-file "lsmacros" 
118                                                     :depends-on ("compound"))
119                          
120                          (:lispstat-lsp-source-file "lsmath"
121                                                     :depends-on ("compound"
122                                                                  "lsmacros"
123                                                                  "lsfloat"))))
125                (:module
126                 "numerics-internal"
127                 :pathname "src/numerics/"
128                 :depends-on ("proto-objects" "lispstat-core")
129                 :components
130                 ((:lispstat-lsp-source-file "cffiglue")
131                  (:lispstat-lsp-source-file "dists"
132                                             :depends-on ("cffiglue"))
133                  (:lispstat-lsp-source-file "matrices"
134                                             :depends-on ("cffiglue"))
135                  (:lispstat-lsp-source-file "ladata"
136                                             :depends-on ("cffiglue"
137                                                          "matrices"))
138                  (:lispstat-lsp-source-file "linalg"
139                                             :depends-on ("cffiglue"
140                                                          "matrices"
141                                                          "ladata"))))
143                (:module
144                 "stat-data"
145                 :pathname "src/data/"
146                 :depends-on ("proto-objects"
147                              "lispstat-core"
148                              "numerics-internal")
149                 :components
150                 (;; (:file "data-clos")
151                  (:file "data")))
153                (:module
154                 "cls-basics"
155                 :pathname "src/basics/"
156                 :depends-on ("proto-objects"
157                              "lispstat-core"
158                              "numerics-internal" )
159                 :components
160                 ((:lispstat-lsp-source-file "lsbasics")))
161                
162                (:module
163                 "describe"
164                 :pathname "src/describe/"
165                 :depends-on ("proto-objects"
166                              "lispstat-core"
167                              "numerics-internal"
168                              "stat-data"
169                              "cls-basics")
170                 :components
171                 ((:lispstat-lsp-source-file "statistics")))
172                
173                (:module
174                 "optimization"
175                 :pathname "src/numerics/"
176                 :depends-on ("proto-objects"
177                              "lispstat-core"
178                              "numerics-internal")
179                 :components ((:file "optimize")))
180                
181                
182                ;; Applications
183                (:module
184                 "stat-models"
185                 :pathname "src/stat-models/"
186                 :depends-on ("proto-objects"
187                              "lispstat-core"
188                              "numerics-internal"
189                              "cls-basics"
190                              "describe")
191                 :components
192                 ((:lispstat-lsp-source-file "regression")
193                  ;; (:lispstat-lsp-source-file "nonlin"
194                  ;;       :depends-on ("regression"))
195                  ;; (:lispstat-lsp-source-file "bayes"
196                  ;;       :depends-on ("proto-objects"
197                  ;;                    "lsmath"
198                  ;;                    "dists"))
199                  ))
201                (:module
202                 "lisp-stat-one"
203                 :pathname "src/"
204                 :depends-on  ("proto-objects"
205                               "lispstat-core"
206                               "numerics-internal" 
207                               "cls-basics"
208                               "stat-data"
209                               "describe"
210                               "stat-models")
211                 :components ((:file "ls-user")))
213                (:module
214                  "lisp-stat-unittest"
215                  :depends-on ( "lisp-stat-one" ) ;; shouldn't need :lift!
216                  :pathname "src/unittests/"
217                  :components ((:file "unittests")
218                               (:file "unittests-lstypes")
219                               ;;  "unittests-arrays.lisp"
220                               ;;  "unittests-data-clos.lisp"
221                               ;;  "unittests-proto.lisp"
222                               ;;  "unittests-regression.lisp"
223                               ))))