ropensci / rzmq

R package for ZMQ
https://docs.ropensci.org/rzmq
84 stars 30 forks source link

Compatibility issue with latest zmq from homebrew on OS X #18

Closed ddauer closed 7 years ago

ddauer commented 9 years ago
$ brew update
Already up-to-date.
$ brew upgrade zmq
Error: zeromq 4.1.2 already installed
$ ls -l /usr/local/lib |grep libzmq
lrwxr-xr-x   1 ddauer admin      41 Jun 22 09:20 libzmq.5.dylib -> ../Cellar/zeromq/4.1.2/lib/libzmq.5.dylib
lrwxr-xr-x   1 ddauer admin      35 Jun 22 09:20 libzmq.a -> ../Cellar/zeromq/4.1.2/lib/libzmq.a
lrwxr-xr-x   1 ddauer admin      39 Jun 22 09:20 libzmq.dylib -> ../Cellar/zeromq/4.1.2/lib/libzmq.dylib
lrwxr-xr-x   1 ddauer admin      53 Jul 16 12:16 libzmqcollab.2.dylib -> ../Cellar/fontforge/20150612/lib/libzmqcollab.2.dylib
lrwxr-xr-x   1 ddauer admin      47 Jul 16 12:16 libzmqcollab.a -> ../Cellar/fontforge/20150612/lib/libzmqcollab.a
lrwxr-xr-x   1 ddauer admin      51 Jul 16 12:16 libzmqcollab.dylib -> ../Cellar/fontforge/20150612/lib/libzmqcollab.dylib

in R:

> library("rzmq", lib.loc="/Library/Frameworks/R.framework/Versions/3.2/Resources/library")
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rzmq/libs/rzmq.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rzmq/libs/rzmq.so, 6): Library not loaded: /usr/local/lib/libzmq.4.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.2/Resources/library/rzmq/libs/rzmq.so
  Reason: image not found
Error: package or namespace load failed for ‘rzmq’

it seems to be looking for libzmq.4.dylib while only libzmq.5.dylib is available

$ otool -L /Library/Frameworks/R.framework/Versions/3.2/Resources/library/rzmq/libs/rzmq.so
/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rzmq/libs/rzmq.so:
    rzmq.so (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/lib/libzmq.4.dylib (compatibility version 5.0.0, current version 5.0.0)
        ...

quickfix:

install_name_tool -change /usr/local/lib/libzmq.4.dylib /usr/local/lib/libzmq.5.dylib /Library/Frameworks/R.framework/Versions/3.2/Resources/library/rzmq/libs/rzmq.so
wkc1986 commented 9 years ago

Had same issue while installing IRKernel, worked with same quickfix, thanks.

sje30 commented 9 years ago

I got the same error too; thanks for the note about install_name_tool, that worked for me too (with slightly change to the rzmq.so location).

armstrtw commented 9 years ago

I'm not a mac person. Is there a change to the package we need, or just something in the install notes?

sje30 commented 9 years ago

Hi,

There is certainly a need for some documentation. If I simply follow the instructions on http://irkernel.github.io/ then rzmq package does not work because the zmq libraries are not installed.

However, it is a bit unusual for a package from CRAN such as this to not install.

(Another problem for me last night was that after installing rzmq and the other packages, I got dead kernel reports when trying a R notebook. There might be something with my setup however.)

I also thought I could install the rzmq package via, devtools, but this didn't work:

 >install_github("armstrtw/rzmq")
Downloading GitHub repo armstrtw/rzmq@master
Installing rzmq
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ  \
  --no-save --no-restore CMD INSTALL  \
  '/private/var/folders/rw/2g0_whns55x580hlgf1vjs8m0000gn/T/RtmpZqAlgd/devtools104ef789bdf69/armstrtw-rzmq-52a491d'  \
  --library='/Users/stephen/NOBACKUP/RLIB' --install-tests 

* installing *source* package ‘rzmq’ ...
** libs
clang++ -std=c++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I../inst/cppzmq -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include    -fPIC  -Wall -mtune=core2 -g -O2 -c interface.cpp -o interface.o
interface.cpp:24:10: fatal error: 'zmq.hpp' file not found
#include <zmq.hpp>
         ^
1 error generated.
make: *** [interface.o] Error 1

There is no sign of zmq.hpp in /usr/local/Cellar/zeromq

We might get some help for this over at r-sig-mac mailing list?

remkoning commented 9 years ago

@sje30 Any progress on this? Running into the same problem after upgrading to el capitan. Thanks!

armstrtw commented 9 years ago

zmq.hpp is part of the repo again (no longer a submodule). https://github.com/armstrtw/rzmq/tree/master/inst

did you re-pull?

sje30 commented 9 years ago

thanks, it now compiles just fine for me!

higgser commented 8 years ago

I tried many different solution to fix the problem with the missing zmq library on my OS X. The easiest and only solution that work for me was to install version 4 of zeromq with homebrew. With the latest version 5 the ipython notebook did not connect with the kernel, even after fixing the linking issue with the install_name_tool. So my solution was;

brew uninstall zeromq
brew install zeromq405

Afterwards I reinstall the R packages of the IRkernel and it finally worked.

armstrtw commented 7 years ago

should be fixed now.

rpcoelho17 commented 7 years ago

I tried to brew install zeromq405 and got these errors: brew install zeromq405 Error: No available formula with the name "zeromq405" ==> Searching for a previously deleted formula... Warning: homebrew/core is shallow clone. To get complete history run: git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found. ==> Searching for similarly named formulae... ==> Searching local taps... Error: No similarly named formulae found. ==> Searching taps... ==> Searching taps on GitHub... Error: No formulae found in taps.

I've been trying to install the R kernel for Jupyter notebooks on a Mac for 3 days now. Any help on the above error? It seems I need this library for IRKernel to work.

Thanks in advance for any help

jeroen commented 7 years ago

If you run the standard R for mac you can just install the binary pkg: install.packages("rzmq").

If you want to build from source using homebrew you need: brew install zeromq