Configuration for Java binding for ZeroMQ (0MQ) with no root privileges on Linux

StackOverflow https://stackoverflow.com/questions/16898080

  •  30-05-2022
  •  | 
  •  

Question

I am a novice with zeroMQ and I am stuck at binding ØMQ with java on a server running CentOS release 5.9.

Unfortunately, I do not have super user/root privileges on the server and am trying to install ØMQ as a normal user with restricted privileges. I have installed ØMQ by following instructions on http://www.zeromq.org/area:download

Make sure that libtool, autoconf, automake are installed.
Check whether uuid-dev package, uuid/e2fsprogs RPM or equivalent on your system is installed.
Unpack the .tar.gz source archive.
Run ./configure, followed by make.

Could not run the following obviously

To install ØMQ system-wide run sudo make install.
On Linux, run sudo ldconfig after installing ØMQ.

Then I attempted to install jzmq.

  1. Cloned [git clone https://github.com/zeromq/jzmq.git]
  2. Ran autogen.sh
  3. Ran configure

At this point I get the following error

checking for ZeroMQ... no
checking zmq.h usability... no
checking zmq.h presence... no
checking for zmq.h... no
configure: error: cannot find zmq.h

As a result of the above error I am not able to run java tests and get error "no jzmq in java.library.path".

Can anybody help/direct me to how to get java binding for zeromq work when you dont have root privileges to install it? Its difficult to get IT department to install a new software on servers.

Appreciate your help.

Note: I do not have write permissions to /usr directory

Thanks GBP

Was it helpful?

Solution

This can be overcome by adding --with-zeromq=/home/user/zeromq (installation directory of zeromq)

./configure --with-zeromq=/home/user/zeromq

Other steps include export LD_LIBRARY_PATH=/home/user/zeromq/lib

OTHER TIPS

You can also use JeroMQ (https://github.com/zeromq/jeromq) which is a pure Java implementation of ZeroMQ

I got this working by running autogen.sh on OEL 6 then running configure / compiling / installing on CentOS 5.9. I briefly looked into why autogen.sh was failing and the problem was the tool chain was too old. Since I had a more up-to-date system with a modern tool chain available running autogen.sh on something other than CentOS 5 was the easiest path for me. I'm sure it works fine with other modern Linux variants, I had OEL 6 at my finger tips.

I also did not have access to a standard directory for installation. To get that working I added zmq.jar to my class path, and the run-time linker needed to be able to find the zeromq and jzmq run-time libraries.

I faced the same issue on CentOS 6.5 and found that you need to install "gcc-c++" for this to work.

I used the following to install dependencies:

yum -y install jdk zeromq-devel unzip libtool gcc autoconf automake gcc-c++ python

Note that "jdk" comes from our private repository and it's same what can be downloaded from java.com

The following public repositories are installed on server:

atomic

Actually, I ended up having this same issue, and the following script worked for me, where I installed zeromq into ~ (so that I have ~/lib contains libzmq.a libzmq.la libzmq.so libzmq.so.3 libzmq.so.3.1.0 pkgconfig)

./autogen.sh ./configure --prefix=$HOME \   #because you don't have root privileges

   --with-zeromq=$HOME --includedir=$HOME/include/ --libdir=$HOME/lib/ 
./make 
./make -n install

#to check to see if it installs it to the right location

make install

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top