Closed rgbkrk closed 7 years ago
Was able to successfully install this on my Mac (which uses clang
under the hood). Appears to be an issue with the moving of the static_assert(ZMQ_VERSION_MAJOR...
line from 550e35f602af349d249ca8f56ba4d036c6f25391 and g++
.
Turns out static_assert
is a C++11 feature and for some reason this isn't being passed to the build process. I was able to build manually by setting -std=c++11
03:26:15 (master=) rgbkrk@dev ~/rzmq/src$ g++ -I/usr/share/R/include -DNDEBUG -I../inst/cppzmq -fpic -O3 -pipe -g -c interface.cpp -o interface.o
interface.cpp:23:14: error: expected constructor, destructor, or type conversion before ‘(’ token
static_assert(ZMQ_VERSION_MAJOR >= 3,"The minimum required version of libzmq is 3.0.0.");
^
03:26:21 (master=) rgbkrk@dev ~/rzmq/src$ g++ -I/usr/share/R/include -DNDEBUG -I../inst/cppzmq -fpic -O3 -pipe -g -c interface.cpp -o interface.o -std=c++11
03:26:32 (master=) rgbkrk@dev ~/rzmq/src$
The c++11 flag should be set by R during the package installation.
All that is required is this flag in the proejct Makevars: CXX_STD = CXX11
which has already been done.
Are you all not using R to build / install the package?
I used install_github
to install it.
From R.
CXX_STD = CXX11 appears to be honored for me:
library(devtools) install_github("rzmq",username="armstrtw") Downloading github repo armstrtw/rzmq@master Installing rzmq '/usr/lib/R/bin/R' --vanilla CMD INSTALL \ '/tmp/RtmpfFcFqT/devtools96b4aab8bc3/armstrtw-rzmq-320891d' \ --library='/usr/local/lib/R/site-library' --install-tests
- installing source package ‘rzmq’ ... * libs g++ -std=c++11 -I/usr/share/R/include -DNDEBUG -I../inst/cppzmq -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c interface.cpp -o interface.o g++ -std=c++11 -shared -Wl,-z,relro -o rzmq.so interface.o -lzmq -L/usr/lib/R/lib -lR installing to /usr/local/lib/R/site-library/rzmq/libs * R * inst * tests * preparing package for lazy loading * help ** installing help indices * building package indices \ testing if installed package can be loaded
- DONE (rzmq) Warning message: Username parameter is deprecated. Please use armstrtw/rzmq
What system are you using @armstrtw? On an Ubuntu 14.04 box I see this behavior. I can fully replicate the error with this Dockerfile:
FROM ubuntu:14.04
RUN apt-get update
RUN apt-get install -y r-base r-base-dev r-cran-rcurl libreadline-dev
RUN apt-get install -y libcurl4-openssl-dev
RUN apt-get install -y libzmq3 libzmq3-dev
RUN useradd -m -s /bin/bash jovyan
ENV HOME /home/jovyan
ENV SHELL /bin/bash
ENV USER jovyan
USER jovyan
RUN echo 'R_LIBS_USER=/home/jovyan/.R:/usr/lib/R/site-library' > /home/jovyan/.Renviron
RUN echo 'options(repos=structure(c(CRAN="http://cran.rstudio.com")))' > /home/jovyan/.Rprofile
RUN mkdir /home/jovyan/.R/
RUN echo "install.packages(c('rzmq'))" | R --no-save
WORKDIR /home/jovyan
Relevant build output:
> install.packages(c('rzmq'))
Installing package into '/home/jovyan/.R'
(as 'lib' is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/rzmq_0.7.7.tar.gz'
Content type 'application/x-gzip' length 16246 bytes (15 Kb)
opened URL
==================================================
downloaded 15 Kb
* installing *source* package 'rzmq' ...
** package 'rzmq' successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/share/R/include -DNDEBUG -I../inst/cppzmq -fpic -O3 -pipe -g -c interface.cpp -o interface.o
interface.cpp:23:14: error: expected constructor, destructor, or type conversion before '(' token
static_assert(ZMQ_VERSION_MAJOR >= 3,"The minimum required version of libzmq is 3.0.0.");
^
make: *** [interface.o] Error 1
ERROR: compilation failed for package 'rzmq'
* removing '/home/jovyan/.R/rzmq'
The downloaded source packages are in
'/tmp/RtmpUrLOXC/downloaded_packages'
Warning message:
In install.packages(c("rzmq")) :
installation of package 'rzmq' had non-zero exit status
I have debian/jessie.
Clearly, your R is not passing on the -std=c++11 flag.
I would start w/ your R config on that system, and see if you can build any other packages requiring c++11 (using the CXX_STD = CXX11 setting in Makevars)
I'll just use my fork for now and see if @takluyver has any ideas. This is a completely vanilla install of R, all steps are in that Dockerfile. I'm not a regular R user anymore, so I'm open to whatever config you think is necessary.
I see -O3 in your compiler options. which also tells me that somewhere in your config, you're using a non-standard config.
On debian, the machine config is here: /etc/R/Makeconf
and look in there and see what this config var is set to: CXX1XSTD = -std=c++11
The user config takes priority, so look here also: warmstrong@krypton:~$ cat ~/.R/Makevars
for user under which the package install runs...
Working on my Debian Jessie machine too. I can try on Ubuntu 14.10 later/another day if that helps.
My compiler arguments look like this:
g++ -std=c++11 -I/usr/share/R/include -DNDEBUG -I../inst/cppzmq -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c interface.cpp -o interface.o
g++ -std=c++11 -shared -Wl,-z,relro -o rzmq.so interface.o -lzmq -L/usr/lib/R/lib -lR
Yes, so that works, but is that with the forked version of rzmq which has the -std=c++11 added to the Makevars? or is your Jessie just picking up the option from CXX_STD = CXX11 like it's supposed to?
Forked version? I just did install_github('armstrtw/rzmq')
, so I assume that's getting the vanilla version.
Yes. looks that way. so this seems like it's a potential problem w/ the Ubuntu R config... good luck.
FYI, when I install R from the official R ubuntu packages on CRAN, it seems like this problem goes away, and /etc/R/Makevars
has CXX1XSTD = -std=c++11
.
I got this using Win7, Rtools and R3.1.2 installed from binary and copying a header file using @armaneshaghi's solution to fix a previous issue.
* installing *source* package 'rzmq' ...
** libs
Warning: running command 'make -f "Makevars" -f "C:/PROGRA~1/R/R-31~1.2/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-31~1.2/share/make/winshlib.mk" CXX='$(CXX1X) $(CXX1XSTD)' CXXFLAGS='$(CXX1XFLAGS)' CXXPICFLAGS='$(CXX1XPICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX1XLDFLAGS)' SHLIB_LD='$(SHLIB_CXX1XLD)' SHLIB="rzmq.dll" WIN=64 TCLBIN=64 OBJECTS="interface.o"' had status 127
ERROR: compilation failed for package 'rzmq'
* removing 'C:/Anaconda/Lib/site-packages/rpy2/R/win-library/3.1/rzmq'
Error: Command failed (1)
No luck installing an R kernel for IPython3
@jasongrout Thanks for your hint. I re-installed R from CRAN and then I could install rzmq
directly from github.
I'm having this problem as well. Its not clear to me how to install R from the ubuntu packages on CRAN. Any advice would be helpful. Thanks!
@jetheurer, there are some instructions here, unfortunately it's a bit involved. http://cran.r-project.org/bin/linux/ubuntu/
I managed to install rzmq using install_github after I added -std=C++11 in CXXFLAGS. I didn't have CXX1XSTD in my /etc/R/Makeconf and if I just added that with -std=C++11 defined I got the same error as above.
Joining the squad of people who are not having much luck. I have a Docker instance running Ubuntu trusty
:
Distributor ID: Ubuntu
Description: Ubuntu 14.04.2 LTS
Release: 14.04
Codename: trusty
When trying to install rzmq
, whether via Github or install.packages
, I get:
* installing *source* package ‘rzmq’ ...
** package ‘rzmq’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/share/R/include -DNDEBUG -I../inst/cppzmq -fpic -std=C++11 -O3 -pipe -g
interface.cpp:23:14: error: expected constructor, destructor, or type conversion before ‘(’ token
static_assert(ZMQ_VERSION_MAJOR >= 3,"The minimum required version of libzmq is 3.0.0.");
^
make: *** [interface.o] Error 1
ERROR: compilation failed for package ‘rzmq’
* removing ‘/usr/local/lib/R/site-library/rzmq’
The downloaded source packages are in
‘/tmp/RtmpNApcNY/downloaded_packages’
Warning message:
In install.packages(c("rzmq")) :
installation of package ‘rzmq’ had non-zero exit status
This is despite having set -std=C++11 in CXXFLAGS
in Makeconf
and libzmq
definitely being installed. Hmmm...
It appears that that CXX1XSTD
line which makes it use C++ 11 was added in R 3.1. Ubuntu 14.04 has R 3.0.2. I assume rzmq won't compile on any R < 3.1, therefore.
I suppose I should add a minimum R version requirement to the DESCRIPTION file.
Why not use a more recent version of R?
while installing rzmq
package after cloning as this is in IRkernel dependencies , first i got Error::interface.cpp:22:17: fatal error: zmq.h: No such file or directory
.
> install_local('./rzmq')
Installing rzmq
'/usr/lib/R/bin/R' --vanilla CMD INSTALL \
'/tmp/RtmpqzMO3O/file58d32991d52e/rzmq' \
--library='/home/kodekracker/R/x86_64-pc-linux-gnu-library/3.2' \
--install-tests
* installing *source* package ‘rzmq’ ...
** libs
g++ -std=c++11 -I/usr/share/R/include -DNDEBUG -I../inst/cppzmq -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c interface.cpp -o interface.o
interface.cpp:22:17: fatal error: zmq.h: No such file or directory
#include <zmq.h>
^
compilation terminated.
make: *** [interface.o] Error 1
ERROR: compilation failed for package ‘rzmq’
* removing ‘/home/kodekracker/R/x86_64-pc-linux-gnu-library/3.2/rzmq’
Error: Command failed (1)
which i removed by installing libzmq1
using this command
$ sudo apt-get install libzmq1
I moved one step further. But, now i face another Error:: interface.cpp:23:1: error: static assertion failed: The minimum required version of libzmq is 3.0.0.
install_local('./rzmq')
Installing rzmq
'/usr/lib/R/bin/R' --vanilla CMD INSTALL \
'/tmp/Rtmp2tFpfX/file6f974d7861e/rzmq' \
--library='/home/kodekracker/R/x86_64-pc-linux-gnu-library/3.2' \
--install-tests
* installing *source* package ‘rzmq’ ...
** libs
g++ -std=c++11 -I/usr/share/R/include -DNDEBUG -I../inst/cppzmq -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c interface.cpp -o interface.o
interface.cpp:23:1: error: static assertion failed: The minimum required version of libzmq is 3.0.0.
static_assert(ZMQ_VERSION_MAJOR >= 3,"The minimum required version of libzmq is 3.0.0.");
^
In file included from interface.cpp:24:0:
../inst/cppzmq/zmq.hpp: In function ‘void zmq::proxy(void*, void*, void*)’:
../inst/cppzmq/zmq.hpp:117:55: error: ‘zmq_proxy’ was not declared in this scope
int rc = zmq_proxy (frontend, backend, capture);
^
../inst/cppzmq/zmq.hpp: In member function ‘bool zmq::message_t::more()’:
../inst/cppzmq/zmq.hpp:232:40: error: ‘zmq_msg_more’ was not declared in this scope
int rc = zmq_msg_more (&msg);
^
../inst/cppzmq/zmq.hpp: At global scope:
../inst/cppzmq/zmq.hpp:275:72: error: ‘ZMQ_MAX_SOCKETS_DFLT’ was not declared in this scope
inline explicit context_t (int io_threads_, int max_sockets_ = ZMQ_MAX_SOCKETS_DFLT)
................................
.......................
................
make: *** [interface.o] Error 1
ERROR: compilation failed for package ‘rzmq’
* removing ‘/home/kodekracker/R/x86_64-pc-linux-gnu-library/3.2/rzmq’
Error: Command failed (1)
OS Ubuntu 14.04
R version 3.2.0
libzmq3 is already installed
Suggest something to help me out this problem.
Have you tried sudo apt-get install libzmq3-dev
? That's what the README says.
I had the same problem using R as installed from the universe repository on Ubuntu 14..04.02. I uninstalled R, and reinstalled from CRAN and rzmq then built just fine.
[Ubuntu 14.04] Set -std=c++11 in CXXFLAGS in Makeconf for installing libzmq where /etc/R/Makeconf
Same problem with Open Revolution R 3.2.0 distribution on Ubuntu 14.04. -std=c++11 is set by default in Makeconf
I encountered the same issue on Ubuntu 14.04 (Trusty Tahr) but successfully fixed it the following way.
I completely removed both pre-installed and manually-installed R-related packages using the Synaptic Package Manager, added deb http://cran.ism.ac.jp/bin/linux/ubuntu precise/
to /etc/apt/sources.list
as per the official instruction, and did a fresh install (sudo apt-get update sudo apt-get install r-base r-base-dev
).
Now I can see the correct compiler flag
$ grep CXX1XSTD /etc/R/Makeconf
CXX1XSTD = -std=c++11
SHLIB_CXX1XLD = $(CXX1X) $(CXX1XSTD)
and am able to install the package rzmq from source without any compilation errors related to the cppzmq library.
I have a dual booting system running Window 10 and Ubuntu 14.04.
I have been facing almost all the issues mentioned in this thread. I just can't get this rzmq
issue solved by whatever means I am trying to find online. @mmizutani your response was last hope and I still face a problem.
When I added the given deb http://cran.ism.ac.jp/bin/linux/ubuntu precise/
, I get the NO_PUBKEY GPG error
. Signature could not be verified.
What do I do now? Please suggest. Why is rzmq
such a big impossible thing to install when such very useful apps depend on this?
What is the complication?
can you not install from source?
do you have these libs on your system: whit@vulcan:~/dvl/R.packages$ dpkg --get-selections|grep zmq libzmq3:amd64 install libzmq3-dev:amd64 install
whit@vulcan:~/dvl/R.packages$ R CMD build rzmq
whit@vulcan:~/dvl/R.packages$ sudo R CMD INSTALL rzmq_0.7.6.tar.gz
Completely removing r-base
and r-base-core
, changing the CRAN mirror in /etc/apt/sources.list
and re-installing r-base
and r-base-dev
solved the issue. I am not sure what exactly made this happen.
Now I successfully installed rzmq
through R itself, not terminal.
All this attempt was to get IRkernel
installed in my Rstudio. Although IRkernel
installed successfully, I still do not get my IPython Notebook recognize it. Anyway, regaring the rzmq
, I hope I am done with it for now. Thank you for your time and will get back in touch if I need further help. Dealing with programming languages without prerequisite knowledge is not only tough, I am afraid all this may go waste. Thanks.
Ok. good luck. a new rzmq should be on cran in the next few days as imports are required to be updated for the forthcoming release of R.
I am receiving a very similar error. It looks like this:
> install.packages('rzmq')
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
Content type 'application/x-gzip' length 16246 bytes (15 KB)
==================================================
downloaded 15 KB
* installing *source* package ‘rzmq’ ...
** package ‘rzmq’ successfully unpacked and MD5 sums checked
** libs
g++ -m64 -std=c++11 -I/usr/include/R -DNDEBUG -I../inst/cppzmq -I/usr/local/include -fpic -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c interface.cpp -o interface.o
interface.cpp:23:1: error: static assertion failed: The minimum required version of libzmq is 3.0.0.
static_assert(ZMQ_VERSION_MAJOR >= 3,"The minimum required version of libzmq is 3.0.0.");
^
In file included from interface.cpp:24:0:
../inst/cppzmq/zmq.hpp: In function ‘void zmq::proxy(void*, void*, void*)’:
../inst/cppzmq/zmq.hpp:117:55: error: ‘zmq_proxy’ was not declared in this scope
int rc = zmq_proxy (frontend, backend, capture);
And it continues on like this. My OS is Fedora, and I've installed the system packages required to install rzmq (zeromq and zeromq-devel) stated by CRAN. The packages are not named libzmq, although rzmq seems to be looking for them. However, there are no libzmq packages on Fedora. Is this the problem? I've also updated all R packages and my R is version 3.2.1. I also checked the Makeconf file, and the CXX1XSTD = -std=c++11
configuration was present.
additionally, the DESCRIPTION file contains the package names for debian and fedora... https://github.com/armstrtw/rzmq/blob/master/DESCRIPTION#L8
If there is still an issue after you install the required packages, then please post here.
I solved the problem. It seems there was a conflict between zeromq-devel and zeromq3-devel packages, so I removed zeromq-devel and installed zeromq3-devel and it worked fine. Thanks for the help!
I installed R with apt-get install r-base-core
which installed R 3.0.2 by default and had the same issue.
After upgrading R to 3.2.4 by following these directions, rzmq installed just fine.
In my case g++ was not installed. Installing it solved the issue.
Mine was Jessie from raspberrian
I've been using the same libzmq set up for a while, installing it in a Docker container. Recently though, I've been getting this error:
Before I posted this issue, I thought it was complaining about my 0mq version (I have 3!!!). Now I see its not failing on
ZMQ_VERSION_MAJOR
. There's a syntax error ininterface.cpp
, which I assume is the vendorized version of the c++ binding.