Commit cb9c6bfd authored by Liam Healy's avatar Liam Healy

Load GSL lib v19 in preference to v0

Load GSL library version 19 (libgsl.so.19) in preference to version 0,
if it is available. This version, corresponding to GSL 2.0+, loads but
functions whose API changed have not been tested. This required a fix to
have-at-least-gsl-version which was incorrectly comparing version
numbers.
parent 32bbd1aa
;; GSL library version ;; GSL library version
;; Liam Healy 2016-08-06 10:37:52EDT gsl-version.lisp ;; Liam Healy 2016-08-06 10:37:52EDT gsl-version.lisp
;; Time-stamp: <2016-08-06 22:05:11EDT gsl-version.lisp> ;; Time-stamp: <2016-11-20 16:42:06CST gsl-version.lisp>
;; ;;
;; Copyright 2016 Liam M. Healy ;; Copyright 2016 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -26,19 +26,17 @@ ...@@ -26,19 +26,17 @@
"The version of the GSL library being used.") "The version of the GSL library being used.")
(export '*gsl-version*) (export '*gsl-version*)
(defun have-at-least-gsl-version (major-minor) (defun have-at-least-gsl-version (version-wanted)
"The GSL version currently running is at least the specified major/minor version." "The GSL version currently running is at least the version wanted, specified as (major minor)."
(or (null major-minor) (or (null version-wanted)
(let* ((sep-pos (position #\. *gsl-version*)) (let ((version-loaded
(my-major (mapcar 'read-from-string (split-sequence:split-sequence #\. *gsl-version*))))
(read-from-string *gsl-version* nil nil :end sep-pos)) ;; subminor version number ignored
(my-minor (or (> (first version-loaded) (first version-wanted))
(read-from-string *gsl-version* nil nil :start (1+ sep-pos)))) (and
(and (>= my-major (first major-minor)) (= (first version-loaded) (first version-wanted))
(>= my-minor (second major-minor)))))) (>= (second version-loaded) (second version-wanted)))))))
)
(when (have-at-least-gsl-version '(2 0)) (when (have-at-least-gsl-version '(2 0))
(pushnew :gsl2 *features*) (pushnew :gsl2 *features*))
;; Following form to be deleted when GSL 2 support is present )
(error "GSLL does not currently work with GSL version 2.x"))
;; Load GSL ;; Load GSL
;; Liam Healy Sat Mar 4 2006 - 18:53 ;; Liam Healy Sat Mar 4 2006 - 18:53
;; Time-stamp: <2015-12-06 09:45:33EST init.lisp> ;; Time-stamp: <2016-11-20 14:46:05CST init.lisp>
;; ;;
;; Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2015 Liam M. Healy ;; Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2015, 2016 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
;; ;;
;; This program is free software: you can redistribute it and/or modify ;; This program is free software: you can redistribute it and/or modify
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
(gsl-config-pathname "libgsl.dylib")) (gsl-config-pathname "libgsl.dylib"))
#-ccl #.(gsl-config-pathname "libgsl.dylib")) #-ccl #.(gsl-config-pathname "libgsl.dylib"))
(:windows (:or "libgsl-0.dll" "cyggsl-0.dll")) (:windows (:or "libgsl-0.dll" "cyggsl-0.dll"))
(:unix (:or "libgsl.so.0" "libgsl.so")) (:unix (:or "libgsl.so.19" "libgsl.so.0" "libgsl.so"))
(t (:default "libgsl"))) (t (:default "libgsl")))
(cffi:use-foreign-library libgsl) (cffi:use-foreign-library libgsl)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment