-
Notifications
You must be signed in to change notification settings - Fork 4
/
load-blapack-libs.lisp
62 lines (41 loc) · 2.01 KB
/
load-blapack-libs.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
;; Copyright rif 2006.
;; Modified BSD License (see LICENSE file in this directory).
(defpackage :org.middleangle.load-blapack-libs
(:use :common-lisp :cffi)
(:export *blapack-libs-loaded*))
(in-package :org.middleangle.load-blapack-libs)
;; EDIT THESE VARIABLES TO POINT TO YOUR LIBRARIES!
#|
;;; The suggestion (from Leo (sdl.web at gmail dot com) to use native
;;; accelerated BLAS and LAPACK on MacOSX is to COMMENT OUT the
;;; gfortran lib DEFPARAMETER and LOAD-FOREIGN-LIBRARY, as it is not
;;; linked in, and to use the following locations:
;; (defparameter *gfortran-lib* "/usr/lib/libgfortran.so.3")
(defparameter *blas-lib*
"/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib")
(defparameter *lapack-lib*
"/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib")
;;; and then for the load, comment it out:
+ ;; (load-foreign-library *gfortran-lib*)
;;; This might not hold for your MacOSX setup, please report back!
;;; THANKS to David Hodge, we have that included directly in the code. Sorry that I forgot about it!!
;;; However, I (Tony Rossini) am leaving the code above for later use.
|#
(eval-when (:compile-toplevel :load-toplevel)
#+darwin (progn
(defparameter *gfortran-lib* nil)
(defparameter *blas-lib*
"/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib")
(defparameter *lapack-lib*
"/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib"))
#-darwin (progn
(defparameter *gfortran-lib* "libgfortran.so.3")
(defparameter *blas-lib* "libblas.so")
(defparameter *lapack-lib* "liblapack.so"))
(defvar *blapack-libs-loaded* nil)
(unless *blapack-libs-loaded*
(progn
(when *gfortran-lib* (load-foreign-library *gfortran-lib*))
(load-foreign-library *blas-lib*)
(load-foreign-library *lapack-lib*)
(setf *blapack-libs-loaded* t))))