LIFT tests modified -- recording current values.
[CommonLispStat.git] / cls.asd
blob379385c515d44e3df0816f2722fece44d00758b4
1 ;;  -*- mode: lisp -*-
2 ;;; Time-stamp: <2010-01-03 16:32:56 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   (: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)
38 (defvar *common-lisp-stat-version* "1.0 Alpha 1")
39 (defvar *default-path* "./")
42 (defparameter *cls-home-dir*
43   (directory-namestring
44    (truename (asdf:system-definition-pathname :cls)))
45   "Value considered \"home\" for our data")
48 (setf *cls-home-dir*
49       ;; #p"/cygdrive/c/local/sandbox/Lisp/CommonLispStat/"w
50       ;; #p"/home/tony/sandbox/CommonLispStat.git/"
51       #p"/home/tony/sandbox/CLS.git/")
54 (macrolet ((ls-dir (root-str)
55              `(pathname (concatenate 'string
56                                      (namestring *cls-home-dir*) ,root-str)))
58            (ls-defdir (target-dir-var  root-str)
59              `(defvar ,target-dir-var (ls-dir ,root-str))))
60   (ls-defdir *cls-asdf-dir* "ASDF/")
61   (ls-defdir *cls-data-dir* "Data/")
62   (ls-defdir *cls-external-dir* "external/")
63   ;; reminder of testing
64   ;;(macroexpand '(ls-defdir *cls-asdf-dir* "ASDF"))
65   ;;(macroexpand-1 '(ls-defdir *cls-asdf-dir* "ASDF"))
66   ;;(macroexpand-1 '(ls-dir "ASDF"))
67   )
69 ;;(pushnew *cls-asdf-dir* asdf:*central-registry*)
70 ;;(pushnew #p"C:/Lisp/libs/" asdf-util:*source-dirs* :test #'equal) ; eg for Microsoft
72 (defpackage #:cls-system
73     (:use :common-lisp :asdf))
75 (in-package #:cls-system)
77 ;;; To avoid renaming everything from *.lsp to *.lisp...
78 ;;; borrowed from Cyrus Harmon's work, for example for the ch-util.
79 ;;; NOT secure against serving multiple architectures/hardwares from
80 ;;; the same file system (i.e. PPC and x86 would not be
81 ;;; differentiated). 
83 (defclass cls-lsp-source-file (cl-source-file) ())
84 (defparameter *fasl-directory*
85    (make-pathname :directory '(:relative
86                                #+sbcl "fasl-sbcl"
87                                #+openmcl "fasl-ccl"
88                                #+openmcl "fasl-ccl"
89                                #+cmu "fasl-cmucl"
90                                #+clisp "fasl-clisp"
91                                #-(or sbcl openmcl clisp cmucl) "fasl"
92                                )))
95 ;;; Handle Luke's *.lsp suffix
96 (defmethod source-file-type ((c cls-lsp-source-file) (s module)) "lsp")
97 (defmethod asdf::output-files :around ((operation compile-op)
98                                        (c cls-lsp-source-file))
99   (list (merge-pathnames *fasl-directory*
100                          (compile-file-pathname (component-pathname c)))))
101 ;;; again, thanks to Cyrus for saving me time...
104 (defsystem "cls"
105   :version #.(with-open-file
106                  (vers (merge-pathnames "version.lisp-expr" *load-truename*))
107                (read vers))
108   :author "A.J. Rossini <blindglobe@gmail.com>"
109   :license "BSD"
110   :description "Common Lisp Statistics (CLS): A System for Statistical
111   Computing with Common Lisp; based on Common LispStat (CLS alpha1) by
112   Luke Tierney <luke@stat.uiowa.edu> (apparently originally written
113   when Luke was at CMU, on leave at Bell Labs?).  Last touched by him
114   in 1991, then by AJR starting in 2005."
115   :serial t
116   :depends-on (:cffi
117                :xarray
118                :lisp-matrix ; on fnv, cl-blapack, ffa
119                :listoflist
120                :lift
121                :rsm-string
122                ;;    :cl-cairo2  :cl-2d
123                )
124   :components ((:static-file "version" :pathname #p"version.lisp-expr")
125                (:static-file "LICENSE")
126                (:static-file "README")
128                (:module
129                 "packaging"
130                 :pathname #p"src/"
131                 :components
132                 ((:file "packages")))
134                (:module
135                 "proto-objects"
136                 :pathname "src/objsys/"
137                 :serial t
138                 :depends-on ("packaging")
139                 :components
140                 ((:cls-lsp-source-file "lsobjects")))
142                (:module "cls-core"
143                         :pathname "src/basics/"
144                         :serial t
145                         :depends-on ("packaging" "proto-objects")
146                         :components
147                         ((:cls-lsp-source-file "lstypes")
148                          (:cls-lsp-source-file "lsfloat")
149                          
150                          (:cls-lsp-source-file "compound")
151                          (:cls-lsp-source-file "lsmacros" 
152                                                     :depends-on ("compound"))
153                          
154                          (:cls-lsp-source-file "lsmath"
155                                                     :depends-on ("compound"
156                                                                  "lsmacros"
157                                                                  "lsfloat"))))
159                (:module
160                 "numerics-internal"
161                 :pathname "src/numerics/"
162                 :depends-on ("packaging" "proto-objects" "cls-core")
163                 :components
164                 ((:cls-lsp-source-file "cffiglue")
165                  (:cls-lsp-source-file "dists"
166                                             :depends-on ("cffiglue"))
168                  (:cls-lsp-source-file "matrices"
169                                             :depends-on ("cffiglue"))
170                  (:cls-lsp-source-file "ladata"
171                                             :depends-on ("cffiglue"
172                                                          "matrices"))
173                  (:file "linalg"
174                         :depends-on ("cffiglue"
175                                      "matrices"
176                                      "ladata"))
178                  ))
181                ;; Dataframes and statistical structures.
182                (:module
183                 "stat-data"
184                 :pathname "src/data/"
185                 :depends-on ("packaging"
186                              "proto-objects"
187                              "cls-core"
188                              "numerics-internal")
189                 :components
190                 ((:file "dataframe")
191                  (:file "dataframe-array")
192                  (:file "dataframe-matrixlike")
193                  (:file "dataframe-listoflist")
194                  (:file "data")
195                  (:file "data-xls-compat")
196                  (:file "import")))
198                (:module
199                 "cls-basics"
200                 :pathname "src/basics/"
201                 :depends-on ("packaging"
202                              "proto-objects"
203                              "cls-core"
204                              "numerics-internal"
205                              "stat-data")
206                 :components
207                 ((:cls-lsp-source-file "lsbasics")))
210                
211                (:module
212                 "descriptives"
213                 :pathname "src/describe/"
214                 :depends-on ("packaging"
215                              "proto-objects"
216                              "cls-core"
217                              "numerics-internal"
218                              "stat-data"
219                              "cls-basics")
220                 :components
221                 ((:cls-lsp-source-file "statistics")))
223                (:module
224                 "visualize"
225                 :pathname "src/visualize/"
226                 :depends-on ("cls-core")
227                 :components
228                 ((:file "plot")))
230                (:module
231                 "optimization"
232                 :pathname "src/numerics/"
233                 :depends-on ("packaging"
234                              "proto-objects"
235                              "cls-core"
236                              "numerics-internal"
237                              "stat-data"
238                              "cls-basics")
239                 :components
240                 ((:file "optimize")))
241                  
242                
243                ;; Applications
244                (:module
245                 "stat-models"
246                 :pathname "src/stat-models/"
247                 :depends-on ("packaging"
248                              "proto-objects"
249                              "cls-core"
250                              "numerics-internal"
251                              "cls-basics"
252                              "descriptives"
253                              "optimization")
254                 :components
255                 ((:file "regression")
256                  ;; (:cls-lsp-source-file "nonlin"
257                  ;;       :depends-on ("regression"))
258                  ;; (:cls-lsp-source-file "bayes"
259                  ;;       :depends-on ("regression"))
260                  ))
262                ;; Applications
263                (:module
264                 "example-data"
265                 :pathname "Data/"
266                 :depends-on ("packaging"
267                              "proto-objects"
268                              "cls-core"
269                              "numerics-internal"
270                              "cls-basics"
271                              "descriptives"
272                              "optimization")
273                 :components
274                 ((:file "examples")
275                  (:cls-lsp-source-file "absorbtion")
276                  (:cls-lsp-source-file "diabetes")
277                  (:cls-lsp-source-file "leukemia")
278                  (:cls-lsp-source-file "randu")
279                  (:cls-lsp-source-file "aircraft")
280                  (:cls-lsp-source-file "metabolism")
281                  (:cls-lsp-source-file "book")
282                  (:cls-lsp-source-file "heating")
283                  (:cls-lsp-source-file "oxygen")
284                  (:cls-lsp-source-file "stackloss") 
285                  (:cls-lsp-source-file "car-prices")
286                  (:cls-lsp-source-file "iris")
287                  (:cls-lsp-source-file "puromycin")
288                  (:cls-lsp-source-file "tutorial")))
290                (:module
291                  "lisp-stat-unittest"
292                 :depends-on  ("packaging" "proto-objects"
293                               "cls-core"
294                               "numerics-internal" 
295                               "stat-data"
296                               "cls-basics"
297                               "descriptives"
298                               "optimization"
299                               "stat-models"
300                               "example-data")
301                  :pathname "src/unittests/"
302                  :components ((:file "unittests")
303                               (:file "unittests-lstypes" :depends-on ("unittests"))
304                               (:file "unittests-specfn" :depends-on ("unittests"))
305                               (:file "unittests-prob" :depends-on ("unittests"))
306                               (:file "unittests-proto" :depends-on ("unittests"))
307                               (:file "unittests-regression" :depends-on ("unittests"))
308                               (:file "unittests-listoflist" :depends-on ("unittests"))
309                               (:file "unittests-arrays" :depends-on ("unittests"))
310                               (:file "unittests-dataframe" :depends-on ("unittests"))))))
314  (defmethod perform ((o test-op) (c (eql (find-system :cls))))
315   (flet ((run-tests (&rest args)
316            (apply (intern (string '#:run-tests) '#:cffi-tests) args)))
317     (run-tests :compiled nil)
318     (run-tests :compiled t)))