[lisplab-cvs] r46 - src/fft src/matlisp system

Jørn Inge Vestgården jivestgarden at common-lisp.net
Mon Jun 1 08:24:28 UTC 2009


Author: jivestgarden
Date: Mon Jun  1 04:24:28 2009
New Revision: 46

Log:
clean up buildin system and bugfixes

Added:
   system/libs.lisp
   system/lisplab-base.asd
   system/lisplab-fftw.asd
   system/lisplab-matlisp.asd
Modified:
   src/fft/level3-fft-fftw.lisp
   src/matlisp/geev.lisp
   start.lisp
   system/lisplab.asd

Modified: src/fft/level3-fft-fftw.lisp
==============================================================================
--- src/fft/level3-fft-fftw.lisp	(original)
+++ src/fft/level3-fft-fftw.lisp	Mon Jun  1 04:24:28 2009
@@ -47,13 +47,15 @@
    (matrix-store x) 
    (matrix-store x) 
    fftw-ffi:+fftw-forward+ 
-   fftw-ffi:+FFTW-ESTIMATE+))  
+   fftw-ffi:+FFTW-ESTIMATE+)
+  x)  
 
-(defmethod fft2! ((x matrix-blas-zge))
+(defmethod ifft2! ((x matrix-blas-zge))
   (fftw-ffi:fftw-fft2 
    (rows x) 
    (cols x) 
    (matrix-store x) 
    (matrix-store x) 
    fftw-ffi:+fftw-backward+ 
-   fftw-ffi:+FFTW-ESTIMATE+))  
+   fftw-ffi:+FFTW-ESTIMATE+)
+  x)  

