examples cleaned up
[CommonLispStat.git] / cls.asd
blob6c2be6e2fccd265a1602846a2cc3000a03e8792a
1 ;;  -*- mode: lisp -*-
2 ;;; Time-stamp: <2010-01-14 08:08:39 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--2010, by AJ Rossini <blindglobe@gmail.com>
7 ;;; License:    MIT, see the file LICENSE.mit in this directory for details.
8 ;;; Purpose:    ASDF specification for Common Lisp Statistics
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 Common Lisp Statistics configuration/loading variables and related functions.")
27   (:nicknames :cls-config)
28   (:use :common-lisp)
29   (:export *common-lisp-stat-version* 
30            *default-path*
31            *lsos-files* *basic-files* *ls-files*
32            *cls-home-dir* *cls-data-dir* *cls-examples-dir*))
34 (in-package :lisp-stat-config)
36 (defvar *common-lisp-stat-version* "1"
37   "Version currently loaded and being used.  Need to make into a
38   parseable object for version testing. Currently using integers.")
40 (defparameter *cls-home-dir*
41   (directory-namestring
42    (truename (asdf:system-definition-pathname :cls)))
43   "Value considered \"home\" for the installation")
46 (setf *cls-home-dir*
47       ;; #p"/cygdrive/c/local/sandbox/Lisp/CommonLispStat/"w
48       ;; #p"/home/tony/sandbox/CommonLispStat.git/"
49       #p"/home/tony/sandbox/CLS.git/")
52 (macrolet ((ls-dir (root-str)
53              `(pathname (concatenate 'string
54                                      (namestring *cls-home-dir*) ,root-str)))
56            (ls-defdir (target-dir-var  root-str)
57              `(defvar ,target-dir-var (ls-dir ,root-str))))
58   (ls-defdir *cls-asdf-dir* "ASDF/")
59   (ls-defdir *cls-data-dir* "Data/")
60   (ls-defdir *cls-external-dir* "external/")
61   ;; reminder of testing
62   ;;(macroexpand '(ls-defdir *cls-asdf-dir* "ASDF"))
63   ;;(macroexpand-1 '(ls-defdir *cls-asdf-dir* "ASDF"))
64   ;;(macroexpand-1 '(ls-dir "ASDF"))
65   )
67 ;;(pushnew *cls-asdf-dir* asdf:*central-registry*)
68 ;;(pushnew #p"C:/Lisp/libs/" asdf-util:*source-dirs* :test #'equal) ; eg for Microsoft
70 (defpackage #:cls-system
71     (:use :common-lisp :asdf))
73 (in-package #:cls-system)
75 ;;; To avoid renaming everything from *.lsp to *.lisp...
76 ;;; borrowed from Cyrus Harmon's work, for example for the ch-util.
77 ;;; NOT secure against serving multiple architectures/hardwares from
78 ;;; the same file system (i.e. PPC and x86 would not be
79 ;;; differentiated). 
81 (defclass cls-lsp-source-file (cl-source-file) ())
82 (defparameter *fasl-directory*
83    (make-pathname :directory '(:relative
84                                #+sbcl "fasl-sbcl"
85                                #+openmcl "fasl-ccl"
86                                #+openmcl "fasl-ccl"
87                                #+cmu "fasl-cmucl"
88                                #+clisp "fasl-clisp"
89                                #-(or sbcl openmcl clisp cmucl) "fasl"
90                                )))
93 ;;; Handle Luke's *.lsp suffix
94 (defmethod source-file-type ((c cls-lsp-source-file) (s module)) "lsp")
95 (defmethod asdf::output-files :around ((operation compile-op)
96                                        (c cls-lsp-source-file))
97   (list (merge-pathnames *fasl-directory*
98                          (compile-file-pathname (component-pathname c)))))
99 ;;; again, thanks to Cyrus for saving me time...
102 (defsystem "cls"
103   :version #.(with-open-file
104                  (vers (merge-pathnames "version.lisp-expr" *load-truename*))
105                (read vers))
106   :author "A.J. Rossini <blindglobe@gmail.com>"
107   :license "BSD"
108   :description "Common Lisp Statistics (CLS): A System for Statistical
109   Computing with Common Lisp; based on Common LispStat (CLS alpha1) by
110   Luke Tierney <luke@stat.uiowa.edu> (apparently originally written
111   when Luke was at CMU, on leave at Bell Labs?).  Last touched by him
112   in 1991, then by AJR starting in 2005."
113   :serial t
114   :depends-on (:cffi
115                :xarray
116                :lisp-matrix ; on fnv, cl-blapack, ffa
117                :listoflist
118                :lift
119                :rsm-string
120                ;;    :cl-cairo2  :cl-2d
121                )
122   :components ((:static-file "version" :pathname #p"version.lisp-expr")
123                (:static-file "LICENSE.mit")
124                (:static-file "README")
126                (:module
127                 "packaging"
128                 :pathname #p"src/"
129                 :components
130                 ((:file "packages")))
132                (:module
133                 "proto-objects"
134                 :pathname "src/objsys/"
135                 :serial t
136                 :depends-on ("packaging")
137                 :components
138                 ((:cls-lsp-source-file "lsobjects")))
140                (:module "cls-core"
141                         :pathname "src/basics/"
142                         :serial t
143                         :depends-on ("packaging" "proto-objects")
144                         :components
145                         ((:cls-lsp-source-file "lstypes")
146                          (:cls-lsp-source-file "lsfloat")
147                          
148                          (:cls-lsp-source-file "compound")
149                          (:cls-lsp-source-file "lsmacros" 
150                                                     :depends-on ("compound"))
151                          
152                          (:cls-lsp-source-file "lsmath"
153                                                     :depends-on ("compound"
154                                                                  "lsmacros"
155                                                                  "lsfloat"))))
157                (:module
158                 "numerics-internal"
159                 :pathname "src/numerics/"
160                 :depends-on ("packaging" "proto-objects" "cls-core")
161                 :components
162                 ((:cls-lsp-source-file "cffiglue")
163                  (:cls-lsp-source-file "dists"
164                                             :depends-on ("cffiglue"))
166                  (:cls-lsp-source-file "matrices"
167                                             :depends-on ("cffiglue"))
168                  (:cls-lsp-source-file "ladata"
169                                             :depends-on ("cffiglue"
170                                                          "matrices"))
171                  (:file "linalg"
172                         :depends-on ("cffiglue"
173                                      "matrices"
174                                      "ladata"))
176                  ))
179                ;; Dataframes and statistical structures.
180                (:module
181                 "stat-data"
182                 :pathname "src/data/"
183                 :depends-on ("packaging"
184                              "proto-objects"
185                              "cls-core"
186                              "numerics-internal")
187                 :components
188                 ((:file "dataframe")
189                  (:file "dataframe-array")
190                  (:file "dataframe-matrixlike")
191                  (:file "dataframe-listoflist")
192                  (:file "data")
193                  (:file "data-xls-compat")
194                  (:file "import")))
196                (:module
197                 "cls-basics"
198                 :pathname "src/basics/"
199                 :depends-on ("packaging"
200                              "proto-objects"
201                              "cls-core"
202                              "numerics-internal"
203                              "stat-data")
204                 :components
205                 ((:cls-lsp-source-file "lsbasics")))
208                
209                (:module
210                 "descriptives"
211                 :pathname "src/describe/"
212                 :depends-on ("packaging"
213                              "proto-objects"
214                              "cls-core"
215                              "numerics-internal"
216                              "stat-data"
217                              "cls-basics")
218                 :components
219                 ((:cls-lsp-source-file "statistics")))
221                (:module
222                 "visualize"
223                 :pathname "src/visualize/"
224                 :depends-on ("cls-core")
225                 :components
226                 ((:file "plot")))
228                (:module
229                 "optimization"
230                 :pathname "src/numerics/"
231                 :depends-on ("packaging"
232                              "proto-objects"
233                              "cls-core"
234                              "numerics-internal"
235                              "stat-data"
236                              "cls-basics")
237                 :components
238                 ((:file "optimize")))
239                  
240                
241                ;; Applications
242                (:module
243                 "stat-models"
244                 :pathname "src/stat-models/"
245                 :depends-on ("packaging"
246                              "proto-objects"
247                              "cls-core"
248                              "numerics-internal"
249                              "cls-basics"
250                              "descriptives"
251                              "optimization")
252                 :components
253                 ((:file "regression")
254                  ;; (:cls-lsp-source-file "nonlin"
255                  ;;       :depends-on ("regression"))
256                  ;; (:cls-lsp-source-file "bayes"
257                  ;;       :depends-on ("regression"))
258                  ))
260                ;; Applications
261                (:module
262                 "example-data"
263                 :pathname "Data/"
264                 :depends-on ("packaging"
265                              "proto-objects"
266                              "cls-core"
267                              "numerics-internal"
268                              "cls-basics"
269                              "descriptives"
270                              "optimization")
271                 :components
272                 ((:file "examples")
273                  (:cls-lsp-source-file "absorbtion")
274                  (:cls-lsp-source-file "diabetes")
275                  (:cls-lsp-source-file "leukemia")
276                  (:cls-lsp-source-file "randu")
277                  (:cls-lsp-source-file "aircraft")
278                  (:cls-lsp-source-file "metabolism")
279                  (:cls-lsp-source-file "book")
280                  (:cls-lsp-source-file "heating")
281                  (:cls-lsp-source-file "oxygen")
282                  (:cls-lsp-source-file "stackloss") 
283                  (:cls-lsp-source-file "car-prices")
284                  (:cls-lsp-source-file "iris")
285                  (:cls-lsp-source-file "puromycin")
286                  (:cls-lsp-source-file "tutorial")))
288                (:module
289                  "lisp-stat-unittest"
290                 :depends-on  ("packaging" "proto-objects"
291                               "cls-core"
292                               "numerics-internal" 
293                               "stat-data"
294                               "cls-basics"
295                               "descriptives"
296                               "optimization"
297                               "stat-models"
298                               "example-data")
299                  :pathname "src/unittests/"
300                  :components ((:file "unittests")
301                               (:file "unittests-lstypes" :depends-on ("unittests"))
302                               (:file "unittests-specfn" :depends-on ("unittests"))
303                               (:file "unittests-prob" :depends-on ("unittests"))
304                               (:file "unittests-proto" :depends-on ("unittests"))
305                               (:file "unittests-regression" :depends-on ("unittests"))
306                               (:file "unittests-listoflist" :depends-on ("unittests"))
307                               (:file "unittests-arrays" :depends-on ("unittests"))
308                               (:file "unittests-dataframe" :depends-on ("unittests"))))))
311  (defmethod perform ((o test-op) (c (eql (find-system :cls))))
312     (describe (lift:run-tests :suite 'lisp-stat-unittests::lisp-stat-ut)))