fixed typo, sketch commented-out proposed code.
[CommonLispStat.git] / cls.asd
blob1495dd223d14f3adf5bfbff04ead5defb8933812
1 ;;  -*- mode: lisp -*-
2 ;;; Time-stamp: <2009-12-23 08:40:18 tony>
3 ;;; Created:    <2005-05-30 17:09:47 blindglobe>
4 ;;; File:       cls.asd
5 ;;; Author:     AJ Rossini <blindglobe@gmail.com>
6 ;;; Copyright:  (c) 2005--2008, by AJ Rossini <blindglobe@gmail.com>
7 ;;; License:    BSD, see the top level directory file LICENSE for details.
8 ;;; Purpose:    ASDF packaging for CommonLisp Stat
10 ;;; What is this talk of 'release'? Klingons do not make software
11 ;;; 'releases'.  Our software 'escapes', leaving a bloody trail of
12 ;;; designers and quality assurance people in its wake.
14 ;; Load ASDF if it isn't loaded
15 #-asdf(load (pathname (concatenate 'string (namestring *cls-external-dir*) "asdf")))
17 (in-package :cl-user)
19 ;;; enforce all floating reads as doubles
20 ;; (setf *read-default-float-format* 'double-float)
22 ;;; optimization settings
23 ;; (proclaim '(optimize (safety 2) (space 3) (speed 3)))
25 (defpackage :lisp-stat-config
26   (:documentation "holds configuration variables, support functions, and ASDF structure.")
27   (:use :common-lisp)
28   (:export *common-lisp-stat-version* 
29            *default-path*
30            *lsos-files* *basic-files* *ls-files*
31            *cls-home-dir* *cls-data-dir* *cls-examples-dir*))
33 (in-package :lisp-stat-config)
37 (defvar *common-lisp-stat-version* "1.0 Alpha 1")
38 (defvar *default-path* "./")
41 (defparameter *cls-home-dir*
42   (directory-namestring
43    (truename (asdf:system-definition-pathname :cls)))
44   "Value considered \"home\" for our data")
47 (setf *cls-home-dir*
48       ;; #p"/cygdrive/c/local/sandbox/Lisp/CommonLispStat/"w
49       ;; #p"/home/tony/sandbox/CommonLispStat.git/"
50       #p"/home/tony/sandbox/CLS.git/")
53 (macrolet ((ls-dir (root-str)
54              `(pathname (concatenate 'string
55                                      (namestring *cls-home-dir*) ,root-str)))
57            (ls-defdir (target-dir-var  root-str)
58              `(defvar ,target-dir-var (ls-dir ,root-str))))
59   (ls-defdir *cls-asdf-dir* "ASDF/")
60   (ls-defdir *cls-data-dir* "Data/")
61   (ls-defdir *cls-external-dir* "external/")
62   ;; reminder of testing
63   ;;(macroexpand '(ls-defdir *cls-asdf-dir* "ASDF"))
64   ;;(macroexpand-1 '(ls-defdir *cls-asdf-dir* "ASDF"))
65   ;;(macroexpand-1 '(ls-dir "ASDF"))
66   )
68 ;;(pushnew *cls-asdf-dir* asdf:*central-registry*)
69 ;;(pushnew #p"C:/Lisp/libs/" asdf-util:*source-dirs* :test #'equal) ; eg for Microsoft
71 (defpackage #:cls-system
72     (:use :common-lisp :asdf))
74 (in-package #:cls-system)
76 ;;; To avoid renaming everything from *.lsp to *.lisp...
77 ;;; borrowed from Cyrus Harmon's work, for example for the ch-util.
78 ;;; NOT secure against serving multiple architectures/hardwares from
79 ;;; the same file system (i.e. PPC and x86 would not be
80 ;;; differentiated). 
82 (defclass cls-lsp-source-file (cl-source-file) ())
83 (defparameter *fasl-directory*
84    (make-pathname :directory '(:relative
85                                #+sbcl "fasl-sbcl"
86                                #+openmcl "fasl-ccl"
87                                #+openmcl "fasl-ccl"
88                                #+cmu "fasl-cmucl"
89                                #+clisp "fasl-clisp"
90                                #-(or sbcl openmcl clisp cmucl) "fasl"
91                                )))
94 ;;; Handle Luke's *.lsp suffix
95 (defmethod source-file-type ((c cls-lsp-source-file) (s module)) "lsp")
96 (defmethod asdf::output-files :around ((operation compile-op)
97                                        (c cls-lsp-source-file))
98   (list (merge-pathnames *fasl-directory*
99                          (compile-file-pathname (component-pathname c)))))
100 ;;; again, thanks to Cyrus for saving me time...
103 (defsystem "cls"
104   :version #.(with-open-file
105                  (vers (merge-pathnames "version.lisp-expr" *load-truename*))
106                (read vers))
107   :author "A.J. Rossini <blindglobe@gmail.com>"
108   :license "BSD"
109   :description "Common Lisp Statistics (CLS): A System for Statistical
110   Computing with Common Lisp; based on Common LispStat (CLS alpha1) by
111   Luke Tierney <luke@stat.uiowa.edu> (apparently originally written
112   when Luke was at CMU, on leave at Bell Labs?).  Last touched by him
113   in 1991, then by AJR starting in 2005."
114   :serial t
115   :depends-on (:cffi
116                :xarray
117                :lisp-matrix ; on fnv, cl-blapack, ffa
118                :listoflist
119                :lift
120                :rsm-string
121                ;;    :cl-cairo2  :cl-2d
122                )
123   :components ((:static-file "version" :pathname #p"version.lisp-expr")
124                (:static-file "LICENSE")
125                (:static-file "README")
127                (:module
128                 "packaging"
129                 :pathname #p"src/"
130                 :components
131                 ((:file "packages")))
133                (:module
134                 "proto-objects"
135                 :pathname "src/objsys/"
136                 :serial t
137                 :depends-on ("packaging")
138                 :components
139                 ((:cls-lsp-source-file "lsobjects")))
141                (:module "cls-core"
142                         :pathname "src/basics/"
143                         :serial t
144                         :depends-on ("packaging" "proto-objects")
145                         :components
146                         ((:cls-lsp-source-file "lstypes")
147                          (:cls-lsp-source-file "lsfloat")
148                          
149                          (:cls-lsp-source-file "compound")
150                          (:cls-lsp-source-file "lsmacros" 
151                                                     :depends-on ("compound"))
152                          
153                          (:cls-lsp-source-file "lsmath"
154                                                     :depends-on ("compound"
155                                                                  "lsmacros"
156                                                                  "lsfloat"))))
158                (:module
159                 "numerics-internal"
160                 :pathname "src/numerics/"
161                 :depends-on ("packaging" "proto-objects" "cls-core")
162                 :components
163                 ((:cls-lsp-source-file "cffiglue")
164                  (:cls-lsp-source-file "dists"
165                                             :depends-on ("cffiglue"))
167                  (:cls-lsp-source-file "matrices"
168                                             :depends-on ("cffiglue"))
169                  (:cls-lsp-source-file "ladata"
170                                             :depends-on ("cffiglue"
171                                                          "matrices"))
172                  (:file "linalg"
173                         :depends-on ("cffiglue"
174                                      "matrices"
175                                      "ladata"))
177                  ))
180                ;; Dataframes and statistical structures.
181                (:module
182                 "stat-data"
183                 :pathname "src/data/"
184                 :depends-on ("packaging"
185                              "proto-objects"
186                              "cls-core"
187                              "numerics-internal")
188                 :components
189                 ((:file "dataframe")
190                  (:file "dataframe-array")
191                  (:file "dataframe-matrixlike")
192                  (:file "dataframe-listoflist")
193                  (:file "data")
194                  (:file "data-xls-compat")
195                  (:file "import")))
197                (:module
198                 "cls-basics"
199                 :pathname "src/basics/"
200                 :depends-on ("packaging"
201                              "proto-objects"
202                              "cls-core"
203                              "numerics-internal"
204                              "stat-data")
205                 :components
206                 ((:cls-lsp-source-file "lsbasics")))
209                
210                (:module
211                 "descriptives"
212                 :pathname "src/describe/"
213                 :depends-on ("packaging"
214                              "proto-objects"
215                              "cls-core"
216                              "numerics-internal"
217                              "stat-data"
218                              "cls-basics")
219                 :components
220                 ((:cls-lsp-source-file "statistics")))
222                (:module
223                 "visualize"
224                 :pathname "src/visualize/"
225                 :depends-on ("cls-core")
226                 :components
227                 ((:file "plot")))
229                (:module
230                 "optimization"
231                 :pathname "src/numerics/"
232                 :depends-on ("packaging"
233                              "proto-objects"
234                              "cls-core"
235                              "numerics-internal"
236                              "stat-data"
237                              "cls-basics")
238                 :components
239                 ((:file "optimize")))
240                  
241                
242                ;; Applications
243                (:module
244                 "stat-models"
245                 :pathname "src/stat-models/"
246                 :depends-on ("packaging"
247                              "proto-objects"
248                              "cls-core"
249                              "numerics-internal"
250                              "cls-basics"
251                              "descriptives"
252                              "optimization")
253                 :components
254                 ((:file "regression")
255                  ;; (:cls-lsp-source-file "nonlin"
256                  ;;       :depends-on ("regression"))
257                  ;; (:cls-lsp-source-file "bayes"
258                  ;;       :depends-on ("regression"))
259                  ))
261                ;; Applications
262                (:module
263                 "example-data"
264                 :pathname "Data/"
265                 :depends-on ("packaging"
266                              "proto-objects"
267                              "cls-core"
268                              "numerics-internal"
269                              "cls-basics"
270                              "descriptives"
271                              "optimization")
272                 :components
273                 ((:file "examples")
274                  (:cls-lsp-source-file "absorbtion")
275                  (:cls-lsp-source-file "diabetes")
276                  (:cls-lsp-source-file "leukemia")
277                  (:cls-lsp-source-file "randu")
278                  (:cls-lsp-source-file "aircraft")
279                  (:cls-lsp-source-file "metabolism")
280                  (:cls-lsp-source-file "book")
281                  (:cls-lsp-source-file "heating")
282                  (:cls-lsp-source-file "oxygen")
283                  (:cls-lsp-source-file "stackloss") 
284                  (:cls-lsp-source-file "car-prices")
285                  (:cls-lsp-source-file "iris")
286                  (:cls-lsp-source-file "puromycin")
287                  (:cls-lsp-source-file "tutorial")))
289                (:module
290                  "lisp-stat-unittest"
291                 :depends-on  ("packaging" "proto-objects"
292                               "cls-core"
293                               "numerics-internal" 
294                               "stat-data"
295                               "cls-basics"
296                               "descriptives"
297                               "optimization"
298                               "stat-models"
299                               "example-data")
300                  :pathname "src/unittests/"
301                  :components ((:file "unittests")
302                               (:file "unittests-lstypes" :depends-on ("unittests"))
303                               (:file "unittests-specfn" :depends-on ("unittests"))
304                               (:file "unittests-prob" :depends-on ("unittests"))
305                               (:file "unittests-proto" :depends-on ("unittests"))
306                               (:file "unittests-regression" :depends-on ("unittests"))
307                               (:file "unittests-listoflist" :depends-on ("unittests"))
308                               (:file "unittests-arrays" :depends-on ("unittests"))
309                               (:file "unittests-dataframe" :depends-on ("unittests"))))))