Torch7: Failed installing lzmq in ubuntu 12.04

Created on 22 Jan 2015  Â·  15Comments  Â·  Source: torch/torch7

Guys,

I am installing torch in my ubuntu 12.04, but failed to lzmq. Are you able to help on this issue? Thanks in advance.
Wenfeng
.....
gcc -shared -o lzmq/timer.so -L/home/wenfeng/torch-distro/install/lib src/ztimer.o src/lzutils.o -lrt
gcc -O2 -fPIC -I/home/wenfeng/torch-distro/install/include -c src/lzmq.c -o src/lzmq.o -DLUAZMQ_USE_SEND_AS_BUF -DLUAZMQ_USE_TEMP_BUFFERS -DLUAZMQ_USE_ERR_TYPE_OBJECT -I/usr/include
src/lzmq.c:482:1: error: ‘ZMQ_EVENT_CONNECTED’ undeclared here (not in a function)
src/lzmq.c:483:1: error: ‘ZMQ_EVENT_CONNECT_DELAYED’ undeclared here (not in a function)
src/lzmq.c:484:1: error: ‘ZMQ_EVENT_CONNECT_RETRIED’ undeclared here (not in a function)
src/lzmq.c:486:1: error: ‘ZMQ_EVENT_LISTENING’ undeclared here (not in a function)
src/lzmq.c:487:1: error: ‘ZMQ_EVENT_BIND_FAILED’ undeclared here (not in a function)
src/lzmq.c:489:1: error: ‘ZMQ_EVENT_ACCEPTED’ undeclared here (not in a function)
src/lzmq.c:490:1: error: ‘ZMQ_EVENT_ACCEPT_FAILED’ undeclared here (not in a function)
src/lzmq.c:492:1: error: ‘ZMQ_EVENT_CLOSED’ undeclared here (not in a function)
src/lzmq.c:493:1: error: ‘ZMQ_EVENT_CLOSE_FAILED’ undeclared here (not in a function)
src/lzmq.c:494:1: error: ‘ZMQ_EVENT_DISCONNECTED’ undeclared here (not in a function)
src/lzmq.c:499:1: error: ‘ZMQ_EVENT_ALL’ undeclared here (not in a function)

Error: Failed installing dependency: https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/lzmq-0.4.2-1.src.rock - Build error: Failed compiling object src/lzmq.o
\nWriting new paths to shell config\n

Most helpful comment

Well - for those who are looking for answer, the problem seems to be because of mismatched version of ZMQ headers.

Best thing is not to rely on these repositories, but build the zmq from source. Found these instructions here https://github.com/gibiansky/IHaskell helpful.

# Compiling from source:
git clone [email protected]:zeromq/zeromq4-x.git libzmq
cd libzmq
mkdir build
cd build
cmake ..
sudo make install
sudo ldconfig

All 15 comments

have you installed this sudo apt-get install libzmq3-dev ?

I tried, but it can't locate package.

$ sudo apt-get install libzmq3-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libzmq3-dev

maybe it's libzmq-dev in 12.04

libzmq-dev was already installed previously, but the problem remains.

$ sudo apt-get install libzmq-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libzmq-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.

