Changeset 1104:53f46f894933


Ignore:
Timestamp:
03/01/11 21:09:27 (4 years ago)
Author:
rtoy
Branch:
default
Message:

o Clean up asdf methods and specify default component class.
o Add a lot of routines that need to be compiled but were not.
o Add defsystems for all of the tests that work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • packages/fishpack.asd

    r534 r1104  
    1010(in-package :fishpack-asd)
    1111
    12 (defclass fortran-source-file (source-file) ())
    13 (defmethod source-file-type ((c fortran-source-file) (s module)) "f")
    14 
    15 (defmethod output-files ((o operation) (c fortran-source-file))
    16   (list (make-pathname :name (component-name c)
    17                        :type #+cmu "x86f" #-cmu "fasl"
    18                        :defaults (component-pathname c))))
    19 
    20 (defmethod perform ((o compile-op) (c fortran-source-file))
    21   (f2cl:f2cl-compile (make-pathname :name (component-name c)
    22                                     :defaults (component-pathname c)) ))
    23 
    24 (defmethod perform ((o load-op) (c fortran-source-file))
    25   (load (car (output-files o c))))
     12(defclass fishpack-fortran-file (cl-source-file)
     13  ()
     14  (:default-initargs :type "f"))
     15
     16(defun fortran-compile (op c &key (array-slicing t) (array-type :array) package declare-common)
     17  (let ((file (component-pathname c)))
     18    (f2cl:f2cl-compile file
     19                       :output-file (first (output-files op c))
     20                       :array-slicing array-slicing
     21                       :array-type array-type
     22                       :package "FISHPACK"
     23                       :declare-common declare-common
     24                       )))
     25
     26(defmethod perform ((op compile-op) (c fishpack-fortran-file))
     27  (fortran-compile op c :package "MINPACK"))
     28
     29(defmethod perform ((op load-op) (c fishpack-fortran-file))
     30  (load (first (input-files op c))))
     31
    2632
    2733(defsystem fishpack
    2834  :components
    29  
    30   ((:fortran-source-file "pimach")
    31    (:fortran-source-file "merge")
    32    (:fortran-source-file "cosgen"
    33                          :depends-on ("pimach"))
    34    (:fortran-source-file "genbun"
    35                          :depends-on ("pimach" "poisd2" "poisp2" "poisn2"))
    36    (:fortran-source-file "tri3")
    37    (:fortran-source-file "trix")
    38    (:fortran-source-file "hwscrt"
    39                          :depends-on ("trix" "tri3" "pimach"))
    40    (:fortran-source-file "poisd2"
    41                          :depends-on ("cosgen" "trix" "merge"))
    42    (:fortran-source-file "poisn2"
    43                          :depends-on ("cosgen" "trix" "tri3" "merge"))
    44    (:fortran-source-file "poisp2"
    45                          :depends-on ("cosgen" "trix" "tri3" "merge"
    46                                                "poisd2"))))
     35  ((:module package
     36            :pathname "fishpack"
     37            :components
     38            ((:file "package")))
     39   (:module fishpack
     40            :default-component-class fishpack-fortran-file
     41            :components
     42            ((:file "pimach")
     43             (:file "merge")
     44             (:file "cosgen"
     45                    :depends-on ("pimach"))
     46             (:file "genbun"
     47                    :depends-on ("pimach" "poisd2" "poisp2" "poisn2"))
     48             (:file "tri3")
     49             (:file "trix")
     50             (:file "hwscrt"
     51                    :depends-on ("trix" "tri3" "pimach"))
     52             (:file "hwscyl")
     53             (:file "hwsplr")
     54             (:file "hwsssp")
     55             (:file "hwsss1")
     56             (:file "hwscsp" :depends-on ("hwscs1"))
     57             (:file "hwscs1" :depends-on ("epmach" "blktri" "store"))
     58             (:file "hstcrt" :depends-on ("poistg"))
     59             (:file "poistg" :depends-on ("postg2"))
     60             (:file "postg2")
     61             (:file "hstplr")
     62             (:file "hstcyl")
     63             (:file "hstssp")
     64             (:file "hstcsp" :depends-on ("hstcs1"))
     65             (:file "hstcs1")
     66             (:file "sepx4" :depends-on ("chkpr4" "speli4"))
     67             (:file "chkpr4")
     68             (:file "speli4"
     69                    :depends-on ("chksn4" "tris4" "ortho4" "minso4" "defe4"))
     70             (:file "chksn4")
     71             (:file "tris4")
     72             (:file "ortho4")
     73             (:file "minso4")
     74             (:file "defe4" :depends-on ("dx4" "dy4")
     75                    :perform (compile-op :around (op c)
     76                                         (fortran-compile op c :declare-common t)))
     77             (:file "dx4")
     78             (:file "dy4")
     79             (:file "epmach"
     80                    :depends-on ("store")
     81                    :perform (compile-op :around (op c)
     82                                         (fortran-compile op c :declare-common t)))
     83             (:file "blktri"
     84                    :depends-on ("compb" "blktr1" "prodp" "cprodp")
     85                    :perform (compile-op :around (op c)
     86                                         (fortran-compile op c :declare-common t)))
     87             ;; WARNING: compb passes an array of single-floats to
     88             ;; PPADD, but PPADD is expecting an array of COMPLEX
     89             ;; numbers.  None of the test programs trigger this, so
     90             ;; it might not be a problem, but it is something to
     91             ;; watch out for.  F2cl does not handle this case.
     92             (:file "compb"
     93                    :depends-on ("indxb" "tevls" "ppadd"))
     94             (:file "blktr1"
     95                    :depends-on ("indxa" "indxb" "indxc"))
     96             (:file "store")
     97             (:file "indxa")
     98             (:file "indxb")
     99             (:file "indxc")
     100             (:file "tevls")
     101             (:file "ppadd"
     102                    :depends-on ("psgf" "bsrh" "ppsgf"))
     103             (:file "psgf")
     104             (:file "bsrh")
     105             (:file "ppsgf")
     106             (:file "poisd2"
     107                    :depends-on ("cosgen" "trix" "merge"))
     108             (:file "poisn2"
     109                    :depends-on ("cosgen" "trix" "tri3" "merge"))
     110             (:file "poisp2"
     111                    :depends-on ("cosgen" "trix" "tri3" "merge"
     112                                          "poisd2"))
     113             (:file "prod")
     114             (:file "cprod")
     115             (:file "cprodp")
     116             (:file "ppspf")
     117             (:file "prodp")))))
     118
     119(defmethod perform ((op test-op) (c (eql (find-system "fishpack"))))
     120  (oos 'test-op "fishpack-test-hwscrt"))
     121
     122;; Some tests of Fishpack.
     123;;
     124;; The results won't match the results printed for the NCAR Control
     125;; Data 7600, but they should be close.
     126
     127;; Works
     128(defsystem fishpack-test-hwscrt
     129  :depends-on ("fishpack")
     130  :components
     131  ((:module hwscrt
     132            :pathname "fishpack/ex/"
     133            :default-component-class fishpack-fortran-file
     134            :components
     135            ((:file "tsthwscrt")))))
     136
     137(defmethod perform ((op test-op) (c (eql (find-system "fishpack-test-hwscrt"))))
     138  (funcall (find-symbol "THWSCRT" (find-package '#:fishpack))))
     139
     140;; Works
     141(defsystem fishpack-test-hwscyl
     142  :depends-on ("fishpack")
     143  :components
     144  ((:module hwscyl
     145            :pathname "fishpack/ex/"
     146            :default-component-class fishpack-fortran-file
     147            :components
     148            ((:file "tsthwscyl")))))
     149
     150(defmethod perform ((op test-op) (c (eql (find-system "fishpack-test-hwscyl"))))
     151  (funcall (find-symbol "THWSCYL" (find-package '#:fishpack))))
     152
     153;; Works
     154(defsystem fishpack-test-hwsplr
     155  :depends-on ("fishpack")
     156  :components
     157  ((:module hwsplr
     158            :pathname "fishpack/ex/"
     159            :default-component-class fishpack-fortran-file
     160            :components
     161            ((:file "tsthwsplr")))))
     162
     163(defmethod perform ((op test-op) (c (eql (find-system "fishpack-test-hwsplr"))))
     164  (funcall (find-symbol "THWSPLR" (find-package '#:fishpack))))
     165
     166;; Works
     167(defsystem fishpack-test-hwsssp
     168  :depends-on ("fishpack")
     169  :components
     170  ((:module hwsssp
     171            :pathname "fishpack/ex/"
     172            :default-component-class fishpack-fortran-file
     173            :components
     174            ((:file "tsthwsssp")))))
     175
     176(defmethod perform ((op test-op) (c (eql (find-system "fishpack-test-hwsssp"))))
     177  (funcall (find-symbol "THWSSSP" (find-package '#:fishpack))))
     178
     179;; Works
     180(defsystem fishpack-test-hwscsp
     181  :depends-on ("fishpack")
     182  :components
     183  ((:module hwscsp
     184            :pathname "fishpack/ex/"
     185            :default-component-class fishpack-fortran-file
     186            :components
     187            ((:file "tsthwscsp")))))
     188
     189(defmethod perform ((op test-op) (c (eql (find-system "fishpack-test-hwscsp"))))
     190  (funcall (find-symbol "THWSCSP" (find-package '#:fishpack))))
     191
     192;; Works
     193(defsystem fishpack-test-hstcrt
     194  :depends-on ("fishpack")
     195  :components
     196  ((:module hstcrt
     197            :pathname "fishpack/ex/"
     198            :default-component-class fishpack-fortran-file
     199            :components
     200            ((:file "tsthstcrt")))))
     201
     202(defmethod perform ((op test-op) (c (eql (find-system "fishpack-test-hstcrt"))))
     203  (funcall (find-symbol "THSTCRT" (find-package '#:fishpack))))
     204
     205;; Works
     206(defsystem fishpack-test-hstplr
     207  :depends-on ("fishpack")
     208  :components
     209  ((:module hstplr
     210            :pathname "fishpack/ex/"
     211            :default-component-class fishpack-fortran-file
     212            :components
     213            ((:file "tsthstplr")))))
     214
     215(defmethod perform ((op test-op) (c (eql (find-system "fishpack-test-hstplr"))))
     216  (funcall (find-symbol "THSTPLR" (find-package '#:fishpack))))
     217
     218;; Works
     219(defsystem fishpack-test-hstcyl
     220  :depends-on ("fishpack")
     221  :components
     222  ((:module hstcyl
     223            :pathname "fishpack/ex/"
     224            :default-component-class fishpack-fortran-file
     225            :components
     226            ((:file "tsthstcyl")))))
     227
     228(defmethod perform ((op test-op) (c (eql (find-system "fishpack-test-hstcyl"))))
     229  (funcall (find-symbol "THSTCYL" (find-package '#:fishpack))))
     230
     231;; Works
     232(defsystem fishpack-test-hstssp
     233  :depends-on ("fishpack")
     234  :components
     235  ((:module hstssp
     236            :pathname "fishpack/ex/"
     237            :default-component-class fishpack-fortran-file
     238            :components
     239            ((:file "tsthstssp")))))
     240
     241(defmethod perform ((op test-op) (c (eql (find-system "fishpack-test-hstssp"))))
     242  (funcall (find-symbol "THSTSSP" (find-package '#:fishpack))))
     243
     244;; Works
     245(defsystem fishpack-test-hstcsp
     246  :depends-on ("fishpack")
     247  :components
     248  ((:module hstcsp
     249            :pathname "fishpack/ex/"
     250            :default-component-class fishpack-fortran-file
     251            :components
     252            ((:file "tsthstcsp")))))
     253
     254(defmethod perform ((op test-op) (c (eql (find-system "fishpack-test-hstcsp"))))
     255  (funcall (find-symbol "THSTCSP" (find-package '#:fishpack))))
     256
     257;; Works
     258(defsystem fishpack-test-sepx4
     259  :depends-on ("fishpack")
     260  :components
     261  ((:module sepx4
     262            :pathname "fishpack/ex/"
     263            :default-component-class fishpack-fortran-file
     264            :components
     265            ((:file "tstsepx4" :depends-on ("cofx4"))
     266             (:file "cofx4")))))
     267
     268(defmethod perform ((op test-op) (c (eql (find-system "fishpack-test-sepx4"))))
     269  (funcall (find-symbol "TSEPX4" (find-package '#:fishpack))))
     270
Note: See TracChangeset for help on using the changeset viewer.