Lisp HUG Maillist Archive

having trouble quickloading zeromq on OSX

I am running HobbyistDV 64 bit on a Mac.  I can quickload zeromq just fine in sbcl and in ccl (Clozure) on the platform.  But lispworks is claiming it can't find libzmq.dylib.  But this exists in both /usr/lib and in /opt/local/lib (the latter being where ccl wants to find it for some reason).   Any hints how to overcome this?  Where does lispworks look for such things?   Also lispworks had no problem with this at all on ubuntu. 

[package zeromq]
Error: Unable to load any of the alternatives:
   ("libzmq.0.dylib" "libzmq.dylib")
   1 (continue) Try loading the foreign library again.
   2 Use another library instead.
   3 Try loading /Users/samantha/.cache/common-lisp/lw-7.0.0-macosx-x64/Users/samantha/quicklisp/dists/quicklisp/software/cl-zmq-20140713-git/src/package.64xfasl again.
   4 Give up loading /Users/samantha/.cache/common-lisp/lw-7.0.0-macosx-x64/Users/samantha/quicklisp/dists/quicklisp/software/cl-zmq-20140713-git/src/package.64xfasl.
   5 Try loading another file instead of /Users/samantha/.cache/common-lisp/lw-7.0.0-macosx-x64/Users/samantha/quicklisp/dists/quicklisp/software/cl-zmq-20140713-git/src/package.64xfasl.


- samantha

OkCupid
June 3, 2015 at 1:04 AM
✉ New message from WarmAndroid
 
 
 
 

WarmAndroid says:

 

Yes independent wealth is on my short list too. Has stayed on there for a long time, unfortunately. (read more)

 
Read More
 
 
 

OkCupid © 2015 Humor Rainbow, Inc.
555 W 18th St, New York, NY 10011

Unsubscribe
 
 

Re: having trouble quickloading zeromq on OSX

Hi Samantha,

Can you check wether your version of libzmq.dylib has 64 bit architecture?
If it is compiled for 32 bit only, LispWorks will complain it cannot find it.
You can run the terminal command e.g. “file libzmq.dylib” to list the library’s architectures.


Best,
Cam

On 03 Jun 2015, at 10:30, Samantha Atkins <sjatkins@gmail.com> wrote:

I am running HobbyistDV 64 bit on a Mac.  I can quickload zeromq just fine in sbcl and in ccl (Clozure) on the platform.  But lispworks is claiming it can't find libzmq.dylib.  But this exists in both /usr/lib and in /opt/local/lib (the latter being where ccl wants to find it for some reason).   Any hints how to overcome this?  Where does lispworks look for such things?   Also lispworks had no problem with this at all on ubuntu.  

[package zeromq]
Error: Unable to load any of the alternatives:
   ("libzmq.0.dylib" "libzmq.dylib")
   1 (continue) Try loading the foreign library again.
   2 Use another library instead.
   3 Try loading /Users/samantha/.cache/common-lisp/lw-7.0.0-macosx-x64/Users/samantha/quicklisp/dists/quicklisp/software/cl-zmq-20140713-git/src/package.64xfasl again.
   4 Give up loading /Users/samantha/.cache/common-lisp/lw-7.0.0-macosx-x64/Users/samantha/quicklisp/dists/quicklisp/software/cl-zmq-20140713-git/src/package.64xfasl.
   5 Try loading another file instead of /Users/samantha/.cache/common-lisp/lw-7.0.0-macosx-x64/Users/samantha/quicklisp/dists/quicklisp/software/cl-zmq-20140713-git/src/package.64xfasl.


- samantha

Re: having trouble quickloading zeromq on OSX

Hi Samantha,

> Am 03.06.2015 um 10:30 schrieb Samantha Atkins <sjatkins@gmail.com>:
> 
> I am running HobbyistDV 64 bit on a Mac.  I can quickload zeromq just fine in sbcl and in ccl (Clozure) on the platform.  But lispworks is claiming it can't find libzmq.dylib.  But this exists in both /usr/lib and in /opt/local/lib (the latter being where ccl wants to find it for some reason).   Any hints how to overcome this?  Where does lispworks look for such things?   Also lispworks had no problem with this at all on ubuntu.  
> 
> [package zeromq]
> Error: Unable to load any of the alternatives:
>    ("libzmq.0.dylib" "libzmq.dylib“)

Please do (in a terminal / Terminal.app):

ccde007:~ frgo$ find / -name "libzmq.dylib“ 2>/dev/null

This may take a while but should yield something like:

/usr/local/Cellar/zeromq/4.0.5_2/lib/libzmq.dylib
/usr/local/lib/libzmq.dylib

If there is no lines stating libzmq then its just not there or unreachable for your user (due to directories not being readable by your system user). Try installing zmq. I’d recommend using homebrew with command: 

ccde007:~ frgo$ brew install zmq

This, too, may take some time. The please rerun the find command. Using its results, add this to the foreign library directories CFFI is aware o. 

In case you have found something please check what CFFI:*FOREIGN-LIBRARY-DIRECTORIES* is bound to. For me:

CL-USER > cffi:*foreign-library-directories*
NIL

Then:

CL-USER > (cffi:define-foreign-library libzmq
	   (t (:default "libzmq")))
LIBZMQ

CL-USER> (cffi:use-foreign-library libzmq)
#<CFFI:FOREIGN-LIBRARY LIBZMQ "libzmq.4.dylib“>

Lean back. Have a good tea. Smile.

;-)

