Hello,
I am trying to link to Gnu Scientific Library into clisp (2.44) on
cygwin (I am trying to get nlisp running on cygwin)
(On cygwin, the shareable libraries (dll's) are prefixed with cyg, and
live in /bin (linked to /usr/bin)).
I tried several variants of (cffi:define-foreign-library libgsl ...)
Here is the transcript of one:
CL-USER> (defpackage :cffi-user
(:use :common-lisp :cffi))
#<PACKAGE CFFI-USER>
CL-USER> (in-package :cffi-user)
#<PACKAGE CFFI-USER>
CFFI-USER> (cffi:define-foreign-library libgsl
(:unix (:or "/bin/cyggsl-0.dll")))
LIBGSL
CFFI-USER> (cffi:use-foreign-library libgsl)
; Evaluation aborted.
CFFI-USER>
The error message is
Unable to load any of the alternatives:
("/bin/cyggsl-0.dll")
[Condition of type LOAD-FOREIGN-LIBRARY-ERROR]
I tried other alternatives, such as not specifying the full path in
the library definition, and also setting the cffi:*foreign-library-
directories*, but none of them could load the library.
I can (probe-file and (probe-directory, so I think I am OK there.
Anything obviously wrong in my definitions?
Thanks,
Mirko
·············@gmail.com wrote:
> Hello,
>
> I am trying to link to Gnu Scientific Library into clisp (2.44) on
> cygwin (I am trying to get nlisp running on cygwin)
>
> (On cygwin, the shareable libraries (dll's) are prefixed with cyg, and
> live in /bin (linked to /usr/bin)).
>
> I tried several variants of (cffi:define-foreign-library libgsl ...)
> Here is the transcript of one:
> CL-USER> (defpackage :cffi-user
> (:use :common-lisp :cffi))
> #<PACKAGE CFFI-USER>
> CL-USER> (in-package :cffi-user)
> #<PACKAGE CFFI-USER>
> CFFI-USER> (cffi:define-foreign-library libgsl
> (:unix (:or "/bin/cyggsl-0.dll")))
> LIBGSL
> CFFI-USER> (cffi:use-foreign-library libgsl)
> ; Evaluation aborted.
> CFFI-USER>
>
> The error message is
> Unable to load any of the alternatives:
> ("/bin/cyggsl-0.dll")
> [Condition of type LOAD-FOREIGN-LIBRARY-ERROR]
>
>
> I tried other alternatives, such as not specifying the full path in
> the library definition, and also setting the cffi:*foreign-library-
> directories*, but none of them could load the library.
>
> I can (probe-file and (probe-directory, so I think I am OK there.
>
> Anything obviously wrong in my definitions?
Sorry, can't help. FWIW, none of the many define-foreign-library calls I
have over here (and there are many) includes any directory info. But I
am posting mainly to recommend the CFFI list, no one in c.l.l Actually
Programs CL (not even me, I switched to Arc for all time as anyone here
can tell you).
hth, kenny
--
http://smuglispweeny.blogspot.com/
http://www.theoryyalgebra.com/
"In the morning, hear the Way;
in the evening, die content!"
-- Confucius
On Feb 17, 10:20 pm, Ken Tilton <···········@optonline.net> wrote:
> ·············@gmail.com wrote:
> > Hello,
>
> > I am trying to link to Gnu Scientific Library into clisp (2.44) on
> > cygwin (I am trying to get nlisp running on cygwin)
>
> > (On cygwin, the shareable libraries (dll's) are prefixed with cyg, and
> > live in /bin (linked to /usr/bin)).
>
> > I tried several variants of (cffi:define-foreign-library libgsl ...)
> > Here is the transcript of one:
> > CL-USER> (defpackage :cffi-user
> > (:use :common-lisp :cffi))
> > #<PACKAGE CFFI-USER>
> > CL-USER> (in-package :cffi-user)
> > #<PACKAGE CFFI-USER>
> > CFFI-USER> (cffi:define-foreign-library libgsl
> > (:unix (:or "/bin/cyggsl-0.dll")))
> > LIBGSL
> > CFFI-USER> (cffi:use-foreign-library libgsl)
> > ; Evaluation aborted.
> > CFFI-USER>
>
> > The error message is
> > Unable to load any of the alternatives:
> > ("/bin/cyggsl-0.dll")
> > [Condition of type LOAD-FOREIGN-LIBRARY-ERROR]
>
> > I tried other alternatives, such as not specifying the full path in
> > the library definition, and also setting the cffi:*foreign-library-
> > directories*, but none of them could load the library.
>
> > I can (probe-file and (probe-directory, so I think I am OK there.
>
> > Anything obviously wrong in my definitions?
>
> Sorry, can't help. FWIW, none of the many define-foreign-library calls I
> have over here (and there are many) includes any directory info. But I
> am posting mainly to recommend the CFFI list, no one in c.l.l Actually
> Programs CL (not even me, I switched to Arc for all time as anyone here
> can tell you).
>
> hth, kenny
>
> --http://smuglispweeny.blogspot.com/http://www.theoryyalgebra.com/
>
> "In the morning, hear the Way;
> in the evening, die content!"
> -- Confucius
You know, with you, I just don't know how to read your posts (I mean
all the stuff about arc). You're like one of those oriental mysteries
that this sub-linear mind just cannot fathom. Of course, my mind is
convoluted too (the PhD after my name stands for permanent head
damage).
And, since, according to you, I'm the last cl programmer, I'll make
sure to turn of the lights at c.l.l when I leave :-)
Cheers (& thanks, I will look-up the cffi list)
Mirko
·············@gmail.com wrote:
> You know, with you, I just don't know how to read your posts (I mean
> all the stuff about arc). You're like one of those oriental mysteries
> that this sub-linear mind just cannot fathom.
Sounds familiar:
http://smuglispweeny.blogspot.com/2008/02/some-cll-yobbo-wrote-you-know-with-you.html
kenny
--
http://smuglispweeny.blogspot.com/
http://www.theoryyalgebra.com/
"In the morning, hear the Way;
in the evening, die content!"
-- Confucius
On Feb 17, 6:16 pm, ·············@gmail.com wrote:
> (On cygwin, the shareable libraries (dll's) are prefixed with cyg, and
> live in /bin (linked to /usr/bin)).
>
> I tried several variants of (cffi:define-foreign-library libgsl ...)
For lispbuilder-sdl, the code that loads external shares is in
lispbuilder-sdl/cffi/library.lisp. The shared libraries are in
lispbuilder-sdl/bin/
Shared libraries are loaded like so:
(in-package #:lispbuilder-sdl-cffi)
#+win32(eval-when (:compile-toplevel :load-toplevel :execute)
(pushnew (merge-pathnames "../bin/" (directory-namestring (or
*load-truename* *default-pathname-defaults*)))
cffi:*foreign-library-directories*
:test #'equal))
(cffi:define-foreign-library sdl
(:darwin (:framework "SDL"))
(:windows "SDL.dll")
(:unix (:or "libSDL-1.2.so.0.7.2"
"libSDL-1.2.so.0"
"libSDL-1.2.so"
"libSDL.so"
"libSDL")))
(cffi:use-foreign-library sdl)
- Luke
On Feb 18, 9:02 pm, Luke Crook <····@balooga.com> wrote:
> On Feb 17, 6:16 pm, ·············@gmail.com wrote:
>
> > (On cygwin, the shareable libraries (dll's) are prefixed with cyg, and
> > live in /bin (linked to /usr/bin)).
>
> > I tried several variants of (cffi:define-foreign-library libgsl ...)
>
> For lispbuilder-sdl, the code that loads external shares is in
> lispbuilder-sdl/cffi/library.lisp. The shared libraries are in
> lispbuilder-sdl/bin/
>
> Shared libraries are loaded like so:
>
> (in-package #:lispbuilder-sdl-cffi)
>
> #+win32(eval-when (:compile-toplevel :load-toplevel :execute)
> (pushnew (merge-pathnames "../bin/" (directory-namestring (or
> *load-truename* *default-pathname-defaults*)))
> cffi:*foreign-library-directories*
> :test #'equal))
>
> (cffi:define-foreign-library sdl
> (:darwin (:framework "SDL"))
> (:windows "SDL.dll")
> (:unix (:or "libSDL-1.2.so.0.7.2"
> "libSDL-1.2.so.0"
> "libSDL-1.2.so"
> "libSDL.so"
> "libSDL")))
>
> (cffi:use-foreign-library sdl)
>
> - Luke
Thanks for your example Luke, but I don't think that is the problem.
For example, I can load libcurl.so (the example in the cffi manual),
which in cygwin is actually cygcurl.dll (and lives in /bin).
Just to eliminate the embarassingly obvious, I tested that clisp can
see cyggsl-0.dll, and I also linked an exacutable against it.
Things are not totally bleak as two other folks (on the cygwin and
cffi mailing lists) were able to (cffi:load-foreign-library "/bin/
cyggsl-0.dll"). So, it must be something in my setup. I'm giving it
a rest for the day.
Thanks,
Mirko