@wangwf if you use the instal-deps(https://github.com/torch/ezinstall/blob/master/install-deps#L95) script to install the dependencies, it will use this PPA:
https://launchpad.net/~chris-lea/+archive/ubuntu/zeromq/+packages

to the install libzmq3-dev

You seem to have not run install-deps, or something failed wrt the PPA.

Rerun it using:
curl -sk https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash

make sure it runs to completion and you see no errors.

Sorry to bother you again, I did follow the install instruction. The below is what I get.
...
$ curl -sk https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash
....
Install OK!
make[1]: Leaving directory `/tmp/OpenBLAS'
==> Torch7's dependencies have been installed

$cd ~/torch-distro; sudo ./install.sh
...
gcc -O2 -fPIC -I/home/wenfeng/torch-distro/install/include -c src/lzmq.c -o src/lzmq.o -DLUAZMQ_USE_SEND_AS_BUF -DLUAZMQ_USE_TEMP_BUFFERS -DLUAZMQ_USE_ERR_TYPE_OBJECT -I/usr/include
src/lzmq.c:482:1: error: ‘ZMQ_EVENT_CONNECTED’ undeclared here (not in a function)
src/lzmq.c:483:1: error: ‘ZMQ_EVENT_CONNECT_DELAYED’ undeclared here (not in a function)
src/lzmq.c:484:1: error: ‘ZMQ_EVENT_CONNECT_RETRIED’ undeclared here (not in a function)
src/lzmq.c:486:1: error: ‘ZMQ_EVENT_LISTENING’ undeclared here (not in a function)
src/lzmq.c:487:1: error: ‘ZMQ_EVENT_BIND_FAILED’ undeclared here (not in a function)
src/lzmq.c:489:1: error: ‘ZMQ_EVENT_ACCEPTED’ undeclared here (not in a function)
src/lzmq.c:490:1: error: ‘ZMQ_EVENT_ACCEPT_FAILED’ undeclared here (not in a function)
src/lzmq.c:492:1: error: ‘ZMQ_EVENT_CLOSED’ undeclared here (not in a function)
src/lzmq.c:493:1: error: ‘ZMQ_EVENT_CLOSE_FAILED’ undeclared here (not in a function)
src/lzmq.c:494:1: error: ‘ZMQ_EVENT_DISCONNECTED’ undeclared here (not in a function)
src/lzmq.c:499:1: error: ‘ZMQ_EVENT_ALL’ undeclared here (not in a function)

Error: Failed installing dependency: https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/lzmq-0.4.2-1.src.rock - Build error: Failed compiling object src/lzmq.o
\nWriting new paths to shell config\n

The fact that
sudo apt-get install libzmq3-dev
does not find a package is a sign of the PPA not being installed.
You can manually try to get it in using these commands:

sudo add-apt-repository ppa:chris-lea/zeromq
sudo apt-get update
sudo apt-get install -y libzmq3-dev

I had the same issue on 14.04 with a previously installed chris-lea ppa. I had to purge the ppa, libzmq3-dev and libzmq3 and reinstall. Now luarocks is only searching for the zmq headers in /usr/local/include when they are actually installed in /usr/include. Getting luarocks to search this path has been somewhat aggravating. Compilation works fine when i symlink but offering some docs on how to change the search paths would be nice.

How did fix this?

What is the solution. I am getting same problem on Ubuntu14

Error: Build error: Failed compiling object src/lzmq.o

It says libzmq3-dev is already up to date and lots of ‘ZMQ_EVENT_CONNECTED’ undeclared here macro related errors.

How to resolve this?

Hope the iTorch installation is streamline just like the torch easyinstall option.

Well - for those who are looking for answer, the problem seems to be because of mismatched version of ZMQ headers.

Best thing is not to rely on these repositories, but build the zmq from source. Found these instructions here https://github.com/gibiansky/IHaskell helpful.

# Compiling from source:
git clone [email protected]:zeromq/zeromq4-x.git libzmq
cd libzmq
mkdir build
cd build
cmake ..
sudo make install
sudo ldconfig

I'm getting :
Cloning into 'libzmq'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Where you able to build?

Yes, I was able to build it. Perhaps you can try https style of clone url as below:
git clone https://github.com/zeromq/zeromq4-x.git libzmq

@KrishnaPG Thanks for this "https" hint ! After searching the web for a couple hours for a solution to the "access denied" problem, this did the trick.

Thanks! It solved.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Nate1874 picture Nate1874  Â·  3Comments

kaleem0002 picture kaleem0002  Â·  10Comments

n3011 picture n3011  Â·  9Comments

spiralswimmer picture spiralswimmer  Â·  6Comments

visonpon picture visonpon  Â·  3Comments