Kind regards

  Frank


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


Re: having trouble quickloading zeromq on OSX

OOPS - There is one line missing - see below.

Am 03.06.15 19:16 schrieb "Frank Gönninger, Gönninger B&T" unter
<frank.goenninger@goenninger.net>:

>
>Hi Samantha,
>
>> Am 03.06.2015 um 10:30 schrieb Samantha Atkins <sjatkins@gmail.com>:
>> 
>> I am running HobbyistDV 64 bit on a Mac.  I can quickload zeromq just
>>fine in sbcl and in ccl (Clozure) on the platform.  But lispworks is
>>claiming it can't find libzmq.dylib.  But this exists in both /usr/lib
>>and in /opt/local/lib (the latter being where ccl wants to find it for
>>some reason).   Any hints how to overcome this?  Where does lispworks
>>look for such things?   Also lispworks had no problem with this at all
>>on ubuntu.  
>> 
>> [package zeromq]
>> Error: Unable to load any of the alternatives:
>>    ("libzmq.0.dylib" "libzmq.dylib“)
>
>Please do (in a terminal / Terminal.app):
>
>ccde007:~ frgo$ find / -name "libzmq.dylib“ 2>/dev/null
>
>This may take a while but should yield something like:
>
>/usr/local/Cellar/zeromq/4.0.5_2/lib/libzmq.dylib
>/usr/local/lib/libzmq.dylib
>
>If there is no lines stating libzmq then its just not there or
>unreachable for your user (due to directories not being readable by your
>system user). Try installing zmq. I’d recommend using homebrew with
>command: 
>
>ccde007:~ frgo$ brew install zmq
>
>This, too, may take some time. The please rerun the find command. Using
>its results, add this to the foreign library directories CFFI is aware o.
>
>In case you have found something please check what
>CFFI:*FOREIGN-LIBRARY-DIRECTORIES* is bound to. For me:
>
>CL-USER > cffi:*foreign-library-directories*
>NIL
>
>Then:

- using the path you have found:

CL-USER >  (pushnew #p"/usr/local/lib/" cffi:*foreign-library-directories*)

>
>CL-USER > (cffi:define-foreign-library libzmq
>	   (t (:default "libzmq")))
>LIBZMQ
>
>CL-USER> (cffi:use-foreign-library libzmq)
>#<CFFI:FOREIGN-LIBRARY LIBZMQ "libzmq.4.dylib“>
>
>Lean back. Have a good tea. Smile.
>
>-)
>
>Kind regards
>
>  Frank
>
>
>_______________________________________________
>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


Re: having trouble quickloading zeromq on OSX

Am 03.06.15 23:01 schrieb "Samantha Atkins" unter <sjatkins@gmail.com>:


>    Thanks, Frank.
>    
>    So the cffi stuff is needed for LW to find libraries used from
>    something installed by quicklisp and/or ASDF?
>    How come?  It isn't needed on ubuntu where I evaluated the
>    professional edition.

There are a couple of things to separate from each other:

1. Foreign libraries, like libzmq is.

It is crucial to load the right image type of that library, meaning if you
are on a 32bit system you will need a 32bit library image. This is, as
others have pointed out already, best determined with the "file
/usr/lib/libzmq.dylib“ command. This is equally true for Linux, Windows
and OS X.

If you want to load a foreign library you’ll need a load mechanism - like
CFFI, Lispworks’ built-in capabilities.

2. Loading Lisp Systems with Quicklisp and/or ASDF.

This is for loading complete packages of Lisp code - and has nothing to do
with foreign libraries. If you load a package with Quicklisp or ASDF and
that package loads a foreign library then you will end up using both
mechanisms.


>   Shouldn't this sort of think just be built
>    in? 

Yes, they are built-in in Lispworks. I can’t say though how to do this in
a Lispworks specific way - I always use Quicklisp and CFFI.

> I also ran across at least one thing on the intertubes saying
>    that setting that was not sufficient.  But I will try later.
>    
>    As mentioned I installed zeromq directly by building it.  I don't
>    see a good reason to prefer the brew thing.  Is there one?
>    
>    As for the places it exists:
>    /opt/local/libzmq.dylib
>    /usr/lib/libzmq.dylib
>    /usr/local/Cellar/zeromq/4.0.5_2/lib/libzmq.dylib
>    
>    - samantha

Looking at your other email I’d suggest you do

(pushnew #p"/usr/lib/" cffi:*foreign-library-directories*)

Please note the trailing / at the end of the path string.

Hope that helps … Next step would be to di a Teamviewer session so I could
look directly in what’s happening.

Kind regards

  Frank



_______________________________________________
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:33 UTC