-
Notifications
You must be signed in to change notification settings - Fork 46
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
MAGICL extensions refactor #125
Changes from 11 commits
a13da59
6a6733a
3838b02
fa9331b
16525db
ca0dad7
d196a7f
8eb19aa
621dfec
0b768b0
c28ff06
acd15fb
68ee356
90ecb4e
5431fc5
891b4d7
47c704f
347baa9
21bb55c
5265ce0
1d49beb
033b8ee
09b39d8
a1fbd99
c14c140
2c44830
163c132
a1eb8e3
688310f
a42fde6
0434460
2f7794a
d9e2722
7cce767
68a4a5b
b1957ea
1d3f2e6
2bc945d
9bd2fb4
c542d97
8658be0
06bcc40
f19abcd
c17bdb9
205e019
790a13c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
transcendental/libexpokit.dylib | ||
transcendental/libexpokit.so | ||
**/*.dylib | ||
**/*.so |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,15 @@ | |
|
||
_Matrix Algebra proGrams In Common Lisp_ by [Rigetti Computing](http://www.rigetti.com). (née FLAIL: _Finally, Linear Algebra In Lisp!_) | ||
|
||
(**Note**: The high-level interface is experimental and subject to rapid change.) | ||
(**Note**: The high-level interface is experimental and subject to change.) | ||
|
||
## Requirements | ||
|
||
* SBCL (> 1.3.19) or CCL (>= 1.11) on AMD64 | ||
* quicklisp | ||
|
||
If you'll want to use BLAS/LAPACK for extended functionality, you'll need: | ||
|
||
* libffi | ||
* BLAS and LAPACK | ||
|
||
|
@@ -29,18 +32,34 @@ running `sbcl` and evaluating `ql:*local-project-directories*`. Once | |
installed, confirm that MAGICL is working properly by running the | ||
tests, as described in the next section. | ||
|
||
## Lisp-Only vs Accelerated MAGICL | ||
|
||
MAGICL by default only uses pure ANSI Common Lisp code. If you with to | ||
accelerate it or extend the functionality, you may load *MAGICL | ||
extensions*. The available ones are: | ||
|
||
- `MAGICL/FANCY`: for every extension we've got under the kitchen sink | ||
- `MAGICL/EXT-BLAS`: for BLAS functions | ||
- `MAGICL/EXT-LAPACK`: for LAPACK functions | ||
- `MAGICL/EXT-EXPOKIT`: for expokit (matrix `exp()`) functions | ||
|
||
If you use extensions, you'll need the requisite C/Fortran | ||
libraries. Expokit will automatically build for you, as it's included | ||
in the distribution of MAGICL. | ||
|
||
## Testing MAGICL | ||
|
||
You can run the MAGICL tests from your Lisp REPL with: | ||
|
||
``` | ||
(ql:quickload :magicl-tests) | ||
(asdf:test-system :magicl) | ||
``` | ||
|
||
You currently need all of the extensions working for the tests to run. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it worth it to throw in a few easy tests that exercise There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought in a separate test we could write test functions which iterate over the backends using |
||
|
||
## High-level Interface | ||
|
||
See [high-level doc](doc/high-level.md). | ||
See [high-level doc](doc/high-level.md) for an extensive discussion and comparison of MAGICL functions with those of MATLAB and NumPy. | ||
|
||
## Showing Available Functions | ||
|
||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
(in-package #:magicl.foreign-libraries) | ||
|
||
(cffi:define-foreign-library libblas | ||
#+:magicl.use-accelerate | ||
(:darwin "libBLAS.dylib" :search-path #P"/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Versions/A/") | ||
#-:magicl.use-accelerate | ||
(:darwin (:or "/usr/local/opt/lapack/lib/libblas.dylib" "libblas.dylib" )) | ||
#+:magicl.use-mkl | ||
(:unix "libmkl_rt.so") | ||
#-:magicl.use-mkl | ||
(:unix (:or "libblas.so" | ||
"libblas.so.3")) | ||
(t (:default "libblas"))) | ||
|
||
(defvar *blas-loaded* nil) | ||
|
||
(unless *blas-loaded* | ||
(cffi:load-foreign-library 'libblas) | ||
(setf *blas-loaded* t)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
(defpackage #:magicl.blas-cffi | ||
(:use) | ||
#-package-local-nicknames | ||
(:nicknames #:blas)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐌