init.lisp 2.17 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: <2010-07-15 22:26:30EDT init.lisp>
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
;;
;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 21 22

(defpackage gsll
  (:nicknames :gsl)
23 24
  (:use :common-lisp :cffi)
  (:import-from
25
   :grid
26
   #:cl-array #:dimensions #:element-type
Liam Healy's avatar
Liam Healy committed
27
   #:foreign-array #:matrix #:dim0 #:dim1 #:^
Liam Healy's avatar
Liam Healy committed
28
   #:copy)
29
  (:shadowing-import-from :grid #:foreign-pointer)
30
  (:export
31
   #:cl-array #:dimensions #:element-type #:dim0 #:dim1
Liam Healy's avatar
Liam Healy committed
32
   #:copy))
33 34

(cffi:define-foreign-library libgslcblas
35 36 37 38
    (: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
39 40
  (:unix (:or "/usr/lib/libgslcblas.so.0" "/usr/lib/libgslcblas.so"
	      "/usr/lib64/libgslcblas.so.0" "/usr/lib64/libgslcblas.so"))
41 42 43 44
  (t (:default "libgslcblas")))
   
(cffi:use-foreign-library libgslcblas)

45 46 47 48 49 50
;; 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")

51
(cffi:define-foreign-library libgsl
52 53 54 55
    (: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
56 57
  (:unix (:or "/usr/lib/libgsl.so.0" "/usr/lib/libgsl.so"
	      "/usr/lib64/libgsl.so.0" "/usr/lib64/libgsl.so"))
58 59 60
  (t (:default "libgsl")))
   
(cffi:use-foreign-library libgsl)
61