first stage finished, moving lisp code out of main dir, while keeping asdf happy.
[CommonLispStat.git] / lispstat.asd
blob55b338694b08d9552975223cd433c3ed775961c4
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-07-31 09:10:05 tony>
6 ;;; Created:    <2005-05-30 17:09:47 blindglobe>
8 ;; What package should we be in?  Contaminating cl-user is probably EVIL.
9 (in-package :cl-user)
12 (defvar *lispstat-home-dir*
13   (directory-namestring (truename (asdf:system-definition-pathname
14                                    :lispstat)))
15   "Value considered \"home\" for our data")
18   (setf *lispstat-home-dir*
19       (directory-namestring (truename (asdf:system-definition-pathname
20                                        :lispstat))))
23 (macrolet ((ls-dir (root-str)
24              `(pathname (concatenate 'string
25                                      (namestring *lispstat-home-dir*) ,root-str)))
27            (ls-defdir (target-dir-var  root-str)
28              `(defvar ,target-dir-var (ls-dir ,root-str))))
30   ;;(macroexpand '(ls-defdir *lispstat-asdf-dir* "ASDF"))
31   ;;(macroexpand-1 '(ls-defdir *lispstat-asdf-dir* "ASDF"))
32   ;;(macroexpand-1 '(ls-dir "ASDF"))
34   (ls-defdir *lispstat-asdf-dir* "ASDF/")
35   (ls-defdir *lispstat-data-dir* "data/")
36   (ls-defdir *lispstat-external-dir* "external/")
37   (ls-defdir *lispstat-examples-dir* "examples/"))
39 (pushnew *lispstat-asdf-dir* asdf:*central-registry*)
40 ;; (pushnew #p"C:/Lisp/libs/" asdf-util:*source-dirs* :test #'equal)
42 ;;; back to our regularly scheduled work...
43 ;;; We should not need these, I think, but?
44 ;; (asdf:oos 'asdf:compile-op :cffi)            ;; FFI
45 ;; (asdf:oos 'asdf:compile-op :lift)            ;; Unit Testing 
46 ;; (asdf:oos 'asdf:load-op :cffi)            ;; FFI
47 ;; (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 :asdf :common-lisp))
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 Computing with Common Lisp;
92 based on CLS alpha1 by Luke Tierney <luke@stat.uiowa.edu> (originally written when Luke was at CMU, apparently).
93 Last touched 1991, then in 2005--2008."
94   :serial t
95   :depends-on (:cffi :lift) ;; need a matrix library
96   :components ((:static-file "version" :pathname #p"version.lisp-expr")
97                (:module "proto-objects"
98                         :pathname "src/objsys/"
99                         :components ((:lispstat-lsp-source-file "lsobjects")))
101                (:lispstat-lsp-source-file "cffiglue")
102                (:lispstat-lsp-source-file "defsys")
103                (:lispstat-lsp-source-file "lstypes")
104                (:lispstat-lsp-source-file "lsfloat")
106                (:lispstat-lsp-source-file "compound" 
107                                           :depends-on ("proto-objects"))
108                (:lispstat-lsp-source-file "lsmacros" 
109                                           :depends-on ("compound"))
111                (:lispstat-lsp-source-file "dists"
112                                           :depends-on ("cffiglue"
113                                                        "lsmacros"))
115                (:lispstat-lsp-source-file "lsmath"
116                                           :depends-on ("proto-objects"
117                                                        "compound"
118                                                        "lsmacros"
119                                                        "lsfloat"))
122                (:lispstat-lsp-source-file "matrices"
123                                           :depends-on ("cffiglue"
124                                                        "compound"))
126                (:lispstat-lsp-source-file "ladata"
127                                           :depends-on ("cffiglue"
128                                                        "defsys"
129                                                        "lstypes"
130                                                        "compound"
131                                                        "matrices"))
133                (:lispstat-lsp-source-file "linalg"
134                                           :depends-on ("cffiglue"
135                                                        "lsmath"
136                                                        "matrices"
137                                                        "ladata"
138                                                        "lsfloat"
139                                                        "lstypes"
140                                                        "compound"))
142                (:file "data" :depends-on ("proto-objects"
143                                           "compound"
144                                           "matrices"
145                                           "linalg"))
147                ;; there is a circ reference which we need to solve.
148                (:lispstat-lsp-source-file "lsbasics"
149                                           :depends-on ("proto-objects"
150                                                        "lstypes"
151                                                        "lsmacros"
152                                                        "lsfloat"
153                                                        "matrices"
154                                                        "linalg"
155                                                        "dists"))
157                (:lispstat-lsp-source-file "statistics"
158                                           :depends-on ("proto-objects"
159                                                        "lsbasics"
160                                                        "compound"
161                                                        "ladata" "matrices" "linalg"
162                                                        "lsmath"
163                                                        "data" ))
165                (:file "optimize" :depends-on ("proto-objects"
166                                               "cffiglue"
167                                               "lstypes"
168                                               "compound"
169                                               "lsmath"
170                                               "lsfloat"
171                                               "lsbasics"
172                                               "matrices"
173                                               "ladata"
174                                               "linalg"))
175                
176                ;; Applications
177                (:lispstat-lsp-source-file "regression"
178                                           :depends-on ("proto-objects"
179                                                        "lsbasics"
180                                                        "compound"
181                                                        "lsmath"
182                                                        "matrices"
183                                                        "linalg"
184                                                        "statistics"))
185 ;              (:lispstat-lsp-source-file "nonlin"
186 ;                                         :depends-on ("regression"))
188 ;              (:lispstat-lsp-source-file "bayes"
189 ;                                         :depends-on ("proto-objects"
190 ;                                                      "lsmath"
191 ;                                                      "dists"))
193                (:module
194                 "lisp-stat-core"
195                 :pathname "src/"
196                 :depends-on  ("proto-objects"
197                               "lsbasics"
198                               "compound"
199                               "dists"
200                               "lstypes"
201                               "lsfloat"
202                               "data"
203                               "lsmath"
204                               "matrices"
205                               "linalg"
206                               "statistics"
207                               "regression")
208                 :components ((:file "ls-user")))
210                (:module
211                  "lisp-stat-unittest"
212                  :depends-on ( "lisp-stat-core") ;; shouldn't need :lift!
213                  :pathname "src/unittests/"
214                  :components ((:file "unittests")
215                               (:file "unittests-lstypes")
216                               ;;  "unittests-arrays.lisp"
217                               ;;  "unittests-data-clos.lisp"
218                               ;;  "unittests-proto.lisp"
219                               ;;  "unittests-regression.lisp"
220                               ))
221                (:static-file "LICENSE")
222                (:static-file "README")
223                ))