Skip to content
Snippets Groups Projects
Commit 8a3c777b authored by Liam Healy's avatar Liam Healy
Browse files

Improved finding of libraries for OS X, by Leo

parent bc4d0b9a
No related branches found
No related tags found
No related merge requests found
;; Load GSL ;; Load GSL
;; Liam Healy Sat Mar 4 2006 - 18:53 ;; Liam Healy Sat Mar 4 2006 - 18:53
;; Time-stamp: <2010-08-13 13:54:07EDT init.lisp> ;; Time-stamp: <2010-08-16 23:08:13EDT init.lisp>
;; ;;
;; Copyright 2006, 2007, 2008, 2009, 2010 Liam M. Healy ;; Copyright 2006, 2007, 2008, 2009, 2010 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
#:cl-array #:dimensions #:element-type #:dim0 #:dim1 #:cl-array #:dimensions #:element-type #:dim0 #:dim1
#:copy)) #:copy))
(in-package :gsl)
(eval-when (:compile-toplevel :load-toplevel :execute) (eval-when (:compile-toplevel :load-toplevel :execute)
(defun gsl-config (arg) (defun gsl-config (arg)
"A wrapper for tool `gsl-config'." "A wrapper for tool `gsl-config'."
...@@ -38,10 +40,13 @@ ...@@ -38,10 +40,13 @@
(s (with-output-to-string (asdf::*verbose-out*) (s (with-output-to-string (asdf::*verbose-out*)
(asdf:run-shell-command "gsl-config ~s" arg))) (asdf:run-shell-command "gsl-config ~s" arg)))
(read-line s) (read-line s)
(read-line s)))) (read-line s)))
#+unix
(defun gsl-config-pathname (pn)
(merge-pathnames pn (pathname (format nil "~a/" (gsl-config "--prefix"))))))
(cffi:define-foreign-library libgslcblas (cffi:define-foreign-library libgslcblas
(:darwin "libgslcblas.dylib") (:darwin #.(gsl-config-pathname "lib/libgslcblas.dylib"))
(:cygwin "cyggslcblas-0.dll") (:cygwin "cyggslcblas-0.dll")
(:unix (:or "libgslcblas.so.0" "libgslcblas.so")) (:unix (:or "libgslcblas.so.0" "libgslcblas.so"))
(t (:default "libgslcblas"))) (t (:default "libgslcblas")))
...@@ -55,7 +60,7 @@ ...@@ -55,7 +60,7 @@
(cffi:load-foreign-library "/lib/lapack/cygblas.dll") (cffi:load-foreign-library "/lib/lapack/cygblas.dll")
(cffi:define-foreign-library libgsl (cffi:define-foreign-library libgsl
(:darwin "libgsl.dylib") (:darwin #. (gsl-config-pathname "lib/libgsl.dylib"))
(:cygwin "cyggsl-0.dll") (:cygwin "cyggsl-0.dll")
(:unix (:or "libgsl.so.0" "libgsl.so")) (:unix (:or "libgsl.so.0" "libgsl.so"))
(t (:default "libgsl"))) (t (:default "libgsl")))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment