Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it build with ASDF 3.3 #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 10 additions & 17 deletions generate-blapack-interface.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -182,32 +182,25 @@ remaining lines."
;; Edit these if you want to change the input/output locations!
(defparameter *basedir* #p"/home/rif/software/LAPACK/")
(defparameter *outdir*
(make-pathname :directory
(pathname-directory
(truename (asdf:system-definition-pathname
(asdf:find-system
:org.middleangle.cl-blapack-gen))))))
(asdf:system-source-directory "org.middleangle.cl-blapack-gen"))

(defun fortran-dir-parsing-helper (basedir wildcard)
(mapcar
(lambda (f) (multiple-value-bind (name vars ret) (parse-fortran-file f)
(list name vars ret)))
(uiop:directory-files basedir wildcard)))

(defmacro fortran-dir-parsing-fn (fn-name fortran-files-wildcard-string)
`(defun ,fn-name (&optional (basedir *basedir*))
(let ((files
(directory
(pathname
(concatenate 'string (namestring basedir)
,fortran-files-wildcard-string)))))
(mapcar (lambda (f)
(multiple-value-bind (name vars ret)
(parse-fortran-file f)
(list name vars ret)))
files))))
`(defun ,fn-name (&optional (basedir *basedir*))
(fortran-dir-parsing-helper basedir ,fortran-files-wildcard-string)))

;; above macro WHEN PROPERLY written (still need to verify the above)
;; should simplify the following two functions into something like:
;;
;; (defvar *basedir* "testme/")
;; (fortran-dir-parsing-fn my-parse-blas-files "BLAS/SRC/*.f") ; slime: C-c M-m
;; (fortran-dir-parsing-fn my-parse-lapack-files "SRC/*.f") ; slime: C-c M-m
;;
;;
;; The reason is that we'd like to add in other Fortran libraries if
;; possible, and factor out the auto-gen bindings into a
;; cffi-fortran-grovel package.
Expand Down
4 changes: 2 additions & 2 deletions org.middleangle.cl-blapack-examples.asd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Copyright rif 2006.
;; Modified BSD License (see LICENSE file in this directory).

(defsystem :org.middleangle.cl-blapack-examples
:depends-on (:org.middleangle.cl-blapack)
(defsystem "org.middleangle.cl-blapack-examples"
:depends-on ("org.middleangle.cl-blapack")
:components
((:file "examples")))
4 changes: 2 additions & 2 deletions org.middleangle.cl-blapack-gen.asd
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
;; Copyright rif 2006.
;; Modified BSD License (see LICENSE file in this directory).

(defsystem :org.middleangle.cl-blapack-gen
:depends-on (:cffi :org.middleangle.foreign-numeric-vector)
(defsystem "org.middleangle.cl-blapack-gen"
:depends-on ("cffi" "org.middleangle.foreign-numeric-vector")
:components
((:file "blapack-cffi-types")
(:file "generate-blapack-interface" :depends-on ("blapack-cffi-types"))))
16 changes: 4 additions & 12 deletions org.middleangle.cl-blapack.asd
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-

(in-package :cl-user)
(defpackage :org.middleangle.cl-blapack-asd
(:nicknames :cl-blapack-asd)
(:use :cl :asdf))

(in-package :org.middleangle.cl-blapack-asd)

;; Copyright rif 2006.
;; Modified BSD License (see LICENSE file in this directory).

(defsystem :org.middleangle.cl-blapack
:depends-on (:cffi :org.middleangle.foreign-numeric-vector)
(defsystem "org.middleangle.cl-blapack"
:depends-on ("cffi" "org.middleangle.foreign-numeric-vector")
:components
((:file "packages")
(:file "features" :depends-on ("packages"))
(:file "bugfix" :depends-on ("packages" "features"))
(:file "load-blapack-libs" :depends-on ("packages" "bugfix"))

(:file "blapack-cffi-types" :depends-on ("packages" "bugfix"))
(:file "blas-cffi" :depends-on ( "load-blapack-libs"
(:file "blas-cffi" :depends-on ("load-blapack-libs"
"blapack-cffi-types"
"bugfix"))
(:file "lapack-cffi" :depends-on ("load-blapack-libs"
"blapack-cffi-types"
"bugfix"))
(:file "cl-blapack" :depends-on ("packages" "bugfix"
(:file "cl-blapack" :depends-on ("packages" "bugfix"
"blas-cffi" "lapack-cffi"))))