Lisp HUG Maillist Archive

Dynamic Library Load Path

Hello,

When I try and load “woo” using quicklisp I get the following:

(ql:quickload "woo")
To load "cffi-grovel":
  Load 1 ASDF system:
    cffi-grovel
; Loading "cffi-grovel"

To load "woo":
  Load 1 ASDF system:
    woo
; Loading "woo"

Error: Unable to load any of the alternatives:
   ("libev.4.dylib" "libev.4.so" "libev.so.4" "libev.dylib" "libev.so")
   1 (continue) Try loading the foreign library again.
   2 Use another library instead.
   3 Try loading /Users/burtonsamograd/.cache/common-lisp/lw-7.0.0-macosx-x64/Users/burtonsamograd/quicklisp/dists/quicklisp/software/lev-20150505-git/src/lev.64xfasl again.
   4 Give up loading /Users/burtonsamograd/.cache/common-lisp/lw-7.0.0-macosx-x64/Users/burtonsamograd/quicklisp/dists/quicklisp/software/lev-20150505-git/src/lev.64xfasl.
   5 Try loading another file instead of /Users/burtonsamograd/.cache/common-lisp/lw-7.0.0-macosx-x64/Users/burtonsamograd/quicklisp/dists/quicklisp/software/lev-20150505-git/src/lev.64xfasl.
   6 Recompile lev and try loading it again
   7 Retry loading FASL for #<ASDF/LISP-ACTION:CL-SOURCE-FILE "lev" "src" "lev">.
   8 Continue, treating loading FASL for #<ASDF/LISP-ACTION:CL-SOURCE-FILE "lev" "src" "lev"> as having been
     successful.
   9 Retry ASDF operation.
  10 Retry ASDF operation after resetting the configuration.
  11 (abort) Give up on "woo"
  12 Return to level 0.
  13 Return to top loop level 0.

I’m curious about how to set the search path for dynamic libraries in LispWorks on MacOS.  I have installed libev using brew and it is located in /usr/local/lib.

—
Burton Samograd

Sent with Unibox

Re: Dynamic Library Load Path

Hi,

First make sure what you have a library of the same bitness as your LW.
I see you are using 64bits LW, then probably it is not an issue.
In my case I'm using 32bits LW and macports, so paths are different.

In Macports case I had to build 32bit version of libev:

sudo port install libev +universal