Modified: src/matlisp/geev.lisp
==============================================================================
--- src/matlisp/geev.lisp	(original)
+++ src/matlisp/geev.lisp	Mon Jun  1 04:24:28 2009
@@ -34,7 +34,7 @@
 
 (defmethod eigenvectors ((a matrix-blas-dge))
    (destructuring-bind (evals vl-mat vr-mat)
-       (dgeev (copy a) nil (create a 0))
+       (dgeev (copy a) nil (mcreate a 0))
      (list evals vr-mat)))
 
 (defmethod eigenvalues ((a matrix-blas-dge))
@@ -130,7 +130,7 @@
 
 (defmethod eigenvectors ((a matrix-zge))
    (destructuring-bind (evals vl-mat vr-mat)
-       (zgeev (copy a) nil (create a 0))
+       (zgeev (copy a) nil (mcreate a 0))
      (list evals vr-mat)))
 
 (defmethod eigenvalues ((a matrix-zge))

Modified: start.lisp
==============================================================================
--- start.lisp	(original)
+++ start.lisp	Mon Jun  1 04:24:28 2009
@@ -1,18 +1,32 @@
+;; The connection between asdf and your machine settings.
+;; Please hack this file to fit your settings.
 
-(in-package :asdf)
+(defvar *lisplab-home* 
+  *default-pathname-defaults*
+  "The lisplab directory.")
 
-(push (merge-pathnames #P"system/"
-		       *default-pathname-defaults*)
-      *central-registry*)
+(defun load-lisplab ()
+  (assert  *lisplab-home*)
 
-(defparameter *lisplab-external-libraries* 
-  '("/usr/lib/atlas/libblas.so.3.0" 
-    "/usr/lib/atlas/liblapack.so.3.0"))
+  (let ((asdf:*central-registry* 	 
+	 (cons
+	  (merge-pathnames #P"system/" cl-user::*lisplab-home*)
+	  asdf:*central-registry*)))
+    (let ((asdf:*compile-file-failure-behaviour* :ignore))
+      ;; There seems to bee some compilation trouble in SBCL 
+      ;; due to type interference. Should be fixed, not just skipped.
+      (asdf:oos 'asdf:load-op 'slatec))
+    (asdf:oos 'asdf:load-op 'quadpack)
+    (asdf:oos 'asdf:load-op 'lisplab)
+    (asdf:oos 'asdf:load-op 'lisplab-base)
+    (asdf:oos 'asdf:load-op 'lisplab-matlisp)
+    (asdf:oos 'asdf:load-op 'lisplab-fftw)
+    
+    ;; The lisplab system will load all the above systems. 
+    ;; They are listed only to expose their names to the hacker. 
+    (asdf:oos 'asdf:load-op 'lisplab)))
 
-(let ((*compile-file-failure-behaviour* :ignore))
-  ;; There seems to bee some compilation trouble in SBCL 
-  ;; due to type interference. Should be fixed, not just skipped.
-  (asdf:operate 'asdf:load-op 'slatec))
 
-(asdf:operate 'asdf:load-op 'quadpack)
-(asdf:operate 'asdf:load-op 'lisplab)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(load-lisplab)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
\ No newline at end of file

Added: system/libs.lisp
==============================================================================
--- (empty file)
+++ system/libs.lisp	Mon Jun  1 04:24:28 2009
@@ -0,0 +1,6 @@
+;; Containes the forign libraries to be loaded
+;; by the asdf systems
+
+((:libblas . "/usr/lib/atlas/libblas.so.3.0")
+ (:liblapack . "/usr/lib/atlas/liblapack.so.3.0")
+ (:libfftw . "/usr/lib/libfftw3.so.3"))
\ No newline at end of file

Added: system/lisplab-base.asd
==============================================================================
--- (empty file)
+++ system/lisplab-base.asd	Mon Jun  1 04:24:28 2009
@@ -0,0 +1,130 @@
+
+(in-package :asdf)
+
+(defsystem :lisplab-base
+  :depends-on (:slatec :quadpack)
+  :components 
+  (
+   (:file "package")
+
+   ;;
+   ;; All core none-matrix stuff (level 0)
+   ;;
+   (:module :core
+    :depends-on ("package")
+    :pathname "../src/core/"
+    :serial t
+    :components 
+    (
+     (:file "level0-basic")
+     (:file "level0-const")
+     (:file "level0-interface")
+     (:file "level0-functions")
+     (:file "level0-permutation")
+     (:file "level0-infpre")))
+
+   ;;
+   ;; Special functions
+   ;;
+   (:module :specfunc
+    :depends-on (:core)
+    :pathname "../src/specfunc/"
+    :serial t
+    :components 
+    (
+     (:file "level0-specfunc")))
+
+   ;;
+   ;; All core matrix stuff (level 1 and 2)
+   ;;
+   (:module :matrix
+    :depends-on (:core :specfunc)
+    :pathname "../src/matrix/"
+    :serial t
+    :components 
+    (
+      (:file "level1-interface")
+      (:file "level1-util")     
+      (:file "level1-classes")
+      (:file "level1-constructors")
+      (:file "level1-matrix")
+      (:file "level1-array")
+
+      (:file "level2-interface")
+      (:file "level2-constructors")
+      (:file "level2-generic")
+      (:file "level2-matrix-dge")
+      (:file "level2-matrix-zge")
+      (:file "level2-array-functions")))
+
+   ;;
+   ;; IO (level 3)
+   ;;
+   (:module :io
+    :depends-on (:matrix)
+    :pathname "../src/io/"
+    :serial t
+    :components 
+    (
+     (:file "level3-io")))
+
+   ;;
+   ;; Linear algebra interface(Level 3)
+   ;;
+   (:module :linalg-interface
+    :depends-on (:matrix)
+    :pathname "../src/linalg/"
+    :serial t
+    :components 
+    (
+     (:file "level3-linalg-interface")))
+
+   ;;
+   ;; Linear algebra lisp implementation (Level 3)
+   ;;
+   (:module :linalg-native
+    :depends-on (:matrix :linalg-interface)
+    :pathname "../src/linalg/"
+    :serial t
+    :components 
+    (
+     (:file "level3-linalg-generic")
+     (:file "level3-linalg-blas-real")))
+
+   ;;
+   ;; Fast Fourier transform (Level 3)
+   ;;
+   (:module :fft
+    :depends-on (:matrix)
+    :pathname "../src/fft/"
+    :serial t
+    :components 
+    (
+     (:file "level3-fft-interface")
+     (:file "level3-fft-blas")))
+
+   ;;
+   ;; Euler and Runge-Kutt solvers (Level 3)
+   ;;
+   (:module :diffsolve
+    :depends-on (:matrix)
+    :pathname "../src/util/"
+    :serial t
+    :components 
+    (
+     (:file "level3-rk4")
+     (:file "level3-euler")))
+
+
+   ;;
+   ;; Quadpack 
+   ;;
+   (:module :integrate
+    :depends-on () ; quadpack
+    :pathname "../src/integrate/"
+    :serial t
+    :components 
+    (
+     (:file "quadpack")))
+))
+

Added: system/lisplab-fftw.asd
==============================================================================
--- (empty file)
+++ system/lisplab-fftw.asd	Mon Jun  1 04:24:28 2009
@@ -0,0 +1,34 @@
+(in-package :asdf)
+
+(defun get-lisplab-lib (name) 
+  (let ((libs (merge-pathnames #P"system/libs.lisp"
+			       cl-user::*lisplab-home*)))
+    (cdr (assoc name (with-open-file (out libs)
+		       (read out))))))
+
+(defsystem :lisplab-fftw
+  :depends-on (:lisplab-base)
+  :pathname (merge-pathnames #P"src/fft/" cl-user::*lisplab-home*)
+  :serial t  
+  :components 
+  (  
+   (:file "fftw-ffi-package")  
+
+   (:module :fftw-libs	     
+    :perform (asdf:load-op :after (op c)
+			   (sb-alien:load-shared-object
+			    (get-lisplab-lib :libfftw)))	
+    :explain (asdf:load-op :after (op c)
+			   (format t "Loads alien object <~A>"
+				   (get-lisplab-lib :libfftw))))
+
+    ;;
+    ;; Blas and Lapack implmentations (Level 3)
+    ;;
+    (:module :fftw
+     :depends-on (:fftw-libs)
+     :pathname ""
+     :serial t
+     :components 
+     ((:file "fftw-ffi")
+      (:file "level3-fft-fftw")))))
\ No newline at end of file

Added: system/lisplab-matlisp.asd
==============================================================================
--- (empty file)
+++ system/lisplab-matlisp.asd	Mon Jun  1 04:24:28 2009
@@ -0,0 +1,47 @@
+(in-package :asdf)
+
+(defun get-lisplab-lib (name) 
+  (let ((libs (merge-pathnames #P"system/libs.lisp"
+			       cl-user::*lisplab-home*)))
+    (cdr (assoc name (with-open-file (out libs)
+		       (read out))))))
+
+(defsystem :lisplab-matlisp
+  :depends-on (:lisplab-base)
+  :pathname (merge-pathnames #P"src/matlisp/" cl-user::*lisplab-home*)
+  :serial t
+  :components 
+  (
+   (:file "f77-package")
+   (:file "f77-mangling")
+   (:file "ffi-sbcl")	
+ 
+   (:module :blas-libs	     
+    :perform (asdf:load-op :after (op c)
+			   (sb-alien:load-shared-object
+			    (get-lisplab-lib :libblas)))	
+    :explain (asdf:load-op :after (op c)
+			   (format t "Loads alien object <~A>"
+				   (get-lisplab-lib :libblas))))
+   (:module :lapack-libs 
+    :perform (asdf:load-op :after (op c)
+			   (sb-alien:load-shared-object
+			    (get-lisplab-lib :liblapack)))	
+    :explain (asdf:load-op :after (op c)
+			   (format t "Loads alien object <~A>"
+				   (get-lisplab-lib :liblapack))))
+
+   ;;
+   ;; Blas and Lapack implmentations (Level 3)
+   ;;
+   (:module :matlisp
+    :depends-on (:lapack-libs)
+    :pathname ""
+    :serial t
+    :components 
+    ((:file "blas")
+     (:file "lapack") 
+     (:file "mul")
+     (:file "inv")
+     (:file "geev")))))
+

Modified: system/lisplab.asd
==============================================================================
--- system/lisplab.asd	(original)
+++ system/lisplab.asd	Mon Jun  1 04:24:28 2009
@@ -1,167 +1,4 @@
+(in-package :asdf)
 
 (defsystem :lisplab
-  :depends-on (:slatec :quadpack)
-  :components 
-  (
-   (:file "package")
-
-   ;;
-   ;; All core none-matrix stuff (level 0)
-   ;;
-   (:module :core
-    :depends-on ("package")
-    :pathname "../src/core/"
-    :serial t
-    :components 
-    (
-     (:file "level0-basic")
-     (:file "level0-const")
-     (:file "level0-interface")
-     (:file "level0-functions")
-     (:file "level0-permutation")
-     (:file "level0-infpre")))
-
-   ;;
-   ;; Special functions
-   ;;
-   (:module :specfunc
-    :depends-on (:core)
-    :pathname "../src/specfunc/"
-    :serial t
-    :components 
-    (
-     (:file "level0-specfunc")))
-
-   ;;
-   ;; All core matrix stuff (level 1 and 2)
-   ;;
-   (:module :matrix
-    :depends-on (:core :specfunc)
-    :pathname "../src/matrix/"
-    :serial t
-    :components 
-    (
-      (:file "level1-interface")
-      (:file "level1-util")     
-      (:file "level1-classes")
-      (:file "level1-constructors")
-      (:file "level1-matrix")
-      (:file "level1-array")
-
-      (:file "level2-interface")
-      (:file "level2-constructors")
-      (:file "level2-generic")
-      (:file "level2-matrix-dge")
-      (:file "level2-matrix-zge")
-      (:file "level2-array-functions")))
-
-   ;;
-   ;; IO (level 3)
-   ;;
-   (:module :io
-    :depends-on (:matrix)
-    :pathname "../src/io/"
-    :serial t
-    :components 
-    (
-     (:file "level3-io")))
-
-   ;;
-   ;; Linear algebra interface(Level 3)
-   ;;
-   (:module :linalg-interface
-    :depends-on (:matrix)
-    :pathname "../src/linalg/"
-    :serial t
-    :components 
-    (
-     (:file "level3-linalg-interface")))
-
-   ;;
-   ;; Linear algebra lisp implementation (Level 3)
-   ;;
-   (:module :linalg-native
-    :depends-on (:matrix :linalg-interface)
-    :pathname "../src/linalg/"
-    :serial t
-    :components 
-    (
-     (:file "level3-linalg-generic")
-     (:file "level3-linalg-blas-real")))
-
-   ;;
-   ;; Fast Fourier transform (Level 3)
-   ;;
-   (:module :fft
-    :depends-on (:matrix)
-    :pathname "../src/fft/"
-    :serial t
-    :components 
-    (
-     (:file "level3-fft-interface")
-     (:file "level3-fft-blas")))
-
-   ;;
-   ;; Euler and Runge-Kutt solvers (Level 3)
-   ;;
-   (:module :diffsolve
-    :depends-on (:matrix)
-    :pathname "../src/util/"
-    :serial t
-    :components 
-    (
-     (:file "level3-rk4")
-     (:file "level3-euler")))
-
-   ;;
-   ;; Blas and Lapack implmentations (Level 3)
-   ;;
-   (:module :matlisp
-    :depends-on (:matrix :linalg-interface)
-    :pathname "../src/matlisp/"
-    :serial t
-    :components 
-    ((:file "f77-package")
-     (:file "f77-mangling")
-     (:file "ffi-sbcl")	
-     (:file "blas")
-     (:file "lapack") 
-     (:file "mul")
-     (:file "inv")
-     (:file "geev"))
-
-    :perform (asdf:load-op :after (op c)
-			   (dolist (lib asdf::*lisplab-external-libraries*)
-			     (sb-alien:load-shared-object lib)))
-
-    :explain (asdf:load-op :after (op c)
-			   (dolist (lib asdf::*lisplab-external-libraries*)
-			     (format t "Loads alien object <~A>" lib))))
-
-
-    ;;
-    ;; Blas and Lapack implmentations (Level 3)
-    ;;
-    (:module :fftw
-     :depends-on (:matrix :fft)
-     :pathname "../src/fft/"
-     :serial t
-     :components 
-     ((:file "fftw-ffi-package")
-      (:file "fftw-ffi")
-      (:file "level3-fft-fftw"))
-    :perform (asdf:load-op :after (op c)
-			   (sb-alien:load-shared-object "/usr/lib/libfftw3.so.3")))
-
-   ;;
-   ;; Euler and Runge-Kutt solvers (Level 3)
-   ;;
-   (:module :integrate
-    :depends-on () ; quadpack
-    :pathname "../src/integrate/"
-    :serial t
-    :components 
-    (
-     (:file "quadpack")))
-))
-
+  :depends-on (:lisplab-base :lisplab-matlisp :lisplab-fftw))




More information about the lisplab-cvs mailing list