init.lisp 1.27 KB
Newer Older
1 2
;; Load GSL
;; Liam Healy Sat Mar  4 2006 - 18:53
Liam Healy's avatar
Liam Healy committed
3
;; Time-stamp: <2009-01-16 11:06:20EST init.lisp>
lhealy's avatar
lhealy committed
4
;; $Id$
5 6 7

(defpackage gsll
  (:nicknames :gsl)
Liam Healy's avatar
Liam Healy committed
8
  (:use :common-lisp :cffi))
9 10

(cffi:define-foreign-library libgslcblas
11 12 13 14
    (:darwin
     (:or "/opt/local/lib/libgslcblas.dylib" "/sw/lib/libgslcblas.dylib"
	  "/usr/local/lib/libgslcblas.dylib"))
  (:cygwin (:or "/bin/cyggslcblas-0.dll"))
Liam Healy's avatar
Liam Healy committed
15 16
  (:unix (:or "/usr/lib/libgslcblas.so.0" "/usr/lib/libgslcblas.so"
	      "/usr/lib64/libgslcblas.so.0" "/usr/lib64/libgslcblas.so"))
17 18 19 20
  (t (:default "libgslcblas")))
   
(cffi:use-foreign-library libgslcblas)

21 22 23 24 25 26
;; When calling libgsl from emacs built for windows and slime, and
;; using clisp built for cygwin, we have to load lapack/cygblas.dll
;; before loading cyggsl-0.dll
#+(and clisp cygwin)
(cffi:load-foreign-library "/lib/lapack/cygblas.dll")

27
(cffi:define-foreign-library libgsl
28 29 30 31
    (:darwin
     (:or "/opt/local/lib/libgsl.dylib" "/sw/lib/libgsl.dylib"
	  "/usr/local/lib/libgsl.dylib"))
  (:cygwin (:or "/bin/cyggsl-0.dll"))
Liam Healy's avatar
Liam Healy committed
32 33
  (:unix (:or "/usr/lib/libgsl.so.0" "/usr/lib/libgsl.so"
	      "/usr/lib64/libgsl.so.0" "/usr/lib64/libgsl.so"))
34 35 36
  (t (:default "libgsl")))
   
(cffi:use-foreign-library libgsl)
37 38 39 40

#+sbcl
(eval-when (:compile-toplevel :load-toplevel :execute)
  (pushnew :native *features*))