Commit cb9c6bfd by Liam M. 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
;; 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
;; Distributed under the terms of the GNU General Public License
......@@ -26,19 +26,17 @@
"The version of the GSL library being used.")
(export '*gsl-version*)
(defun have-at-least-gsl-version (major-minor)
"The GSL version currently running is at least the specified major/minor version."
(or (null major-minor)
(let* ((sep-pos (position #\. *gsl-version*))
(my-major
(read-from-string *gsl-version* nil nil :end sep-pos))
(my-minor
(read-from-string *gsl-version* nil nil :start (1+ sep-pos))))
(and (>= my-major (first major-minor))
(>= my-minor (second major-minor))))))
)
(defun have-at-least-gsl-version (version-wanted)
"The GSL version currently running is at least the version wanted, specified as (major minor)."
(or (null version-wanted)
(let ((version-loaded
(mapcar 'read-from-string (split-sequence:split-sequence #\. *gsl-version*))))
;; subminor version number ignored
(or (> (first version-loaded) (first version-wanted))
(and
(= (first version-loaded) (first version-wanted))
(>= (second version-loaded) (second version-wanted)))))))
(when (have-at-least-gsl-version '(2 0))
(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"))
(when (have-at-least-gsl-version '(2 0))
(pushnew :gsl2 *features*))
)
;; Load GSL
;; 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
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -100,7 +100,7 @@
(gsl-config-pathname "libgsl.dylib"))
#-ccl #.(gsl-config-pathname "libgsl.dylib"))
(: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")))
(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