To add proper path to the library:
(ql:quickload "cffi")
(pushnew #P"/opt/local/lib/" cffi:*foreign-library-directories* :test
#'equal)

No problems now:
(ql:quickload "woo")

If still doesn't work you can test like this:

(cffi:load-foreign-library '(:default "libev"))

More information here:
https://common-lisp.net/project/cffi/manual/html_node/_002aforeign_002dlibrary_002ddirectories_002a.html


BusFactor1 <busfactor1@gmail.com> writes:

> Hello,
>
> When I try and load “woo” using quicklisp I get the following:
>
> (ql:quickload "woo")
> To load "cffi-grovel":
> Load 1 ASDF system:
> cffi-grovel
> ; Loading "cffi-grovel"
>
> To load "woo":
> Load 1 ASDF system:
> woo
> ; Loading "woo"
>
> Error: Unable to load any of the alternatives:
> ("libev.4.dylib" "libev.4.so" "libev.so.4" "libev.dylib" "libev.so")
> 1 (continue) Try loading the foreign library again.
> 2 Use another library instead.
> 3 Try loading
> /Users/burtonsamograd/.cache/common-lisp/lw-7.0.0-macosx-x64/Users/burtonsamograd/quicklisp/dists/quicklisp/software/lev-20150505-git/src/lev.64xfasl
> again.
> 4 Give up loading
> /Users/burtonsamograd/.cache/common-lisp/lw-7.0.0-macosx-x64/Users/burtonsamograd/quicklisp/dists/quicklisp/software/lev-20150505-git/src/lev.64xfasl.
>
> 5 Try loading another file instead of
> /Users/burtonsamograd/.cache/common-lisp/lw-7.0.0-macosx-x64/Users/burtonsamograd/quicklisp/dists/quicklisp/software/lev-20150505-git/src/lev.64xfasl.
>
> 6 Recompile lev and try loading it again
> 7 Retry loading FASL for #<ASDF/LISP-ACTION:CL-SOURCE-FILE "lev" "src" "lev">.
> 8 Continue, treating loading FASL for #<ASDF/LISP-ACTION:CL-SOURCE-FILE "lev" "src" "lev"> as
> having been
> successful.
> 9 Retry ASDF operation.
> 10 Retry ASDF operation after resetting the configuration.
> 11 (abort) Give up on "woo"
> 12 Return to level 0.
> 13 Return to top loop level 0.
>
> I’m curious about how to set the search path for dynamic libraries in LispWorks on MacOS. I have
> installed libev using brew and it is located in /usr/local/lib.
>
> —
> Burton Samograd
>
> Sent with Unibox 
>

-- 
Br,
/Alexey

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Dynamic Library Load Path

Hi BusFactor1,

It would be even better to have a solution that avoids the use of CFFI or any external dependency.
Any clue?


Best,
Cam



> On Jan 5, 2017, at 19:51, Alexey Veretennikov <txm.fourier@gmail.com> wrote:
> 
> Hi,
> 
> First make sure what you have a library of the same bitness as your LW.
> I see you are using 64bits LW, then probably it is not an issue.
> In my case I'm using 32bits LW and macports, so paths are different.
> 
> In Macports case I had to build 32bit version of libev:
> 
> sudo port install libev +universal
> 
> To add proper path to the library:
> (ql:quickload "cffi")
> (pushnew #P"/opt/local/lib/" cffi:*foreign-library-directories* :test
> #'equal)
> 
> No problems now:
> (ql:quickload "woo")
> 
> If still doesn't work you can test like this:
> 
> (cffi:load-foreign-library '(:default "libev"))
> 
> More information here:
> https://common-lisp.net/project/cffi/manual/html_node/_002aforeign_002dlibrary_002ddirectories_002a.html
> 
> 
> BusFactor1 <busfactor1@gmail.com> writes:
> 
>> Hello,
>> 
>> When I try and load “woo” using quicklisp I get the following:
>> 
>> (ql:quickload "woo")
>> To load "cffi-grovel":
>> Load 1 ASDF system:
>> cffi-grovel
>> ; Loading "cffi-grovel"
>> 
>> To load "woo":
>> Load 1 ASDF system:
>> woo
>> ; Loading "woo"
>> 
>> Error: Unable to load any of the alternatives:
>> ("libev.4.dylib" "libev.4.so" "libev.so.4" "libev.dylib" "libev.so")
>> 1 (continue) Try loading the foreign library again.
>> 2 Use another library instead.
>> 3 Try loading
>> /Users/burtonsamograd/.cache/common-lisp/lw-7.0.0-macosx-x64/Users/burtonsamograd/quicklisp/dists/quicklisp/software/lev-20150505-git/src/lev.64xfasl
>> again.
>> 4 Give up loading
>> /Users/burtonsamograd/.cache/common-lisp/lw-7.0.0-macosx-x64/Users/burtonsamograd/quicklisp/dists/quicklisp/software/lev-20150505-git/src/lev.64xfasl.
>> 
>> 5 Try loading another file instead of
>> /Users/burtonsamograd/.cache/common-lisp/lw-7.0.0-macosx-x64/Users/burtonsamograd/quicklisp/dists/quicklisp/software/lev-20150505-git/src/lev.64xfasl.
>> 
>> 6 Recompile lev and try loading it again
>> 7 Retry loading FASL for #<ASDF/LISP-ACTION:CL-SOURCE-FILE "lev" "src" "lev">.
>> 8 Continue, treating loading FASL for #<ASDF/LISP-ACTION:CL-SOURCE-FILE "lev" "src" "lev"> as
>> having been
>> successful.
>> 9 Retry ASDF operation.
>> 10 Retry ASDF operation after resetting the configuration.
>> 11 (abort) Give up on "woo"
>> 12 Return to level 0.
>> 13 Return to top loop level 0.
>> 
>> I’m curious about how to set the search path for dynamic libraries in LispWorks on MacOS. I have
>> installed libev using brew and it is located in /usr/local/lib.
>> 
>> —
>> Burton Samograd
>> 
>> Sent with Unibox 
>> 
> 
> -- 
> Br,
> /Alexey
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Updated at: 2020-12-10 08:31 UTC